Make AdSense Deluxe plugin work with WordPress 2.8.5

Recently I upgraded to WordPress 2.8.5. The upgrade process itself went smoothly but some of the plugins I have installed on my blog stopped working with latest WordPress version. One of them is AdSense Deluxe.I use AdSense units on my blog (as you can see) and use AdSense Deluxe plugin to manage my ads. The plugin was still displaying my AdSense units properly, the problem was that I could not access its admin panel to change settings or ad units. I was getting following error.

“You do not have sufficient permissions to access this page.”

It is a very handy plugin so I was very disappointed that is not compatible with WordPress 2.8.5. With no update available for this plugin I had to go into the plugin code to fix the problem.

Fortunately with a little research I was able to find and fix the problem.
Here is a step by step guide to make AdSense Deluxe work with WordPress 2.8.1 and beyond.

  • Logon to your WordPress dashboard.
  • Go to Plugins and then Installed.
  • You will see a list of all the plugins you have installed on your blog.
  • Locate the link for AdSense Deluxe plugin. Click on the ‘Edit’ link, located under plugin’s name.
  • A text-editing box with plugin’s code will come up.
  • Search for the phrase admin_head and then replace it with admin_menu.
  • Here is the code before and after the change
  • Before the change:

    if( function_exists('add_action') ){
    		add_action('admin_head', 'add_adsense_deluxe_menu');
                   	add_action('wp_head', 'add_adsense_deluxe_handle_head');

    After the change:

    if( function_exists('add_action') ){
    		add_action('admin_menu', 'add_adsense_deluxe_menu');
                   	add_action('wp_head', 'add_adsense_deluxe_handle_head');
  • Click on “Update File” button.
  • Now you should be able to access the options page of AdSense Deluxe plugin.

I hope this post helps you in fixing your plugin issues.