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
← All changes | modules/wordads/class-wordads.php +227 -54 12.2.3 → 16.3-a.7 View file →
@@ -6,8 +6,12 @@
6 6 */
7 7
8 8 use Automattic\Jetpack\Status\Host;
9 9
10 +if ( ! defined( 'ABSPATH' ) ) {
11 + exit( 0 );
12 +}
13 +
10 14 define( 'WORDADS_ROOT', __DIR__ );
11 15 define( 'WORDADS_BASENAME', plugin_basename( __FILE__ ) );
12 16 define( 'WORDADS_FILE_PATH', WORDADS_ROOT . '/' . basename( __FILE__ ) );
13 17 define( 'WORDADS_URL', plugins_url( '/', __FILE__ ) );
@@ -18,8 +22,13 @@
18 22 require_once WORDADS_ROOT . '/php/class-wordads-api.php';
19 23 require_once WORDADS_ROOT . '/php/class-wordads-cron.php';
20 24 require_once WORDADS_ROOT . '/php/class-wordads-california-privacy.php';
21 25 require_once WORDADS_ROOT . '/php/class-wordads-ccpa-do-not-sell-link-widget.php';
26 +require_once WORDADS_ROOT . '/php/class-wordads-consent-management-provider.php';
27 +require_once WORDADS_ROOT . '/php/class-wordads-formats.php';
28 +require_once WORDADS_ROOT . '/php/class-wordads-smart.php';
29 +require_once WORDADS_ROOT . '/php/class-wordads-shortcode.php';
30 +require_once WORDADS_ROOT . '/php/class-wordads-premium-analytics.php';
22 31
23 32 /**
24 33 * Primary WordAds class.
25 34 */
@@ -27,9 +36,9 @@
27 36
28 37 /**
29 38 * Ads parameters.
30 39 *
31 - * @var null
40 + * @var WordAds_Params
32 41 */
33 42 public $params = null;
34 43
35 44 /**
@@ -105,9 +114,9 @@
105 114 * Solo unit CSS string.
106 115 *
107 116 * @var string
108 117 */
109 - public static $solo_unit_css = 'float:left;margin-right:5px;margin-top:0px;';
118 + public static $solo_unit_css = 'float:left;margin-right:5px;margin-top:0;';
110 119
111 120 /**
112 121 * Checks for AMP support and returns true iff active & AMP request
113 122 *
@@ -132,9 +141,9 @@
132 141 * Convenience function for grabbing options from params->options
133 142 *
134 143 * @param string $option the option to grab.
135 144 * @param mixed $default (optional).
136 - * @return option or $default if not set
145 + * @return mixed option or $default if not set
137 146 *
138 147 * @since 4.5.0
139 148 */
140 149 public function option( $option, $default = false ) {
@@ -178,8 +187,9 @@
178 187 add_action( 'widgets_init', array( $this, 'widget_callback' ) );
179 188
180 189 if ( is_admin() ) {
181 190 WordAds_California_Privacy::init_ajax_actions();
191 + WordAds_Consent_Management_Provider::init_ajax_actions();
182 192 }
183 193 }
184 194
185 195 /**
@@ -206,10 +216,22 @@
206 216 if ( $this->params->options['wordads_ccpa_enabled'] ) {
207 217 WordAds_California_Privacy::init();
208 218 }
209 219
210 - if ( isset( $_SERVER['REQUEST_URI'] ) && '/ads.txt' === $_SERVER['REQUEST_URI'] ) {
220 + // Initialize CMP if enabled.
221 + if ( isset( $this->params->options['wordads_cmp_enabled'] ) && $this->params->options['wordads_cmp_enabled'] ) {
222 + WordAds_Consent_Management_Provider::init();
223 + }
211 224
225 + // Initialize [wordads] shortcode.
226 + WordAds_Shortcode::init();
227 +
228 + // Initialize Smart.
229 + WordAds_Smart::instance()->init( $this->params );
230 +
231 + if ( ( isset( $_SERVER['REQUEST_URI'] ) && '/ads.txt' === $_SERVER['REQUEST_URI'] )
232 + || ( site_url( 'ads.txt', 'relative' ) === $_SERVER['REQUEST_URI'] ) ) {
233 +
212 234 $ads_txt_transient = get_transient( 'wordads_ads_txt' );
213 235
214 236 if ( false === ( $ads_txt_transient ) ) {
215 237 $wordads_ads_txt = WordAds_API::get_wordads_ads_txt();
@@ -227,12 +249,12 @@
227 249 * @param string WordAds_API::get_wordads_ads_txt() The contents of the ads.txt file.
228 250 */
229 251 $ads_txt_content = apply_filters( 'wordads_ads_txt', $ads_txt_transient );
230 252
231 - http_response_code( 200 );
253 + status_header( 200 );
232 254 header( 'Content-Type: text/plain; charset=utf-8' );
233 255 echo esc_html( $ads_txt_content );
234 - die();
256 + die( 0 );
235 257 }
236 258 }
237 259
238 260 /**
@@ -252,10 +274,13 @@
252 274 * @since 4.5.0
253 275 */
254 276 private function insert_adcode() {
255 277 add_filter( 'wp_resource_hints', array( $this, 'resource_hints' ), 10, 2 );
278 +
279 + // These 'wp_head' actions add the IPONWEB JavaScript snippets to the page.
280 + // We need to remove these calls whenever migration to Aditude is complete.
256 281 add_action( 'wp_head', array( $this, 'insert_head_meta' ), 20 );
257 - add_action( 'wp_head', array( $this, 'insert_head_iponweb' ), 30 );
282 +
258 283 add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
259 284 add_filter( 'wordads_ads_txt', array( $this, 'insert_custom_adstxt' ) );
260 285
261 286 /**
@@ -303,8 +328,13 @@
303 328 *
304 329 * @since 4.5.0
305 330 */
306 331 public function enqueue_scripts() {
332 + // Ads are never shown on 404 pages.
333 + if ( is_404() ) {
334 + return;
335 + }
336 +
307 337 wp_enqueue_style(
308 338 'wordads',
309 339 WORDADS_URL . 'css/style.css',
310 340 array(),
@@ -322,9 +352,9 @@
322 352 *
323 353 * @return array Domains for hinting.
324 354 */
325 355 public function resource_hints( $hints, $relation_type ) {
326 - if ( 'dns-prefetch' === $relation_type ) {
356 + if ( 'dns-prefetch' === $relation_type && ! is_404() ) {
327 357 $hints[] = '//s.pubmine.com';
328 358 $hints[] = '//x.bidswitch.net';
329 359 $hints[] = '//static.criteo.net';
330 360 $hints[] = '//ib.adnxs.com';
@@ -347,13 +377,11 @@
347 377 }
348 378
349 379 /**
350 380 * IPONWEB metadata used by the various scripts
351 - *
352 - * @return [type] [description]
353 381 */
354 382 public function insert_head_meta() {
355 - if ( self::is_amp() ) {
383 + if ( self::is_amp() || is_404() ) {
356 384 return;
357 385 }
358 386 $hosting_type = ( new Host() )->is_woa_site() ? 1 : 2; // 1 = WPCOM, 2 = Jetpack.
359 387 $pagetype = (int) $this->params->get_page_type_ipw();
@@ -360,11 +388,45 @@
360 388 $data_tags = ( $this->params->cloudflare ) ? ' data-cfasync="false"' : '';
361 389 $site_id = $this->params->blog_id;
362 390 $consent = (int) isset( $_COOKIE['personalized-ads-consent'] );
363 391 $is_logged_in = is_user_logged_in() ? '1' : '0';
392 +
393 + $disabled_slot_formats = apply_filters( 'wordads_disabled_slot_formats', array() );
394 +
395 + if ( apply_filters( 'wordads_iponweb_bottom_sticky_ad_disable', false ) ) {
396 + $disabled_slot_formats[] = 'MTS';
397 + }
398 +
399 + if ( apply_filters( 'wordads_iponweb_sidebar_sticky_right_ad_disable', false ) ) {
400 + $disabled_slot_formats[] = 'DPR';
401 + }
402 +
403 + $config = array(
404 + 'pt' => $pagetype,
405 + 'ht' => $hosting_type,
406 + 'tn' => get_stylesheet(),
407 + 'uloggedin' => $is_logged_in,
408 + 'amp' => false,
409 + 'siteid' => $site_id,
410 + 'consent' => $consent,
411 + 'ad' => array(
412 + 'label' => array(
413 + 'text' => __( 'Advertisements', 'jetpack' ),
414 + ),
415 + 'reportAd' => array(
416 + 'text' => __( 'Report this ad', 'jetpack' ),
417 + ),
418 + 'privacySettings' => array(
419 + 'text' => __( 'Privacy', 'jetpack' ),
420 + 'onClick' => 'js:function() { window.__tcfapi && window.__tcfapi(\'showUi\'); }',
421 + ),
422 + ),
423 + 'disabled_slot_formats' => $disabled_slot_formats,
424 + );
425 + $js_config = WordAds_Array_Utils::array_to_js_object( $config );
364 426 ?>
365 427 <script<?php echo esc_attr( $data_tags ); ?> type="text/javascript">
366 - var __ATA_PP = { pt: <?php echo esc_js( $pagetype ); ?>, ht: <?php echo esc_js( $hosting_type ); ?>, tn: '<?php echo esc_js( get_stylesheet() ); ?>', uloggedin: <?php echo esc_js( $is_logged_in ); ?>, amp: false, siteid: <?php echo esc_js( $site_id ); ?>, consent: <?php echo esc_js( $consent ); ?>, ad: { label: { text: '<?php echo esc_js( __( 'Advertisements', 'jetpack' ) ); ?>' }, reportAd: { text: '<?php echo esc_js( __( 'Report this ad', 'jetpack' ) ); ?>' } } };
428 + var __ATA_PP = <?php echo $js_config; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>;
367 429 var __ATA = __ATA || {};
368 430 __ATA.cmd = __ATA.cmd || [];
369 431 __ATA.criteo = __ATA.criteo || {};
370 432 __ATA.criteo.cmd = __ATA.criteo.cmd || [];
@@ -369,29 +431,40 @@
369 431 __ATA.criteo = __ATA.criteo || {};
370 432 __ATA.criteo.cmd = __ATA.criteo.cmd || [];
371 433 </script>
372 434 <?php
373 - }
374 435
375 - /**
376 - * IPONWEB scripts in <head>
377 - *
378 - * @since 4.5.0
379 - */
380 - public function insert_head_iponweb() {
381 - if ( self::is_amp() ) {
382 - return;
383 - }
436 + $section_id = $this->params->blog_id . 5;
384 437
385 - $data_tags = ( $this->params->cloudflare ) ? ' data-cfasync="false"' : '';
386 - ?>
387 - <script<?php echo esc_attr( $data_tags ); ?> type="text/javascript">
388 - (function(){var g=Date.now||function(){return+new Date};function h(a,b){a:{for(var c=a.length,d="string"==typeof a?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return 0>b?null:"string"==typeof a?a.charAt(b):a[b]};function k(a,b,c){c=null!=c?"="+encodeURIComponent(String(c)):"";if(b+=c){c=a.indexOf("#");0>c&&(c=a.length);var d=a.indexOf("?");if(0>d||d>c){d=c;var e=""}else e=a.substring(d+1,c);a=[a.substr(0,d),e,a.substr(c)];c=a[1];a[1]=b?c?c+"&"+b:b:c;a=a[0]+(a[1]?"?"+a[1]:"")+a[2]}return a};var l=0;function m(a,b){var c=document.createElement("script");c.src=a;c.onload=function(){b&&b(void 0)};c.onerror=function(){b&&b("error")};a=document.getElementsByTagName("head");var d;a&&0!==a.length?d=a[0]:d=document.documentElement;d.appendChild(c)}function n(a){var b=void 0===b?document.cookie:b;return(b=h(b.split("; "),function(c){return-1!=c.indexOf(a+"=")}))?b.split("=")[1]:""}function p(a){return"string"==typeof a&&0<a.length}
389 - function r(a,b,c){b=void 0===b?"":b;c=void 0===c?".":c;var d=[];Object.keys(a).forEach(function(e){var f=a[e],q=typeof f;"object"==q&&null!=f||"function"==q?d.push(r(f,b+e+c)):null!==f&&void 0!==f&&(e=encodeURIComponent(b+e),d.push(e+"="+encodeURIComponent(f)))});return d.filter(p).join("&")}function t(a,b){a||((window.__ATA||{}).config=b.c,m(b.url))}var u=Math.floor(1E13*Math.random()),v=window.__ATA||{};window.__ATA=v;window.__ATA.cmd=v.cmd||[];v.rid=u;v.createdAt=g();var w=window.__ATA||{},x="s.pubmine.com";
390 - w&&w.serverDomain&&(x=w.serverDomain);var y="//"+x+"/conf",z=window.top===window,A=window.__ATA_PP&&window.__ATA_PP.gdpr_applies,B="boolean"===typeof A?Number(A):null,C=window.__ATA_PP||null,D=z?document.referrer?document.referrer:null:null,E=z?window.location.href:document.referrer?document.referrer:null,F,G=n("__ATA_tuuid");F=G?G:null;var H=window.innerWidth+"x"+window.innerHeight,I=n("usprivacy"),J=r({gdpr:B,pp:C,rid:u,src:D,ref:E,tuuid:F,vp:H,us_privacy:I?I:null},"",".");
391 - (function(a){var b=void 0===b?"cb":b;l++;var c="callback__"+g().toString(36)+"_"+l.toString(36);a=k(a,b,c);window[c]=function(d){t(void 0,d)};m(a,function(d){d&&t(d)})})(y+"?"+J);}).call(this);
392 - </script>
393 - <?php
438 + // Get below post tag.
439 + $tag_belowpost = $this->get_fallback_ad_snippet( $section_id, 'square', 'belowpost', '', '{{unique_id}}' );
440 +
441 + // Remove linebreaks and sanitize.
442 + $tag_belowpost = esc_js( str_replace( array( "\n", "\t", "\r" ), '', $tag_belowpost ) );
443 +
444 + // Get an inline tag with a macro as id handled on JS side to use as a fallback.
445 + $tag_inline = $this->get_fallback_ad_snippet( $section_id, 'square', 'inline', '', '{{unique_id}}' );
446 +
447 + // Remove linebreaks and sanitize.
448 + $tag_inline = esc_js( str_replace( array( "\n", "\t", "\r" ), '', $tag_inline ) );
449 +
450 + // Get top tag.
451 + $tag_top = $this->get_fallback_ad_snippet( $section_id, 'leaderboard', 'top', '', '{{unique_id}}' );
452 +
453 + // Remove linebreaks and sanitize.
454 + $tag_top = esc_js( str_replace( array( "\n", "\t", "\r" ), '', $tag_top ) );
455 +
456 + // phpcs:disable WordPress.Security.EscapeOutput.HeredocOutputNotEscaped
457 + echo <<<HTML
458 + <script type="text/javascript">
459 + window.sas_fallback = window.sas_fallback || [];
460 + window.sas_fallback.push(
461 + { tag: "$tag_inline", type: 'inline' },
462 + { tag: "$tag_belowpost", type: 'belowpost' },
463 + { tag: "$tag_top", type: 'top' }
464 + );
465 + </script>
466 +HTML;
394 467 }
395 468
396 469 /**
397 470 * Insert the ad onto the page
@@ -450,10 +523,17 @@
450 523 return $content;
451 524 }
452 525
453 526 $ad_type = $this->option( 'wordads_house' ) ? 'house' : 'iponweb';
454 - $content .= $this->get_ad( 'inline', $ad_type );
455 - return $content;
527 + $location = 'shortcode';
528 +
529 + // Not house ad and WATL enabled.
530 + // phpcs:disable WordPress.Security.NonceVerification.Recommended
531 + if ( 'house' !== $ad_type && ( isset( $_GET['wordads-logging'] ) && isset( $_GET[ $location ] ) && 'true' === $_GET[ $location ] ) ) {
532 + return $content . $this->get_watl_ad_html_tag( $location );
533 + }
534 +
535 + return $content . $this->get_ad( 'inline', $ad_type );
456 536 }
457 537
458 538 /**
459 539 * Inserts ad into header
@@ -562,9 +642,8 @@
562 642 public function get_ad( $spot, $type = 'iponweb' ) {
563 643 $snippet = '';
564 644 if ( 'iponweb' === $type ) {
565 645 $section_id = WORDADS_API_TEST_ID;
566 - $snippet = '';
567 646
568 647 if ( 'top' === $spot ) {
569 648 // mrec for mobile, leaderboard for desktop.
570 649 $section_id = 0 === $this->params->blog_id ? WORDADS_API_TEST_ID : $this->params->blog_id . '2';
@@ -650,21 +729,52 @@
650 729 $loc_id = self::$ad_location_ids[ $location ];
651 730 }
652 731
653 732 $loc_id = esc_js( $loc_id );
733 +
734 + // Determine supported Gutenberg format by width and height.
735 + $format = WordAds_Formats::get_format_slug( (int) $width, (int) $height );
736 + if ( $format === '' ) {
737 + return ''; // When format is not supported, ignore placement.
738 + }
739 +
740 + // For a while return elements for both IPONWEB (__ATA) and Aditude (tudeMappings).
741 + // We will remove using IPONWEB after partnership termination on June 30, 2025.
654 742 return <<<HTML
655 743 <div style="padding-bottom:15px;width:{$width}px;height:{$height}px;$css">
656 744 <div id="atatags-{$ad_number}">
657 745 <script$data_tags type="text/javascript">
658 - __ATA.cmd.push(function() {
659 - __ATA.initSlot('atatags-{$ad_number}', {
660 - collapseEmpty: 'before',
661 - sectionId: '{$section_id}',
662 - location: {$loc_id},
663 - width: {$width},
664 - height: {$height}
665 - });
666 - });
746 + window.getAdSnippetCallback = function () {
747 + if ( true === ( window.isWatlV1 ?? false ) ) {
748 + // Use IPONWEB scripts.
749 + window.__ATA = window.__ATA || {};
750 + window.__ATA.cmd = __ATA.cmd || [];
751 + window.__ATA.cmd.push(function() {
752 + window.__ATA.initSlot('atatags-{$ad_number}', {
753 + collapseEmpty: 'before',
754 + sectionId: '{$section_id}',
755 + location: {$loc_id},
756 + width: {$width},
757 + height: {$height}
758 + });
759 + });
760 + } else {
761 + // Use Aditude scripts.
762 + window.tudeMappings = window.tudeMappings || [];
763 + window.tudeMappings.push( {
764 + divId: 'atatags-{$ad_number}',
765 + format: '{$format}',
766 + width: {$width},
767 + height: {$height},
768 + } );
769 + }
770 + }
771 +
772 + if ( document.readyState === 'loading' ) {
773 + document.addEventListener( 'DOMContentLoaded', window.getAdSnippetCallback );
774 + } else {
775 + window.getAdSnippetCallback();
776 + }
667 777 </script>
668 778 </div>
669 779 </div>
670 780 HTML;
@@ -682,18 +792,43 @@
682 792
683 793 /**
684 794 * Returns the dynamic snippet to be inserted into the ad unit
685 795 *
686 - * @param int $section_id section_id.
687 - * @param string $form_factor form_factor.
688 - * @param string $location location.
689 - * @param string $relocate location to be moved after the fact for themes without required hook.
796 + * @param int $section_id section_id.
797 + * @param string $form_factor form_factor.
798 + * @param string $location location.
799 + * @param string $relocate location to be moved after the fact for themes without required hook.
800 + * @param string | null $id A unique string ID or placeholder.
801 + *
690 802 * @return string
691 803 *
692 804 * @since 8.7
693 805 */
694 - public function get_dynamic_ad_snippet( $section_id, $form_factor = 'square', $location = '', $relocate = '' ) {
695 - $div_id = 'atatags-' . $section_id . '-' . uniqid();
806 + public function get_dynamic_ad_snippet( $section_id, $form_factor = 'square', $location = '', $relocate = '', $id = null ) {
807 + $is_location_enabled = in_array( $location, array( 'top', 'belowpost', 'inline' ), true );
808 +
809 + if ( $is_location_enabled ) {
810 + return self::get_watl_ad_html_tag( $location );
811 + }
812 +
813 + return $this->get_fallback_ad_snippet( $section_id, $form_factor, $location, $relocate, $id );
814 + }
815 +
816 + /**
817 + * Returns the fallback dynamic snippet to be inserted into the ad unit
818 + *
819 + * @param int $section_id section_id.
820 + * @param string $form_factor form_factor.
821 + * @param string $location location.
822 + * @param string $relocate location to be moved after the fact for themes without required hook.
823 + * @param string | null $id A unique string ID or placeholder.
824 + *
825 + * @return string
826 + *
827 + * @since 8.7
828 + */
829 + public function get_fallback_ad_snippet( $section_id, $form_factor = 'square', $location = '', $relocate = '', $id = null ) {
830 + $div_id = 'atatags-' . $section_id . '-' . ( $id ?? uniqid() );
696 831 $div_id = esc_attr( $div_id );
697 832
698 833 // Default form factor.
699 834 $form_factor_id = self::$form_factor_ids['square'];
@@ -712,9 +847,9 @@
712 847 $privacy_settings_text = esc_js( __( 'Privacy settings', 'jetpack' ) );
713 848
714 849 $relocate_script = '';
715 850 if ( ! empty( $relocate ) ) {
716 - $selector = wp_json_encode( $relocate );
851 + $selector = wp_json_encode( $relocate, JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP );
717 852 $relocate_script = <<<JS
718 853 <script type="text/javascript">
719 854 var adNode = document.getElementById( '{$div_id}' );
720 855 var selector = {$selector};
@@ -741,8 +876,9 @@
741 876 text: '{$report_ad_text}',
742 877 },
743 878 privacySettings: {
744 879 text: '{$privacy_settings_text}',
880 + onClick: function() { window.__tcfapi && window.__tcfapi('showUi'); },
745 881 }
746 882 }
747 883 });
748 884 });
@@ -764,12 +900,8 @@
764 900 if ( strpos( strtolower( $spot ), 'amp' ) === false && ! 'inline' === $spot ) {
765 901 return $snippet; // we don't want dynamic ads to be inserted for AMP & Gutenberg.
766 902 }
767 903
768 - if ( empty( $css_classes ) ) {
769 - $css_classes = array();
770 - }
771 -
772 904 $css_classes[] = 'wpcnt';
773 905 if ( 'top' === $spot ) {
774 906 $css_classes[] = 'wpcnt-header';
775 907 }
@@ -839,8 +971,46 @@
839 971 HTML;
840 972 }
841 973
842 974 /**
975 + * Returns the html ad tag used by WordAds Tag Library
976 + *
977 + * @param string $slot_type e.g belowpost, gutenberg_rectangle.
978 + *
979 + * @return string
980 + *
981 + * @since 8.7
982 + */
983 + public static function get_watl_ad_html_tag( string $slot_type ): string {
984 + $uid = uniqid( 'atatags-dynamic-' . $slot_type . '-' );
985 +
986 + return <<<HTML
987 + <div style="padding-bottom:15px;" class="wordads-tag" data-slot-type="{$slot_type}">
988 + <div id="{$uid}">
989 + <script type="text/javascript">
990 + window.getAdSnippetCallback = function () {
991 + if ( false === ( window.isWatlV1 ?? false ) ) {
992 + // Use Aditude scripts.
993 + window.tudeMappings = window.tudeMappings || [];
994 + window.tudeMappings.push( {
995 + divId: '{$uid}',
996 + format: '{$slot_type}',
997 + } );
998 + }
999 + }
1000 +
1001 + if ( document.readyState === 'loading' ) {
1002 + document.addEventListener( 'DOMContentLoaded', window.getAdSnippetCallback );
1003 + } else {
1004 + window.getAdSnippetCallback();
1005 + }
1006 + </script>
1007 + </div>
1008 + </div>
1009 +HTML;
1010 + }
1011 +
1012 + /**
843 1013 * Activation hook actions
844 1014 *
845 1015 * @since 4.5.0
846 1016 */
@@ -864,7 +1034,10 @@
864 1034
865 1035 add_action( 'jetpack_activate_module_wordads', array( 'WordAds', 'activate' ) );
866 1036 add_action( 'jetpack_activate_module_wordads', array( 'WordAds_Cron', 'activate' ) );
867 1037 add_action( 'jetpack_deactivate_module_wordads', array( 'WordAds_Cron', 'deactivate' ) );
1038 +
1039 +// The Ads tab of the Premium Analytics dashboard follows the module.
1040 +WordAds_Premium_Analytics::init();
868 1041
869 1042 global $wordads;
870 1043 $wordads = new WordAds();