WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for help about this issue I've been having on one of my client's sites (http://revistero.mx it's in spanish) The problem is that somehow, every once in a while the last published posts (let's say, from 2 days ago til now) get deleted from the site. First I believed that it was someone from my client's office who was deleting the posts, so i created two functions in functions.php to create a mini-log of actions:

function wp_log_publish($post_ID){
    global $wpdb;
    $post = get_post($post_ID);
    if ($post->post_date != $post->post_modified) return;
    if(!wp_is_post_revision($post_ID)) {
            $actionP = "New ";  
        $user = get_userdata($post->post_author);
        $date = new DateTime();
        $wpdb->insert('wplog', array('author'=>$user->user_login, 'description'=>$actionP.$post->post_title .' ID = '.$post->ID, 'date'=>$date->format("Y-m-d H:i:s")));
add_action('publish_rvs_revista', 'wp_log_publish');

function wp_log_delete($post_ID){
    global $wpdb;
    $post = get_post($post_ID);
    $user = get_userdata($post->post_author);
    $date = new DateTime();
    $wpdb->insert('wplog', array('author'=>$user->user_login, 'description'=>'Delete '.$post->post_title .' ID = '.$post->ID, 'date'=>$date->format("Y-m-d H:i:s")));

add_action('delete_post', 'wp_log_delete');

What the log stated is that it was the "webmaster" (a.k.a. the user of my client) who was deleting the posts. Strangely all posts stated that they were deleted exactly at the same time. After a meeting with my client we decided I was going to manage the site for 15 days to check everything. Everything went just OK in those 15 days. Not a single post went missing.

But today, after our last meeting after the 15 days a bunch of posts got deleted. What's more strange is that this time not only they appeared to be deleted at the same time, also it stated that my user, another user from my office and even the user from my client (whom, by the way, I revoked all privileges to) were the ones who deleted them!

I don't know what could be happening, I'm thinking about a security issue but I don't even know where to start so I come here for ideas.

More Specs about the site:

Plug Ins Installed:

Custom Post Types:

  • Magazines (they are the ones that are disappearing, no other posts disappear)

I forgot to mention before, it has only happened three times, and dates are not periodical.

share|improve this question

closed as too localized by Chip Bennett, toscho Jul 21 '12 at 21:59

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Close voted as too localized. If it is a security issue, then the question is explicitly out of scope. If not a security issue, then it's either a Theme/Plugin issue (verify by disabling all Plugins, and changing to Twenty Eleven Theme), or else a server configuration issue (some errant cron job, or a DB backup/restore procedure, etc.). – Chip Bennett Feb 21 '12 at 15:27
Where are you storing the user's details? In the above code you've stored the author of the post, not the 'current user' when they were deleted... – Stephen Harris Feb 21 '12 at 15:30

Browse other questions tagged or ask your own question.