Support » Plugin: W3 Total Cache » [Plugin: W3 Total Cache] BUG: Preloading loads the same page several times at the same time

  • I have a problem with several of my plugins. It took a while to locate the problem – but now I’ve found it.

    To test it, use the following plugin:

    <?php
    /*
    Plugin Name: Test
    Plugin URI: http://www.test.com/test/
    Description:
    Version: 1.0
    Author: Niska
    Author URI: http://www.test.com/test/
    */
    
    function niskatest ($content) {
    	$postid   = get_the_ID();
    	update_post_meta($postid, 'niskatest', time());
    
    	if (preg_match('/W3 Total Cache/', $_SERVER['HTTP_USER_AGENT'])) {
    		$message .= print_r($_SERVER, true);
    		wp_mail(get_option('admin_email'), 'Post ' . $postid . ' fetched by W3TC at ' . time(), $message, "From: Niskatest.com <test@niskatest.com>\r\n");
    	}
    
    	return $content;
    }
    add_filter('the_content', 'niskatest');
    ?>

    Then activate the plugin and activate preloading in W3TC. After a while you will start getting emails. And you will notice that several of the emails are for the same posts.

    If you check one of these posts, you will find that it has several custom fields that look like this:

    niskatest 1296764608
    niskatest 1296764608
    niskatest 1296764609

    This is not correct. There should only be one custom field named ‘niskatest’.

    You can try this out by using the plugin above.

Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: W3 Total Cache] BUG: Preloading loads the same page several times at the same time’ is closed to new replies.