• Resolved smarx80

    (@smarx80)


    Hi,

    I am experiencing a strange behaviour of wp super cache and scheduled posts.
    While posts that I directly publish will invoke the invalidation hook correctly and consequently purge a series of pages (post page, home page, etc…), scheduled posts instead change from “future” to “publish” status without triggering the hook related to transition post status ( add_action( ‘transition_post_status’, ‘wpsc_post_transition’, 10, 3 ); ). I’ve tried modifying the code of wpsc_post_transition by adding some debugging on log files and it just doesn’t seem to go through there (all this code is inside wp-cache-phase2.php)
    I tried removing all the plugins, leaving active only wpsc, and activate the twenty-twenty four theme, same problem. Please note that I use define(‘DISABLE_WP_CRON’, true); and consequently the cron is called by cron with PHP CLI every minute.

    Below is the configuration of super cache:


    <?php
    /*
    WP-Cache Config Sample File

    See wp-cache.php for author details.
    */

    $wpsc_ignore_tracking_parameters = 1;
    $wpsc_tracking_parameters = array ( 0 => 'fbclid', 1 => 'ref', 2 => 'gclid', 3 => 'fb_source', 4 => 'mc_cid', 5 => 'mc_eid', 6 => 'utm_source', 7 => 'utm_medium', 8 => 'utm_campaign', 9 => 'utm_term', 10 => 'utm_content', 11 => 'utm_expid', 12 => 'mtm_source', 13 => 'mtm_medium', 14 => 'mtm_campaign', 15 => 'mtm_keyword', 16 => 'mtm_content', 17 => 'mtm_cid', 18 => 'mtm_group', 19 => 'mtm_placement', );
    $wp_cache_debug_username = 'XXXXXXX';
    $cache_page_secret = 'XXXXXXX';
    $wp_cache_home_path = '/';
    $wp_cache_slash_check = 1;
    $cache_time_interval = '600';
    if ( ! defined('WPCACHEHOME') )
    define( 'WPCACHEHOME', WP_CONTENT_DIR . "/plugins/wp-super-cache/" );

    $cache_compression = 1;
    $cache_enabled = true;
    $super_cache_enabled = true;
    $cache_max_time = 0;
    //$use_flock = true; // Set it true or false if you know what to use
    $cache_path = WP_CONTENT_DIR . '/cache/';
    $file_prefix = 'wp-cache-';
    $ossdlcdn = 0;

    // Array of files that have 'wp-' but should still be cached
    $cache_acceptable_files = array( 'wp-comments-popup.php', 'wp-links-opml.php', 'wp-locations.php' );

    $cache_rejected_uri = array ( 0 => 'wp-.*\\.php', 1 => 'index\\.php', 2 => '_ppp', 3 => 'pagebuilder', 4 => 'preview=1', 5 => 'preview=true', );
    $cache_rejected_user_agent = array();

    $cache_rebuild_files = 1;

    // Disable the file locking system.
    // If you are experiencing problems with clearing or creating cache files
    // uncommenting this may help.
    $wp_cache_mutex_disabled = 1;

    // Just modify it if you have conflicts with semaphores
    $sem_id = 1784244287;

    if ( '/' != substr($cache_path, -1)) {
    $cache_path .= '/';
    }

    $wp_cache_mobile = 0;
    $wp_cache_mobile_whitelist = 'Stand Alone/QNws';
    $wp_cache_mobile_browsers = 'Android, 2.0 MMP, 240x320, AvantGo, BlackBerry, Blazer, Cellphone, Danger, DoCoMo, Elaine/3.0, EudoraWeb, hiptop, IEMobile, iPhone, iPod, KYOCERA/WX310K, LG/U990, MIDP-2.0, MMEF20, MOT-V, NetFront, Newt, Nint
    endo Wii, Nitro, Nokia, Opera Mini, Palm, Playstation Portable, portalmmm, Proxinet, ProxiNet, SHARP-TQ-GX10, Small, SonyEricsson, Symbian OS, SymbianOS, TS21i-10, UP.Browser, UP.Link, Windows CE, WinWAP';

    // change to relocate the supercache plugins directory
    $wp_cache_plugins_dir = WPCACHEHOME . 'plugins';
    // set to 1 to do garbage collection during normal process shutdown instead of wp-cron
    $wp_cache_shutdown_gc = 0;
    $wp_super_cache_late_init = 0;

    // uncomment the next line to enable advanced debugging features
    $wp_super_cache_advanced_debug = 0;
    $wp_super_cache_front_page_text = '';
    $wp_super_cache_front_page_clear = 0;
    $wp_super_cache_front_page_check = 0;
    $wp_super_cache_front_page_notification = 0;

    $wp_cache_anon_only = 0;
    $wp_supercache_cache_list = 0;
    $wp_cache_debug_to_file = 0;
    $wp_super_cache_debug = 1;
    $wp_cache_debug_level = 5;
    $wp_cache_debug_ip = '';
    $wp_cache_debug_log = 'XXXXXXXXXXXXXXXXXXXXXXXXX.php';
    $wp_cache_debug_email = '';
    $wp_cache_pages[ "search" ] = 0;
    $wp_cache_pages[ "feed" ] = 0;
    $wp_cache_pages[ "category" ] = 0;
    $wp_cache_pages[ "home" ] = 0;
    $wp_cache_pages[ "frontpage" ] = 0;
    $wp_cache_pages[ "tag" ] = 0;
    $wp_cache_pages[ "archives" ] = 0;
    $wp_cache_pages[ "pages" ] = 0;
    $wp_cache_pages[ "single" ] = 0;
    $wp_cache_pages[ "author" ] = 0;
    $wp_cache_hide_donation = 0;
    $wp_cache_not_logged_in = 2;
    $wp_cache_clear_on_post_edit = 0;
    $wp_cache_hello_world = 0;
    $wp_cache_mobile_enabled = 0;
    $wp_cache_cron_check = 1;
    $wp_cache_mfunc_enabled = 0;
    $wp_cache_make_known_anon = 0;
    $wp_cache_refresh_single_only = 0;
    $wp_cache_mod_rewrite = 1;
    $wp_supercache_304 = 0;
    $wp_cache_front_page_checks = 0;
    $wp_cache_disable_utf8 = 0;
    $wp_cache_no_cache_for_get = 0;
    $cache_scheduled_time = '00:00';
    $wp_cache_preload_interval = 600;
    $cache_schedule_type = 'time';
    $wp_cache_preload_posts = 'all';
    $wp_cache_preload_on = 0;
    $wp_cache_preload_taxonomies = 0;
    $wp_cache_preload_email_me = 0;
    $wp_cache_preload_email_volume = 'none';
    $wp_cache_mobile_prefixes = '';
    $cached_direct_pages = array( );
    $wpsc_served_header = false;
    $cache_gc_email_me = 0;
    $wpsc_save_headers = 0;
    $cache_schedule_interval = 'hourly';
    $wp_super_cache_comments = 1;
    $wpsc_version = 169;

    Can you help me to investigate this problem? Thanks, Simone.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter smarx80

    (@smarx80)

    Update: It seems that a quite effective workaround is to add this line to the function.php in the theme.

    if ( defined( 'DOING_CRON' ) && DOING_CRON && function_exists("wpsc_post_transition") ) add_action( 'transition_post_status', 'wpsc_post_transition', 10, 3 );

    however, this is and should be considered a workaround, for which I do not know if side effects could arise. I hope that Donncha or other maintainers could work for a patch directly to the plugin.

    Thanks, Simone.

    Plugin Author Donncha O Caoimh (a11n)

    (@donncha)

    @smarx80 – sorry for the late reply. There is indeed a bug here. The backend check in wp_cache_postload() stopped the script working, so it never got as far as hooking onto the transition_post_status action.

    We’ll get that fixed and have a new release out soon. Thanks for your detailed report.

    Edit: follow this GH issue for updates.

    Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hey @smarx80,

    Our very own Donncha has fixed the bug already, and pulled the fix. You’re welcome to test it yourself from this GitHub link here, and let us know how it goes!

    Plugin Author Donncha O Caoimh (a11n)

    (@donncha)

    We released a new version of the plugin a few minutes ago with a fix for this. Thanks again for reporting the problem!

    Thread Starter smarx80

    (@smarx80)

    Hi,
    I’m not too sure about the suggested solution, because I think that the checks are failing before this.
    To be specific, in wp_cache_postload() $wp_cache_request_uri is evaluated, but for a call from PHP-CLI is definitely empty.
    Thanks,

    Simone.

    Plugin Author Donncha O Caoimh (a11n)

    (@donncha)

    Ah, you’re right. We will need to fix this too.

    Meanwhile, you could trigger the cron system by using wget instead?

    * * * * * /usr/bin/wget -q -O - https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

    That will avoid the problem with the PHP CLI and scheduled posts will clear the cache. It might be a while before I can make a new release of the plugin.

    Thread Starter smarx80

    (@smarx80)

    Hi, do you have updates on this issue? Can I help you in any way?

    Plugin Support Animesh Gaurav (a11n)

    (@bizanimesh)

    Hello @smarx80 – I think the fix has not been yet released and most probably it will release in the next version. In the meantime, have you tried the steps, that we have provided here?

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.