diff --git a/projects/packages/jetpack-mu-wpcom/changelog/add-populate-site-from-wp-admin b/projects/packages/jetpack-mu-wpcom/changelog/add-populate-site-from-wp-admin new file mode 100644 index 0000000000000..f360113cb080e --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/add-populate-site-from-wp-admin @@ -0,0 +1,4 @@ +Significance: minor +Type: added + +Add origin_site_id param to the links on masterbar diff --git a/projects/packages/jetpack-mu-wpcom/composer.json b/projects/packages/jetpack-mu-wpcom/composer.json index cfdd91a913616..7ea558a19b407 100644 --- a/projects/packages/jetpack-mu-wpcom/composer.json +++ b/projects/packages/jetpack-mu-wpcom/composer.json @@ -62,7 +62,7 @@ }, "autotagger": true, "branch-alias": { - "dev-trunk": "5.46.x-dev" + "dev-trunk": "5.47.x-dev" }, "textdomain": "jetpack-mu-wpcom", "version-constants": { diff --git a/projects/packages/jetpack-mu-wpcom/package.json b/projects/packages/jetpack-mu-wpcom/package.json index 2b6c769690511..de51c3d11b22e 100644 --- a/projects/packages/jetpack-mu-wpcom/package.json +++ b/projects/packages/jetpack-mu-wpcom/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-mu-wpcom", - "version": "5.46.1-alpha", + "version": "5.47.0-alpha", "description": "Enhances your site with features powered by WordPress.com", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/jetpack-mu-wpcom/#readme", "bugs": { diff --git a/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php b/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php index e957bd1713454..4553fd9d2a753 100644 --- a/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php +++ b/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php @@ -13,7 +13,7 @@ * Jetpack_Mu_Wpcom main class. */ class Jetpack_Mu_Wpcom { - const PACKAGE_VERSION = '5.46.1-alpha'; + const PACKAGE_VERSION = '5.47.0-alpha'; const PKG_DIR = __DIR__ . '/../'; const BASE_DIR = __DIR__ . '/'; const BASE_FILE = __FILE__; diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-bar/wpcom-admin-bar.php b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-bar/wpcom-admin-bar.php index 67034c150207c..5b49f81730a2f 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-bar/wpcom-admin-bar.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-bar/wpcom-admin-bar.php @@ -7,10 +7,26 @@ * @package automattic/jetpack-mu-wpcom */ +use Automattic\Jetpack\Connection\Manager as Connection_Manager; use Automattic\Jetpack\Jetpack_Mu_Wpcom; define( 'WPCOM_ADMIN_BAR_UNIFICATION', true ); +/** + * Adds the origin_site_id query parameter to a URL. + * + * @param string $url The URL to add the query param to. + * @return string The URL with the origin_site_id query parameter mey be added. + */ +function maybe_add_origin_site_id_to_url( $url ) { + $site_id = Connection_Manager::get_site_id(); + if ( is_wp_error( $site_id ) ) { + return $url; + } + + return add_query_arg( 'origin_site_id', $site_id, $url ); +} + /** * Enqueue assets needed by the WordPress.com admin bar. */ @@ -56,7 +72,6 @@ function wpcom_repurpose_wp_logo_as_all_sites_menu( $wp_admin_bar ) { $wp_admin_bar->remove_node( $node->id ); } } - $wp_admin_bar->remove_node( 'wp-logo' ); $wp_admin_bar->add_node( array( @@ -65,7 +80,7 @@ function wpcom_repurpose_wp_logo_as_all_sites_menu( $wp_admin_bar ) { /* translators: Hidden accessibility text. */ __( 'All Sites', 'jetpack-mu-wpcom' ) . '', - 'href' => 'https://wordpress.com/sites', + 'href' => maybe_add_origin_site_id_to_url( 'https://wordpress.com/sites' ), 'meta' => array( 'menu_title' => __( 'All Sites', 'jetpack-mu-wpcom' ), ), @@ -84,7 +99,7 @@ function wpcom_add_reader_menu( $wp_admin_bar ) { array( 'id' => 'reader', 'title' => __( 'Reader', 'jetpack-mu-wpcom' ), - 'href' => 'https://wordpress.com/read', + 'href' => maybe_add_origin_site_id_to_url( 'https://wordpress.com/read' ), 'meta' => array( 'class' => 'wp-admin-bar-reader', ), @@ -104,13 +119,12 @@ function wpcom_add_my_account_item_to_profile_menu( $wp_admin_bar ) { // Adds the 'My Account' menu item before 'Log Out'. $wp_admin_bar->remove_node( 'logout' ); } - $wp_admin_bar->add_node( array( 'id' => 'wpcom-profile', 'parent' => 'user-actions', 'title' => __( 'My Account', 'jetpack-mu-wpcom' ), - 'href' => 'https://wordpress.com/me/account', + 'href' => maybe_add_origin_site_id_to_url( 'https://wordpress.com/me/account' ), ) ); diff --git a/projects/plugins/mu-wpcom-plugin/changelog/add-populate-site-from-wp-admin b/projects/plugins/mu-wpcom-plugin/changelog/add-populate-site-from-wp-admin new file mode 100644 index 0000000000000..139fbc24b1564 --- /dev/null +++ b/projects/plugins/mu-wpcom-plugin/changelog/add-populate-site-from-wp-admin @@ -0,0 +1,4 @@ +Significance: minor +Type: added + +Adds checks to remove wpcom items and links in wp-admin for users who are not connected to wpcom. diff --git a/projects/plugins/mu-wpcom-plugin/composer.json b/projects/plugins/mu-wpcom-plugin/composer.json index d49395345b634..02b95ad328f5b 100644 --- a/projects/plugins/mu-wpcom-plugin/composer.json +++ b/projects/plugins/mu-wpcom-plugin/composer.json @@ -46,6 +46,6 @@ ] }, "config": { - "autoloader-suffix": "d9d132a783958a00a2c7cccff60ca42d_jetpack_mu_wpcom_pluginⓥ2_4_2_alpha" + "autoloader-suffix": "d9d132a783958a00a2c7cccff60ca42d_jetpack_mu_wpcom_pluginⓥ2_5_0_alpha" } } diff --git a/projects/plugins/mu-wpcom-plugin/composer.lock b/projects/plugins/mu-wpcom-plugin/composer.lock index d9b2f3dda1fea..02b70303a66c5 100644 --- a/projects/plugins/mu-wpcom-plugin/composer.lock +++ b/projects/plugins/mu-wpcom-plugin/composer.lock @@ -1005,7 +1005,7 @@ "dist": { "type": "path", "url": "../../packages/jetpack-mu-wpcom", - "reference": "a417025d2587643638c7e276bb2dee14423dd51e" + "reference": "4a39c4961bf87d1d5d44ec9328a0a947034f37e3" }, "require": { "automattic/jetpack-assets": "@dev", @@ -1039,7 +1039,7 @@ }, "autotagger": true, "branch-alias": { - "dev-trunk": "5.46.x-dev" + "dev-trunk": "5.47.x-dev" }, "textdomain": "jetpack-mu-wpcom", "version-constants": { diff --git a/projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php b/projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php index 576fcd1fceae9..169f2115ab023 100644 --- a/projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php +++ b/projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php @@ -3,7 +3,7 @@ * * Plugin Name: WordPress.com Features * Description: Test plugin for the jetpack-mu-wpcom package - * Version: 2.4.2-alpha + * Version: 2.5.0-alpha * Author: Automattic * License: GPLv2 or later * Text Domain: jetpack-mu-wpcom-plugin diff --git a/projects/plugins/mu-wpcom-plugin/package.json b/projects/plugins/mu-wpcom-plugin/package.json index b95d2cb7aea6b..94111841fa45f 100644 --- a/projects/plugins/mu-wpcom-plugin/package.json +++ b/projects/plugins/mu-wpcom-plugin/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-mu-wpcom-plugin", - "version": "2.4.2-alpha", + "version": "2.5.0-alpha", "description": "Test plugin for the jetpack-mu-wpcom package", "homepage": "https://jetpack.com", "bugs": { diff --git a/projects/plugins/wpcomsh/changelog/add-populate-site-from-wp-admin b/projects/plugins/wpcomsh/changelog/add-populate-site-from-wp-admin new file mode 100644 index 0000000000000..139fbc24b1564 --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/add-populate-site-from-wp-admin @@ -0,0 +1,4 @@ +Significance: minor +Type: added + +Adds checks to remove wpcom items and links in wp-admin for users who are not connected to wpcom. diff --git a/projects/plugins/wpcomsh/composer.json b/projects/plugins/wpcomsh/composer.json index 53996f024c03b..9458eed6bed9a 100644 --- a/projects/plugins/wpcomsh/composer.json +++ b/projects/plugins/wpcomsh/composer.json @@ -130,7 +130,7 @@ "composer/installers": true, "roots/wordpress-core-installer": true }, - "autoloader-suffix": "26841ac2064774301cbe06d174833bfc_wpcomshⓥ4_0_1_alpha" + "autoloader-suffix": "26841ac2064774301cbe06d174833bfc_wpcomshⓥ4_1_0_alpha" }, "extra": { "mirror-repo": "Automattic/wpcom-site-helper", diff --git a/projects/plugins/wpcomsh/composer.lock b/projects/plugins/wpcomsh/composer.lock index a1de6b64e87bc..21c59a686db90 100644 --- a/projects/plugins/wpcomsh/composer.lock +++ b/projects/plugins/wpcomsh/composer.lock @@ -1142,7 +1142,7 @@ "dist": { "type": "path", "url": "../../packages/jetpack-mu-wpcom", - "reference": "a417025d2587643638c7e276bb2dee14423dd51e" + "reference": "4a39c4961bf87d1d5d44ec9328a0a947034f37e3" }, "require": { "automattic/jetpack-assets": "@dev", @@ -1176,7 +1176,7 @@ }, "autotagger": true, "branch-alias": { - "dev-trunk": "5.46.x-dev" + "dev-trunk": "5.47.x-dev" }, "textdomain": "jetpack-mu-wpcom", "version-constants": { @@ -3212,45 +3212,45 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.19", + "version": "9.6.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8" + "reference": "49d7820565836236411f5dc002d16dd689cde42f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1a54a473501ef4cdeaae4e06891674114d79db8", - "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/49d7820565836236411f5dc002d16dd689cde42f", + "reference": "49d7820565836236411f5dc002d16dd689cde42f", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", + "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", + "myclabs/deep-copy": "^1.12.0", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.28", - "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-code-coverage": "^9.2.31", + "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.6", + "sebastian/global-state": "^5.0.7", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", "sebastian/version": "^3.0.2" }, "suggest": { @@ -3295,7 +3295,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.19" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.20" }, "funding": [ { @@ -3311,7 +3311,7 @@ "type": "tidelift" } ], - "time": "2024-04-05T04:35:58+00:00" + "time": "2024-07-10T11:45:39+00:00" }, { "name": "psr/container", diff --git a/projects/plugins/wpcomsh/package.json b/projects/plugins/wpcomsh/package.json index bc2cbca125cfe..a3188ee997d8f 100644 --- a/projects/plugins/wpcomsh/package.json +++ b/projects/plugins/wpcomsh/package.json @@ -3,7 +3,7 @@ "name": "@automattic/jetpack-wpcomsh", "description": "A helper for connecting WordPress.com sites to external host infrastructure.", "homepage": "https://jetpack.com", - "version": "4.0.1-alpha", + "version": "4.1.0-alpha", "bugs": { "url": "https://github.com/Automattic/jetpack/labels/[Plugin] Wpcomsh" }, diff --git a/projects/plugins/wpcomsh/wpcomsh.php b/projects/plugins/wpcomsh/wpcomsh.php index 92b36269bc584..29cdc464af203 100644 --- a/projects/plugins/wpcomsh/wpcomsh.php +++ b/projects/plugins/wpcomsh/wpcomsh.php @@ -2,14 +2,14 @@ /** * Plugin Name: WordPress.com Site Helper * Description: A helper for connecting WordPress.com sites to external host infrastructure. - * Version: 4.0.1-alpha + * Version: 4.1.0-alpha * Author: Automattic * Author URI: http://automattic.com/ * * @package wpcomsh */ -define( 'WPCOMSH_VERSION', '4.0.1-alpha' ); +define( 'WPCOMSH_VERSION', '4.1.0-alpha' ); // If true, Typekit fonts will be available in addition to Google fonts add_filter( 'jetpack_fonts_enable_typekit', '__return_true' );