PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.7
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.7
16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 All 506 releases
jetpack / modules / wordads / php / class-wordads-premium-analytics.php

class-wordads-premium-analytics.php in Jetpack – WP Security, Backup, Speed, & Growth 16.3-a.7, at modules/wordads/php/class-wordads-premium-analytics.php

40 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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