PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.2
Jetpack – WP Security, Backup, Speed, & Growth v16.2
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 13.9.2 14.0.1 14.1.1 14.2.2 All 502 releases
← All changes | modules/subscriptions.php +156 -176 13.2.416.2 View file →
@@ -1,14 +1,14 @@
1 1 <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName)
2 2 /**
3 3 * Module Name: Newsletter
4 - * Module Description: Let visitors subscribe to new posts and comments via email
4 + * Module Description: Grow your subscriber list and deliver your content directly to their email inbox.
5 5 * Sort Order: 9
6 6 * Recommendation Order: 8
7 7 * First Introduced: 1.2
8 8 * Requires Connection: Yes
9 9 * Requires User Connection: Yes
10 - * Auto Activate: No
10 + * Auto Activate: Yes
11 11 * Module Tags: Social
12 12 * Feature: Engagement
13 13 * Additional Search Queries: subscriptions, subscription, email, follow, followers, subscribers, signup, newsletter, creator
14 14 */
@@ -14,14 +14,20 @@
14 14 */
15 15
16 16 // phpcs:disable Universal.Files.SeparateFunctionsFromOO.Mixed -- TODO: Move classes to appropriately-named class files.
17 17
18 +use Automattic\Jetpack\Admin_UI\Admin_Menu;
18 19 use Automattic\Jetpack\Connection\Manager as Connection_Manager;
19 20 use Automattic\Jetpack\Connection\XMLRPC_Async_Call;
21 +use Automattic\Jetpack\Newsletter\Settings as Newsletter_Settings;
20 22 use Automattic\Jetpack\Redirect;
21 23 use Automattic\Jetpack\Status;
22 24 use Automattic\Jetpack\Status\Host;
23 25
26 +if ( ! defined( 'ABSPATH' ) ) {
27 + exit( 0 );
28 +}
29 +
24 30 add_action( 'jetpack_modules_loaded', 'jetpack_subscriptions_load' );
25 31
26 32 // Loads the User Content Link Redirection feature.
27 33 require_once __DIR__ . '/subscriptions/jetpack-user-content-link-redirection.php';
@@ -57,8 +63,10 @@
57 63 }
58 64
59 65 /**
60 66 * Main class file for the Subscriptions module.
67 + *
68 + * @phan-constructor-used-for-side-effects
61 69 */
62 70 class Jetpack_Subscriptions {
63 71 /**
64 72 * Whether Jetpack has been instantiated or not.
@@ -127,8 +135,10 @@
127 135 add_filter( 'post_updated_messages', array( $this, 'update_published_message' ), 18, 1 );
128 136
129 137 // Set "social_notifications_subscribe" option during the first-time activation.
130 138 add_action( 'jetpack_activate_module_subscriptions', array( $this, 'set_social_notifications_subscribe' ) );
139 + add_action( 'jetpack_activate_module_subscriptions', array( $this, 'set_featured_image_in_email_default' ) );
140 + add_action( 'jetpack_activate_module_subscriptions', array( $this, 'set_newsletter_send_default' ) );
131 141
132 142 // Hide subscription messaging in Publish panel for posts that were published in the past
133 143 add_action( 'init', array( $this, 'register_post_meta' ), 20 );
134 144 add_action( 'transition_post_status', array( $this, 'maybe_set_first_published_status' ), 10, 3 );
@@ -134,8 +144,22 @@
134 144 add_action( 'transition_post_status', array( $this, 'maybe_set_first_published_status' ), 10, 3 );
135 145
136 146 // Add Subscribers menu to Jetpack navigation.
137 147 add_action( 'jetpack_admin_menu', array( $this, 'add_subscribers_menu' ) );
148 +
149 + // Customize the configuration URL to lead to the Subscriptions settings.
150 + add_filter(
151 + 'jetpack_module_configuration_url_subscriptions',
152 + function () {
153 + return Jetpack::admin_url( array( 'page' => 'jetpack#/newsletter' ) );
154 + }
155 + );
156 +
157 + // Track categories created through the category editor page
158 + add_action( 'wp_ajax_add-tag', array( $this, 'track_newsletter_category_creation' ), 1 );
159 +
160 + $newsletter_settings = new Newsletter_Settings();
161 + $newsletter_settings::init();
138 162 }
139 163
140 164 /**
141 165 * Jetpack_Subscriptions::xmlrpc_methods()
@@ -357,23 +381,8 @@
357 381 'discussion',
358 382 'stc_enabled'
359 383 );
360 384
361 - /** Enable Subscribe Modal */
362 -
363 - add_settings_field(
364 - 'jetpack_subscriptions_comment_subscribe',
365 - __( 'Enable Subscribe Modal', 'jetpack' ),
366 - array( $this, 'subscribe_modal_setting' ),
367 - 'discussion',
368 - 'jetpack_subscriptions'
369 - );
370 -
371 - register_setting(
372 - 'discussion',
373 - 'sm_enabled'
374 - );
375 -
376 385 /** Email me whenever: Someone subscribes to my blog */
377 386 /* @since 8.1 */
378 387
379 388 add_settings_section(
@@ -395,47 +404,8 @@
395 404 'discussion',
396 405 'social_notifications_subscribe',
397 406 array( $this, 'social_notifications_subscribe_validate' )
398 407 );
399 -
400 - /** Subscription Messaging Options */
401 -
402 - register_setting(
403 - 'reading',
404 - 'subscription_options',
405 - array( $this, 'validate_settings' )
406 - );
407 -
408 - add_settings_section(
409 - 'email_settings',
410 - __( 'Follower Settings', 'jetpack' ),
411 - array( $this, 'reading_section' ),
412 - 'reading'
413 - );
414 -
415 - add_settings_field(
416 - 'invitation',
417 - __( 'Blog follow email text', 'jetpack' ),
418 - array( $this, 'setting_invitation' ),
419 - 'reading',
420 - 'email_settings'
421 - );
422 -
423 - add_settings_field(
424 - 'comment-follow',
425 - __( 'Comment follow email text', 'jetpack' ),
426 - array( $this, 'setting_comment_follow' ),
427 - 'reading',
428 - 'email_settings'
429 - );
430 -
431 - add_settings_field(
432 - 'welcome',
433 - __( 'Welcome email text', 'jetpack' ),
434 - array( $this, 'setting_welcome' ),
435 - 'reading',
436 - 'email_settings'
437 - );
438 408 }
439 409
440 410 /**
441 411 * Discussions setting section blurb.
@@ -494,24 +464,8 @@
494 464 <?php
495 465 }
496 466
497 467 /**
498 - * Subscribe Modal Toggle.
499 - */
500 - public function subscribe_modal_setting() {
501 -
502 - $sm_enabled = get_option( 'sm_enabled', 1 );
503 - ?>
504 -
505 - <p class="description">
506 - <input type="checkbox" name="sm_enabled" id="jetpack-subscribe-modal" value="1" <?php checked( $sm_enabled, 1 ); ?> />
507 - <?php esc_html_e( 'Show a popup subscribe modal to readers.', 'jetpack' ); ?>
508 - </p>
509 -
510 - <?php
511 - }
512 -
513 - /**
514 468 * Someone subscribes to my blog section
515 469 *
516 470 * @since 8.1
517 471 */
@@ -573,92 +527,8 @@
573 527 return 'on';
574 528 }
575 529
576 530 /**
577 - * Validate settings for the Subscriptions module.
578 - *
579 - * @param array $settings Settings to be validated.
580 - */
581 - public function validate_settings( $settings ) {
582 - global $allowedposttags;
583 -
584 - $default = $this->get_default_settings();
585 -
586 - // Blog Follow.
587 - $settings['invitation'] = trim( wp_kses( $settings['invitation'], $allowedposttags ) );
588 - if ( empty( $settings['invitation'] ) ) {
589 - $settings['invitation'] = $default['invitation'];
590 - }
591 -
592 - // Comments Follow (single post).
593 - $settings['comment_follow'] = trim( wp_kses( $settings['comment_follow'], $allowedposttags ) );
594 - if ( empty( $settings['comment_follow'] ) ) {
595 - $settings['comment_follow'] = $default['comment_follow'];
596 - }
597 -
598 - return $settings;
599 - }
600 -
601 - /**
602 - * HTML output helper for Reading section.
603 - */
604 - public function reading_section() {
605 - echo '<p id="follower-settings">';
606 - esc_html_e( 'These settings change emails sent from your blog to followers.', 'jetpack' );
607 - echo '</p>';
608 - }
609 -
610 - /**
611 - * HTML output helper for Invitation section.
612 - */
613 - public function setting_invitation() {
614 - $settings = $this->get_settings();
615 - echo '<textarea name="subscription_options[invitation]" class="large-text" cols="50" rows="5">' . esc_textarea( $settings['invitation'] ) . '</textarea>';
616 - echo '<p><span class="description">' . esc_html__( 'Introduction text sent when someone follows your blog. (Site and confirmation details will be automatically added for you.)', 'jetpack' ) . '</span></p>';
617 - }
618 -
619 - /**
620 - * HTML output helper for Comment Follow section.
621 - */
622 - public function setting_comment_follow() {
623 - $settings = $this->get_settings();
624 - echo '<textarea name="subscription_options[comment_follow]" class="large-text" cols="50" rows="5">' . esc_textarea( $settings['comment_follow'] ) . '</textarea>';
625 - echo '<p><span class="description">' . esc_html__( 'Introduction text sent when someone follows a post on your blog. (Site and confirmation details will be automatically added for you.)', 'jetpack' ) . '</span></p>';
626 - }
627 -
628 - /**
629 - * HTML output helper for Welcome section.
630 - */
631 - public function setting_welcome() {
632 - $settings = $this->get_settings();
633 - echo '<textarea name="subscription_options[welcome]" class="large-text" cols="50" rows="5">' . esc_textarea( $settings['welcome'] ) . '</textarea>';
634 - echo '<p><span class="description">' . esc_html__( 'Welcome text sent when someone follows your blog.', 'jetpack' ) . '</span></p>';
635 - }
636 -
637 - /**
638 - * Get default settings for the Subscriptions module.
639 - */
640 - public function get_default_settings() {
641 - $site_url = get_home_url();
642 - $display_url = preg_replace( '(^https?://)', '', untrailingslashit( $site_url ) );
643 -
644 - return array(
645 - /* translators: Both %1$s and %2$s is site address */
646 - 'invitation' => sprintf( __( "Howdy,\nYou recently subscribed to <a href='%1\$s'>%2\$s</a> and we need to verify the email you provided. Once you confirm below, you'll be able to receive and read new posts.\n\nIf you believe this is an error, ignore this message and nothing more will happen.", 'jetpack' ), $site_url, $display_url ),
647 - 'comment_follow' => __( "Howdy.\n\nYou recently followed one of my posts. This means you will receive an email when new comments are posted.\n\nTo activate, click confirm below. If you believe this is an error, ignore this message and we'll never bother you again.", 'jetpack' ),
648 - /* translators: %1$s is the site address */
649 - 'welcome' => sprintf( __( 'Cool, you are now subscribed to %1$s and will receive an email notification when a new post is published.', 'jetpack' ), $display_url ),
650 - );
651 - }
652 -
653 - /**
654 - * Reeturn merged `subscription_options` option with module default settings.
655 - */
656 - public function get_settings() {
657 - return wp_parse_args( (array) get_option( 'subscription_options' ), $this->get_default_settings() );
658 - }
659 -
660 - /**
661 531 * Jetpack_Subscriptions::subscribe()
662 532 *
663 533 * Send a synchronous XML-RPC subscribe to blog posts or subscribe to post comments request.
664 534 *
@@ -697,8 +567,9 @@
697 567
698 568 if ( $async ) {
699 569 XMLRPC_Async_Call::add_call( 'jetpack.subscribeToSite', 0, $email, $post_id, serialize( $extra_data ) ); //phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize
700 570 } else {
571 + // @phan-suppress-next-line PhanPossiblyUndeclaredVariable -- $xml is set when $async is false
701 572 $xml->addCall( 'jetpack.subscribeToSite', $email, $post_id, serialize( $extra_data ) ); //phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize
702 573 }
703 574 }
704 575
@@ -706,19 +577,24 @@
706 577 return;
707 578 }
708 579
709 580 // Call.
581 + // @phan-suppress-next-line PhanPossiblyUndeclaredVariable -- $xml is set when $async is false, otherwise we return early
710 582 $xml->query();
711 583
584 + // @phan-suppress-next-line PhanPossiblyUndeclaredVariable -- $xml is set when $async is false, otherwise we return early
712 585 if ( $xml->isError() ) {
586 + // @phan-suppress-next-line PhanPossiblyUndeclaredVariable -- $xml is set when $async is false, otherwise we return early
713 587 return $xml->get_jetpack_error();
714 588 }
715 589
590 + // @phan-suppress-next-line PhanPossiblyUndeclaredVariable -- $xml is set when $async is false
716 591 $responses = $xml->getResponse();
717 592
718 593 $r = array();
719 594 foreach ( (array) $responses as $response ) {
720 595 if ( isset( $response['faultCode'] ) || isset( $response['faultString'] ) ) {
596 + // @phan-suppress-next-line PhanPossiblyUndeclaredVariable -- $xml is set when $async is false
721 597 $r[] = $xml->get_jetpack_error( $response['faultCode'], $response['faultString'] );
722 598 continue;
723 599 }
724 600
@@ -836,9 +712,9 @@
836 712 */
837 713 do_action( 'jetpack_subscriptions_form_submission', $result );
838 714
839 715 wp_safe_redirect( "$redirect#$redirect_fragment" );
840 - exit;
716 + exit( 0 );
841 717 }
842 718
843 719 /**
844 720 * Jetpack_Subscriptions::comment_subscribe_init()
@@ -934,8 +810,19 @@
934 810 * @param int|string $comment_id Comment thread being subscribed to.
935 811 * @param string $approved Comment status.
936 812 */
937 813 public function comment_subscribe_submit( $comment_id, $approved ) {
814 + /**
815 + * Filters whether to skip comment subscription processing.
816 + *
817 + * @since 15.5
818 + *
819 + * @param bool $skip Whether to skip comment subscription. Default false.
820 + */
821 + if ( apply_filters( 'jetpack_subscription_comment_subscribe_skip', false ) ) {
822 + return;
823 + }
824 +
938 825 if ( 'spam' === $approved ) {
939 826 return;
940 827 }
941 828
@@ -998,9 +885,9 @@
998 885 public function set_cookies( $subscribe_to_post = false, $post_id = null, $subscribe_to_blog = false ) {
999 886 $post_id = (int) $post_id;
1000 887
1001 888 /** This filter is already documented in core/wp-includes/comment-functions.php */
1002 - $cookie_lifetime = apply_filters( 'comment_cookie_lifetime', 30000000 );
889 + $cookie_lifetime = apply_filters( 'comment_cookie_lifetime', YEAR_IN_SECONDS );
1003 890
1004 891 /**
1005 892 * Filter the Jetpack Comment cookie path.
1006 893 *
@@ -1023,15 +910,15 @@
1023 910 */
1024 911 $cookie_domain = apply_filters( 'jetpack_comment_cookie_domain', COOKIE_DOMAIN );
1025 912
1026 913 if ( $subscribe_to_post && $post_id >= 0 ) {
1027 - setcookie( 'jetpack_comments_subscribe_' . self::$hash . '_' . $post_id, 1, time() + $cookie_lifetime, $cookie_path, $cookie_domain, is_ssl(), true );
914 + setcookie( 'jetpack_comments_subscribe_' . self::$hash . '_' . $post_id, '1', time() + $cookie_lifetime, $cookie_path, $cookie_domain, is_ssl(), true );
1028 915 } else {
1029 916 setcookie( 'jetpack_comments_subscribe_' . self::$hash . '_' . $post_id, '', time() - 3600, $cookie_path, $cookie_domain, is_ssl(), true );
1030 917 }
1031 918
1032 919 if ( $subscribe_to_blog ) {
1033 - setcookie( 'jetpack_blog_subscribe_' . self::$hash, 1, time() + $cookie_lifetime, $cookie_path, $cookie_domain, is_ssl(), true );
920 + setcookie( 'jetpack_blog_subscribe_' . self::$hash, '1', time() + $cookie_lifetime, $cookie_path, $cookie_domain, is_ssl(), true );
1034 921 } else {
1035 922 setcookie( 'jetpack_blog_subscribe_' . self::$hash, '', time() - 3600, $cookie_path, $cookie_domain, is_ssl(), true );
1036 923 }
1037 924 }
@@ -1049,8 +936,26 @@
1049 936 }
1050 937 }
1051 938
1052 939 /**
940 + * Set the featured image in email option to `1` when the Subscriptions module is activated in the first time.
941 + *
942 + * @return void
943 + */
944 + public function set_featured_image_in_email_default() {
945 + add_option( 'wpcom_featured_image_in_email', 1 );
946 + }
947 +
948 + /**
949 + * Set the email post to subscribers default option to `1` when the Subscriptions module is activated for the first time.
950 + *
951 + * @return void
952 + */
953 + public function set_newsletter_send_default() {
954 + add_option( 'wpcom_newsletter_send_default', 1 );
955 + }
956 +
957 + /**
1053 958 * Save a flag when a post was ever published.
1054 959 *
1055 960 * It saves the post meta when the post was published and becomes a draft.
1056 961 * Then this meta is used to hide subscription messaging in Publish panel.
@@ -1059,8 +964,13 @@
1059 964 * @param string $old_status The "old" post status of the transition when saved.
1060 965 * @param object $post obj The post object.
1061 966 */
1062 967 public function maybe_set_first_published_status( $new_status, $old_status, $post ) {
968 + // Subscriptions are only available for posts so far.
969 + if ( ! $post instanceof \WP_Post || 'post' !== $post->post_type ) {
970 + return;
971 + }
972 +
1063 973 $was_post_ever_published = get_post_meta( $post->ID, '_jetpack_post_was_ever_published', true );
1064 974 if ( ! $was_post_ever_published && 'publish' === $old_status && 'draft' === $new_status ) {
1065 975 update_post_meta( $post->ID, '_jetpack_post_was_ever_published', true );
1066 976 }
@@ -1066,14 +976,24 @@
1066 976 }
1067 977 }
1068 978
1069 979 /**
1070 - * Checks if the current user can publish posts.
980 + * Checks if the current user can edit posts.
1071 981 *
1072 982 * @return bool
1073 983 */
1074 984 public function first_published_status_meta_auth_callback() {
1075 - if ( current_user_can( 'publish_posts' ) ) {
985 + /**
986 + * Filter the capability required to edit the "was ever published" post meta.
987 + *
988 + * @module subscriptions
989 + *
990 + * @since 13.4
991 + *
992 + * @param string $capability User capability needed to edit the "was ever published" meta. Default to edit_posts.
993 + */
994 + $capability = apply_filters( 'jetpack_subscriptions_post_was_ever_published_capability', 'edit_posts' );
995 + if ( current_user_can( $capability ) ) {
1076 996 return true;
1077 997 }
1078 998 return false;
1079 999 }
@@ -1082,16 +1002,17 @@
1082 1002 * Registers the 'post_was_ever_published' post meta for use in the REST API.
1083 1003 */
1084 1004 public function register_post_meta() {
1085 1005 $jetpack_post_was_ever_published = array(
1086 - 'type' => 'boolean',
1087 - 'description' => __( 'Whether the post was ever published.', 'jetpack' ),
1088 - 'single' => true,
1089 - 'default' => false,
1090 - 'show_in_rest' => array(
1006 + 'type' => 'boolean',
1007 + 'description' => __( 'Whether the post was ever published.', 'jetpack' ),
1008 + 'single' => true,
1009 + 'default' => false,
1010 + 'show_in_rest' => array(
1091 1011 'name' => 'jetpack_post_was_ever_published',
1092 1012 ),
1093 - 'auth_callback' => array( $this, 'first_published_status_meta_auth_callback' ),
1013 + 'auth_callback' => array( $this, 'first_published_status_meta_auth_callback' ),
1014 + 'object_subtype' => 'post', // Subscriptions are only for the post post type so far, so we can limit this meta to posts only.
1094 1015 );
1095 1016
1096 1017 register_meta( 'post', '_jetpack_post_was_ever_published', $jetpack_post_was_ever_published );
1097 1018 }
@@ -1100,17 +1021,28 @@
1100 1021 * Create a Subscribers menu displayed on self-hosted sites.
1101 1022 *
1102 1023 * - It is not displayed on WordPress.com sites.
1103 1024 * - It directs you to Calypso to the existing Subscribers page.
1025 + * - It is retired once the Newsletter modernization filter is on, since the
1026 + * unified Newsletter page then owns the Subscribers tab.
1104 1027 *
1105 1028 * @return void
1106 1029 */
1107 1030 public function add_subscribers_menu() {
1108 1031 /*
1109 - * Do not display any menu on WoA and WordPress.com Simple sites.
1032 + * Referenced as a string literal (mirrors Newsletter\Settings::MODERNIZATION_FILTER)
1033 + * to keep this bootstrap path safe if the packaged Newsletter Settings class does
1034 + * not expose the constant yet.
1035 + */
1036 + if ( apply_filters( 'rsm_jetpack_ui_modernization_newsletter', true ) ) {
1037 + return;
1038 + }
1039 +
1040 + /*
1041 + * Do not display any menu on WoA and WordPress.com Simple sites (unless Classic wp-admin is enabled).
1110 1042 * They already get a menu item under Users via nav-unification.
1111 1043 */
1112 - if ( ( new Host() )->is_wpcom_platform() ) {
1044 + if ( ( new Host() )->is_wpcom_platform() && get_option( 'wpcom_admin_interface' ) !== 'wp-admin' ) {
1113 1045 return;
1114 1046 }
1115 1047
1116 1048 $status = new Status();
@@ -1125,24 +1057,66 @@
1125 1057 ) {
1126 1058 return;
1127 1059 }
1128 1060
1061 + /**
1062 + * Enables the new in development subscribers in wp-admin dashboard.
1063 + *
1064 + * @since 9.5.0
1065 + *
1066 + * @param bool If the new dashboard is enabled. Defaults on for every site; hosts
1067 + * can opt out with this filter.
1068 + */
1069 + if ( apply_filters( 'jetpack_wp_admin_subscriber_management_enabled', true ) ) {
1070 + return;
1071 + }
1072 +
1129 1073 $blog_id = Connection_Manager::get_site_id( true );
1130 1074
1131 1075 $link = Redirect::get_url(
1132 - 'jetpack-menu-calypso-subscribers',
1076 + 'jetpack-menu-jetpack-manage-subscribers',
1133 1077 array( 'site' => $blog_id ? $blog_id : $status->get_site_suffix() )
1134 1078 );
1135 1079
1136 - add_submenu_page(
1137 - 'jetpack',
1138 - esc_attr__( 'Subscribers', 'jetpack' ),
1139 - __( 'Subscribers', 'jetpack' ) . ' <span class="dashicons dashicons-external"></span>',
1080 + Admin_Menu::add_menu(
1081 + __( 'Subscribers', 'jetpack' ),
1082 + __( 'Subscribers', 'jetpack' ) . ' <span aria-hidden="true">↗</span>',
1140 1083 'manage_options',
1141 1084 esc_url( $link ),
1142 - null
1085 + null,
1086 + 100
1143 1087 );
1144 1088 }
1089 +
1090 + /**
1091 + * Record tracks event if categories is created when user enters
1092 + * the edit category page through the newsletter settings page.
1093 + *
1094 + * @return void
1095 + */
1096 + public function track_newsletter_category_creation() {
1097 +
1098 + // phpcs:disable WordPress.Security.NonceVerification.Missing
1099 + if ( empty( $_POST['_wp_http_referer'] ) ) {
1100 + return;
1101 + }
1102 +
1103 + if ( strpos( sanitize_url( wp_unslash( $_POST['_wp_http_referer'] ) ), 'referer=newsletter-categories' ) > -1 ) {
1104 +
1105 + $parent = filter_var( empty( $_POST['parent'] ) ? 0 : wp_unslash( $_POST['parent'] ), FILTER_SANITIZE_NUMBER_INT );
1106 +
1107 + $is_child_category = $parent > 0;
1108 +
1109 + $tracking = new Automattic\Jetpack\Tracking();
1110 + $tracking->tracks_record_event(
1111 + wp_get_current_user(),
1112 + 'jetpack_newsletter_add_category',
1113 + array(
1114 + 'is_child_category' => $is_child_category,
1115 + )
1116 + );
1117 + }
1118 + }
1145 1119 }
1146 1120
1147 1121 Jetpack_Subscriptions::init();
1148 1122
@@ -1147,4 +1121,10 @@
1147 1121 Jetpack_Subscriptions::init();
1148 1122
1149 1123 require __DIR__ . '/subscriptions/views.php';
1150 1124 require __DIR__ . '/subscriptions/subscribe-modal/class-jetpack-subscribe-modal.php';
1125 +require __DIR__ . '/subscriptions/subscribe-overlay/class-jetpack-subscribe-overlay.php';
1126 +require __DIR__ . '/subscriptions/subscribe-floating-button/class-jetpack-subscribe-floating-button.php';
1127 +require __DIR__ . '/subscriptions/newsletter-widget/class-jetpack-newsletter-dashboard-widget.php';
1128 +
1129 +require_once __DIR__ . '/subscriptions/abilities/class-newsletter-abilities.php';
1130 +\Automattic\Jetpack\Plugin\Abilities\Newsletter_Abilities::init();