Adsense-Deluxe WordPress Plugin “Invalid Argument” PHP error

If you’ve seen a PHP error when saving Adsense-Deluxe options in your WordPress blog which looks like the following:

Warning: Invalid argument supplied for foreach() in /public_html/wp-content/plugins/adsense-deluxe.php on line XXX

it’s most likely because some adsense code was inserted into the database with fancy or curly quotes instead of plain ASCII quotes. I’ve gotten four reports of this problem and finally tracked it down while trying to work through the problem with an Adsense-Deluxe user. It seems I may have been the source of these mistakes because this user simply copied some code from one of my posts which showed how to make an ad block float to the left side of your post, and my WordPress was displaying that code with fancy/curly quotes.

If you’re able to fix those quotes or delete the adsense blocks you defined containing those quotes, that should resolve the problems. If you’re unable to do that, then there’s a convoluted method outlined below which can be used to wipe out all the plugin’s stored settings and start over.

Convoluted Way of deleting the plugin settings:

  1. Use your FTP software to edit the file wp-content/plugins/adsense-deluxe.php.
  2. Locate the line near the top of the file: define(’ADSDEL_OPTIONS_ID’, ‘acmetech_adsensedeluxe’);
  3. Insert underneath that line, beginning on a blank line in the file:update_option(ADSDEL_OPTIONS_ID, '');, and save the file back to the server.
  4. Return to your WordPress administration and load the Adsense-Deluxe options page. Loading this page after making that change will zero out the old options and create a new default set.
  5. Go back to the Adsense-Deluxe.php file opened in your FTP software and remove that line. Save these changes back to the server.

For savvy users you can optionally go into the wordpress database and remove the plugin options record for the key ‘acmetech_adsensedeluxe’.

Leave a Reply

You must be logged in to post a comment.