Wordpress Plugin - Automatic cache purge doesn't seem to work when scheduling posts

I have wordpress blog with cloudflare plugin installed, activated and enabled auto purge cache.

The cache purge is working fine if I update the posts via wordpress admin console. If I schedule a post to publish little later, then the cache is not getting purged automatically when the post go live.

Looks like the wordpress hooks clouflare plugin listening to is not sufficient and doesn’t trigger when the scheduled posts go live via Wordpress Cron.

Does anybody else have experienced similar issue? TIA

Looking at the plugin source, it is listening to only the below hooks where as the future publish hook is different.

$cloudflarePurgeURLActions = array(
    'deleted_post',                     // Delete a post
    'edit_post',                        // Edit a post - includes leaving comments
    'delete_attachment',                // Delete an attachment - includes re-uploading
);

https://codex.wordpress.org/Plugin_API/Action_Reference/publish_future_post

After changing the plugin source via Admin and adding this hook refreshed the cache automatically.

$cloudflarePurgeURLActions = array(
    'deleted_post',                     // Delete a post
    'edit_post',                        // Edit a post - includes leaving comments
    'delete_attachment',                // Delete an attachment - includes re-uploading
    'publish_future_post',  // Whenever a post is scheduled to be published later and when the post goes live, this hook action is triggerd
);
2 Likes

This topic was automatically closed after 30 days. New replies are no longer allowed.