1 | <?php |
||
5 | class Jetpack_Sync_Settings { |
||
6 | const SETTINGS_OPTION_PREFIX = 'jetpack_sync_settings_'; |
||
7 | |||
8 | static $valid_settings = array( |
||
|
|||
9 | 'dequeue_max_bytes' => true, |
||
10 | 'upload_max_bytes' => true, |
||
11 | 'upload_max_rows' => true, |
||
12 | 'sync_wait_time' => true, |
||
13 | 'sync_wait_threshold' => true, |
||
14 | 'enqueue_wait_time' => true, |
||
15 | 'max_queue_size' => true, |
||
16 | 'max_queue_lag' => true, |
||
17 | 'queue_max_writes_sec' => true, |
||
18 | 'post_types_blacklist' => true, |
||
19 | 'disable' => true, |
||
20 | 'render_filtered_content' => true, |
||
21 | 'post_meta_whitelist' => true, |
||
22 | 'comment_meta_whitelist' => true, |
||
23 | 'max_enqueue_full_sync' => true, |
||
24 | 'max_queue_size_full_sync'=> true, |
||
25 | 'sync_via_cron' => true, |
||
26 | 'cron_sync_time_limit' => true, |
||
27 | ); |
||
28 | |||
29 | static $is_importing; |
||
30 | static $is_doing_cron; |
||
31 | static $is_syncing; |
||
32 | static $is_sending; |
||
33 | |||
34 | static $settings_cache = array(); // some settings can be expensive to compute - let's cache them |
||
35 | |||
36 | static function get_settings() { |
||
44 | |||
45 | // Fetches the setting. It saves it if the setting doesn't exist, so that it gets |
||
46 | // autoloaded on page load rather than re-queried every time. |
||
47 | static function get_setting( $setting ) { |
||
92 | |||
93 | static function update_settings( $new_settings ) { |
||
108 | |||
109 | // returns escapted SQL that can be injected into a WHERE clause |
||
110 | static function get_blacklisted_post_types_sql() { |
||
113 | |||
114 | static function get_whitelisted_post_meta_sql() { |
||
117 | |||
118 | static function get_whitelisted_comment_meta_sql() { |
||
121 | |||
122 | static function get_comments_filter_sql() { |
||
125 | |||
126 | static function reset_data() { |
||
137 | |||
138 | static function set_importing( $is_importing ) { |
||
142 | |||
143 | static function is_importing() { |
||
150 | |||
151 | static function set_doing_cron( $is_doing_cron ) { |
||
155 | |||
156 | static function is_doing_cron() { |
||
163 | |||
164 | static function is_syncing() { |
||
165 | return (bool) self::$is_syncing || ( defined( 'REST_API_REQUEST' ) && REST_API_REQUEST ); |
||
166 | } |
||
167 | |||
168 | static function set_is_syncing( $is_syncing ) { |
||
171 | |||
172 | static function is_sending() { |
||
175 | |||
176 | static function set_is_sending( $is_sending ) { |
||
179 | } |
||
180 |
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.