Completed
Push — try/xmlrpc-server-package-clas... ( 6199c0...8e0ceb )
by
unknown
07:26
created

Jetpack_Sync_Main   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 17 1
1
<?php
2
/**
3
 * This class hooks the main sync actions.
4
 *
5
 * @package jetpack-sync
6
 */
7
8
/**
9
 * Jetpack Sync main class.
10
 */
11
class Jetpack_Sync_Main {
12
	/**
13
	 * Initialize the main sync actions.
14
	 */
15
	public static function init() {
16
		// Check for WooCommerce support.
17
		add_action( 'plugins_loaded', array( 'Jetpack_Sync_Actions', 'initialize_woocommerce' ), 5 );
18
19
		// Check for WP Super Cache.
20
		add_action( 'plugins_loaded', array( 'Jetpack_Sync_Actions', 'initialize_wp_super_cache' ), 5 );
21
22
		/*
23
		 * Init after plugins loaded and before the `init` action. This helps with issues where plugins init
24
		 * with a high priority or sites that use alternate cron.
25
		 */
26
		add_action( 'plugins_loaded', array( 'Jetpack_Sync_Actions', 'init' ), 90 );
27
28
		// We need to define this here so that it's hooked before `updating_jetpack_version` is called.
29
		add_action( 'updating_jetpack_version', array( 'Jetpack_Sync_Actions', 'cleanup_on_upgrade' ), 10, 2 );
30
		add_action( 'jetpack_user_authorized', array( 'Jetpack_Sync_Actions', 'do_initial_sync' ), 10, 0 );
31
	}
32
}
33