← All changes
|
jetpack_vendor/automattic/jetpack-config/src/class-config.php
+25
-21
12.8.3
→
16.3
View file →
| @@ -11,8 +11,9 @@ | ||
| 11 | 11 | * The Config package does not require the composer packages that |
| 12 | 12 | * contain the package classes shown below. The consumer plugin |
| 13 | 13 | * must require the corresponding packages to use these features. |
| 14 | 14 | */ |
| 15 | +use Automattic\Jetpack\Account_Protection\Account_Protection as Jetpack_Account_Protection_Main; | |
| 15 | 16 | use Automattic\Jetpack\Connection\Manager; |
| 16 | 17 | use Automattic\Jetpack\Connection\Plugin; |
| 17 | 18 | use Automattic\Jetpack\Import\Main as Import_Main; |
| 18 | 19 | use Automattic\Jetpack\JITMS\JITM as JITMS_JITM; |
| @@ -23,9 +24,8 @@ | ||
| 23 | 24 | use Automattic\Jetpack\Stats_Admin\Main as Stats_Admin_Main; |
| 24 | 25 | use Automattic\Jetpack\Sync\Main as Sync_Main; |
| 25 | 26 | use Automattic\Jetpack\VideoPress\Initializer as VideoPress_Pkg_Initializer; |
| 26 | 27 | use Automattic\Jetpack\Waf\Waf_Initializer as Jetpack_Waf_Main; |
| 27 | -use Automattic\Jetpack\WordAds\Initializer as Jetpack_WordAds_Main; | |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * The configuration class. |
| 31 | 31 | */ |
| @@ -40,22 +40,22 @@ | ||
| 40 | 40 | * |
| 41 | 41 | * @var Array |
| 42 | 42 | */ |
| 43 | 43 | protected $config = array( |
| 44 | - 'jitm' => false, | |
| 45 | - 'connection' => false, | |
| 46 | - 'sync' => false, | |
| 47 | - 'post_list' => false, | |
| 48 | - 'identity_crisis' => false, | |
| 49 | - 'search' => false, | |
| 50 | - 'publicize' => false, | |
| 51 | - 'wordads' => false, | |
| 52 | - 'waf' => false, | |
| 53 | - 'videopress' => false, | |
| 54 | - 'stats' => false, | |
| 55 | - 'stats_admin' => false, | |
| 56 | - 'yoast_promo' => false, | |
| 57 | - 'import' => false, | |
| 44 | + 'jitm' => false, | |
| 45 | + 'connection' => false, | |
| 46 | + 'sync' => false, | |
| 47 | + 'post_list' => false, | |
| 48 | + 'identity_crisis' => false, | |
| 49 | + 'search' => false, | |
| 50 | + 'publicize' => false, | |
| 51 | + 'account_protection' => false, | |
| 52 | + 'waf' => false, | |
| 53 | + 'videopress' => false, | |
| 54 | + 'stats' => false, | |
| 55 | + 'stats_admin' => false, | |
| 56 | + 'yoast_promo' => false, | |
| 57 | + 'import' => false, | |
| 58 | 58 | ); |
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * Initialization options stored here. |
| @@ -138,11 +138,11 @@ | ||
| 138 | 138 | $this->ensure_class( 'Automattic\Jetpack\Publicize\Publicize_UI' ) && $this->ensure_class( 'Automattic\Jetpack\Publicize\Publicize' ) |
| 139 | 139 | && $this->ensure_feature( 'publicize' ); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - if ( $this->config['wordads'] ) { | |
| 143 | - $this->ensure_class( 'Automattic\Jetpack\WordAds\Initializer' ) | |
| 144 | - && $this->ensure_feature( 'wordads' ); | |
| 142 | + if ( $this->config['account_protection'] ) { | |
| 143 | + $this->ensure_class( 'Automattic\Jetpack\Account_Protection\Account_Protection' ) | |
| 144 | + && $this->ensure_feature( 'account_protection' ); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | if ( $this->config['waf'] ) { |
| 148 | 148 | $this->ensure_class( 'Automattic\Jetpack\Waf\Waf_Initializer' ) |
| @@ -233,8 +233,9 @@ | ||
| 233 | 233 | if ( class_exists( 'Automattic\Jetpack\JITMS\JITM' ) ) { |
| 234 | 234 | JITMS_JITM::configure(); |
| 235 | 235 | } else { |
| 236 | 236 | // Provides compatibility with jetpack-jitm <v1.6. |
| 237 | + // @phan-suppress-next-line PhanUndeclaredClassMethod | |
| 237 | 238 | JITM::configure(); |
| 238 | 239 | } |
| 239 | 240 | |
| 240 | 241 | return true; |
| @@ -301,12 +302,15 @@ | ||
| 301 | 302 | } |
| 302 | 303 | } |
| 303 | 304 | |
| 304 | 305 | /** |
| 305 | - * Enables WordAds. | |
| 306 | + * Enables Account Protection. | |
| 306 | 307 | */ |
| 307 | - protected function enable_wordads() { | |
| 308 | - Jetpack_WordAds_Main::init(); | |
| 308 | + protected function enable_account_protection() { | |
| 309 | + $account_protection = Jetpack_Account_Protection_Main::instance(); | |
| 310 | + $account_protection->initialize(); | |
| 311 | + | |
| 312 | + return true; | |
| 309 | 313 | } |
| 310 | 314 | |
| 311 | 315 | /** |
| 312 | 316 | * Enables Waf. |