Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.18 main features #7165

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/deploy_dynamic_lists_fallback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,23 @@ jobs:
uses: engahmeds3ed/[email protected]
with:
name: "dynamic-lists.json"
url: "https://b.rucss.wp-rocket.me/api/exclusions/list"
url: "https://b.rucss.wp-rocket.me/api/v2/exclusions/list"
dir: '/'

- name: Get and save incompatible plugins lists
id: saveIncompatiblePluginsLists
uses: engahmeds3ed/[email protected]
with:
name: "dynamic-lists-incompatible-plugins.json"
url: "https://b.rucss.wp-rocket.me/api/incompatible-plugins/list"
url: "https://b.rucss.wp-rocket.me/api/v2/incompatible-plugins/list"
dir: '/'

- name: Get and Save DelayJS Lists
id: saveDynamicDelayJSLists
uses: engahmeds3ed/[email protected]
with:
name: "dynamic-lists-delayjs.json"
url: "https://b.rucss.wp-rocket.me/api/delay-js-exclusions/list"
url: "https://b.rucss.wp-rocket.me/api/v2/delay-js-exclusions/list"
dir: '/'

- name: Commit All lists JSON files
Expand Down
43 changes: 42 additions & 1 deletion assets/css/wpr-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -3104,9 +3104,37 @@ div.wpr-tutorial-item {
}
.wpr-field--categorizedmultiselect .wpr-list.open .wpr-list-header {
max-height: 32px;
cursor: pointer;
}
.wpr-field--categorizedmultiselect .wpr-list .wpr-list-header {
max-height: 32px;
cursor: pointer;
}
.wpr-field--categorizedmultiselect .wpr-list .wpr-list-header .wpr-badge-counter {
display: inline-block;
vertical-align: top;
box-sizing: border-box;
margin: 2px 0 0px 2px;
padding: 0 7px;
min-width: 18px;
height: 18px;
border-radius: 9px;
background-color: #eb714a;
color: #fff;
font-size: 11px;
font-weight: bold;
line-height: 1.6;
text-align: center;
}
.wpr-field--categorizedmultiselect .wpr-list .wpr-list-header .wpr-list-header-data {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
}
.wpr-field--categorizedmultiselect .wpr-list .wpr-list-header .wpr-list-header-data img {
width: 16px;
height: 16px;
}
.wpr-field--categorizedmultiselect .wpr-list [type=checkbox] + label:before {
top: 4px;
Expand Down Expand Up @@ -3139,8 +3167,21 @@ div.wpr-tutorial-item {
color: #72777c;
}
.wpr-field--categorizedmultiselect .wpr-multiple-select-title {
cursor: pointer;
font-weight: bold;
margin-left: 5px;
}
.wpr-field--categorizedmultiselect .wpr-subsection {
padding-left: 30px;
}
.wpr-field--categorizedmultiselect .wpr-select-all {
border-bottom: 2px solid #e9e9e9;
width: 150px;
padding-bottom: 10px;
}

[data-parent=delay_js].wpr-field--children {
margin-left: 32px;
padding-left: 0;
}

@media only screen and (min-width: 782px) {
Expand Down
2 changes: 1 addition & 1 deletion assets/css/wpr-admin.min.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions assets/img/ad_network.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/img/analytics.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/img/others.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/img/payment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/img/plugins.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/img/themes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 33 additions & 2 deletions assets/js/wpr-admin.js

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 assets/js/wpr-admin.min.js.map

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions inc/3rd-party/plugins/autoptimize.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,34 @@ function rocket_activate_autoptimize() {
}
add_action( 'activate_autoptimize/autoptimize.php', 'rocket_activate_autoptimize', 11 );

/**
* Disable WP Rocket minification if Autoptimize css /js minification is enabled.
*
* @param array $options WP Rocket options array.
*
* @since 3.18
*
* @return array
*/
function rocket_maybe_disable_minification( $options ) {
// Bail early if plugin is not active.
if ( ! is_plugin_active( 'autoptimize/autoptimize.php' ) ) {
return $options;
}

if ( 'on' === get_option( 'autoptimize_css' ) ) {
$options['minify_css'] = 0;
}

if ( 'on' === get_option( 'autoptimize_js' ) ) {
$options['minify_js'] = 0;
}

return $options;
}

add_filter( 'rocket_first_install_options', 'rocket_maybe_disable_minification' );

/**
* Disable WP Rocket lazyload fields if Autoptimize lazyload is enabled
*
Expand Down
41 changes: 32 additions & 9 deletions inc/Engine/Admin/Settings/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,7 @@ private function assets_section() {
]
);

$delay_js_list_helper = esc_html__( 'If you have problems after activating this option, copy and paste the default exclusions to quickly resolve issues:', 'rocket' );
$delay_js_list_helper .= sprintf( '<br><pre><code>%1$s</code></pre><br>', implode( '<br>', DelayJSSettings::get_delay_js_default_exclusions() ) );
$delay_js_list_helper .= sprintf(
$delay_js_list_helper = sprintf(
// translators: %1$s = opening </a> tag, %2$s = closing </a> tag.
esc_html__( 'Also, please check our %1$sdocumentation%2$s for a list of compatibility exclusions.', 'rocket' ),
'<a href="' . esc_url( $delay_js_exclusions_beacon['url'] ) . '" target="_blank" rel="noopener">',
Expand Down Expand Up @@ -777,8 +775,8 @@ private function assets_section() {
'delay_js_exclusions_selected' => [
'type' => 'categorized_multiselect',
'label' => __( 'One-click exclusions', 'rocket' ),
'description' => __( 'When using the Delay JavaScript Execution, you might experience delay loading elements located in the viewport that need to appear immediately - e.g. slider, header, menu.', 'rocket' ),
'sub_description' => __( 'If you need instant visibility, click below on files that should NOT be delayed. This selection will help users interact with the elements straight away.', 'rocket' ),
'description' => __( 'When using the Delay JavaScript feature, you might notice that some elements in the viewport take time to appear.', 'rocket' ),
'sub_description' => __( 'If you need these elements to load immediately, select the related plugins, themes, or services below to ensure they appear without delay.', 'rocket' ),
'container_class' => [
'wpr-field--children',
],
Expand All @@ -794,11 +792,11 @@ private function assets_section() {
],
'delay_js_exclusions' => [
'type' => 'textarea',
'label' => __( 'Excluded JavaScript Files', 'rocket' ),
'description' => __( 'Specify URLs or keywords that can identify inline or JavaScript files to be excluded from delaying execution (one per line).', 'rocket' ),
'container_class' => [
'wpr-field--children',
],
'label' => __( 'Excluded JavaScript Files', 'rocket' ),
'description' => __( 'Specify URLs or keywords that can identify inline or JavaScript files to be excluded from delaying execution (one per line).', 'rocket' ),
'parent' => 'delay_js',
'section' => 'js',
'page' => 'file_optimization',
Expand All @@ -808,9 +806,34 @@ private function assets_section() {
'disabled' => get_rocket_option( 'delay_js' ) ? 0 : 1,
],
'helper' => DelayJSSettings::exclusion_list_has_default() ? $delay_js_found_list_helper : $delay_js_list_helper,
'placeholder' => '/wp-includes/js/jquery/jquery.min.js',
'placeholder' => '',
],
]
'delay_js_execution_safe_mode' => [
'type' => 'checkbox',
'label' => __( 'Safe Mode for Delay JavaScript Execution', 'rocket' ),
// translators: %1$s = opening <a> tag, %2$s = closing </a> tag.
'description' => __( 'The Safe Mode mode prevents all internal scripts from being delayed.', 'rocket' ),
'helper' => '',
'container_class' => [
'wpr-field--parent',
'wpr-NoPaddingBottom',
'wpr-field--children',
],
'section' => 'js',
'page' => 'file_optimization',
'parent' => 'delay_js',
'default' => 0,
'sanitize_callback' => 'sanitize_checkbox',
'input_attr' => [
'disabled' => 0,
],
'warning' => [
'title' => __( 'Performance impact', 'rocket' ),
'description' => __( 'By enabling Safe Mode, you significantly reduce your website performance improvements. We recommend using it only as a temporary solution. If you’re experiencing issues with the Delay JavaScript feature, our support team can help you troubleshoot.', 'rocket' ),
'button_label' => __( 'ACTIVATE SAFE MODE', 'rocket' ),
],
],
],
);
}

Expand Down
Loading
Loading