Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 0 additions & 70 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Significance: patch
Type: changed
Comment: Drop the standalone "Jetpack > Subscribers" submenu and the Calypso shortcut; the Newsletter page now owns the Subscribers tab.
1 change: 0 additions & 1 deletion projects/packages/jetpack-mu-wpcom/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"automattic/jetpack-rtc": "@dev",
"automattic/jetpack-stats-admin": "@dev",
"automattic/jetpack-status": "@dev",
"automattic/jetpack-subscribers-dashboard": "@dev",
"automattic/scheduled-updates": "@dev",
"scssphp/scssphp": "2.1.0",
"symfony/filesystem": "^6.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Automattic\Jetpack\Newsletter\Settings as Newsletter_Settings;
use Automattic\Jetpack\Podcast\Admin_Page as Podcast_Admin_Page;
use Automattic\Jetpack\Redirect;
use Automattic\Jetpack\Subscribers_Dashboard\Dashboard as Subscribers_Dashboard;

require_once __DIR__ . '/../../common/wpcom-callout.php';

Expand Down Expand Up @@ -386,21 +385,11 @@ function () {
null // @phan-suppress-current-line PhanTypeMismatchArgumentProbablyReal -- Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
);

// Jetpack > Subscribers.
if ( ! apply_filters( 'jetpack_wp_admin_subscriber_management_enabled', false ) ) {
wpcom_hide_submenu_page( 'jetpack', esc_url( Redirect::get_url( 'jetpack-menu-jetpack-manage-subscribers', array( 'site' => $blog_id ) ) ) );
add_submenu_page(
'jetpack',
__( 'Subscribers', 'jetpack-mu-wpcom' ),
__( 'Subscribers', 'jetpack-mu-wpcom' ),
'manage_options',
'https://wordpress.com/subscribers/' . $domain,
null // @phan-suppress-current-line PhanTypeMismatchArgumentProbablyReal -- Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
);
} else {
$subscribers_dashboard = new Subscribers_Dashboard();
$subscribers_dashboard->add_wp_admin_submenu();
}
// "Jetpack > Subscribers" / standalone "Subscribers" wp-admin pages were
// retired alongside the Newsletter modernization umbrella (#48530); the
// Newsletter page now owns the Subscribers tab. Keep the Calypso link
// hidden in case some other layer adds it back.
wpcom_hide_submenu_page( 'jetpack', esc_url( Redirect::get_url( 'jetpack-menu-jetpack-manage-subscribers', array( 'site' => $blog_id ) ) ) );

// When the `jetpack_podcast_untangle` filter is on, register the new
// "Jetpack > Podcast" in-admin page from the jetpack-podcast package.
Expand Down Expand Up @@ -464,7 +453,6 @@ function () {
'forms',
'earn',
'search',
'subscribers',
'newsletter',
'jetpack-podcast',
'podcasting',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Significance: patch
Type: removed
Comment: Drop the unused `automattic/jetpack-subscribers-dashboard` composer dep.
3 changes: 1 addition & 2 deletions projects/packages/masterbar/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"automattic/jetpack-jitm": "@dev",
"automattic/jetpack-logo": "@dev",
"automattic/jetpack-plans": "@dev",
"automattic/jetpack-status": "@dev",
"automattic/jetpack-subscribers-dashboard": "@dev"
"automattic/jetpack-status": "@dev"
},
"require-dev": {
"brain/monkey": "^2.6.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import analytics from '@automattic/jetpack-analytics';
import JetpackLogo from '@automattic/jetpack-components/jetpack-logo';
import { getSiteType } from '@automattic/jetpack-script-data';
import { Page } from '@wordpress/admin-ui';
import { useCallback } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
Expand Down Expand Up @@ -77,6 +79,12 @@ export default function NewsletterPage( {
if ( next !== 'subscribers' && next !== 'settings' ) {
return;
}
if ( next !== activeTab ) {
analytics.tracks.recordEvent( 'jetpack_newsletter_tab_view', {
site_type: getSiteType(),
tab: next,
} );
}
navigate( {
search: {
tab: next === 'settings' ? 'settings' : undefined,
Expand All @@ -85,7 +93,7 @@ export default function NewsletterPage( {
},
} as unknown as Parameters< typeof navigate >[ 0 ] );
},
[ navigate ]
[ activeTab, navigate ]
);

const contentClass = contentHasPadding
Expand Down
3 changes: 3 additions & 0 deletions projects/packages/newsletter/changelog/add-wp-build-flip-flag
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Significance: minor
Type: changed
Comment: The Newsletter admin page now ships the unified Subscribers/Settings chassis by default; opt out with `add_filter( 'rsm_jetpack_ui_modernization_newsletter', '__return_false' );`.
19 changes: 13 additions & 6 deletions projects/packages/newsletter/src/class-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,14 @@ public function load_admin_scripts() {
// This callback is registered via `admin_enqueue_scripts` from `admin_init`,
// which itself fires on `load-{$page_suffix}` in `add_wp_admin_menu()` — so it
// only fires on the Newsletter admin page; no need to re-check the page here.
// The Tracks transport is required on both surfaces — `analytics.initialize`
// only queues events into `window._tkq`; without `jp-tracks` loaded, no
// pixel.gif requests fire and the queue grows forever.
wp_enqueue_script( 'jp-tracks', '//stats.wp.com/w.js', array(), gmdate( 'YW' ), true );

if ( self::is_modernized() ) {
// wp-build manages its own enqueue pipeline. The legacy newsletter
// script, JetpackScriptData, and Tracks are intentionally skipped
// wp-build manages the rest of its enqueue pipeline. The legacy
// newsletter script and JetpackScriptData are intentionally skipped
// for the wp-build dashboard.
return;
}
Expand All @@ -302,9 +307,6 @@ public function load_admin_scripts() {
'dependencies' => array( 'jetpack-script-data' ),
)
);

// Enqueue the Tracks script for analytics.
wp_enqueue_script( 'jp-tracks', '//stats.wp.com/w.js', array(), gmdate( 'YW' ), true );
}

/**
Expand Down Expand Up @@ -472,10 +474,15 @@ public static function alias_screen_id_for_wp_build( $screen ) {
/**
* Returns true when the wp-build modernization filter is enabled.
*
* Default `true` since PR 6 of the Newsletter modernization rollout
* (umbrella #48530): every Jetpack site now lands on the unified
* Subscribers/Settings chassis. Sites that need the legacy AdminPage
* surface back can opt out with `add_filter( self::MODERNIZATION_FILTER, '__return_false' );`.
*
* @return bool
*/
private static function is_modernized() {
return (bool) apply_filters( self::MODERNIZATION_FILTER, false );
return (bool) apply_filters( self::MODERNIZATION_FILTER, true );
}

/**
Expand Down
9 changes: 0 additions & 9 deletions projects/packages/subscribers-dashboard/.babelrc

This file was deleted.

20 changes: 0 additions & 20 deletions projects/packages/subscribers-dashboard/.gitattributes

This file was deleted.

5 changes: 0 additions & 5 deletions projects/packages/subscribers-dashboard/.gitignore

This file was deleted.

13 changes: 0 additions & 13 deletions projects/packages/subscribers-dashboard/.phan/config.php

This file was deleted.

24 changes: 0 additions & 24 deletions projects/packages/subscribers-dashboard/.phpcs.dir.xml

This file was deleted.

Loading
Loading