Skip to content

Commit

Permalink
Social: Use Blog ID in links to WPCOM instead of site slug (#35006)
Browse files Browse the repository at this point in the history
Adjust checkout links in Social plugin to use blog ID instead of slug for multi-URL support.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/7701408005
  • Loading branch information
sergeymitr authored and matticbot committed Jan 29, 2024
1 parent f0c5295 commit 2a150db
Show file tree
Hide file tree
Showing 18 changed files with 206 additions and 186 deletions.
2 changes: 1 addition & 1 deletion _inc/blocks/editor-beta.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => 'ec63998e4948ba4d20e2');
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => 'a4c5bca92f5f6e80ff0d');
4 changes: 2 additions & 2 deletions _inc/blocks/editor-beta.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _inc/blocks/editor-experimental.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => '162bf27545f0a9062fad');
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => '77f959dd51d857cf2c7e');
4 changes: 2 additions & 2 deletions _inc/blocks/editor-experimental.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _inc/blocks/editor.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => '7ca37b7df911b311f9f6');
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => 'd7c69cd0df890502492e');
4 changes: 2 additions & 2 deletions _inc/blocks/editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _inc/build/admin.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('jquery', 'lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '90795b06fb4c50d364b6');
<?php return array('dependencies' => array('jquery', 'lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'bbb92b33aafcdf56e720');
2 changes: 1 addition & 1 deletion _inc/build/admin.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"automattic/jetpack-compat": "^2.0.0",
"automattic/jetpack-composer-plugin": "^2.0.0",
"automattic/jetpack-config": "^2.0.0",
"automattic/jetpack-connection": "^2.2.0",
"automattic/jetpack-connection": "^2.3.0-alpha",
"automattic/jetpack-constants": "^2.0.0",
"automattic/jetpack-device-detection": "^2.0.1",
"automattic/jetpack-error": "^2.0.0",
Expand All @@ -39,7 +39,7 @@
"automattic/jetpack-my-jetpack": "^4.7.0-alpha",
"automattic/jetpack-plugins-installer": "^0.3.1",
"automattic/jetpack-post-list": "^0.5.1",
"automattic/jetpack-publicize": "^0.40.0",
"automattic/jetpack-publicize": "^0.41.0-alpha",
"automattic/jetpack-redirect": "^2.0.0",
"automattic/jetpack-roles": "^2.0.0",
"automattic/jetpack-search": "^0.42.0",
Expand Down
8 changes: 8 additions & 0 deletions jetpack_vendor/automattic/jetpack-connection/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.3.0-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Changed
- Adjust 'get_site_id()' method to return null if there's no blog ID.

## [2.2.0] - 2024-01-18
### Added
- Adding support for IDC when site URL is an IP address. [#34753]
Expand Down Expand Up @@ -950,6 +957,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Separate the connection library into its own package.

[2.3.0-alpha]: https://github.com/Automattic/jetpack-connection/compare/v2.2.0...v2.3.0-alpha
[2.2.0]: https://github.com/Automattic/jetpack-connection/compare/v2.1.1...v2.2.0
[2.1.1]: https://github.com/Automattic/jetpack-connection/compare/v2.1.0...v2.1.1
[2.1.0]: https://github.com/Automattic/jetpack-connection/compare/v2.0.3...v2.1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
class Package_Version {

const PACKAGE_VERSION = '2.2.0';
const PACKAGE_VERSION = '2.3.0-alpha';

const PACKAGE_SLUG = 'connection';

Expand Down
8 changes: 8 additions & 0 deletions jetpack_vendor/automattic/jetpack-publicize/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.41.0-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Changed
- Use Blog ID in links to WPCOM instead of site slug.

## [0.40.0] - 2024-01-18
### Changed
- Changed dismissed notices endpoint to be a core endpoint [#34544]
Expand Down Expand Up @@ -458,6 +465,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated package dependencies.
- Update package.json metadata.

[0.41.0-alpha]: https://github.com/Automattic/jetpack-publicize/compare/v0.40.0...v0.41.0-alpha
[0.40.0]: https://github.com/Automattic/jetpack-publicize/compare/v0.39.0...v0.40.0
[0.39.0]: https://github.com/Automattic/jetpack-publicize/compare/v0.38.3...v0.39.0
[0.38.3]: https://github.com/Automattic/jetpack-publicize/compare/v0.38.2...v0.38.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace Automattic\Jetpack\Publicize;

use Automattic\Jetpack\Connection\Client;
use Automattic\Jetpack\Connection\Manager as Connection_Manager;
use Automattic\Jetpack\Current_Plan;
use Automattic\Jetpack\Redirect;
use Automattic\Jetpack\Status;
Expand Down Expand Up @@ -1673,7 +1674,10 @@ protected static function build_sprintf( $args ) {
public function publicize_connections_url( $source = 'calypso-marketing-connections' ) {
$allowed_sources = array( 'jetpack-social-connections-admin-page', 'jetpack-social-connections-classic-editor', 'calypso-marketing-connections' );
$source = in_array( $source, $allowed_sources, true ) ? $source : 'calypso-marketing-connections';
return Redirect::get_url( $source, array( 'site' => ( new Status() )->get_site_suffix() ) );
$blog_id = Connection_Manager::get_site_id( true );
$site = ( new Status() )->get_site_suffix();

return Redirect::get_url( $source, array( 'site' => $blog_id ? $blog_id : $site ) );
}

/**
Expand Down
4 changes: 2 additions & 2 deletions jetpack_vendor/i18n-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
),
'jetpack-connection' => array(
'path' => 'jetpack_vendor/automattic/jetpack-connection',
'ver' => '2.2.0',
'ver' => '2.3.0-alpha1706556436',
),
'jetpack-forms' => array(
'path' => 'jetpack_vendor/automattic/jetpack-forms',
Expand Down Expand Up @@ -90,7 +90,7 @@
),
'jetpack-publicize-pkg' => array(
'path' => 'jetpack_vendor/automattic/jetpack-publicize',
'ver' => '0.40.0',
'ver' => '0.41.0-alpha1706556436',
),
'jetpack-search-pkg' => array(
'path' => 'jetpack_vendor/automattic/jetpack-search',
Expand Down
Loading

0 comments on commit 2a150db

Please sign in to comment.