Hacking the easy-fancybox WordPress plugin


The easy-fancybox WordPress is actually a rather simple but cool plugin to use, if it would work out-of-the-box in WordPress 3.x (on Debian unstable).

First of all, a bit of background information:

  • I’ve installed WordPress using apt-get install wordpress on a Debian Unstable server
  • I’ve created three WordPress sites, all three use the same DocumentRoot ( /usr/share/wordpress), but they do have separate wp-content/ locations (each in their own home directory)
  • plugins are installed in one of the blogs
  • Symlinks are creating from the blog that installed plugin to /usr/share/wordpress/wp-content/plugins/

Now, I have never written a WordPress plugin before, nor have I been developing in PHP for years! But since I really liked this plugin so much, I decided to give it a go (PHP, how hard can it be … kids play with it!).

The Hack

After analyzing other WordPress plugins (copy-paste development, don’t we just all do it!), the hack to make it work was pretty straightforward:
The original code:

My hack:

And now the plugins works on my website and on all the other WordPress sites I run on my server (I’ve installed WordPress 3.x on my Debian server using the apt-get command.)

I’ve mailed the author my changes 😉


After talking back and forwards with the author of this great plugin, the final result of the hacking is the following:

UPDATE: 07/10/2010

This works for version I’ve only changed the wp_enqueue_script() statements.

UPDATE: 03/11/2010

This works for version 1.3.2. I’ve only changed the wp_enqueue_script() statements.

UPDATE: 23/11/2010

This works for version 1.3.3:

UPDATE: 08/03/2011

Patch for version

In your WordPress plugins directory you will have to make the following symlinks:

The plugin and the discussion can be found on http://4visions.nl/wordpress-plugins/easy-fancybox/

Comments are closed.