
If you’ve ever tried to use the popular image manager plugin or the digital fingerprint plugin at the same time as the immensely popular Adsense Deluxe plugin then you’ll have probably run across a perplexing problem: some buttons won’t show up in the post and page editor. Seemingly, Adsense Deluxe doesn’t play nice with the ButtonSnap Class Library created by Owen Winkler. ButtonSnap makes it relatively easy for plugin authors to insert customized buttons into the WordPress post and page editor regardless of the users editor preference (WYSIWYG vs rich editor). For an example of how this works see the Sawchuk Buttons plugin and the corresponding Tutorial on how to write your own button functions using ButtonSnap.
With hundreds of plugin writers and authors contributing to the WordPress community there is bound to be some conflicts between plugins. The method that the Adsense Deluxe plugin uses to create it’s button in the WordPress post and page editor stops any plugin which uses the ButtonSnap class library from producing it’s own button in the editor. The two just don’t work together.
In order to get around this, I suggest a simple workaround to the Adsense Deluxe plugin until a more suitable solution can be found: disable the part of Adsense deluxe plugin that produces the button in the post editor. Its easy:
Step 1. Open adsense-deluxe.php in your favourite text editor (I recommend PSpad).
Step 2. Find the following on line 1081 (or thereabouts):
add_filter(’admin_footer’, ‘_AdsDel_InsertAdsenseButton’);
Step 3. Place two slashes in front of the line to turn it into a comment, like so:
// add_filter(’admin_footer’, ‘_AdsDel_InsertAdsenseButton’);
Step 4. Save the file and upload it to your server. You’re done.
Of course this means that you’ll have to type out your Adsense deluxe triggers by hand, e.g. <!–adsense#example–>. This isn’t such a big deal for me because I don’t use too many different kinds of Adsense blocks. Alternatively, you can write your own mini plugin to add your own Adsense buttons to the post editor. I’ll post an example of this using buttonsnap shortly.
29 Oct 06
12:13 pm
Would be a good idea to get the author to correct his version of the plugin to work well with ButtonSnap?
I don’t use Adsense Deluxe, do you recommend it?
29 Oct 06
2:47 pm
Adsense Deluxe is a good plugin for inserting ads into posts. The author and I have exchanged emails on the subject of ButtonSnap in the past. He doesn’t seem interested in changing his plugin. Why would he really, the plugin works fine and he probably has a lot more important things to do. I have no problem with that, Adsense Deluxe is opensource, someone else is free to come along and modify it. I think that is what will eventually happen.
29 Oct 06
2:56 pm
And that is when the author will jump up and complain that someone is “stealing” his code!
29 Oct 06
3:04 pm
It’s happened to me. I’m all for someone taking something and making it better — just be nice and ask first. Otherwise, I think it is self serving and rude.
29 Oct 06
10:47 pm
Agreed on that. Didn’t realize it happened to you, though I do faintly remember it was some plugin of yours?
It’s always good manners to ask.
Hopefully the authors bother to reply.
01 Dec 06
10:35 am
Thanks for your helpful post. I just spent the morning reading through the Image Manager comment page, as well as the associated forum. Then googled and eventually found your post. Crazy thing is, I visit your site occasionally because I like it - I even read your feed in Bloglines - but I didn’t remember this post until I saw it.
You mentioned a mini plug-in as a work around, have you worked on this? If so i would appreciate the convenience of it.
Thanks again
18 Dec 06
2:32 pm
First, thanks for sharing your fix for this annoying crash. However, I found a new fix at AdSense-Deluxe And ButtonSnap Fix which allows you to use both adsense-deluxe (with editor button) and buttonsnap plugins together.
Give it a try.
25 Jan 07
10:52 pm
Hi Owen,
Do you know where I can get hold of ButtonSnap?
Also, any clue if it works with WordPress 2.1?
25 Jan 07
10:57 pm
Hey… no clue why I said Owen instead of Kirk… that’s what happens when I try to search for stuff early in the morning… sorry