Automattic /
jetpack
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | class Jetpack_Sync_Module_WP_Super_Cache extends Jetpack_Sync_Module { |
||
| 4 | |||
| 5 | static $wp_super_cache_constants = array( |
||
|
0 ignored issues
–
show
|
|||
| 6 | 'WPLOCKDOWN', |
||
| 7 | 'WPSC_DISABLE_COMPRESSION', |
||
| 8 | 'WPSC_DISABLE_LOCKING', |
||
| 9 | 'WPSC_DISABLE_HTACCESS_UPDATE', |
||
| 10 | 'ADVANCEDCACHEPROBLEM', |
||
| 11 | ); |
||
| 12 | |||
| 13 | static $wp_super_cache_callables = array( |
||
|
0 ignored issues
–
show
The visibility should be declared for property
$wp_super_cache_callables.
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using class A {
var $property;
}
the property is implicitly global. To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2. Loading history...
|
|||
| 14 | 'wp_super_cache_globals' => array( 'Jetpack_Sync_Module_WP_Super_Cache', 'get_wp_super_cache_globals' ), |
||
| 15 | ); |
||
| 16 | |||
| 17 | public function name() { |
||
| 18 | return 'wp-super-cache'; |
||
| 19 | } |
||
| 20 | |||
| 21 | public static function get_wp_super_cache_globals() { |
||
| 22 | global $wp_cache_mod_rewrite; |
||
| 23 | global $cache_enabled; |
||
| 24 | global $super_cache_enabled; |
||
| 25 | global $ossdlcdn; |
||
| 26 | global $cache_rebuild_files; |
||
| 27 | global $wp_cache_mobile; |
||
| 28 | global $wp_super_cache_late_init; |
||
| 29 | global $wp_cache_anon_only; |
||
| 30 | global $wp_cache_not_logged_in; |
||
| 31 | global $wp_cache_clear_on_post_edit; |
||
| 32 | global $wp_cache_mobile_enabled; |
||
| 33 | global $wp_super_cache_debug; |
||
| 34 | global $cache_max_time; |
||
| 35 | global $wp_cache_refresh_single_only; |
||
| 36 | global $wp_cache_mfunc_enabled; |
||
| 37 | global $wp_supercache_304; |
||
| 38 | global $wp_cache_no_cache_for_get; |
||
| 39 | global $wp_cache_mutex_disabled; |
||
| 40 | global $cache_jetpack; |
||
| 41 | global $cache_domain_mapping; |
||
| 42 | |||
| 43 | return array( |
||
| 44 | 'wp_cache_mod_rewrite' => $wp_cache_mod_rewrite, |
||
| 45 | 'cache_enabled' => $cache_enabled, |
||
| 46 | 'super_cache_enabled' => $super_cache_enabled, |
||
| 47 | 'ossdlcdn' => $ossdlcdn, |
||
| 48 | 'cache_rebuild_files' => $cache_rebuild_files, |
||
| 49 | 'wp_cache_mobile' => $wp_cache_mobile, |
||
| 50 | 'wp_super_cache_late_init' => $wp_super_cache_late_init, |
||
| 51 | 'wp_cache_anon_only' => $wp_cache_anon_only, |
||
| 52 | 'wp_cache_not_logged_in' => $wp_cache_not_logged_in, |
||
| 53 | 'wp_cache_clear_on_post_edit' => $wp_cache_clear_on_post_edit, |
||
| 54 | 'wp_cache_mobile_enabled' => $wp_cache_mobile_enabled, |
||
| 55 | 'wp_super_cache_debug' => $wp_super_cache_debug, |
||
| 56 | 'cache_max_time' => $cache_max_time, |
||
| 57 | 'wp_cache_refresh_single_only' => $wp_cache_refresh_single_only, |
||
| 58 | 'wp_cache_mfunc_enabled' => $wp_cache_mfunc_enabled, |
||
| 59 | 'wp_supercache_304' => $wp_supercache_304, |
||
| 60 | 'wp_cache_no_cache_for_get' => $wp_cache_no_cache_for_get, |
||
| 61 | 'wp_cache_mutex_disabled' => $wp_cache_mutex_disabled, |
||
| 62 | 'cache_jetpack' => $cache_jetpack, |
||
| 63 | 'cache_domain_mapping' => $cache_domain_mapping, |
||
| 64 | ); |
||
| 65 | } |
||
| 66 | |||
| 67 | public function init_listeners( $callable ) { |
||
| 68 | $this->sync_wp_super_cache(); |
||
| 69 | } |
||
| 70 | |||
| 71 | public function init_full_sync_listeners( $callable ) { |
||
| 72 | $this->sync_wp_super_cache(); |
||
| 73 | } |
||
| 74 | |||
| 75 | public function sync_wp_super_cache() { |
||
| 76 | add_filter( 'jetpack_sync_constants_whitelist', array( $this, 'add_wp_super_cache_constants_whitelist' ), 10 ); |
||
| 77 | add_filter( 'jetpack_sync_callable_whitelist', array( $this, 'add_wp_super_cache_callable_whitelist' ), 10 ); |
||
| 78 | } |
||
| 79 | |||
| 80 | public function add_wp_super_cache_constants_whitelist( $list ) { |
||
| 81 | return array_merge( $list, self::$wp_super_cache_constants ); |
||
| 82 | } |
||
| 83 | |||
| 84 | public function add_wp_super_cache_callable_whitelist( $list ) { |
||
| 85 | return array_merge( $list, self::$wp_super_cache_callables ); |
||
| 86 | } |
||
| 87 | } |
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.