Skip to content

Commit

Permalink
Wordpress core and plugin upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
michaliskambi committed Oct 20, 2024
1 parent 030dd1a commit b30f6f8
Show file tree
Hide file tree
Showing 428 changed files with 6,421 additions and 2,998 deletions.
3 changes: 2 additions & 1 deletion htdocs/wp/wp-content/jetpack-waf/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
define( 'JETPACK_WAF_SHARE_DEBUG_DATA', false );
define( 'JETPACK_WAF_DIR', '/home/michalis/cge-www/htdocs/wp/wp-content/jetpack-waf' );
define( 'JETPACK_WAF_WPCONFIG', '/home/michalis/cge-www/htdocs/wp/wp-content/../wp-config.php' );
require_once '/home/michalis/cge-www/htdocs/wp/wp-content/plugins/jetpack/vendor/autoload.php';
define( 'JETPACK_WAF_ENTRYPOINT', 'rules/rules.php' );
require_once '/home/michalis/cge-www/htdocs/wp/wp-content/plugins/jetpack-protect/vendor/autoload.php';
Automattic\Jetpack\Waf\Waf_Runner::initialize();
11 changes: 11 additions & 0 deletions htdocs/wp/wp-content/plugins/jetpack-boost/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ 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.5.2] - 2024-10-15
### Changed
- Deferred JS: Exclude all scripts produced by a shortcode. [#39616]
- General: Sync Boost's Getting Started page with My Jetpack's version. [#39130]
- General: Update minimum required WordPress version to 6.5 in main plugin file. Previous release only changed plugin readme. [#39719]

### Fixed
- Image CDN: URL encode image path parts for RSS feed compatibility [#39560]
- Image Guide: Improve check for Jetpack Image CDN URLs [#39635]

## [3.5.1] - 2024-09-26
### Changed
- Support: Increased minumum required WordPress version to 6.5 [#39540]
Expand Down Expand Up @@ -514,6 +524,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- First public alpha release

[3.5.2]: https://github.com/Automattic/jetpack-boost-production/compare/3.5.1...3.5.2
[3.5.1]: https://github.com/Automattic/jetpack-boost-production/compare/3.5.0...3.5.1
[3.5.0]: https://github.com/Automattic/jetpack-boost-production/compare/3.4.9...3.5.0
[3.4.9]: https://github.com/Automattic/jetpack-boost-production/compare/3.4.8...3.4.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
use Automattic\Jetpack_Boost\Lib\Analytics;
use Automattic\Jetpack_Boost\Lib\Environment_Change_Detector;
use Automattic\Jetpack_Boost\Lib\Premium_Features;
use Automattic\Jetpack_Boost\Modules\Modules_Index;
use Automattic\Jetpack_Boost\Modules\Modules_Setup;
use Automattic\Jetpack_Boost\Modules\Optimizations\Critical_CSS\Critical_CSS;

class Admin {
/**
Expand Down Expand Up @@ -83,29 +81,13 @@ public function enqueue_scripts() {
*/
$internal_path = apply_filters( 'jetpack_boost_asset_internal_path', 'app/assets/dist/' );

$critical_css_gen_handle = 'jetpack-boost-critical-css-gen';

Assets::register_script(
$critical_css_gen_handle,
$internal_path . 'critical-css-gen.js',
JETPACK_BOOST_PATH,
array(
'in_footer' => true,
)
);

$admin_js_handle = 'jetpack-boost-admin';

$admin_js_dependencies = array(
'wp-i18n',
'wp-components',
);

// Enqueue the critical CSS generator script if Critical CSS is available.
if ( ( new Modules_Index() )->is_module_available( Critical_CSS::get_slug() ) ) {
$admin_js_dependencies[] = $critical_css_gen_handle;
}

Assets::register_script(
$admin_js_handle,
$internal_path . 'jetpack-boost.js',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Automattic\Jetpack\Status;
use Automattic\Jetpack\Status\Host;

/**
* Handle the configuration constants.
*
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-components', 'wp-compose', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '4686e652b7c46b0e812c');
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-components', 'wp-compose', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '2cb14679e652b9409e07');

Large diffs are not rendered by default.

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions htdocs/wp/wp-content/plugins/jetpack-boost/app/lib/My_Jetpack.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Automattic\Jetpack_Boost\Lib;

use Automattic\Jetpack\My_Jetpack\Products;

class My_Jetpack {
public static function get_product() {
$product = Products::get_product_class( 'boost' );
if ( ! $product ) {
return array();
}

return array(
'tiers' => $product::get_tiers(),
'features_by_tier' => $product::get_features_by_tier(),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@

namespace Automattic\Jetpack_Boost\Lib;

use Automattic\Jetpack\My_Jetpack\Products\Boost;
use Automattic\Jetpack\My_Jetpack\Wpcom_Products;
use Automattic\Jetpack\Status;

class Premium_Pricing {
const PRODUCT_SLUG_BASE = 'jetpack_boost';

/**
* Get an object containing the yearly pricing information for Jetpack Boost.
*
* Used by Jetpack_Boost js constants and data sync.
*/
public static function get_yearly_pricing() {
$yearly_pricing_slug = self::PRODUCT_SLUG_BASE . '_yearly';
$yearly_pricing = Wpcom_Products::get_product_pricing( $yearly_pricing_slug );
$yearly_pricing = Wpcom_Products::get_product_pricing( Boost::UPGRADED_TIER_PRODUCT_SLUG );

if ( empty( $yearly_pricing ) ) {
// In offline mode, we don't have access to the pricing data and it's not an error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ public static function handle_proxy() {
wp_send_json_error( 'Invalid URL', 400 );
}

$photon_url = Image_CDN_Core::cdn_url( $proxy_url );
$photon_url_domain = wp_parse_url( $photon_url, PHP_URL_HOST );
$photon_domain = wp_parse_url( apply_filters( 'jetpack_photon_domain', 'https://i0.wp.com' ), PHP_URL_HOST );
if ( $photon_url_domain !== $photon_domain ) {
$photon_url = Image_CDN_Core::cdn_url( $proxy_url );
if ( ! Image_CDN_Core::is_cdn_url( $proxy_url ) ) {
wp_send_json_error( 'Failed to proxy the image.', 400 );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ private static function add_wp_cache_define() {
$content
);

$result = Filesystem_Utils::write_to_file( $config_file, $content );
if ( $result instanceof Boost_Cache_Error ) {
$result = self::write_to_file_direct( $config_file, $content );
if ( $result === false ) {
return new \WP_Error( 'wp-config-not-writable' );
}
self::clear_opcache( $config_file );
Expand Down Expand Up @@ -423,4 +423,21 @@ private static function clear_opcache( $file ) {
opcache_invalidate( $file, true );
}
}

private static function write_to_file_direct( $file, $content ) {
$filesystem = self::get_wp_filesystem();
$chmod = $filesystem->getchmod( $file );
if ( $chmod === false ) {
$chmod = 0644; // Default to a common permission for files
} else {
$chmod = intval( '0' . $chmod, 8 ); // Ensure leading zero
}
return $filesystem->put_contents( $file, $content, $chmod );
}

private static function get_wp_filesystem() {
require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php';
require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php';
return new \WP_Filesystem_Direct( null );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ public function setup() {
$this->ignore_attribute = apply_filters( 'jetpack_boost_render_blocking_js_ignore_attribute', 'data-jetpack-boost' );

add_action( 'template_redirect', array( $this, 'start_output_filtering' ), -999999 );

/**
* Shortcodes can sometimes output script to embed widget. It's safer to ignore them.
*/
add_filter( 'do_shortcode_tag', array( $this, 'add_ignore_attribute' ) );
}

/**
Expand Down Expand Up @@ -256,7 +261,7 @@ protected function ignore_exclusion_scripts( $buffer ) {
return preg_replace_callback(
$exclusions,
function ( $script_match ) {
return str_replace( '<script', sprintf( '<script %s="%s"', esc_html( $this->ignore_attribute ), esc_attr( $this->ignore_value ) ), $script_match[0] );
return $this->add_ignore_attribute( $script_match[0] );
},
$buffer
);
Expand Down Expand Up @@ -324,7 +329,18 @@ public function handle_exclusions( $tag, $handle ) {
return $tag;
}

return str_replace( '<script', sprintf( '<script %s="%s"', esc_html( $this->ignore_attribute ), esc_attr( $this->ignore_value ) ), $tag );
return $this->add_ignore_attribute( $tag );
}

/**
* Add the ignore attribute to the script tags
*
* @param string $html HTML code possibly containing a <script> opening tag.
*
* @return string
*/
public function add_ignore_attribute( $html ) {
return str_replace( '<script', sprintf( '<script %s="%s"', esc_html( $this->ignore_attribute ), esc_attr( $this->ignore_value ) ), $html );
}

/**
Expand Down
20 changes: 10 additions & 10 deletions htdocs/wp/wp-content/plugins/jetpack-boost/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Boost your WordPress site's performance, from the creators of Jetpack",
"type": "library",
"license": "GPL-2.0-or-later",
"version": "3.5.1",
"version": "3.5.2",
"authors": [
{
"name": "Automattic, Inc.",
Expand All @@ -15,21 +15,21 @@
"require": {
"ext-json": "*",
"automattic/jetpack-admin-ui": "^0.4.5",
"automattic/jetpack-assets": "^2.3.8",
"automattic/jetpack-autoloader": "^3.1.0",
"automattic/jetpack-assets": "^2.3.10",
"automattic/jetpack-autoloader": "^3.1.1",
"automattic/jetpack-boost-core": "^0.2.12",
"automattic/jetpack-boost-speed-score": "^0.3.12",
"automattic/jetpack-composer-plugin": "^2.0.3",
"automattic/jetpack-config": "^2.0.4",
"automattic/jetpack-connection": "^5.1.0",
"automattic/jetpack-connection": "^5.1.3",
"automattic/jetpack-device-detection": "^2.1.5",
"automattic/jetpack-image-cdn": "^0.4.9",
"automattic/jetpack-my-jetpack": "^4.35.8",
"automattic/jetpack-image-cdn": "^0.5.1",
"automattic/jetpack-my-jetpack": "^4.35.12",
"automattic/jetpack-plugin-deactivation": "^0.2.2",
"automattic/jetpack-schema": "^0.1.1",
"automattic/jetpack-schema": "^0.1.2",
"automattic/jetpack-status": "^4.0.2",
"automattic/jetpack-sync": "^3.13.1",
"automattic/jetpack-wp-js-data-sync": "^0.5.0",
"automattic/jetpack-sync": "^3.14.0",
"automattic/jetpack-wp-js-data-sync": "^0.5.1",
"matthiasmullie/minify": "^1.3",
"tubalmartin/cssmin": "^4.1"
},
Expand Down Expand Up @@ -74,7 +74,7 @@
"platform": {
"ext-intl": "0.0.0"
},
"autoloader-suffix": "b1e77e6231d50e7663f84529b6a3dfda_jetpack_boostⓥ3_5_1",
"autoloader-suffix": "b1e77e6231d50e7663f84529b6a3dfda_jetpack_boostⓥ3_5_2",
"allow-plugins": {
"roots/wordpress-core-installer": true,
"automattic/jetpack-autoloader": true,
Expand Down
6 changes: 3 additions & 3 deletions htdocs/wp/wp-content/plugins/jetpack-boost/jetpack-boost.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
* Plugin Name: Jetpack Boost
* Plugin URI: https://jetpack.com/boost
* Description: Boost your WordPress site's performance, from the creators of Jetpack
* Version: 3.5.1
* Version: 3.5.2
* Author: Automattic - Jetpack Site Speed team
* Author URI: https://jetpack.com/boost/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: jetpack-boost
* Domain Path: /languages
* Requires at least: 5.5
* Requires at least: 6.5
* Requires PHP: 7.0
*
* @package automattic/jetpack-boost
Expand All @@ -29,7 +29,7 @@
die;
}

define( 'JETPACK_BOOST_VERSION', '3.5.1' );
define( 'JETPACK_BOOST_VERSION', '3.5.2' );
define( 'JETPACK_BOOST_SLUG', 'jetpack-boost' );

if ( ! defined( 'JETPACK_BOOST_CLIENT_NAME' ) ) {
Expand Down
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).

## [2.0.3] - 2024-09-30
### Fixed
- Added a check for function presence to avoid fatal errors. [#39581]

## [2.0.2] - 2024-08-23
### Changed
- Updated package dependencies. [#39004]
Expand Down Expand Up @@ -139,6 +143,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Creates the MC Stats package

[2.0.3]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v2.0.2...v2.0.3
[2.0.2]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v2.0.1...v2.0.2
[2.0.1]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v2.0.0...v2.0.1
[2.0.0]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.22...v2.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ public function do_server_side_stat( $url ) {
public function build_stats_url( $args ) {
$defaults = array(
'v' => 'wpcom2',
'rand' => md5( wp_rand( 0, 999 ) . time() ),
// phpcs:ignore WordPress.WP.AlternativeFunctions.rand_rand -- There can be a case where pluggables are not yet loaded.
'rand' => md5( ( function_exists( 'wp_rand' ) ? wp_rand( 0, 999 ) : rand( 0, 999 ) ) . time() ),
);
$args = wp_parse_args( $args, $defaults );
$gifname = true === $this->use_transparent_pixel ? 'b.gif' : 'g.gif';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ 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.10] - 2024-10-10
### Changed
- Updated package dependencies.

## [2.3.9] - 2024-10-07
### Changed
- Updated package dependencies. [#39594]

## [2.3.8] - 2024-09-10
### Changed
- Updated package dependencies. [#39302]
Expand Down Expand Up @@ -501,6 +509,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Statically access asset tools

[2.3.10]: https://github.com/Automattic/jetpack-assets/compare/v2.3.9...v2.3.10
[2.3.9]: https://github.com/Automattic/jetpack-assets/compare/v2.3.8...v2.3.9
[2.3.8]: https://github.com/Automattic/jetpack-assets/compare/v2.3.7...v2.3.8
[2.3.7]: https://github.com/Automattic/jetpack-assets/compare/v2.3.6...v2.3.7
[2.3.6]: https://github.com/Automattic/jetpack-assets/compare/v2.3.5...v2.3.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"@automattic/jetpack-webpack-config": "workspace:*",
"@wordpress/browserslist-config": "6.7.0",
"@wordpress/browserslist-config": "6.9.0",
"jest": "29.7.0",
"md5-es": "1.8.2",
"webpack": "5.94.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ 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).

## [5.1.3] - 2024-10-10
### Changed
- Updated package dependencies.

## [5.1.2] - 2024-10-07
### Changed
- Adjust conditions to optimize admin notices callback. [#39650]
- Initialize assets in wp-admin only. [#39604]
- Updated package dependencies. [#39594]

## [5.1.1] - 2024-09-30
### Changed
- In 'connect_url_redirect' hook, redirect to 'redirect_after_auth` url if already connected (for connect_after_checkout flow). [#39573]
- My Jetpack Welcome Flow: Display default recommendations upfront first, then offer optional survey for customized recommendations. [#39485]

## [5.1.0] - 2024-09-25
### Changed
- Jetpack Connection - REST API: Allow site-level authentication on POST requests to 'jetpack/v4/connection' [#39503]
Expand Down Expand Up @@ -1211,6 +1226,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Separate the connection library into its own package.

[5.1.3]: https://github.com/Automattic/jetpack-connection/compare/v5.1.2...v5.1.3
[5.1.2]: https://github.com/Automattic/jetpack-connection/compare/v5.1.1...v5.1.2
[5.1.1]: https://github.com/Automattic/jetpack-connection/compare/v5.1.0...v5.1.1
[5.1.0]: https://github.com/Automattic/jetpack-connection/compare/v5.0.0...v5.1.0
[5.0.0]: https://github.com/Automattic/jetpack-connection/compare/v4.0.4...v5.0.0
[4.0.4]: https://github.com/Automattic/jetpack-connection/compare/v4.0.3...v4.0.4
Expand Down
Loading

0 comments on commit b30f6f8

Please sign in to comment.