Photopress2 0.2

As expected, I found a bunch of bugs when testing the album. The biggie is that WordPress doesn’t make “real” attachment pages for attachments that don’t have parents. To make things really interesting, it does make sort-of attachment pages for logged-in users, but not for visitors. So, this version fixes the problem by linking directly to the image file when an image doesn’t have a parent.

I also added an option to turn off caching, mostly to make testing easier. In the same vein, just visiting the options page will now clear all caches and flushes the rewrite rules, which should help with some caching weirdness I was seeing.

Download Photopress2 0.2: pp2.0.2.zip

Tagged Leave a comment

Photopress2 0.1

While the uploading parts of Photopress aren’t very useful anymore, I still like some of the other features, such as the album and random image widget. So, this plugin adds an album, a widget, and a shortcode to display the images in your media library.

If you’re migrating from the old Photopress and used the migrate tools in 1.8 then Photopress2 will import your categories as tags for your migrated images.

To activate the album, create a new page with this in it somewhere: <!–pp2_album–>

If the page slug for your album page is something other than ‘photos’ go to Settings:Photopress2 and enter it there.

Enter tags during upload or when you edit an image.

Since this is the first version, there are bound to be some…issues – let me know what you find.

Download Photopress2 0.1: pp2.0.1.zip

Tagged Leave a comment

Filez 0.9

Like Photopress, Filez isn’t all that useful now that the built-in uploader works so well. If you’ve been using Filez tags though, you’ve needed to keep Filez active so your old links would continue working. This version of Filez adds a migration tool to pull files into the Media Library, replacing all tags with links to the migrated files.

The migration tool is included as a separate plugin – to use it you’ll need to activate it, then go to Tools:Filez Migrate and click the button. Once it’s done you should be able to deactivate and delete both Filez and Filez Migrate.

Note that if you’re using W3 Total Cache with a CDN you’ll likely need to re-export your Media Library after using the migration tool – some of my files appeared to make it but not all of them.

Get Filez 0.9: filez.0.9.zip

Tagged Leave a comment

S3 doesn’t like plus in filenames

Exporting my media library files to S3 with W3 Total Cache has gone mostly smoothly, with one exception – S3 replaces plus signs in filenames with the urlencoded equivalent, breaking links on the blog that still expect the plus sign in the filename.

I know what you’re thinking – “Who puts a plus in a filename??” Well, over on the family blog anything is possible! I was surprised that WP’s sanitize_file_name even allows plus signs, but it does have a convenient filter to add to the list of characters to sanitize – sanitize_file_name_chars. So, I wrote a quick plugin to add a plus sign to the list: sanitizeplus.0.1.zip

Tagged , Leave a comment

Trying W3 Total Cache

I’ve been trying out various WordPress caching plugins in an effort to improve page loading performance and reduce resource usage on my virtual private server. I started with WP Super Cache but quickly learned that it doesn’t work well with with DreamHost PS. Next I tried Hyper Cache and DB Cache Reloaded. While the DB Cache Reloaded description makes it sound like it does all the caching you’ll ever need, I think page caching is still a good idea to help reduce resource usage when a site gets a lot of traffic – if you can serve static pages to most visitors, your server might just survive.

I’d still be using that combination if I hadn’t found W3 Total Cache, which adds a few more features on top of page and query caching. First, it does “minification” – stripping whitespace out of your HTML, JavaScript, and CSS to make all of these smaller. Since they’re smaller, your visitors get your pages faster. Next, it integrates with Content Delivery Networks like Amazon’s S3. This means you can seamlessly host your static files like JavaScript, CSS, and images with a CDN, which can (probably) deliver them to your visitors more quickly than your web host. This also takes some load off of your server and makes it more likely you’ll survive a traffic spike. Of course, using a CDN costs something, but probably not much compared to what you’re already paying for web hosting.

I’ve been wondering how using a CDN would work with my media library – would images and files automatically get synced upon upload or would there be an annoying manual step necessary to keep things from breaking? I can report that images like this do indeed automatically get sent to the CDN upon upload:

Hibiscus

I had one small problem setting up W3 Total Cache to use my S3 account – the plugin couldn’t create a “bucket” (a folder in S3-speak). I ended up using s3cmd to create a bucket and once I entered that bucket name in the W3 Total Cache options everything worked fine.

Tagged 3 Comments

Photopress and Lightbox 2

Thanks to Steven for telling me about this issue!

Lightbox 2 has a cool feature where it’ll automagically add code to images in your posts so they’ll work with Lightbox. This is great until it runs into the Photopress album and breaks stuff. To fix this easily, you can turn off the auto-lightbox feature in the Lightbox 2 settings. But what if you like auto-lightboxing?

The function that does auto-lightboxing is around line 60 of lightbox2.php. Adding this “if” to detect the Photopress album (actually “pp_wrap”) and avoid auto-lightboxing seems to do the trick:

function autoexpand_rel_wlightbox ($content) {
/*add this--->*/ if ( strstr($content, 'pp_wrap') ) { return $content; }

Of course, then you’d need to re-do this hack every time you upgrade Lightbox 2…

Tagged , Leave a comment

Photopress 1.8

The long-awaited migration release – this version adds some new tools at Tools:Photopress:Maintain that can be used to pull your Photopress images into the Media Library and then replace your Photopress tags with links to those files in the Media Library.

First, you can now migrate Photopress images into the Media Library. Moving images into the Media Library involves resizing images and can be quite a workout for your server – so it’s done in batches based on a new setting at Settings:Photopress that you should change depending on your server resources. Check to be sure your Media Library is working properly – creating thumbnails and whatnot – before trying to import photos. Image title, description, and category are all imported – but maybe aren’t put in the best spots, so let me know if you have ideas about where they should go. The “attached to” field should get filled correctly, but I’ve seen some funky behavior there that I’ll need to investigate.

If you’ve been using tags to insert images into posts you have two migration options for those. For images you’ve imported into the Media Library, you can replace tags with linked Media Library images. Alternatively, there’s a tool to replace tags with links straight to your Photopress images, useful if you don’t want to do the Media Library import.

So far I’ve tested out the migrate functions on my personal blog, where I had about 400 images that I migrated to the Media Library in batches of 50. Tag replacement worked fine.

The next big release of Photopress will not include the popup uploader/browser. The media handling parts of WordPress work great now – there’s just no need for the Photopress popup tool anymore. So, the next major version of Photopress will only include the album and random image stuff – and both will only work with images in the Media Library.

Get Photopress 1.8: photopress_1.8.zip

Tagged Leave a comment

Birthdaze 0.4.2

Based on some great feedback and testing from Vac I’ve updated Birthdaze so it should now properly translate dates (month and days of the week). Date formatting is also now done with standard PHP date formatting strings, so you’ve got complete control. See the readme for more information and http://php.net/manual/en/function.date.php details on how to get exactly the date format you want.

This version also (hopefully) fixes a bug where empty “before” and “after” strings in the widget were getting replaced with the defaults.

Get the latest version of Birthdaze here: birthdaze_0.4.2.zip

Tagged Leave a comment

flickpress 1.6

Bugfix! @flash just let me know about a bug preventing new Flickr users from getting added. I think I’ve fixed the bug – version 1.6.1 should be available for upgrade shortly.

This release fixes a bunch of cosmetic things and adds some navigation links. I find the Older/Newer links for recent photos especially useful when I want to add several photos to a post.

I made a bunch of little changes to get the markup valid, both in the plugin and for the stuff it inserts into posts. Note that some of the tags I’ve used (table?) might not be valid with your particular theme’s doctype. If you do find non-valid markup anywhere please let me know.

For a fun feature I added interesting photo browsing. They seem to mostly be “all rights reserved” – I’m leaving it to you to decide whether it’s okay to post them or not.

You can get flickpress from the WordPress Plugins Directory.

Tagged , Leave a comment

flickpress 1.5

Bug fix! Tarique and Falko noticed that having more than one phpFlickr-based plugin enabled at once can result in conflicts. Rather than figure out how to check for the library (and version – conflicts there too) I’ve opted to rename some things in the version of phpFlickr included with flickpress. This should avoid any conflicts, so let me know if you’re still seeing errors.

Another bug fix! Ben noticed a bug that led me to test inserting a bunch of different photos. I finally ran into trouble with this adorable kitty, which has a title that’s got quotes and a description with a variety of fun characters. It turns out I was using the wrong PHP function to escape text – PHP’s rawurlencode seems to go with JavaScript’s unescape. I hope so at least – let me know if you find any photos that won’t insert or if you get unexpected characters in captions.

New feature! You can now browse a user’s favorites. I like to use favorites to bookmark photos to use in posts – it’s nice to be able to get to those right in flickpress.

You can get flickpress from the WordPress Plugins Directory.

…or right here: flickpress_1.5.zip

Tagged , Leave a comment