diff --git a/projects/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php b/projects/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php index c311427b52318..04417f772b4d1 100644 --- a/projects/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php +++ b/projects/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php @@ -2541,14 +2541,20 @@ public static function get_updateable_data_list( $selector = '' ) { 'stb_enabled' => array( 'description' => esc_html__( "Show a 'follow blog' option in the comment form", 'jetpack' ), 'type' => 'boolean', - 'default' => 1, + // Keep the previous behaviour after updating subscription to autoactivate + // So we don't update the frontend for new users of Jetpack + // https://github.com/Automattic/jetpack/pull/29028 + 'default' => jetpack_get_module_info( 'subscriptions' )['auto_activate'] === 'No' ? 1 : 0, 'validate_callback' => __CLASS__ . '::validate_boolean', 'jp_group' => 'subscriptions', ), 'stc_enabled' => array( 'description' => esc_html__( "Show a 'follow comments' option in the comment form", 'jetpack' ), 'type' => 'boolean', - 'default' => 1, + // Keep the previous behaviour after updating subscription to autoactivate + // So we don't update the frontend for new users of Jetpack + // https://github.com/Automattic/jetpack/pull/29028 + 'default' => jetpack_get_module_info( 'subscriptions' )['auto_activate'] === 'No' ? 1 : 0, 'validate_callback' => __CLASS__ . '::validate_boolean', 'jp_group' => 'subscriptions', ), diff --git a/projects/plugins/jetpack/changelog/update-jumpstart-subscriptions b/projects/plugins/jetpack/changelog/update-jumpstart-subscriptions new file mode 100644 index 0000000000000..17e80b01f46e2 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-jumpstart-subscriptions @@ -0,0 +1,4 @@ +Significance: patch +Type: enhancement + +Autoactivate Subscriptions diff --git a/projects/plugins/jetpack/modules/comments/comments.php b/projects/plugins/jetpack/modules/comments/comments.php index d1da4f8266c92..da9318e88f986 100644 --- a/projects/plugins/jetpack/modules/comments/comments.php +++ b/projects/plugins/jetpack/modules/comments/comments.php @@ -281,12 +281,12 @@ public function comment_form_after() { ) . '

'; return; } - if ( in_array( 'subscriptions', Jetpack::get_active_modules(), true ) ) { - $stb_enabled = get_option( 'stb_enabled', 1 ); + $default = jetpack_get_module_info( 'subscriptions' )['auto_activate'] === 'No' ? 1 : 0; + $stb_enabled = get_option( 'stb_enabled', $default ); $stb_enabled = empty( $stb_enabled ) ? 0 : 1; - $stc_enabled = get_option( 'stc_enabled', 1 ); + $stc_enabled = get_option( 'stc_enabled', $default ); $stc_enabled = empty( $stc_enabled ) ? 0 : 1; } else { $stb_enabled = 0; diff --git a/projects/plugins/jetpack/modules/subscriptions.php b/projects/plugins/jetpack/modules/subscriptions.php index d3a977f5f017e..4399a33e5de14 100644 --- a/projects/plugins/jetpack/modules/subscriptions.php +++ b/projects/plugins/jetpack/modules/subscriptions.php @@ -7,7 +7,7 @@ * First Introduced: 1.2 * Requires Connection: Yes * Requires User Connection: Yes - * Auto Activate: No + * Auto Activate: Yes * Module Tags: Social * Feature: Engagement * Additional Search Queries: subscriptions, subscription, email, follow, followers, subscribers, signup @@ -414,12 +414,23 @@ public function subscriptions_settings_section() { stc_stb_default_value() ); ?>

@@ -441,8 +452,7 @@ public function subscription_post_subscribe_setting() { * Comments Subscriptions Toggle. */ public function subscription_comment_subscribe_setting() { - - $stc_enabled = get_option( 'stc_enabled', 1 ); + $stc_enabled = get_option( 'stc_enabled', $this->stc_stb_default_value() ); ?>

@@ -809,7 +819,7 @@ public function comment_subscribe_init( $submit_button ) { $str = ''; - if ( false === has_filter( 'comment_form', 'show_subscription_checkbox' ) && 1 === (int) get_option( 'stc_enabled', 1 ) && empty( $post->post_password ) && 'post' === get_post_type() ) { + if ( false === has_filter( 'comment_form', 'show_subscription_checkbox' ) && 1 === (int) get_option( 'stc_enabled', $this->stc_stb_default_value() ) && empty( $post->post_password ) && 'post' === get_post_type() ) { // Subscribe to comments checkbox. $str .= '

'; $comment_sub_text = __( 'Notify me of follow-up comments by email.', 'jetpack' ); @@ -828,7 +838,7 @@ public function comment_subscribe_init( $submit_button ) { $str .= '

'; } - if ( 1 === (int) get_option( 'stb_enabled', 1 ) ) { + if ( 1 === (int) get_option( 'stb_enabled', $this->stc_stb_default_value() ) ) { // Subscribe to blog checkbox. $str .= '

'; $blog_sub_text = __( 'Notify me of new posts by email.', 'jetpack' );