| 1 |
<?php |
| 2 |
/** |
| 3 |
* The Ads section of the Premium Analytics dashboard, on sites that run the WordAds module. |
| 4 |
* |
| 5 |
* @package automattic/jetpack |
| 6 |
*/ |
| 7 |
|
| 8 |
use Automattic\Jetpack\Status\Host; |
| 9 |
use Automattic\Jetpack\WordAds\Analytics_Dashboard; |
| 10 |
|
| 11 |
/** |
| 12 |
* Hands the Ads section and its widget types to the Premium Analytics dashboard. |
| 13 |
* |
| 14 |
* The section, its layout and the widgets live in the jetpack-ads package; this class decides |
| 15 |
* that a site running the module gets them. On the WordPress.com platform jetpack-mu-wpcom decides, |
| 16 |
* by plan feature and WordAds being on, and this registrant stays out. |
| 17 |
* |
| 18 |
* @since 16.3 |
| 19 |
*/ |
| 20 |
class WordAds_Premium_Analytics { |
| 21 |
|
| 22 |
/** |
| 23 |
* Hook the package's registrants on the dashboard's registry actions. |
| 24 |
* |
| 25 |
* @return void |
| 26 |
*/ |
| 27 |
public static function init() { |
| 28 |
// Simple and Atomic decide by plan feature and WordAds being on, from jetpack-mu-wpcom. |
| 29 |
if ( ( new Host() )->is_wpcom_platform() ) { |
| 30 |
return; |
| 31 |
} |
| 32 |
|
| 33 |
if ( ! class_exists( Analytics_Dashboard::class ) ) { |
| 34 |
return; |
| 35 |
} |
| 36 |
|
| 37 |
Analytics_Dashboard::init(); |
| 38 |
} |
| 39 |
} |
| 40 |
|