class.jetpack-sync-module-wp-super-cache.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. class Jetpack_Sync_Module_WP_Super_Cache extends Jetpack_Sync_Module {
  3. public function __construct() {
  4. add_filter( 'jetpack_sync_constants_whitelist', array( $this, 'add_wp_super_cache_constants_whitelist' ), 10 );
  5. add_filter( 'jetpack_sync_callable_whitelist', array( $this, 'add_wp_super_cache_callable_whitelist' ), 10 );
  6. }
  7. static $wp_super_cache_constants = array(
  8. 'WPLOCKDOWN',
  9. 'WPSC_DISABLE_COMPRESSION',
  10. 'WPSC_DISABLE_LOCKING',
  11. 'WPSC_DISABLE_HTACCESS_UPDATE',
  12. 'ADVANCEDCACHEPROBLEM',
  13. );
  14. static $wp_super_cache_callables = array(
  15. 'wp_super_cache_globals' => array( 'Jetpack_Sync_Module_WP_Super_Cache', 'get_wp_super_cache_globals' ),
  16. );
  17. public function name() {
  18. return 'wp-super-cache';
  19. }
  20. public static function get_wp_super_cache_globals() {
  21. global $wp_cache_mod_rewrite;
  22. global $cache_enabled;
  23. global $super_cache_enabled;
  24. global $ossdlcdn;
  25. global $cache_rebuild_files;
  26. global $wp_cache_mobile;
  27. global $wp_super_cache_late_init;
  28. global $wp_cache_anon_only;
  29. global $wp_cache_not_logged_in;
  30. global $wp_cache_clear_on_post_edit;
  31. global $wp_cache_mobile_enabled;
  32. global $wp_super_cache_debug;
  33. global $cache_max_time;
  34. global $wp_cache_refresh_single_only;
  35. global $wp_cache_mfunc_enabled;
  36. global $wp_supercache_304;
  37. global $wp_cache_no_cache_for_get;
  38. global $wp_cache_mutex_disabled;
  39. global $cache_jetpack;
  40. global $cache_domain_mapping;
  41. return array(
  42. 'wp_cache_mod_rewrite' => $wp_cache_mod_rewrite,
  43. 'cache_enabled' => $cache_enabled,
  44. 'super_cache_enabled' => $super_cache_enabled,
  45. 'ossdlcdn' => $ossdlcdn,
  46. 'cache_rebuild_files' => $cache_rebuild_files,
  47. 'wp_cache_mobile' => $wp_cache_mobile,
  48. 'wp_super_cache_late_init' => $wp_super_cache_late_init,
  49. 'wp_cache_anon_only' => $wp_cache_anon_only,
  50. 'wp_cache_not_logged_in' => $wp_cache_not_logged_in,
  51. 'wp_cache_clear_on_post_edit' => $wp_cache_clear_on_post_edit,
  52. 'wp_cache_mobile_enabled' => $wp_cache_mobile_enabled,
  53. 'wp_super_cache_debug' => $wp_super_cache_debug,
  54. 'cache_max_time' => $cache_max_time,
  55. 'wp_cache_refresh_single_only' => $wp_cache_refresh_single_only,
  56. 'wp_cache_mfunc_enabled' => $wp_cache_mfunc_enabled,
  57. 'wp_supercache_304' => $wp_supercache_304,
  58. 'wp_cache_no_cache_for_get' => $wp_cache_no_cache_for_get,
  59. 'wp_cache_mutex_disabled' => $wp_cache_mutex_disabled,
  60. 'cache_jetpack' => $cache_jetpack,
  61. 'cache_domain_mapping' => $cache_domain_mapping,
  62. );
  63. }
  64. public function add_wp_super_cache_constants_whitelist( $list ) {
  65. return array_merge( $list, self::$wp_super_cache_constants );
  66. }
  67. public function add_wp_super_cache_callable_whitelist( $list ) {
  68. return array_merge( $list, self::$wp_super_cache_callables );
  69. }
  70. }