Advertisement
swte

Reset Warmup Table Cron

May 29th, 2020
890
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_action('template_redirect', function(){
  2.     if (isset($_GET['reset-warmup']) && $_GET['reset-warmup'] == 'a3ef456de32e' && class_exists('Swift_Performance_Cache')){
  3.             global $wpdb;
  4.             $wpdb->query('DROP TABLE IF EXISTS ' . SWIFT_PERFORMANCE_TABLE_PREFIX . 'warmup');
  5.             delete_option(SWIFT_PERFORMANCE_TABLE_PREFIX . 'db_version');
  6.             delete_transient('swift_performance_initial_prebuild_links');
  7.             Swift_Performance::db_install();
  8.             Swift_Performance_Cache::clear_all_cache();
  9.             Swift_Performance::get_prebuild_urls();
  10.     }
  11. });
  12.  
  13. // Set a real cronjob: curl "https://yoursite.com/?clear-cache=a3ef456de32e"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement