Completed
Push — branch-7.5 ( 9378b5...5f3718 )
by Jeremy
211:39 queued 203:47
created

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
namespace Automattic\Jetpack\Sync;
9
10
/**
11
 * Jetpack Sync main class.
12
 */
13
class Main {
14
	/**
15
	 * Initialize the main sync actions.
16
	 */
17
	public static function init() {
18
		// Check for WooCommerce support.
19
		add_action( 'plugins_loaded', array( 'Automattic\\Jetpack\\Sync\\Actions', 'initialize_woocommerce' ), 5 );
20
21
		// Check for WP Super Cache.
22
		add_action( 'plugins_loaded', array( 'Automattic\\Jetpack\\Sync\\Actions', 'initialize_wp_super_cache' ), 5 );
23
24
		/*
25
		 * Init after plugins loaded and before the `init` action. This helps with issues where plugins init
26
		 * with a high priority or sites that use alternate cron.
27
		 */
28
		add_action( 'plugins_loaded', array( 'Automattic\\Jetpack\\Sync\\Actions', 'init' ), 90 );
29
30
		// We need to define this here so that it's hooked before `updating_jetpack_version` is called.
31
		add_action( 'updating_jetpack_version', array( 'Automattic\\Jetpack\\Sync\\Actions', 'cleanup_on_upgrade' ), 10, 2 );
32
		add_action( 'jetpack_user_authorized', array( 'Automattic\\Jetpack\\Sync\\Actions', 'do_initial_sync' ), 10, 0 );
33
	}
34
}
35