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:
- Use your FTP software to edit the file
- Locate the line near the top of the file:
- 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.
- 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.
- 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’.