Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/trunk' into add/performance-impr…
Browse files Browse the repository at this point in the history
…ovements
  • Loading branch information
kraftbj committed Oct 17, 2024
2 parents 3c41cdd + 941e980 commit 4ff7eab
Show file tree
Hide file tree
Showing 117 changed files with 388 additions and 369 deletions.
6 changes: 5 additions & 1 deletion .github/files/generate-ci-matrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
// {string} Name for the job. Required, and must be unique.
'name' => null,

// {string} Runner name as found in https://github.com/actions/runner-images/.
'runner' => 'ubuntu-latest',

// {string} Composer script for the job. Required.
'script' => null,

Expand Down Expand Up @@ -68,9 +71,10 @@
);
}

// TODO: When WordPress 6.5 is no longer supported, this can be removed.
// TODO: When WordPress 6.5 is no longer supported, this can be removed. Runs too slow on ubuntu-24.04 (ubuntu-latest).
$matrix[] = array(
'name' => 'PHP tests: PHP 7.0 WP previous',
'runner' => 'ubuntu-22.04',
'script' => 'test-php',
'php' => '7.0',
'wp' => 'previous',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run-tests:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
runs-on: ${{ matrix.runner }}
needs: create-matrix
services:
database:
Expand Down
6 changes: 6 additions & 0 deletions projects/js-packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

### This is a list detailing changes for the Jetpack RNA Components package releases.

## [0.58.0] - 2024-10-15
### Added
- Add DiffViewer component [#39672]
- Add ThreatSeverityBadge component [#39758]

## [0.57.0] - 2024-10-14
### Added
- Add JetpackProtectLogo component. [#39703]
Expand Down Expand Up @@ -1190,6 +1195,7 @@
### Changed
- Update node version requirement to 14.16.1

[0.58.0]: https://github.com/Automattic/jetpack-components/compare/0.57.0...0.58.0
[0.57.0]: https://github.com/Automattic/jetpack-components/compare/0.56.3...0.57.0
[0.56.3]: https://github.com/Automattic/jetpack-components/compare/0.56.2...0.56.3
[0.56.2]: https://github.com/Automattic/jetpack-components/compare/0.56.1...0.56.2
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ const severityClassNames = severity => {

const severityText = severity => {
if ( severity >= 5 ) {
return _x( 'Critical', 'Severity label for issues rated 5 or higher.', 'jetpack-protect' );
return _x( 'Critical', 'Severity label for issues rated 5 or higher.', 'jetpack' );
} else if ( severity >= 3 && severity < 5 ) {
return _x( 'High', 'Severity label for issues rated between 3 and 5.', 'jetpack-protect' );
return _x( 'High', 'Severity label for issues rated between 3 and 5.', 'jetpack' );
}
return _x( 'Low', 'Severity label for issues rated below 3.', 'jetpack-protect' );
return _x( 'Low', 'Severity label for issues rated below 3.', 'jetpack' );
};

const ThreatSeverityBadge = ( { severity } ) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import ThreatSeverityBadge from '../index.jsx';
import ThreatSeverityBadge from '../index.js';

export default {
title: 'Plugins/Protect/Threat Severity Badge',
title: 'JS Packages/Components/Threat Severity Badge',
component: ThreatSeverityBadge,
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { render, screen } from '@testing-library/react';
import ThreatSeverityBadge from '..';

describe( 'ThreatSeverityBadge', () => {
it( 'renders the correct severity label', () => {
render( <ThreatSeverityBadge severity={ 4 } /> );
expect( screen.getByText( 'High' ) ).toBeInTheDocument();
} );
} );
1 change: 1 addition & 0 deletions projects/js-packages/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export { default as CopyToClipboard } from './components/copy-to-clipboard';
export * from './components/icons';
export { default as SplitButton } from './components/split-button';
export { default as ThemeProvider } from './components/theme-provider';
export { default as ThreatSeverityBadge } from './components/threat-severity-badge';
export { default as Text, H2, H3, Title } from './components/text';
export { default as ToggleControl } from './components/toggle-control';
export { default as numberFormat } from './components/number-format';
Expand Down
2 changes: 1 addition & 1 deletion projects/js-packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-components",
"version": "0.57.0",
"version": "0.58.0",
"description": "Jetpack Components Package",
"author": "Automattic",
"license": "GPL-2.0-or-later",
Expand Down
5 changes: 5 additions & 0 deletions projects/js-packages/connection/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

### This is a list detailing changes for the Jetpack RNA Connection Component releases.

## [0.35.14] - 2024-10-15
### Changed
- Update dependencies.

## [0.35.13] - 2024-10-14
### Changed
- Internal updates.
Expand Down Expand Up @@ -871,6 +875,7 @@
- `Main` and `ConnectUser` components added.
- `JetpackRestApiClient` API client added.

[0.35.14]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.13...v0.35.14
[0.35.13]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.12...v0.35.13
[0.35.12]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.11...v0.35.12
[0.35.11]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.10...v0.35.11
Expand Down
2 changes: 1 addition & 1 deletion projects/js-packages/connection/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-connection",
"version": "0.35.13",
"version": "0.35.14",
"description": "Jetpack Connection Component",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/connection/#readme",
"bugs": {
Expand Down
4 changes: 4 additions & 0 deletions projects/js-packages/idc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

### This is a list detailing changes for the Jetpack RNA IDC package releases.

## 0.11.17 - 2024-10-15
### Changed
- Update dependencies.

## 0.11.16 - 2024-10-14
### Changed
- Update dependencies.
Expand Down
2 changes: 1 addition & 1 deletion projects/js-packages/idc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-idc",
"version": "0.11.16",
"version": "0.11.17",
"description": "Jetpack Connection Component",
"author": "Automattic",
"license": "GPL-2.0-or-later",
Expand Down
4 changes: 4 additions & 0 deletions projects/js-packages/licensing/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ 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.13.5 - 2024-10-15
### Changed
- Update dependencies. [#37982]

## 0.13.4 - 2024-10-14
### Changed
- Update dependencies. [#37982]
Expand Down
2 changes: 1 addition & 1 deletion projects/js-packages/licensing/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-licensing",
"version": "0.13.4",
"version": "0.13.5",
"description": "Jetpack licensing flow",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/licensing/#readme",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Significance: patch
Type: changed

Fixes lastChecked conversions
Update dependencies.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
Update dependencies.
5 changes: 5 additions & 0 deletions projects/packages/autoloader/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ 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).

## [3.1.2] - 2024-10-15
### Changed
- Internal updates.

## [3.1.1] - 2024-10-10
### Changed
- Internal updates.
Expand Down Expand Up @@ -381,6 +385,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Add Custom Autoloader

[3.1.2]: https://github.com/Automattic/jetpack-autoloader/compare/v3.1.1...v3.1.2
[3.1.1]: https://github.com/Automattic/jetpack-autoloader/compare/v3.1.0...v3.1.1
[3.1.0]: https://github.com/Automattic/jetpack-autoloader/compare/v3.0.10...v3.1.0
[3.0.10]: https://github.com/Automattic/jetpack-autoloader/compare/v3.0.9...v3.0.10
Expand Down
5 changes: 0 additions & 5 deletions projects/packages/autoloader/changelog/update-docs-autoloader

This file was deleted.

2 changes: 1 addition & 1 deletion projects/packages/autoloader/src/AutoloadGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
class AutoloadGenerator {

const VERSION = '3.1.1';
const VERSION = '3.1.2';

/**
* IO object.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
Update dependencies.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
Update dependencies.
4 changes: 4 additions & 0 deletions projects/packages/forms/changelog/force-a-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Update dependencies.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: added

Admin bar: Add reader icon tooltip
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: added

adding a WPCOM task
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Make the Migrating the site task complete by default
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ function wpcom_launchpad_get_task_definitions() {
'get_title' => function () {
return __( 'Migrating the site', 'jetpack-mu-wpcom' );
},
'is_complete_callback' => 'wpcom_launchpad_is_task_option_completed',
'is_complete_callback' => '__return_true',
'is_visible_callback' => '__return_true',
),
// Post-migration tasks.
Expand Down Expand Up @@ -852,6 +852,17 @@ function wpcom_launchpad_get_task_definitions() {
'is_complete_callback' => 'wpcom_launchpad_is_task_option_completed',
'is_visible_callback' => '__return_true',
),
'check_ssl_status' => array(
'get_title' => function () {
return __( 'Provision SSL certificate', 'jetpack-mu-wpcom' );
},
'is_complete_callback' => 'wpcom_launchpad_is_task_option_completed',
'is_disabled_callback' => 'wpcom_launchpad_is_primary_domain_wpcom',
'get_calypso_path' => function ( $task, $default, $data ) {
$domain = $data['site_slug_encoded'];
return '/domains/manage/' . $domain . '/edit/' . $domain;
},
),
);

$extended_task_definitions = apply_filters( 'wpcom_launchpad_extended_task_definitions', array() );
Expand Down Expand Up @@ -2803,3 +2814,20 @@ function wpcom_launchpad_get_latest_draft_id() {

return $cached_draft_id;
}

/**
* Checks if the current site primary domain is a WPCOM domain.
*
* @return bool Will return true if the primary domain is a WPCOM domain.
*/
function wpcom_launchpad_is_primary_domain_wpcom() {
if ( ! ( new Automattic\Jetpack\Status\Host() )->is_wpcom_platform() ) {
return false;
}

$url = home_url();
$host = wp_parse_url( $url, PHP_URL_HOST );

// If site_slug ends with .wpcomstaging.com return true
return str_ends_with( $host, '.wpcomstaging.com' );
}
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ function wpcom_launchpad_get_task_list_definitions() {
'review_plugins',
'connect_migration_domain',
'domain_dns_mapped',
'check_ssl_status',
),
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function wpcom_add_reader_menu( $wp_admin_bar ) {
$wp_admin_bar->add_menu(
array(
'id' => 'reader',
'title' => '<span class="ab-icon" aria-hidden="true"></span><span class="screen-reader-text">' .
'title' => '<span class="ab-icon" title="' . __( 'Read the blogs and topics you follow', 'jetpack-mu-wpcom' ) . '" aria-hidden="true"></span><span class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
__( 'Reader', 'jetpack-mu-wpcom' ) .
'</span>',
Expand Down
5 changes: 5 additions & 0 deletions projects/packages/my-jetpack/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ 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).

## [4.35.14] - 2024-10-15
### Changed
- Update dependencies. [#38910]

## [4.35.13] - 2024-10-14
### Changed
- Only include `wp-polyfill` as a script dependency when needed. [#39629]
Expand Down Expand Up @@ -1776,6 +1780,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Created package

[4.35.14]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.35.13...4.35.14
[4.35.13]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.35.12...4.35.13
[4.35.12]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.35.11...4.35.12
[4.35.11]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.35.10...4.35.11
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fix the "Missing site connection" notice.
2 changes: 1 addition & 1 deletion projects/packages/my-jetpack/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-my-jetpack",
"version": "4.35.13",
"version": "4.35.14",
"description": "WP Admin page with information and configuration shared among all Jetpack stand-alone plugins",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/my-jetpack/#readme",
"bugs": {
Expand Down
11 changes: 6 additions & 5 deletions projects/packages/my-jetpack/src/class-initializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Initializer {
*
* @var string
*/
const PACKAGE_VERSION = '4.35.13';
const PACKAGE_VERSION = '4.35.14';

/**
* HTML container ID for the IDC screen on My Jetpack page.
Expand Down Expand Up @@ -940,17 +940,18 @@ public static function alert_if_missing_connection( array $red_bubble_slugs ) {
$broken_modules = self::check_for_broken_modules();
$connection = new Connection_Manager();

if ( ! empty( $broken_modules['needs_user_connection'] ) ) {
// Checking for site connection issues first.
if ( ! empty( $broken_modules['needs_site_connection'] ) ) {
$red_bubble_slugs[ self::MISSING_CONNECTION_NOTIFICATION_KEY ] = array(
'type' => 'user',
'type' => 'site',
'is_error' => true,
);
return $red_bubble_slugs;
}

if ( ! empty( $broken_modules['needs_site_connection'] ) ) {
if ( ! empty( $broken_modules['needs_user_connection'] ) ) {
$red_bubble_slugs[ self::MISSING_CONNECTION_NOTIFICATION_KEY ] = array(
'type' => 'site',
'type' => 'user',
'is_error' => true,
);
return $red_bubble_slugs;
Expand Down
4 changes: 4 additions & 0 deletions projects/packages/search/changelog/force-a-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Update dependencies.
Loading

0 comments on commit 4ff7eab

Please sign in to comment.