Skip to content

Commit

Permalink
Closes #4966 Remove warnings on minify CSS/JS options (#6783)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tabrisrp committed Jul 17, 2024
1 parent 901612f commit 914bc51
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions inc/Engine/Admin/Settings/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,8 @@ private function assets_section() {
$offline_beacon = $this->beacon->get_suggest( 'offline' );
$fallback_css_beacon = $this->beacon->get_suggest( 'fallback_css' );

$disable_combine_js = $this->disable_combine_js();
$disable_combine_css = $this->disable_combine_css();
$disable_ocd = 'local' === wp_get_environment_type();
$disable_combine_js = $this->disable_combine_js();
$disable_ocd = 'local' === wp_get_environment_type();

/**
* Filters the status of the RUCSS option.
Expand Down Expand Up @@ -559,7 +558,6 @@ private function assets_section() {
'description' => __( 'Minify CSS removes whitespace and comments to reduce the file size.', 'rocket' ),
'container_class' => [
rocket_maybe_disable_minify_css() ? 'wpr-isDisabled' : '',
'wpr-field--parent',
],
'section' => 'css',
'page' => 'file_optimization',
Expand All @@ -568,11 +566,6 @@ private function assets_section() {
'input_attr' => [
'disabled' => rocket_maybe_disable_minify_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 minify CSS', 'rocket' ),
],
],
'exclude_css' => [
'type' => 'textarea',
Expand Down Expand Up @@ -689,7 +682,6 @@ private function assets_section() {
'description' => __( 'Minify JavaScript removes whitespace and comments to reduce the file size.', 'rocket' ),
'container_class' => [
rocket_maybe_disable_minify_js() ? 'wpr-isDisabled' : '',
'wpr-field--parent',
],
'section' => 'js',
'page' => 'file_optimization',
Expand All @@ -698,11 +690,6 @@ private function assets_section() {
'disabled' => rocket_maybe_disable_minify_js() ? 1 : 0,
],
'sanitize_callback' => 'sanitize_checkbox',
'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 minify JavaScript', 'rocket' ),
],
],
'minify_concatenate_js' => [
'type' => 'checkbox',
Expand Down Expand Up @@ -2178,21 +2165,6 @@ private function disable_combine_js(): bool {
return ! (bool) get_rocket_option( 'minify_js', 0 );
}

/**
* Checks if combine CSS option should be disabled
*
* @since 3.11
*
* @return bool
*/
private function disable_combine_css(): bool {
if ( (bool) get_rocket_option( 'remove_unused_css', 0 ) ) {
return true;
}

return ! (bool) get_rocket_option( 'minify_css', 0 );
}

/**
* Render radio options sub fields.
*
Expand Down

0 comments on commit 914bc51

Please sign in to comment.