I'm going to answer my own question primarily to keep a log of debugging until I get to the bottom of this (hopefully resulting in an answer to my question for the benefit of other SE users):-
28th May 2014
Asked question as per above. Ongoing issue with menu items being deleted randomly all the time. Duplicated website on a sub domain for testing purposes.
6th June 2014
Menu items deleted on live site. Still intact on dev site however noticed there were 4 plugin updates as per the below:-
- CM Tooltip Glossary (active)
- Form Maker (inactive)
- Share This (inactive)
- Wordpress SEO (active)
Updated all four plugins, within 10 seconds, all menu items were deleted on the dev site. Manually reinstated menu items.
Manually deactivated and reactivated the plugins CM Tooltip Glossary and Wordpress SEO (trying to replicate part of the update process). After a few minutes, all menu items still intact and have not been deleted.
I think perhaps update plugins one at a time in future so that can pinpoint exactly which is causing the issue.
8th June 2014
Okay, so the menu items on the live site have all just disappeared again. No updates in Wordpress were performed at all. They are still intact on dev site. No files had been modified on the server since 6th June for the live site.
Manually reinstated menu items on the live site again.
Two plugin updates available on the live site:-
- Form Maker (inactive)
- Share This (inactive)
Updated both plugins, menu items still intact...
One plugin update available on the dev site:-
Updated plugin, menu items still intact...
Ran a diff check on the database dumps before and after plugin updates and reinstating of the menu items on the live site (as suggested in the comments):-
What is interesting is the insertion of the below line which is slapped in the middle of the wp_posts
table:-
(1170, 2, '2014-06-08 11:02:05', '2014-06-08 10:02:05', ' ', '', '', 'publish', 'open', 'open', '', '1170', '', '', '2014-06-08 11:02:05', '2014-06-08 10:02:05', '', 0, 'http://www.domain.com/?p=1170', 4, 'nav_menu_item', '', 0),
This row is inserted between 688 and 689 so looks like this in the table:-
688
1170
689
Just seemed peculiar that it would insert this randomly there...
I also noticed the following difference in the wp_usermeta
table:-
(542, 2, 'nav_menu_recently_edited', '44'),
My user ID is 2 and this seems like it is suggesting that my user ID recently edited 44 nav menu items... Which would probably be the deleting of them all?
Just installed the plugin Stream on live and dev sites to track any changes made in the Wordpress admin.
Also upgraded every single module on the Apache server, including mysql and repaired the mysql database. Everything I came across on the server, I upgraded. I then added max_input_vars
to the php.ini
(2000).
12th June 2014
Menu items all deleted again in live site. No updates were processed. The menu items have been deleted without anyone even touching anything on the website. Menu items still intact on dev site.
With the menu items not being deleted at the same time on live site and dev site (the site and database being identical other than loads more comments and things like that) is probably indicative of something, I'm just unsure what.
Attempting Wordpress's built in database and repair tool by adding the following to wp_config.php
:-
define('WP_ALLOW_REPAIR', TRUE);
Didn't seem to find anything wrong, results below:-
The wp_users table is okay.
Failed to optimize the wp_users table. Error: Table does not support optimize, doing recreate + analyze instead
The wp_usermeta table is okay.
Failed to optimize the wp_usermeta table. Error: Table does not support optimize, doing recreate + analyze instead
The wp_posts table is okay.
The wp_posts table is already optimized.
The wp_comments table is okay.
Failed to optimize the wp_comments table. Error: Table does not support optimize, doing recreate + analyze instead
The wp_links table is okay.
Failed to optimize the wp_links table. Error: Table does not support optimize, doing recreate + analyze instead
The wp_options table is okay.
Failed to optimize the wp_options table. Error: Table does not support optimize, doing recreate + analyze instead
The wp_postmeta table is okay.
Failed to optimize the wp_postmeta table. Error: Table does not support optimize, doing recreate + analyze instead
The wp_terms table is okay.
Failed to optimize the wp_terms table. Error: Table does not support optimize, doing recreate + analyze instead
The wp_term_taxonomy table is okay.
Failed to optimize the wp_term_taxonomy table. Error: Table does not support optimize, doing recreate + analyze instead
The wp_term_relationships table is okay.
Failed to optimize the wp_term_relationships table. Error: Table does not support optimize, doing recreate + analyze instead
The wp_commentmeta table is okay.
Failed to optimize the wp_commentmeta table. Error: Table does not support optimize, doing recreate + analyze instead
The wp_snippets table is okay.
Failed to optimize the wp_snippets table. Error: Table does not support optimize, doing recreate + analyze instead
Repairs complete. Please remove the following line from wp-config.php
to prevent this page from being used by unauthorized users.
define('WP_ALLOW_REPAIR', true);
Also installed logging from point 1 of @birgire's answer.
14th July 2014
I just wanted to confirm that since the removal of the Stealth Publish plugin, the menu items have no longer been deleted. Thanks to Rarst's contribution in the other thread that this one has been marked as a duplicate of.
The plugin developer has been made aware of the issue on Wordpress but it is becoming apparent that they don't care and the plugin has been abandoned/is not maintained any longer.
wp_scheduled_auto_draft_delete
cron job, I have asked an own question here: wordpress.stackexchange.com/questions/145953/….