Skip to content

Commit

Permalink
Janitorial: Disparate cleanup tasks (#40200)
Browse files Browse the repository at this point in the history
* Remove Phan suppression now that PHPDoc is correct in supported WP versions

* Remove WP 6.5 polyfill (see #38428)

* Remove is_callable check for wp_trigger_error()

* setMethods → onlyMethods

* static → const property

* Add type hinting

* Throw exception instead of triggering deprecation notice

* Remove now-unneeded CSS

* Updated comment

* Add future todo

* Remove fallbacks

* Add changelogs

* Remove composer downgrade logic

* CRM requires PHP 7.4 already

* Super Cache has previously required WP 6.5

* Vaultpress has previous required WP 5.2

* Get realpath of temp dir

* Fix changelogger tests

* Add changelogs

* Fix typo

* Adjust comment

* Simplify logic

* See if this sates tests

* Jetpack::is_connection_ready has been around in its current state since JP 9.7

* Remove checks for more long-present calls

* Clean up Phan suppressions

* Update changelog

Co-authored-by: Brad Jorsch <[email protected]>

* Update changelog

Co-authored-by: Brad Jorsch <[email protected]>

* Remove old comment

---------

Co-authored-by: Brad Jorsch <[email protected]>

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11897114078

Upstream-Ref: Automattic/jetpack@d4ff610
  • Loading branch information
tbradsha authored and matticbot committed Nov 18, 2024
1 parent e30d4e2 commit b7bedd9
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 29 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This is an alpha version! The changes listed here are not final.
- Updated package dependencies.

### Removed
- Cleaned up legacy code.
- General: Update minimum PHP version to 7.2.
- General: Update minimum WordPress version to 6.6.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
"automattic/jetpack-changelogger": "^5.0.0"
"automattic/jetpack-changelogger": "^5.1.0-alpha"
},
"autoload": {
"classmap": [
Expand Down
12 changes: 6 additions & 6 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-device-detection/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
"automattic/jetpack-changelogger": "^5.0.0"
"automattic/jetpack-changelogger": "^5.1.0-alpha"
},
"suggest": {
"automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package."
Expand Down
4 changes: 2 additions & 2 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-device-detection",
"reference": "d420622256718ac965160e39ef3934c8fadfbe4b"
"reference": "0cab0cbb7901b936632562da29b00065329428a3"
},
"require": {
"php": ">=7.2"
},
"require-dev": {
"automattic/jetpack-changelogger": "^5.0.0",
"automattic/jetpack-changelogger": "^5.1.0-alpha",
"yoast/phpunit-polyfills": "^1.1.1"
},
"suggest": {
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'automattic/jetpack-device-detection' => array(
'pretty_version' => '3.0.0',
'version' => '3.0.0.0',
'reference' => 'd420622256718ac965160e39ef3934c8fadfbe4b',
'reference' => '0cab0cbb7901b936632562da29b00065329428a3',
'type' => 'jetpack-library',
'install_path' => __DIR__ . '/../automattic/jetpack-device-detection',
'aliases' => array(),
Expand Down
24 changes: 6 additions & 18 deletions wp-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,7 @@ function wpsupercache_activate() {
register_activation_hook( __FILE__, 'wpsupercache_activate' );

function wpsupercache_site_admin() {
global $wp_version;

if ( version_compare( $wp_version, '4.8', '>=' ) ) {
return current_user_can( 'setup_network' );
}

return is_super_admin();
return current_user_can( 'setup_network' );
}

function wp_cache_add_pages() {
Expand Down Expand Up @@ -2011,7 +2005,7 @@ function wp_cache_remove_index() {
}

function wp_cache_index_notice() {
global $wp_version, $cache_path;
global $cache_path;

if ( false == wpsupercache_site_admin() )
return false;
Expand All @@ -2036,16 +2030,10 @@ function wp_cache_index_notice() {
echo "<p><strong>";
_e( 'If you just installed WP Super Cache for the first time, you can dismiss this message. Otherwise, you should probably refresh the login cookies of all logged in WordPress users here by clicking the logout link below.', 'wp-super-cache' );
echo "</strong></p>";
if ( -1 == version_compare( $wp_version, '4.0' ) ) {
echo '<p>' . __( 'Your site is using a very old version of WordPress. When you update to the latest version everyone will be logged out and cookie information updated.', 'wp-super-cache' ) . '</p>';
} else {
echo '<p>' . __( 'The logout link will log out all WordPress users on this site except you. Your authentication cookie will be updated, but you will not be logged out.', 'wp-super-cache' ) . '</p>';
}
echo "<a id='wpsc-dismiss' href='#'>" . __( 'Dismiss', 'wp-super-cache' ) . "</a>";
if ( 1 == version_compare( $wp_version, '4.0' ) ) {
echo " | <a href='" . wp_nonce_url( admin_url( '?action=wpsclogout' ), 'wpsc_logout' ) . "'>" . __( 'Logout', 'wp-super-cache' ) . "</a>";
}
echo "</div>";
echo '<p>' . esc_html__( 'The logout link will log out all WordPress users on this site except you. Your authentication cookie will be updated, but you will not be logged out.', 'wp-super-cache' ) . '</p>';
echo '<a id="wpsc-dismiss" href="#">' . esc_html__( 'Dismiss', 'wp-super-cache' ) . '</a>';
echo ' | <a href="' . esc_url( wp_nonce_url( admin_url( '?action=wpsclogout' ), 'wpsc_logout' ) ) . '">' . esc_html__( 'Logout', 'wp-super-cache' ) . '</a>';
echo '</div>';
?>
<script type='text/javascript'>
<!--
Expand Down

0 comments on commit b7bedd9

Please sign in to comment.