Feature #2092


Create upstream patch for WP Shadowbox plugin

Added by Boone Gorges over 10 years ago. Updated about 7 years ago.

Priority name:
Dominic Giglio
Category name:
WordPress Plugins
Target version:
Start date:
Due date:
% Done:


Estimated time:
Deployment actions:


Dom - In and you updated the WP Shadowbox plugin to use a shared copy of the library files, to avoid permissions errors and redundancy on multisite installations like ours. I would like to package a version of these changes into a patch that we can then send along to sivel, the plugin author.

The basic strategy should remain the same: on multisite, look for a shared library location (wp-content/shared_lib is fine with me, though perhaps 'lib' rather than 'shared_lib' would be a bit more predictable). But a few additional things would make the patch even better suited for the distribution plugin:

1) More graceful fallbacks. Instead of requiring that the shared lib be used in multisite, instead you should first try to use the shared_lib (maybe using file_exists()), and then fall back to the default blogs.dir location if it can't be found. Alternatively, because doing this check on every pageload requires some overhead, you might consider an admin setting that appears when multisite is enabled. Not sure what that would look like. Think about it and tell me if you have any brilliant ideas :)

2) Consider abstracting the library location. Right now it's scattered in a couple places through the plugin, but could easily be abstracted to a single method of the main plugin class.

3) Use apply_filters() just before returning the library location, so that admins can have total control over the location (eg, if they have a preferred location for storing shared library files in their MS installation).

To make the patch properly, get an svn checkout of the plugin on a clean WP install. Then use svn diff to generate a patch file.

This is low priority. Do it when you have a few minutes downtime :)


Also available in: Atom PDF