Skip to content

Commit

Permalink
Scheduled Updates: Minor cleanup (#35964)
Browse files Browse the repository at this point in the history
* Scheduled Updates: Minor cleanup

* Removes unused phpunit filter.
* Removes unneeded `jetpack_` prefixes from when we experimented with a functional approach.
* Moves endpoint loader into an action callback so it can be unhooked if needed.

* Update package version

Props @zaerl

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8055544198
  • Loading branch information
obenland authored and matticbot committed Feb 26, 2024
1 parent f5f38a6 commit 8afa6d7
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 29 deletions.
16 changes: 8 additions & 8 deletions composer.lock

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

2 changes: 1 addition & 1 deletion vendor/automattic/jetpack-mu-wpcom/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"require": {
"php": ">=7.0",
"automattic/jetpack-assets": "^2.1.1",
"automattic/scheduled-updates": "^0.2.0"
"automattic/scheduled-updates": "^0.2.1-alpha"
},
"require-dev": {
"yoast/phpunit-polyfills": "1.1.0",
Expand Down
5 changes: 5 additions & 0 deletions vendor/automattic/scheduled-updates/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.2.1-alpha] - unreleased

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

## [0.2.0] - 2024-02-26
### Added
- Show schedule information for scheduled plugin updates in wp-admin [#35917]
Expand All @@ -16,4 +20,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Generate initial package for Scheduled Updates [#35796]

[0.2.1-alpha]: https://github.com/Automattic/scheduled-updates/compare/v0.2.0...v0.2.1-alpha
[0.2.0]: https://github.com/Automattic/scheduled-updates/compare/v0.1.0...v0.2.0
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Scheduled_Updates {
*
* @var string
*/
const PACKAGE_VERSION = '0.2.0';
const PACKAGE_VERSION = '0.2.1-alpha';

/**
* Initialize the class.
Expand All @@ -27,10 +27,9 @@ public static function init() {
return;
}

static::load_rest_api_endpoints();

add_action( 'jetpack_scheduled_update', array( __CLASS__, 'jetpack_run_scheduled_update' ) );
add_filter( 'auto_update_plugin', array( __CLASS__, 'jetpack_allowlist_scheduled_plugins' ), 10, 2 );
add_action( 'plugins_loaded', array( __CLASS__, 'load_rest_api_endpoints' ), 20 );
add_action( 'jetpack_scheduled_update', array( __CLASS__, 'run_scheduled_update' ) );
add_filter( 'auto_update_plugin', array( __CLASS__, 'allowlist_scheduled_plugins' ), 10, 2 );
add_filter( 'plugin_auto_update_setting_html', array( __CLASS__, 'show_scheduled_updates' ), 10, 2 );
}

Expand All @@ -50,7 +49,7 @@ public static function load_rest_api_endpoints() {
*
* @param string ...$plugins List of plugins to update.
*/
public static function jetpack_run_scheduled_update( ...$plugins ) {
public static function run_scheduled_update( ...$plugins ) {
$available_updates = get_site_transient( 'update_plugins' );
$plugins_to_update = array();

Expand Down Expand Up @@ -79,7 +78,7 @@ public static function jetpack_run_scheduled_update( ...$plugins ) {
* @param object $item The update offer.
* @return bool
*/
public static function jetpack_allowlist_scheduled_plugins( $update, $item ) {
public static function allowlist_scheduled_plugins( $update, $item ) {
// TODO: Check if we're in a scheduled update request from Jetpack_Autoupdates.
$schedules = get_option( 'jetpack_update_schedules', array() );

Expand Down
14 changes: 7 additions & 7 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-assets",
"reference": "d3e56c3f715c09438ccb46db97a535b462f1eadd"
"reference": "6c0b15858031b09b78d3497bb5e52aa1dbd9dd6d"
},
"require": {
"automattic/jetpack-constants": "^2.0.0",
Expand Down Expand Up @@ -76,7 +76,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-constants",
"reference": "53a160caec40a3d6d0cf13f7151929b1a8949cec"
"reference": "fddb13271695d97efef4ba90487695c177c60434"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -130,11 +130,11 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-mu-wpcom",
"reference": "c38fb6d76a5e24c23928a4b522ec6645d9096a49"
"reference": "f8a3355226c739a94d74737b4bc42faffefe0a1d"
},
"require": {
"automattic/jetpack-assets": "^2.1.1",
"automattic/scheduled-updates": "^0.2.0",
"automattic/scheduled-updates": "^0.2.1-alpha",
"php": ">=7.0"
},
"require-dev": {
Expand Down Expand Up @@ -197,12 +197,12 @@
},
{
"name": "automattic/scheduled-updates",
"version": "0.2.0",
"version_normalized": "0.2.0.0",
"version": "0.2.1-alpha.1708981403",
"version_normalized": "0.2.1.0-alpha1708981403",
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/scheduled-updates",
"reference": "a654d055d54164e2064fc9e21c65a086d9e6a8fb"
"reference": "cff89801ee1398cf18d9eb0c9a58dc55c83d826c"
},
"require": {
"php": ">=7.0"
Expand Down
12 changes: 6 additions & 6 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'automattic/jetpack-assets' => array(
'pretty_version' => '2.1.1',
'version' => '2.1.1.0',
'reference' => 'd3e56c3f715c09438ccb46db97a535b462f1eadd',
'reference' => '6c0b15858031b09b78d3497bb5e52aa1dbd9dd6d',
'type' => 'jetpack-library',
'install_path' => __DIR__ . '/../automattic/jetpack-assets',
'aliases' => array(),
Expand All @@ -22,7 +22,7 @@
'automattic/jetpack-constants' => array(
'pretty_version' => '2.0.0',
'version' => '2.0.0.0',
'reference' => '53a160caec40a3d6d0cf13f7151929b1a8949cec',
'reference' => 'fddb13271695d97efef4ba90487695c177c60434',
'type' => 'jetpack-library',
'install_path' => __DIR__ . '/../automattic/jetpack-constants',
'aliases' => array(),
Expand All @@ -31,7 +31,7 @@
'automattic/jetpack-mu-wpcom' => array(
'pretty_version' => '5.14.1',
'version' => '5.14.1.0',
'reference' => 'c38fb6d76a5e24c23928a4b522ec6645d9096a49',
'reference' => 'f8a3355226c739a94d74737b4bc42faffefe0a1d',
'type' => 'jetpack-library',
'install_path' => __DIR__ . '/../automattic/jetpack-mu-wpcom',
'aliases' => array(),
Expand All @@ -47,9 +47,9 @@
'dev_requirement' => false,
),
'automattic/scheduled-updates' => array(
'pretty_version' => '0.2.0',
'version' => '0.2.0.0',
'reference' => 'a654d055d54164e2064fc9e21c65a086d9e6a8fb',
'pretty_version' => '0.2.1-alpha.1708981403',
'version' => '0.2.1.0-alpha1708981403',
'reference' => 'cff89801ee1398cf18d9eb0c9a58dc55c83d826c',
'type' => 'jetpack-library',
'install_path' => __DIR__ . '/../automattic/scheduled-updates',
'aliases' => array(),
Expand Down

0 comments on commit 8afa6d7

Please sign in to comment.