Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
Complex classes like Jetpack_Sync_Client often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Jetpack_Sync_Client, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 8 | class Jetpack_Sync_Client { |
||
| 9 | |||
| 10 | const CONSTANTS_CHECKSUM_OPTION_NAME = 'jetpack_constants_sync_checksum'; |
||
| 11 | const CALLABLES_CHECKSUM_OPTION_NAME = 'jetpack_callables_sync_checksum'; |
||
| 12 | const SYNC_THROTTLE_OPTION_NAME = 'jetpack_sync_min_wait'; |
||
| 13 | const LAST_SYNC_TIME_OPTION_NAME = 'jetpack_last_sync_time'; |
||
| 14 | const CALLABLES_AWAIT_TRANSIENT_NAME = 'jetpack_sync_callables_await'; |
||
| 15 | const CONSTANTS_AWAIT_TRANSIENT_NAME = 'jetpack_sync_constants_await'; |
||
| 16 | |||
| 17 | private $checkout_memory_size; |
||
| 18 | private $upload_max_bytes; |
||
| 19 | private $upload_max_rows; |
||
| 20 | private $sync_queue; |
||
| 21 | private $full_sync_client; |
||
| 22 | private $codec; |
||
| 23 | private $options_whitelist; |
||
| 24 | private $constants_whitelist; |
||
| 25 | private $meta_types = array( 'post', 'comment' ); |
||
| 26 | private $callable_whitelist; |
||
| 27 | private $network_options_whitelist; |
||
| 28 | private $taxonomy_whitelist; |
||
| 29 | private $is_multisite; |
||
| 30 | |||
| 31 | // singleton functions |
||
| 32 | private static $instance; |
||
| 33 | |||
| 34 | public static function getInstance() { |
||
| 35 | if ( null === self::$instance ) { |
||
| 36 | self::$instance = new self(); |
||
| 37 | } |
||
| 38 | |||
| 39 | return self::$instance; |
||
| 40 | } |
||
| 41 | |||
| 42 | // this is necessary because you can't use "new" when you declare instance properties >:( |
||
| 43 | protected function __construct() { |
||
| 44 | $this->set_defaults(); |
||
| 45 | $this->init(); |
||
| 46 | } |
||
| 47 | |||
| 48 | private function init() { |
||
| 49 | |||
| 50 | $handler = array( $this, 'action_handler' ); |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Most of the following hooks are sent to the same $handler |
||
| 54 | * for immediate serialization and queuing be sent to the server. |
||
| 55 | * The only exceptions are actions which need additional processing. |
||
| 56 | */ |
||
| 57 | |||
| 58 | // constants |
||
| 59 | add_action( 'jetpack_sync_constant', $handler, 10, 2 ); |
||
| 60 | |||
| 61 | // callables |
||
| 62 | add_action( 'jetpack_sync_callable', $handler, 10, 2 ); |
||
| 63 | |||
| 64 | // posts |
||
| 65 | add_action( 'wp_insert_post', $handler, 10, 3 ); |
||
| 66 | add_action( 'deleted_post', $handler, 10 ); |
||
| 67 | add_filter( 'jetpack_sync_before_send_wp_insert_post', array( $this, 'expand_wp_insert_post' ) ); |
||
| 68 | |||
| 69 | add_action( 'jetpack_publicize_post', $handler ); |
||
| 70 | |||
| 71 | // attachments |
||
| 72 | |||
| 73 | add_action( 'edit_attachment', array( $this, 'send_attachment_info' ) ); |
||
| 74 | // Once we don't have to support 4.3 we can start using add_action( 'attachment_updated', $handler, 10, 3 ); instead |
||
| 75 | add_action( 'add_attachment', array( $this, 'send_attachment_info' ) ); |
||
| 76 | add_action( 'jetpack_sync_save_add_attachment', $handler, 10, 2 ); |
||
| 77 | |||
| 78 | // comments |
||
| 79 | add_action( 'wp_insert_comment', $handler, 10, 2 ); |
||
| 80 | add_action( 'deleted_comment', $handler, 10 ); |
||
| 81 | add_action( 'trashed_comment', $handler, 10 ); |
||
| 82 | add_action( 'spammed_comment', $handler, 10 ); |
||
| 83 | |||
| 84 | // even though it's messy, we implement these hooks because |
||
| 85 | // the edit_comment hook doesn't include the data |
||
| 86 | // so this saves us a DB read for every comment event |
||
| 87 | foreach ( array( '', 'trackback', 'pingback' ) as $comment_type ) { |
||
| 88 | foreach ( array( 'unapproved', 'approved' ) as $comment_status ) { |
||
| 89 | add_action( "comment_{$comment_status}_{$comment_type}", $handler, 10, 2 ); |
||
| 90 | } |
||
| 91 | } |
||
| 92 | |||
| 93 | // options |
||
| 94 | add_action( 'added_option', $handler, 10, 2 ); |
||
| 95 | add_action( 'updated_option', $handler, 10, 3 ); |
||
| 96 | add_action( 'deleted_option', $handler, 10, 1 ); |
||
| 97 | |||
| 98 | // Sync Core Icon: Detect changes in Core's Site Icon and make it syncable. |
||
| 99 | add_action( 'add_option_site_icon', array( $this, 'jetpack_sync_core_icon' ) ); |
||
| 100 | add_action( 'update_option_site_icon', array( $this, 'jetpack_sync_core_icon' ) ); |
||
| 101 | add_action( 'delete_option_site_icon', array( $this, 'jetpack_sync_core_icon' ) ); |
||
| 102 | |||
| 103 | // wordpress version |
||
| 104 | add_action( 'upgrader_process_complete', array( $this, 'send_wp_version' ), 10, 2 ); |
||
| 105 | add_action( 'jetpack_sync_wp_version', $handler ); |
||
| 106 | |||
| 107 | // themes |
||
| 108 | add_action( 'switch_theme', array( $this, 'send_theme_info' ) ); |
||
| 109 | add_action( 'jetpack_sync_current_theme_support', $handler, 10 ); // custom hook, see meta-hooks below |
||
| 110 | |||
| 111 | // post-meta, and in the future - other meta? |
||
| 112 | foreach ( $this->meta_types as $meta_type ) { |
||
| 113 | add_action( "added_{$meta_type}_meta", $handler, 10, 4 ); |
||
| 114 | add_action( "updated_{$meta_type}_meta", $handler, 10, 4 ); |
||
| 115 | add_action( "deleted_{$meta_type}_meta", $handler, 10, 4 ); |
||
| 116 | } |
||
| 117 | |||
| 118 | // terms |
||
| 119 | add_action( 'created_term', array( $this, 'save_term_handler' ), 10, 3 ); |
||
| 120 | add_action( 'edited_term', array( $this, 'save_term_handler' ), 10, 3 ); |
||
| 121 | add_action( 'jetpack_sync_save_term', $handler, 10, 4 ); |
||
| 122 | add_action( 'delete_term', $handler, 10, 4 ); |
||
| 123 | add_action( 'set_object_terms', $handler, 10, 6 ); |
||
| 124 | add_action( 'deleted_term_relationships', $handler, 10, 2 ); |
||
| 125 | |||
| 126 | // users |
||
| 127 | add_action( 'user_register', array( $this, 'save_user_handler' ) ); |
||
| 128 | add_action( 'profile_update', array( $this, 'save_user_handler' ), 10, 2 ); |
||
| 129 | add_action( 'jetpack_sync_save_user', $handler, 10, 2 ); |
||
| 130 | add_action( 'deleted_user', $handler, 10, 2 ); |
||
| 131 | |||
| 132 | // user roles |
||
| 133 | add_action( 'add_user_role', array( $this, 'save_user_role_handler' ), 10, 2 ); |
||
| 134 | add_action( 'set_user_role', array( $this, 'save_user_role_handler' ), 10, 3 ); |
||
| 135 | add_action( 'remove_user_role', array( $this, 'save_user_role_handler' ), 10, 2 ); |
||
| 136 | |||
| 137 | |||
| 138 | // user capabilities |
||
| 139 | add_action( 'added_user_meta', array( $this, 'save_user_cap_handler' ), 10, 4 ); |
||
| 140 | add_action( 'updated_user_meta', array( $this, 'save_user_cap_handler' ), 10, 4 ); |
||
| 141 | add_action( 'deleted_user_meta', array( $this, 'save_user_cap_handler' ), 10, 4 ); |
||
| 142 | |||
| 143 | // themes |
||
| 144 | add_action( 'set_site_transient_update_plugins', $handler, 10, 1 ); |
||
| 145 | add_action( 'set_site_transient_update_themes', $handler, 10, 1 ); |
||
| 146 | add_action( 'set_site_transient_update_core', $handler, 10, 1 ); |
||
| 147 | |||
| 148 | // multi site network options |
||
| 149 | if ( $this->is_multisite ) { |
||
| 150 | add_action( 'add_site_option', $handler, 10, 2 ); |
||
| 151 | add_action( 'update_site_option', $handler, 10, 3 ); |
||
| 152 | add_action( 'delete_site_option', $handler, 10, 1 ); |
||
| 153 | } |
||
| 154 | |||
| 155 | // synthetic actions for full sync |
||
| 156 | add_action( 'jetpack_full_sync_start', $handler ); |
||
| 157 | add_action( 'jetpack_full_sync_end', $handler ); |
||
| 158 | add_action( 'jetpack_full_sync_options', $handler ); |
||
| 159 | add_action( 'jetpack_full_sync_posts', $handler ); // also sends post meta |
||
| 160 | add_action( 'jetpack_full_sync_comments', $handler ); // also send comments meta |
||
| 161 | add_action( 'jetpack_full_sync_users', $handler ); |
||
| 162 | add_action( 'jetpack_full_sync_terms', $handler, 10, 2 ); |
||
| 163 | if ( is_multisite() ) { |
||
| 164 | add_action( 'jetpack_full_sync_network_options', $handler ); |
||
| 165 | } |
||
| 166 | |||
| 167 | |||
| 168 | // TODO: Callables, Constanst, Network Options, Users, Terms |
||
|
|
|||
| 169 | |||
| 170 | /** |
||
| 171 | * Sync all pending actions with server |
||
| 172 | */ |
||
| 173 | add_action( 'jetpack_sync_actions', array( $this, 'do_sync' ) ); |
||
| 174 | } |
||
| 175 | |||
| 176 | // TODO: Refactor to use one set whitelist function, with one is_whitelisted. |
||
| 177 | function set_options_whitelist( $options ) { |
||
| 178 | $this->options_whitelist = $options; |
||
| 179 | } |
||
| 180 | |||
| 181 | function get_options_whitelist() { |
||
| 184 | |||
| 185 | function set_constants_whitelist( $constants ) { |
||
| 186 | $this->constants_whitelist = $constants; |
||
| 187 | } |
||
| 188 | |||
| 189 | function get_callable_whitelist() { |
||
| 190 | return $this->callable_whitelist; |
||
| 191 | } |
||
| 192 | |||
| 193 | function set_callable_whitelist( $callables ) { |
||
| 194 | $this->callable_whitelist = $callables; |
||
| 195 | } |
||
| 196 | |||
| 197 | function set_network_options_whitelist( $options ) { |
||
| 198 | $this->network_options_whitelist = $options; |
||
| 199 | } |
||
| 200 | |||
| 201 | function set_send_buffer_memory_size( $size ) { |
||
| 202 | $this->checkout_memory_size = $size; |
||
| 203 | } |
||
| 204 | |||
| 205 | // in bytes |
||
| 206 | function set_upload_max_bytes( $max_bytes ) { |
||
| 207 | $this->upload_max_bytes = $max_bytes; |
||
| 208 | } |
||
| 209 | |||
| 210 | // in rows |
||
| 211 | function set_upload_max_rows( $max_rows ) { |
||
| 212 | $this->upload_max_rows = $max_rows; |
||
| 213 | } |
||
| 214 | |||
| 215 | // in seconds |
||
| 216 | function set_min_sync_wait_time( $seconds ) { |
||
| 217 | update_option( self::SYNC_THROTTLE_OPTION_NAME, $seconds, true ); |
||
| 218 | } |
||
| 219 | |||
| 220 | function get_min_sync_wait_time() { |
||
| 221 | return get_option( self::SYNC_THROTTLE_OPTION_NAME ); |
||
| 222 | } |
||
| 223 | |||
| 224 | private function get_last_sync_time() { |
||
| 225 | return (double) get_option( self::LAST_SYNC_TIME_OPTION_NAME ); |
||
| 226 | } |
||
| 227 | |||
| 228 | private function set_last_sync_time() { |
||
| 229 | return update_option( self::LAST_SYNC_TIME_OPTION_NAME, microtime( true ), true ); |
||
| 230 | } |
||
| 231 | |||
| 232 | function set_taxonomy_whitelist( $taxonomies ) { |
||
| 233 | $this->taxonomy_whitelist = $taxonomies; |
||
| 234 | } |
||
| 235 | |||
| 236 | function is_whitelisted_option( $option ) { |
||
| 237 | return in_array( $option, $this->options_whitelist ); |
||
| 238 | } |
||
| 239 | |||
| 240 | function is_whitelisted_network_option( $option ) { |
||
| 241 | return $this->is_multisite && in_array( $option, $this->network_options_whitelist ); |
||
| 242 | } |
||
| 243 | |||
| 244 | function set_codec( iJetpack_Sync_Codec $codec ) { |
||
| 245 | $this->codec = $codec; |
||
| 246 | } |
||
| 247 | |||
| 248 | function set_full_sync_client( $full_sync_client ) { |
||
| 249 | if ( $this->full_sync_client ) { |
||
| 250 | remove_action( 'jetpack_sync_full', array( $this->full_sync_client, 'start' ) ); |
||
| 251 | } |
||
| 252 | |||
| 253 | $this->full_sync_client = $full_sync_client; |
||
| 254 | |||
| 255 | /** |
||
| 256 | * Sync all objects in the database with the server |
||
| 257 | */ |
||
| 258 | add_action( 'jetpack_sync_full', array( $this->full_sync_client, 'start' ) ); |
||
| 259 | } |
||
| 260 | |||
| 261 | function get_full_sync_client() { |
||
| 262 | return $this->full_sync_client; |
||
| 263 | } |
||
| 264 | |||
| 265 | function action_handler() { |
||
| 266 | // TODO: it's really silly to have this function here - it should be |
||
| 267 | // wherever we initialize the action listeners or we're just wasting cycles |
||
| 268 | if ( Jetpack::is_development_mode() || Jetpack::is_staging_site() ) { |
||
| 269 | return false; |
||
| 270 | } |
||
| 271 | |||
| 272 | $current_filter = current_filter(); |
||
| 273 | $args = func_get_args(); |
||
| 274 | |||
| 275 | if ( $current_filter === 'wp_insert_post' && $args[1]->post_type === 'revision' ) { |
||
| 276 | return; |
||
| 277 | } |
||
| 278 | |||
| 279 | if ( in_array( $current_filter, array( 'deleted_option', 'added_option', 'updated_option' ) ) |
||
| 280 | && |
||
| 281 | ! $this->is_whitelisted_option( $args[0] ) |
||
| 282 | ) { |
||
| 283 | return; |
||
| 284 | } |
||
| 285 | |||
| 286 | if ( in_array( $current_filter, array( 'delete_site_option', 'add_site_option', 'update_site_option' ) ) |
||
| 287 | && |
||
| 288 | ! $this->is_whitelisted_network_option( $args[0] ) |
||
| 289 | ) { |
||
| 290 | return; |
||
| 291 | } |
||
| 292 | |||
| 293 | // don't sync private meta |
||
| 294 | if ( preg_match( '/^(added|updated|deleted)_.*_meta$/', $current_filter ) |
||
| 295 | && $args[2][0] === '_' |
||
| 296 | && ! in_array( $args[2], Jetpack_Sync_Defaults::$default_whitelist_meta_keys ) |
||
| 297 | ) { |
||
| 298 | return; |
||
| 299 | } |
||
| 300 | |||
| 301 | $this->sync_queue->add( array( |
||
| 302 | $current_filter, |
||
| 303 | $args, |
||
| 304 | get_current_user_id(), |
||
| 305 | microtime( true ) |
||
| 306 | ) ); |
||
| 307 | } |
||
| 308 | |||
| 309 | function send_theme_info() { |
||
| 332 | |||
| 333 | function send_wp_version( $update, $meta_data ) { |
||
| 347 | |||
| 348 | function save_term_handler( $term_id, $tt_id, $taxonomy ) { |
||
| 364 | |||
| 365 | function send_attachment_info( $attachment_id ) { |
||
| 378 | |||
| 379 | function save_user_handler( $user_id, $old_user_data = null ) { |
||
| 405 | |||
| 406 | function save_user_role_handler( $user_id, $role, $old_roles = null ) { |
||
| 418 | |||
| 419 | function save_user_cap_handler( $meta_id, $user_id, $meta_key, $capabilities ) { |
||
| 432 | |||
| 433 | public function sanitize_user( $user ) { |
||
| 434 | unset( $user->data->user_pass ); |
||
| 435 | |||
| 436 | return $user; |
||
| 437 | } |
||
| 438 | |||
| 439 | |||
| 440 | function do_sync() { |
||
| 441 | // don't sync if importing |
||
| 442 | if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { |
||
| 443 | $this->schedule_sync( "+1 minute" ); |
||
| 444 | |||
| 445 | return false; |
||
| 446 | } |
||
| 447 | |||
| 448 | // don't sync if we are throttled |
||
| 449 | $sync_wait = $this->get_min_sync_wait_time(); |
||
| 450 | $last_sync = $this->get_last_sync_time(); |
||
| 451 | |||
| 452 | if ( $last_sync && $sync_wait && $last_sync + $sync_wait > microtime( true ) ) { |
||
| 453 | return false; |
||
| 454 | } |
||
| 455 | |||
| 456 | $this->set_last_sync_time(); |
||
| 457 | $this->maybe_sync_constants(); |
||
| 458 | $this->maybe_sync_callables(); |
||
| 459 | |||
| 460 | if ( $this->sync_queue->size() === 0 ) { |
||
| 461 | return false; |
||
| 462 | } |
||
| 463 | |||
| 464 | $buffer = $this->sync_queue->checkout_with_memory_limit( $this->checkout_memory_size, $this->upload_max_rows ); |
||
| 465 | |||
| 466 | if ( ! $buffer ) { |
||
| 467 | // buffer has no items |
||
| 468 | return false; |
||
| 469 | } |
||
| 470 | |||
| 471 | if ( is_wp_error( $buffer ) ) { |
||
| 472 | // another buffer is currently sending |
||
| 473 | return false; |
||
| 474 | } |
||
| 475 | |||
| 476 | $upload_size = 0; |
||
| 477 | $items_to_send = array(); |
||
| 478 | |||
| 479 | // we estimate the total encoded size as we go by encoding each item individually |
||
| 480 | // this is expensive, but the only way to really know :/ |
||
| 481 | foreach ( $buffer->get_items() as $key => $item ) { |
||
| 482 | |||
| 483 | /** |
||
| 484 | * Modify the data within an action before it is serialized and sent to the server |
||
| 485 | * For example, during full sync this expands Post ID's into full Post objects, |
||
| 486 | * so that we don't have to serialize the whole object into the queue. |
||
| 487 | * |
||
| 488 | * @since 4.1.0 |
||
| 489 | * |
||
| 490 | * @param array The action parameters |
||
| 491 | */ |
||
| 492 | $item[1] = apply_filters( "jetpack_sync_before_send_" . $item[0], $item[1] ); |
||
| 493 | |||
| 494 | $encoded_item = $this->codec->encode( $item ); |
||
| 495 | $upload_size += strlen( $encoded_item ); |
||
| 496 | |||
| 497 | if ( $upload_size > $this->upload_max_bytes && count( $items_to_send ) > 0 ) { |
||
| 498 | break; |
||
| 499 | } |
||
| 500 | |||
| 501 | $items_to_send[ $key ] = $encoded_item; |
||
| 502 | } |
||
| 503 | |||
| 504 | /** |
||
| 505 | * Fires when data is ready to send to the server. |
||
| 506 | * Return false or WP_Error to abort the sync (e.g. if there's an error) |
||
| 507 | * The items will be automatically re-sent later |
||
| 508 | * |
||
| 509 | * @since 4.1 |
||
| 510 | * |
||
| 511 | * @param array $data The action buffer |
||
| 512 | */ |
||
| 513 | $result = apply_filters( 'jetpack_sync_client_send_data', $items_to_send ); |
||
| 514 | |||
| 515 | if ( ! $result || is_wp_error( $result ) ) { |
||
| 516 | // error_log("There was an error sending data:"); |
||
| 517 | // error_log(print_r($result, 1)); |
||
| 518 | $result = $this->sync_queue->checkin( $buffer ); |
||
| 519 | |||
| 520 | if ( is_wp_error( $result ) ) { |
||
| 521 | error_log( "Error checking in buffer: " . $result->get_error_message() ); |
||
| 522 | $this->sync_queue->force_checkin(); |
||
| 523 | } |
||
| 524 | // try again in 1 minute |
||
| 525 | $this->schedule_sync( "+1 minute" ); |
||
| 526 | } else { |
||
| 527 | |||
| 528 | // scan the sent data to see if a full sync started or finished |
||
| 529 | if ( $this->buffer_includes_action( $buffer, 'jetpack_full_sync_start' ) ) { |
||
| 530 | $this->full_sync_client->set_status_sending_started(); |
||
| 531 | } |
||
| 532 | |||
| 533 | if ( $this->buffer_includes_action( $buffer, 'jetpack_full_sync_end' ) ) { |
||
| 534 | $this->full_sync_client->set_status_sending_finished(); |
||
| 535 | } |
||
| 536 | |||
| 537 | $this->sync_queue->close( $buffer, $result ); |
||
| 538 | // check if there are any more events in the buffer |
||
| 539 | // if so, schedule a cron job to happen soon |
||
| 540 | if ( $this->sync_queue->has_any_items() ) { |
||
| 541 | $this->schedule_sync( "+1 minute" ); |
||
| 542 | } |
||
| 543 | } |
||
| 544 | } |
||
| 545 | |||
| 546 | private function buffer_includes_action( $buffer, $action_name ) { |
||
| 555 | |||
| 556 | function expand_wp_insert_post( $args ) { |
||
| 560 | |||
| 561 | // Expands wp_insert_post to include filtered content |
||
| 562 | function filter_post_content_and_add_links( $post ) { |
||
| 563 | if ( 0 < strlen( $post->post_password ) ) { |
||
| 564 | $post->post_password = 'auto-' . wp_generate_password( 10, false ); |
||
| 565 | } |
||
| 566 | /** This filter is already documented in core. wp-includes/post-template.php */ |
||
| 567 | $post->post_content_filtered = apply_filters( 'the_content', $post->post_content ); |
||
| 568 | $post->permalink = get_permalink( $post->ID ); |
||
| 569 | $post->shortlink = wp_get_shortlink( $post->ID ); |
||
| 570 | |||
| 571 | // legacy fields until we fully sync users |
||
| 572 | $extra = array(); |
||
| 573 | $extra['author_email'] = get_the_author_meta( 'email', $post->post_author ); |
||
| 574 | $extra['author_display_name'] = get_the_author_meta( 'display_name', $post->post_author ); |
||
| 575 | $extra['dont_email_post_to_subs'] = get_post_meta( $post->ID, '_jetpack_dont_email_post_to_subs', true ); |
||
| 576 | $post->extra = $extra; |
||
| 577 | |||
| 578 | return $post; |
||
| 579 | } |
||
| 580 | |||
| 581 | private function schedule_sync( $when ) { |
||
| 584 | |||
| 585 | function force_sync_constants() { |
||
| 593 | |||
| 594 | function force_sync_options() { |
||
| 604 | |||
| 605 | function force_sync_network_options() { |
||
| 615 | |||
| 616 | View Code Duplication | private function maybe_sync_constants() { |
|
| 647 | |||
| 648 | private function get_all_constants() { |
||
| 654 | |||
| 655 | private function get_constant( $constant ) { |
||
| 662 | |||
| 663 | public function force_sync_callables() { |
||
| 671 | |||
| 672 | View Code Duplication | private function maybe_sync_callables() { |
|
| 702 | |||
| 703 | private function get_all_callables() { |
||
| 709 | |||
| 710 | private function get_callable( $callable ) { |
||
| 713 | |||
| 714 | // Is public so that we don't have to store so much data all the options twice. |
||
| 715 | function get_all_options() { |
||
| 723 | |||
| 724 | function get_all_network_options() { |
||
| 732 | |||
| 733 | private function get_check_sum( $values ) { |
||
| 736 | |||
| 737 | View Code Duplication | function jetpack_sync_core_icon() { |
|
| 753 | |||
| 754 | function get_sync_queue() { |
||
| 757 | |||
| 758 | function reset_sync_queue() { |
||
| 761 | |||
| 762 | function set_defaults() { |
||
| 791 | |||
| 792 | function reset_data() { |
||
| 795 | } |
||
| 796 |