Destroying the pesky wpsd_hourly_register_stats cron job
Removing ‘wpsd_hourly_register_stats’ future cron jobs after uninstalling WP Stats Dashboard
WP Stats Dashboard was over-running my site and I haven’t had it installed or active in over a year, yet every minute, it was running 6 cron jobs (wpsd_hourly_register_stats).
First I tried to destroy the cron job by deleting it with WP-Crontrol but they kept re-appearing when I refreshed the list (but at least that plugin let me see the problem for the first time in years)
When that failed, I tried to see if it was an “Orphan” by running Clean Options but even that powerful plugin didn’t find anything wrong.
So I had to go head-first into the database (PhpMyAdmin)
First, I did a search for “wpsd” in all the tables, just by clicking on “Search” and “Selecting all the tables”
And it found the following 2 tables in wp_options
Uh oh. It’s within a table that has a lot of values that I actually need – all my cron jobs for EVERYTHING.
Time for a database backup. Backed-up my database and went for the kill.
First I deleted the harmless-looking one (WPSDAdminConfigForm)
Then I clicked “edit” next to the “cron” one.
I copied all the data in there into editpad in case I do anything drastic (although I still have a backup, so I’m not too worried) and then searched through all the lines to find the pesky wpsd cronjob.
I found it but I have no idea what I’m doing in here – I don’t know if it’s all on one-line or if it spreads over multiple lines, and having no idea what these things mean, should tell me not to touch anything in here, but I would have no idea who to get to do this, so I’ll be brave (or stupid.. depending on how you look at it).
Looking at it, it really seems like they go over several lines, so this “might” break something if I just delete that one line
{i:0;i:217;}}}}i:1364448268;a:1:{s:26:”wpsd_hourly_register_stats”;a:1:
I thought about creating a new cron job within wordpress to be able to see the difference, but that turned out to be a bigger task than I first thought (like, apparantly I need to know more about what I’m doing – about arguments and hooks and things that I’ve never “played with” before).
So in a last attempt to fix the problem, I re-installed the WP Stats Dashboard plugin to see what would happen.
Reinstalled, and it removed all my wpsd-related cron jobs, just leaving “one” future one (in one hour).
Uninstalled the plugin, deleted it, and found that it had added 51 new entries in the wp-options file – but searching through all 51 entries – none of them were in cron! So that’s good news for me – I deleted all 51 entries. Problem solved.
If that hadn’t of worked, I was going to have to do some more sleuth work to get the job done because I don’t understand all the lines in that table.
If anyone can let me know what the lines / numbers mean in the screenshot, that would be helpful in future to know which lines I could safely delete to get the job done.
I’m now going to attempt to do the same with other “future cron jobs” that are scheduled by other pesky plugins that did not clear their cron-jobs upon deletion of the plugin. Most likely what happened with WP Stats is that I must’ve had an older version and he has since updated the plugin to clear the future cron jobs, otherwise, I’m not sure what happened. In any case, that plugin author really needs to “clean up” after the uninstall – it’s good that there is no cron jobs anymore, but why, after deleting the plugin, should it leave 51 tables in the database?
As a sidenote, that might help (or hurt) you or me in future but I’m thinking that I might be able to just clear out the cron jobs within the wp-options table and things that are active and use the schedule, should (in theory) just “recreate” the relevant scheduled tasks, but that’s what I’ll try later, i.e. when something “doesn’t work” and I will have my backup close at hand to re-install in case my theory falls to pieces.