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

Closes #5909 Remove combine CSS option #5911

Merged
merged 14 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from 8 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
2 changes: 0 additions & 2 deletions inc/3rd-party/plugins/autoptimize.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ function rocket_maybe_deactivate_lazyload( $old_value, $value ) {
function rocket_maybe_deactivate_minify_css( $old_value, $value ) {
if ( $value !== $old_value && 'on' === $value ) {
update_rocket_option( 'minify_css', 0 );
update_rocket_option( 'minify_concatenate_css', 0 );
}
}
add_action( 'update_option_autoptimize_css', 'rocket_maybe_deactivate_minify_css', 10, 2 );
Expand Down Expand Up @@ -89,7 +88,6 @@ function rocket_maybe_deactivate_css_defer( $old_value, $value ) {
function rocket_activate_autoptimize() {
if ( 'on' === get_option( 'autoptimize_css' ) ) {
update_rocket_option( 'minify_css', 0 );
update_rocket_option( 'minify_concatenate_css', 0 );
}

if ( 'on' === get_option( 'autoptimize_js' ) ) {
Expand Down
25 changes: 12 additions & 13 deletions inc/Engine/Admin/Deactivation/DeactivationIntent.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,18 @@ public function activate_safe_mode() {
$reset_options = apply_filters(
'rocket_safe_mode_reset_options',
[
'async_css' => 0,
'lazyload' => 0,
'lazyload_iframes' => 0,
'lazyload_youtube' => 0,
'minify_css' => 0,
'minify_concatenate_css' => 0,
'minify_js' => 0,
'minify_concatenate_js' => 0,
'defer_all_js' => 0,
'delay_js' => 0,
'remove_unused_css' => 0,
'minify_google_fonts' => 0,
'cdn' => 0,
'async_css' => 0,
'lazyload' => 0,
'lazyload_iframes' => 0,
'lazyload_youtube' => 0,
'minify_css' => 0,
'minify_js' => 0,
'minify_concatenate_js' => 0,
'defer_all_js' => 0,
'delay_js' => 0,
'remove_unused_css' => 0,
'minify_google_fonts' => 0,
'cdn' => 0,
]
);

Expand Down
25 changes: 1 addition & 24 deletions inc/Engine/Admin/Settings/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -679,30 +679,6 @@ private function assets_section() {
'button_label' => __( 'Activate minify CSS', 'rocket' ),
],
],
'minify_concatenate_css' => [
remyperona marked this conversation as resolved.
Show resolved Hide resolved
'type' => 'checkbox',
'label' => __( 'Combine CSS files <em>(Enable Minify CSS files to select)</em>', 'rocket' ),
// translators: %1$s = opening <a> tag, %2$s = closing </a> tag.
'description' => sprintf( __( 'Combine CSS merges all your files into 1, reducing HTTP requests. Not recommended if your site uses HTTP/2. %1$sMore info%2$s', 'rocket' ), '<a href="' . esc_url( $combine_beacon['url'] ) . '" data-beacon-article="' . esc_attr( $combine_beacon['id'] ) . '" target="_blank">', '</a>' ),
'helper' => get_rocket_option( 'remove_unused_css' ) ? __( 'For compatibility and best results, this option is disabled when Remove unused CSS is enabled.', 'rocket' ) : '',
'container_class' => [
$disable_combine_css ? 'wpr-isDisabled' : '',
'wpr-field--parent',
'wpr-NoPaddingBottom',
],
'section' => 'css',
'page' => 'file_optimization',
'default' => 0,
'sanitize_callback' => 'sanitize_checkbox',
'input_attr' => [
'disabled' => $disable_combine_css ? 1 : 0,
],
'warning' => [
'title' => __( 'This could break things!', 'rocket' ),
'description' => __( 'If you notice any errors on your website after having activated this setting, just deactivate it again, and your site will be back to normal.', 'rocket' ),
'button_label' => __( 'Activate combine CSS', 'rocket' ),
],
],
'exclude_css' => [
'type' => 'textarea',
'label' => __( 'Excluded CSS Files', 'rocket' ),
Expand Down Expand Up @@ -2152,6 +2128,7 @@ private function hidden_fields() {
'emoji',
'remove_unused_css',
'async_css',
'minify_concatenate_css',
CrochetFeve0251 marked this conversation as resolved.
Show resolved Hide resolved
]
)
);
Expand Down
3 changes: 1 addition & 2 deletions inc/Engine/Admin/Settings/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,7 @@ public function sanitize_callback( $input ) {
$input['minify_css'] = ! empty( $input['minify_css'] ) ? 1 : 0;
$input['minify_js'] = ! empty( $input['minify_js'] ) ? 1 : 0;

$input['minify_concatenate_css'] = ! empty( $input['minify_concatenate_css'] ) ? 1 : 0;
$input['minify_concatenate_js'] = ! empty( $input['minify_concatenate_js'] ) ? 1 : 0;
$input['minify_concatenate_js'] = ! empty( $input['minify_concatenate_js'] ) ? 1 : 0;

$input['defer_all_js'] = ! empty( $input['defer_all_js'] ) ? 1 : 0;
$input['exclude_defer_js'] = ! empty( $input['exclude_defer_js'] ) ? rocket_sanitize_textarea_field( 'exclude_defer_js', $input['exclude_defer_js'] ) : [];
Expand Down
Loading