Skip to content

Commit

Permalink
Release v3.15.2 (PR #6211)
Browse files Browse the repository at this point in the history
Release v3.15.2
  • Loading branch information
engahmeds3ed authored Oct 10, 2023
2 parents c1e79ac + 89fcfb1 commit 619644d
Show file tree
Hide file tree
Showing 152 changed files with 927 additions and 712 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/lint_phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
name: WPRocket lint with PHPCS. PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}.
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -35,7 +35,5 @@ jobs:
run: composer install --prefer-dist --no-interaction --no-scripts

- name: Lint with phpcs
run: |
vendor/bin/phpcs --config-set installed_paths ../../phpcompatibility/phpcompatibility-paragonie,../../phpcompatibility/phpcompatibility-wp,../../wp-coding-standards/wpcs,../../phpcompatibility/php-compatibility
composer phpcs
run: composer phpcs

24 changes: 24 additions & 0 deletions assets/css/wpr-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,15 @@ a:focus, button:focus {
text-decoration: underline;
}

/* ----------------------------------------------- *\
Rocket Analytics CTA
/* ----------------------------------------------- */
.wpr-rocket-analytics-cta.wpr-isHidden {
display: none;
}

/*-----------------------------------------------*\
Upgrade popin
Expand Down Expand Up @@ -2049,6 +2058,21 @@ div.wpr-upgrade-websites {
.wpr-addon .wpr-field-description {
font-style: normal;
}
.wpr-addon .wpr-field-helper {
font-size: 0.8125rem;
line-height: 1.5384615385;
color: #666666;
background-color: #E0E4E9;
padding: 8px;
margin: 8px 0;
}
.wpr-addon .wpr-field-helper span.wpr-helper-title {
font-weight: 600;
}
.wpr-addon .wpr-field-helper span.wpr-helper-title::after {
content: "\a";
white-space: pre;
}
.wpr-addon .wpr-addon-logo {
text-align: center;
flex: 0 0 160px;
Expand Down
2 changes: 1 addition & 1 deletion assets/css/wpr-admin.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/css/wpr-modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
display: flex;
justify-content: center;
align-items: center;
z-index: 100;
}

.wpr-modal-container {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/lazyload-css.min.js

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

2 changes: 1 addition & 1 deletion assets/js/lazyload-css.min.js.map

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

10 changes: 5 additions & 5 deletions assets/js/wpr-admin.js

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

2 changes: 1 addition & 1 deletion assets/js/wpr-admin.js.min.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/wpr-admin.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"roave/security-advisories": "dev-master",
"szepeviktor/phpstan-wordpress": "^1.3",
"woocommerce/action-scheduler": "^3.4",
"wp-coding-standards/wpcs": "^2",
"wp-coding-standards/wpcs": "^3",
"wp-media/background-processing": "^1.3",
"wp-media/phpunit": "^3",
"wp-media/rocket-lazyload-common": "^3.0.11",
Expand Down
2 changes: 1 addition & 1 deletion dynamic-lists-delayjs.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dynamic-lists.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inc/3rd-party/hosting/flywheel.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function rocket_flywheel_remove_partial_purge_hooks() {

// Remove rocket_clean_post() from core action hooks.
array_map(
function( $hook ) {
function ( $hook ) {
remove_action( $hook, 'rocket_clean_post' );
},
$clean_post_hooks
Expand Down
4 changes: 2 additions & 2 deletions inc/3rd-party/hosting/presslabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function rocket_pl_clean_post( $post = false, $permalink = false ) {
*
* @return void
*/
function rocket_pl_clean_home( $root = false, $lang = false ) {
function rocket_pl_clean_home( $root = false, $lang = false ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
if ( ! $post || ! $permalink ) {
return;
}
Expand All @@ -72,7 +72,7 @@ function rocket_pl_remove_partial_purge_hooks() {
];
// Remove rocket_clean_post() from core action hooks.
array_map(
function( $hook ) {
function ( $hook ) {
remove_action( $hook, 'rocket_clean_post' );
},
$clean_post_hooks
Expand Down
2 changes: 1 addition & 1 deletion inc/3rd-party/plugins/cookies/weepie-cookie-allow.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @param array $old_value Previous values for the plugin options.
* @param array $value New values for the plugin options.
*/
function rocket_after_update_wp_cookie_allow_options( $old_value, $value ) {
function rocket_after_update_wp_cookie_allow_options( $old_value, $value ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
// clear the cache because WeePie Cookie Allow plugin settings might have been changed.
rocket_clean_domain();
}
Expand Down
6 changes: 3 additions & 3 deletions inc/3rd-party/plugins/ecommerce/woocommerce-multilingual.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ function rocket_wcml_reset_settings( $option, $old_data, $data ) {
'default_currencies',
];

$check_key = function( $result, $key ) use ( $old_data, $data ) {
$has_value_changed = function( $key ) use ( $old_data, $data ) {
$get_value = function( $key, $data ) {
$check_key = function ( $result, $key ) use ( $old_data, $data ) {
$has_value_changed = function ( $key ) use ( $old_data, $data ) {
$get_value = function ( $key, $data ) {
return isset( $data[ $key ] ) ? $data[ $key ] : null;
};

Expand Down
2 changes: 0 additions & 2 deletions inc/3rd-party/plugins/envira-gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,3 @@ function rocket_deactivate_lazyload_on_envira_gallery_indexable_images( $images
return $images;
}
add_filter( 'envira_gallery_indexable_images', 'rocket_deactivate_lazyload_on_envira_gallery_indexable_images', PHP_INT_MAX );


2 changes: 1 addition & 1 deletion inc/Addon/Cloudflare/Auth/AuthFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ interface AuthFactoryInterface {
* @param array $data Data to inject into the client.
* @return AuthInterface
*/
public function create( array $data = []): AuthInterface;
public function create( array $data = [] ): AuthInterface;
}
2 changes: 1 addition & 1 deletion inc/Addon/Cloudflare/Cloudflare.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function purge_cloudflare() {
*
* @return mixed true if the purge is successful, WP_Error otherwise
*/
public function purge_by_url( $post, $purge_urls, $lang ) {
public function purge_by_url( $post, $purge_urls, $lang ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
$result = $this->endpoints->purge_files( $this->options->get( 'cloudflare_zone_id', '' ), $purge_urls );

if ( is_wp_error( $result ) ) {
Expand Down
7 changes: 3 additions & 4 deletions inc/Addon/WebP/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ private function get_extensions() {
$extensions = apply_filters( 'rocket_file_extensions_for_webp', $extensions );
$extensions = array_filter(
(array) $extensions,
function( $extension ) {
function ( $extension ) {
return $extension && is_string( $extension );
}
);
Expand Down Expand Up @@ -334,7 +334,7 @@ private function get_attribute_names() {
$attributes = apply_filters( 'rocket_attributes_for_webp', $attributes );
$attributes = array_filter(
(array) $attributes,
function( $attributes ) {
function ( $attributes ) {
return $attributes && is_string( $attributes );
}
);
Expand Down Expand Up @@ -539,7 +539,7 @@ private function get_url_to_path_associations() {
$list = apply_filters( 'rocket_url_to_path_associations', $list );
$list = array_filter(
$list,
function( $path, $url ) {
function ( $path, $url ) {
return $path && $url && is_string( $path ) && is_string( $url );
},
ARRAY_FILTER_USE_BOTH
Expand Down Expand Up @@ -595,5 +595,4 @@ public function change_youtube_thumbnail( $extension ) {
}
return 'webp';
}

}
2 changes: 1 addition & 1 deletion inc/Engine/Admin/Beacon/Beacon.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private function prefill_data() {
*
* @return array
*/
private function config_data() : array {
private function config_data(): array {
return [
'display' => [
'position' => is_rtl() ? 'left' : 'right',
Expand Down
1 change: 0 additions & 1 deletion inc/Engine/Admin/Database/OptimizationProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,4 @@ protected function complete() {

parent::complete();
}

}
6 changes: 2 additions & 4 deletions inc/Engine/Admin/Metaboxes/PostEditOptionsSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,8 @@ public function save_metabox_options() {
if ( ! isset( $rejected_uris[ $path ] ) ) {
array_push( $new_cache_reject_uri, $path );
}
} else {
if ( isset( $rejected_uris[ $path ] ) ) {
unset( $new_cache_reject_uri[ $rejected_uris[ $path ] ] );
}
} elseif ( isset( $rejected_uris[ $path ] ) ) {
unset( $new_cache_reject_uri[ $rejected_uris[ $path ] ] );
}

if ( $new_cache_reject_uri !== $cache_reject_uri ) {
Expand Down
22 changes: 2 additions & 20 deletions inc/Engine/Admin/Settings/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,25 +260,7 @@ public function customer_data() {
'is_from_one_dot_com' => false,
];

if (
false === $user
||
! isset( $user->licence_account, $user->licence_expiration )
) {
return $data;
}

if (
1 <= $user->licence_account
&&
$user->licence_account < 3
) {
$data['license_type'] = 'Single';
} elseif ( -1 === (int) $user->licence_account ) {
$data['license_type'] = 'Infinite';
} else {
$data['license_type'] = 'Plus';
}
$data['license_type'] = rocket_get_license_type( $user );

$data['license_class'] = time() < $user->licence_expiration ? 'wpr-isValid' : 'wpr-isInvalid';
$data['license_expiration'] = date_i18n( get_option( 'date_format' ), (int) $user->licence_expiration );
Expand Down Expand Up @@ -2189,7 +2171,7 @@ private function hidden_fields() {
* @param string $tag_name Name of the HTML tag that will wrap each element of the list.
* @return array
*/
private function sanitize_and_format_list( $list, $tag_name = 'strong' ) {
private function sanitize_and_format_list( $list, $tag_name = 'strong' ) { // phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.listFound
if ( ! is_array( $list ) || empty( $list ) ) {
return [];
}
Expand Down
2 changes: 1 addition & 1 deletion inc/Engine/Admin/Settings/Render.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function render_navigation() {
];

$navigation = array_map(
function( array $item ) use ( $default ) {
function ( array $item ) use ( $default ) {
$item = wp_parse_args( $item, $default );

if ( ! empty( $item['class'] ) ) {
Expand Down
8 changes: 4 additions & 4 deletions inc/Engine/Admin/Settings/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ public function sanitize_callback( $input ) {
$notices = array_merge( (array) $wp_settings_errors, (array) get_transient( 'settings_errors' ) );
$notices = array_filter(
$notices,
function( $error ) {
function ( $error ) {
if ( ! $error || ! is_array( $error ) ) {
return false;
}
Expand Down Expand Up @@ -472,7 +472,7 @@ function( $error ) {
* @param string $key Array key to check.
* @return int
*/
public function sanitize_checkbox( $array, $key ) {
public function sanitize_checkbox( $array, $key ) { // phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.arrayFound
return isset( $array[ $key ] ) && ! empty( $array[ $key ] ) ? 1 : 0;
}

Expand Down Expand Up @@ -520,7 +520,7 @@ private function sanitize_dns_prefetch( array $input ) {

return array_unique(
array_map(
function( $url ) {
function ( $url ) {
return '//' . wp_parse_url( $url, PHP_URL_HOST );
},
$urls
Expand Down Expand Up @@ -678,7 +678,7 @@ private function check_global_exclusion( $field ) {
*/
private function sanitize_cdn_cnames( array $cnames ) {
$cnames = array_map(
function( $cname ) {
function ( $cname ) {
$cname = trim( $cname );

if ( empty( $cname ) ) {
Expand Down
3 changes: 1 addition & 2 deletions inc/Engine/Cache/AdminSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class AdminSubscriber implements Event_Manager_Aware_Subscriber_Interface {
public function __construct( AdvancedCache $advanced_cache, WPCache $wp_cache, $filesystem = null ) {
$this->advanced_cache = $advanced_cache;
$this->wp_cache = $wp_cache;
$this->filesystem = $filesystem ?: rocket_direct_filesystem();
$this->filesystem = ! empty( $filesystem ) ? $filesystem : rocket_direct_filesystem();
}

/**
Expand All @@ -77,7 +77,6 @@ public static function get_subscribed_events() {
[ 'delete_old_configs' ],
[ 'clear_cache', 10, 2 ],
],
'wp_rocket_upgrade' => [ 'on_update', 10, 2 ],
];
}

Expand Down
1 change: 0 additions & 1 deletion inc/Engine/Cache/PurgeExpired/PurgeExpiredCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,5 +401,4 @@ public function update_lifespan_value( $old_lifespan, $old_lifespan_unit ) {

update_option( 'wp_rocket_settings', $options );
}

}
2 changes: 1 addition & 1 deletion inc/Engine/Common/Context/ContextInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ interface ContextInterface {
* @param array $data Data to pass to the context.
* @return bool
*/
public function is_allowed( array $data = []): bool;
public function is_allowed( array $data = [] ): bool;
}
3 changes: 2 additions & 1 deletion inc/Engine/Common/ExtractCSS/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
use WP_Rocket\Logger\LoggerAwareInterface;

class Subscriber implements Subscriber_Interface, LoggerAwareInterface {
use RegexTrait, LoggerAware;
use RegexTrait;
use LoggerAware;

/**
* Returns an array of events that this subscriber wants to listen to.
Expand Down
1 change: 0 additions & 1 deletion inc/Engine/Common/Queue/Cleaner.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,4 @@ public function delete_old_actions() {
}
}
}

}
1 change: 0 additions & 1 deletion inc/Engine/Common/Queue/QueueInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,4 @@ public function get_next( $hook, $args = null );
* @return array
*/
public function search( $args = [], $return_format = OBJECT );

}
Loading

0 comments on commit 619644d

Please sign in to comment.