Changeset 2930475
- Timestamp:
- 06/25/2023 05:10:49 AM (3 years ago)
- Location:
- disable-dashboard-for-woocommerce
- Files:
-
- 26 added
- 2 deleted
- 8 edited
- 1 copied
-
tags/3.2.7 (copied) (copied from disable-dashboard-for-woocommerce/trunk)
-
tags/3.2.7/.jenkins (added)
-
tags/3.2.7/.jenkins/config.ini (added)
-
tags/3.2.7/.jenkins/crudini.py (added)
-
tags/3.2.7/.jenkins/deploy.php (added)
-
tags/3.2.7/.jenkins/deploy.sh (added)
-
tags/3.2.7/.jenkins/freemius-php-api (added)
-
tags/3.2.7/.jenkins/package.sh (added)
-
tags/3.2.7/.jenkins/release.sh (added)
-
tags/3.2.7/.jenkins/wp-bump-version.sh (added)
-
tags/3.2.7/.jenkins/wp-readme-last-wp-tested.sh (added)
-
tags/3.2.7/composer.json (added)
-
tags/3.2.7/composer.lock (added)
-
tags/3.2.7/disable-dashboard-for-woocommerce.php (modified) (3 diffs)
-
tags/3.2.7/includes/freemius (deleted)
-
tags/3.2.7/includes/functions/disable-bloat-functions_pro__premium_only.php (added)
-
tags/3.2.7/includes/settings/class-disable-bloat-settings-admin.php (modified) (12 diffs)
-
tags/3.2.7/includes/settings/class-disable-bloat-settings-performance.php (modified) (20 diffs)
-
tags/3.2.7/readme.txt (modified) (1 diff)
-
trunk/.jenkins (added)
-
trunk/.jenkins/config.ini (added)
-
trunk/.jenkins/crudini.py (added)
-
trunk/.jenkins/deploy.php (added)
-
trunk/.jenkins/deploy.sh (added)
-
trunk/.jenkins/freemius-php-api (added)
-
trunk/.jenkins/package.sh (added)
-
trunk/.jenkins/release.sh (added)
-
trunk/.jenkins/wp-bump-version.sh (added)
-
trunk/.jenkins/wp-readme-last-wp-tested.sh (added)
-
trunk/composer.json (added)
-
trunk/composer.lock (added)
-
trunk/disable-dashboard-for-woocommerce.php (modified) (3 diffs)
-
trunk/includes/freemius (deleted)
-
trunk/includes/functions/disable-bloat-functions_pro__premium_only.php (added)
-
trunk/includes/settings/class-disable-bloat-settings-admin.php (modified) (12 diffs)
-
trunk/includes/settings/class-disable-bloat-settings-performance.php (modified) (20 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
disable-dashboard-for-woocommerce/tags/3.2.7/disable-dashboard-for-woocommerce.php
r2926554 r2930475 5 5 * Plugin URI: https://disablebloat.com/ 6 6 * Description: All-in-One solution to speed up your WordPress & WooCommerce. Remove unnecessary features and make your site faster and cleaner. 7 * Version: 3.2. 67 * Version: 3.2.7 8 8 * Author: Disable Bloat 9 9 * Developer: Disable Bloat … … 19 19 * License URI: http://www.gnu.org/licenses/gpl-3.0.html 20 20 */ 21 if ( !defined( 'ABSPATH' ) ) { 21 22 if (!defined('ABSPATH')) { 22 23 exit; 23 24 } 24 25 25 if ( function_exists( 'wcbloat_fs' )) {26 wcbloat_fs()->set_basename( false, __FILE__);26 if (function_exists('wcbloat_fs')) { 27 wcbloat_fs()->set_basename(false, __FILE__); 27 28 } else { 28 29 // DO NOT REMOVE THIS IF, IT IS ESSENTIAL FOR THE `function_exists` CALL ABOVE TO PROPERLY WORK. 29 30 if ( !function_exists( 'wcbloat_fs' )) {30 31 if (!function_exists('wcbloat_fs')) { 31 32 // Actual Freemius integration snippet 32 33 if ( !function_exists( 'wcbloat_fs' )) {33 34 if (!function_exists('wcbloat_fs')) { 34 35 // Create a helper function for easy SDK access. 35 36 function wcbloat_fs() 36 37 { 37 global $wcbloat_fs ;38 39 if ( !isset( $wcbloat_fs )) {38 global $wcbloat_fs; 39 40 if (!isset($wcbloat_fs)) { 40 41 // Activate multisite network integration. 41 if ( !defined( 'WP_FS__PRODUCT_10157_MULTISITE' )) {42 define( 'WP_FS__PRODUCT_10157_MULTISITE', true);42 if (!defined('WP_FS__PRODUCT_10157_MULTISITE')) { 43 define('WP_FS__PRODUCT_10157_MULTISITE', true); 43 44 } 44 45 // Include Freemius SDK. 45 require_once dirname( __FILE__ ) . '/includes/freemius/start.php';46 $wcbloat_fs = fs_dynamic_init( array(46 require_once dirname(__FILE__) . '/vendor/freemius/wordpress-sdk/start.php'; 47 $wcbloat_fs = fs_dynamic_init(array( 47 48 'id' => '10157', 48 49 'slug' => 'disable-dashboard-for-woocommerce', … … 50 51 'type' => 'plugin', 51 52 'public_key' => 'pk_16f665643a809fd13e01f8a3d1381', 52 'is_premium' => false,53 'is_premium' => true, 53 54 'premium_suffix' => 'PRO', 54 55 'has_addons' => false, 55 56 'has_paid_plans' => true, 56 57 'menu' => array( 57 'contact' => false,58 'support' => false,59 'account' => false,60 'pricing' => false,61 ),58 'contact' => false, 59 'support' => false, 60 'account' => false, 61 'pricing' => false, 62 ), 62 63 'pricing' => false, 63 'anonymous_mode' => !function_exists( 'is_anonymous_mode_disabled__premium_only' ) || !is_anonymous_mode_disabled__premium_only(), 64 'is_live' => true, 65 ) ); 64 'anonymous_mode' => !function_exists('is_anonymous_mode_disabled__premium_only') || !is_anonymous_mode_disabled__premium_only(), 65 'secret_key' => 'sk_68M]h<4Kl5O:Q;[)&U.Usfc?{8D4o', 66 67 )); 66 68 } 67 69 68 70 return $wcbloat_fs; 69 71 } 70 72 71 73 // Init Freemius. 72 74 wcbloat_fs(); 73 75 // Signal that SDK was initiated. 74 do_action( 'wcbloat_fs_loaded');76 do_action('wcbloat_fs_loaded'); 75 77 } 76 77 if ( function_exists( 'fs_override_i18n' )) {78 fs_override_i18n( array(79 'opt-in' => __( '', 'disable-dashboard-for-woocommerce'),80 ), 'disable-dashboard-for-woocommerce' );78 79 if (function_exists('fs_override_i18n')) { 80 fs_override_i18n(array( 81 'opt-in' => __('', 'disable-dashboard-for-woocommerce'), 82 ), 'disable-dashboard-for-woocommerce'); 81 83 } 82 wcbloat_fs()->add_filter( 'default_to_anonymous_feedback', '__return_true');83 wcbloat_fs()->add_filter( 'hide_freemius_powered_by', '__return_true');84 wcbloat_fs()->add_filter( 'hide_billing_and_payments_info', '__return_true');84 wcbloat_fs()->add_filter('default_to_anonymous_feedback', '__return_true'); 85 wcbloat_fs()->add_filter('hide_freemius_powered_by', '__return_true'); 86 wcbloat_fs()->add_filter('hide_billing_and_payments_info', '__return_true'); 85 87 // Opt-In Icon Customization 86 88 function wcbloat_custom_plugin_icon() 87 89 { 88 return dirname( __FILE__) . '/assets/img/disable-dashboard-for-woocommerce.png';90 return dirname(__FILE__) . '/assets/img/disable-dashboard-for-woocommerce.png'; 89 91 } 90 91 wcbloat_fs()->add_filter( 'plugin_icon', 'wcbloat_custom_plugin_icon');92 93 wcbloat_fs()->add_filter('plugin_icon', 'wcbloat_custom_plugin_icon'); 92 94 // Freemius END 93 95 // load plugin text domain 94 96 function wcbloat_init() 95 97 { 96 load_plugin_textdomain( 'disable-dashboard-for-woocommerce', false, dirname( plugin_basename( __FILE__ ) ) . '/languages');98 load_plugin_textdomain('disable-dashboard-for-woocommerce', false, dirname(plugin_basename(__FILE__)) . '/languages'); 97 99 } 98 99 add_action( 'plugins_loaded', 'wcbloat_init');100 101 add_action('plugins_loaded', 'wcbloat_init'); 100 102 // Links on Plugins screen 101 function wcbloat_action_links( $links)103 function wcbloat_action_links($links) 102 104 { 103 $custom_links = [ '<a href="' . admin_url( 'options-general.php?page=disable-bloat' ) . '">' . __( 'Settings' ) . '</a>' ]; 104 if ( !wcbloat_fs()->is_premium() ) { 105 $custom_links[] = '<a href="https://disablebloat.com/?utm_source=plugins_list&utm_medium=referral&utm_campaign=Plugin+links" target="_blank"><b>' . __( 'Upgrade', 'disable-dashboard-for-woocommerce' ) . '</b></a>'; 105 $custom_links = ['<a href="' . admin_url('options-general.php?page=disable-bloat') . '">' . __('Settings') . '</a>']; 106 107 if (!wcbloat_fs()->is_premium()) { 108 $custom_links[] = '<a href="https://disablebloat.com/?utm_source=plugins_list&utm_medium=referral&utm_campaign=Plugin+links" target="_blank"><b>' . __('Upgrade', 'disable-dashboard-for-woocommerce') . '</b></a>'; 106 109 } 107 if ( wcbloat_fs()->is_plan( 'pro' ) ) { 108 $custom_links[] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( wcbloat_fs()->get_account_url() ), __( 'My Account', 'disable-dashboard-for-woocommerce' ) ); 110 111 if (wcbloat_fs()->is_plan('pro')) { 112 $custom_links[] = sprintf( 113 '<a href="%1$s">%2$s</a>', 114 esc_url(wcbloat_fs()->get_account_url()), 115 __('My Account', 'disable-dashboard-for-woocommerce') 116 ); 109 117 } 110 return array_merge( $custom_links, $links ); 118 119 return array_merge($custom_links, $links); 111 120 } 112 113 add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'wcbloat_action_links');121 122 add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'wcbloat_action_links'); 114 123 } 115 124 116 125 // Add CSS and JS to the plugin settings screens 117 126 function wcbloat_custom_wp_admin_assets() 118 127 { 119 $page = ( isset( $_GET['page'] ) ? $_GET['page'] : '' );120 121 if ( $page === 'disable-bloat') {122 wp_enqueue_style( 'wcbloat_wp_admin_css', plugin_dir_url( __FILE__ ) . 'assets/css/disable-bloat-admin-style.css');123 wp_enqueue_script( 'wcbloat_wp_admin_js', plugin_dir_url( __FILE__ ) . 'assets/js/disable-bloat-admin.js');128 $page = isset($_GET['page']) ? $_GET['page'] : ''; 129 130 if ($page === 'disable-bloat') { 131 wp_enqueue_style('wcbloat_wp_admin_css', plugin_dir_url(__FILE__) . 'assets/css/disable-bloat-admin-style.css'); 132 wp_enqueue_script('wcbloat_wp_admin_js', plugin_dir_url(__FILE__) . 'assets/js/disable-bloat-admin.js'); 124 133 } 125 126 134 } 127 128 add_action( 'admin_enqueue_scripts', 'wcbloat_custom_wp_admin_assets' ); 135 136 add_action('admin_enqueue_scripts', 'wcbloat_custom_wp_admin_assets'); 137 129 138 // Include WooCommerce integration 130 139 require_once 'includes/functions/disable-bloat-woocommerce.php'; 140 131 141 // Include functions files 132 142 require_once 'includes/functions/disable-bloat-functions_free.php'; 143 144 if (wcbloat_fs()->is__premium_only()) { 145 if (wcbloat_fs()->is_plan('pro')) { 146 require_once 'includes/functions/disable-bloat-functions_pro__premium_only.php'; 147 } 148 } 149 133 150 // Include Options pages 134 151 require_once 'includes/settings/class-disable-bloat-settings.php'; 152 135 153 // Include Uninstall Cleanup code 136 154 require_once 'includes/functions/disable-bloat-uninstall-cleanup.php'; 155 137 156 // Compatibility with WooCommerce HPOS (Custom order tables) - only if WooCommmerce is active 138 if ( wcbloat_is_woo_active()) {139 add_action( 'before_woocommerce_init', function () {140 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class )) {141 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true);157 if (wcbloat_is_woo_active()) { 158 add_action('before_woocommerce_init', function () { 159 if (class_exists(\Automattic\WooCommerce\Utilities\FeaturesUtil::class)) { 160 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true); 142 161 } 143 } );162 }); 144 163 } 164 145 165 // MAIN PLUGIN FILE END 146 166 // DO NOT REMOVE THE BRACKET BELOW, AS IT IS NEEDED FOR THE MECHANISM OF AUTO DEACTIVATING THE FREE VERSION DURING PRO ACTIVATION: -
disable-dashboard-for-woocommerce/tags/3.2.7/includes/settings/class-disable-bloat-settings-admin.php
r2873201 r2930475 1 1 <?php 2 2 3 if ( !defined( 'ABSPATH' ) ) { 4 exit; 5 } 6 // Exit if accessed directly 3 if (!defined('ABSPATH')) exit; // Exit if accessed directly 4 7 5 // Add sections and fields on Main settings screen 8 6 function wcbloat_admin_settings_init() 9 7 { 10 // Section's icon 11 add_settings_section( 12 'wcbloat-admin-desc-icon-section', 13 '', 14 'wcbloat_admin_desc_icon_callback', 15 'wcbloat-admin' 16 ); 17 // Section's title and description 18 add_settings_section( 19 'wcbloat-admin-desc-section', 20 esc_attr__( 'Admin panel optimization', 'disable-dashboard-for-woocommerce' ), 21 'wcbloat_admin_desc_callback', 22 'wcbloat-admin' 23 ); 24 // Clean admin interface section 25 add_settings_section( 26 'wcbloat_clean_admin_section', 27 esc_attr__( 'Clean admin interface', 'disable-dashboard-for-woocommerce' ), 28 'wcbloat_clean_admin_desc_section_callback', 29 'wcbloat-admin' 30 ); 31 // Hide update notice for non-admin users 32 add_settings_field( 33 'wcbloat_wp_update_nag_disable', 34 'Hide update notice for non-admin users', 35 'wcbloat_wp_update_nag_disable_callback', 36 'wcbloat-admin', 37 'wcbloat_clean_admin_section' 38 ); 39 register_setting( 'wcbloat-admin-options', 'wcbloat_wp_update_nag_disable', array( 40 'sanitize_callback' => 'sanitize_key', 41 ) ); 42 // Disable Dashboard widgets PRO 43 add_settings_field( 44 'wcbloat_wp_dashboard_widgets_disable', 45 esc_attr__( 'Disable WordPress Dashboard widgets', 'disable-dashboard-for-woocommerce' ), 46 'wcbloat_wp_dashboard_widgets_disable_callback', 47 'wcbloat-admin', 48 'wcbloat_clean_admin_section' 49 ); 50 register_setting( 'wcbloat-admin-options', 'wcbloat_wp_dashboard_widgets_disable', 'validate_setting' ); 51 // Remove the WordPress logo ("W") from the admin bar PRO 52 add_settings_field( 53 'wcbloat_w_logo_disable', 54 'WordPress logo in the admin bar', 55 'wcbloat_w_logo_disable_callback', 56 'wcbloat-admin', 57 'wcbloat_clean_admin_section' 58 ); 59 register_setting( 'wcbloat-admin-options', 'wcbloat_w_logo_disable', array( 60 'sanitize_callback' => 'sanitize_key', 61 ) ); 62 // Remove admin footer text PRO 63 add_settings_field( 64 'wcbloat_wp_footer_disable', 65 'Admin footer text', 66 'wcbloat_wp_footer_disable_callback', 67 'wcbloat-admin', 68 'wcbloat_clean_admin_section' 69 ); 70 register_setting( 'wcbloat-admin-options', 'wcbloat_wp_footer_disable', array( 71 'sanitize_callback' => 'sanitize_key', 72 ) ); 73 // WordPress login page section 74 add_settings_section( 75 'wcbloat-admin-wp-login-page-section', 76 esc_attr__( 'WordPress login page', 'disable-dashboard-for-woocommerce' ), 77 'wcbloat_admin_wp_login_page_section_callback', 78 'wcbloat-admin' 79 ); 80 // Hide WordPress logo on the WordPress Login Page PRO 81 add_settings_field( 82 'wcbloat_hide_wp_logo_on_login_page', 83 'Hide WordPress logo on the Login Page', 84 'wcbloat_hide_wp_logo_on_login_page_callback', 85 'wcbloat-admin', 86 'wcbloat-admin-wp-login-page-section' 87 ); 88 register_setting( 'wcbloat-admin-options', 'wcbloat_hide_wp_logo_on_login_page', array( 89 'sanitize_callback' => 'sanitize_key', 90 ) ); 91 // Change the Logo URL on the WordPress Login Page PRO 92 add_settings_field( 93 'wcbloat_wp_logo_url_disable', 94 'Change the Logo Link', 95 'wcbloat_wp_logo_url_disable_callback', 96 'wcbloat-admin', 97 'wcbloat-admin-wp-login-page-section' 98 ); 99 register_setting( 'wcbloat-admin-options', 'wcbloat_wp_logo_url_disable', array( 100 'sanitize_callback' => 'sanitize_key', 101 ) ); 102 // Change the Logo title the WordPress Login Page PRO 103 add_settings_field( 104 'wcbloat_wp_logo_title', 105 'Change the Logo title parameter', 106 'wcbloat_wp_logo_title_callback', 107 'wcbloat-admin', 108 'wcbloat-admin-wp-login-page-section' 109 ); 110 register_setting( 'wcbloat-admin-options', 'wcbloat_wp_logo_title', array( 111 'sanitize_callback' => 'sanitize_key', 112 ) ); 113 // Disable WordPress Login Language Switcher PRO 114 add_settings_field( 115 'wcbloat_wp_language_select_disable', 116 'Disable WordPress Login Language Switcher', 117 'wcbloat_wp_language_select_disable_callback', 118 'wcbloat-admin', 119 'wcbloat-admin-wp-login-page-section' 120 ); 121 register_setting( 'wcbloat-admin-options', 'wcbloat_wp_language_select_disable', array( 122 'sanitize_callback' => 'sanitize_key', 123 ) ); 8 9 // Section's icon 10 add_settings_section( 11 'wcbloat-admin-desc-icon-section', 12 '', 13 'wcbloat_admin_desc_icon_callback', 14 'wcbloat-admin' 15 ); 16 17 // Section's title and description 18 add_settings_section( 19 'wcbloat-admin-desc-section', 20 esc_attr__('Admin panel optimization', 'disable-dashboard-for-woocommerce'), 21 'wcbloat_admin_desc_callback', 22 'wcbloat-admin' 23 ); 24 25 // Clean admin interface section 26 add_settings_section( 27 'wcbloat_clean_admin_section', 28 esc_attr__('Clean admin interface', 'disable-dashboard-for-woocommerce'), 29 'wcbloat_clean_admin_desc_section_callback', 30 'wcbloat-admin' 31 ); 32 33 // Hide update notice for non-admin users 34 add_settings_field( 35 'wcbloat_wp_update_nag_disable', 36 'Hide update notice for non-admin users', 37 'wcbloat_wp_update_nag_disable_callback', 38 'wcbloat-admin', 39 'wcbloat_clean_admin_section' 40 ); 41 register_setting( 42 'wcbloat-admin-options', 43 'wcbloat_wp_update_nag_disable', 44 array('sanitize_callback' => 'sanitize_key') 45 ); 46 47 // Disable Dashboard widgets PRO 48 add_settings_field( 49 'wcbloat_wp_dashboard_widgets_disable', 50 esc_attr__( 'Disable WordPress Dashboard widgets', 'disable-dashboard-for-woocommerce' ), 51 'wcbloat_wp_dashboard_widgets_disable_callback', 52 'wcbloat-admin', 53 'wcbloat_clean_admin_section' ); 54 register_setting( 55 'wcbloat-admin-options', 56 'wcbloat_wp_dashboard_widgets_disable', 57 'validate_setting' 58 ); 59 60 // Remove the WordPress logo ("W") from the admin bar PRO 61 add_settings_field( 62 'wcbloat_w_logo_disable', 63 'WordPress logo in the admin bar', 64 'wcbloat_w_logo_disable_callback', 65 'wcbloat-admin', 66 'wcbloat_clean_admin_section' 67 ); 68 register_setting( 69 'wcbloat-admin-options', 70 'wcbloat_w_logo_disable', 71 array('sanitize_callback' => 'sanitize_key') 72 ); 73 74 // Remove admin footer text PRO 75 add_settings_field( 76 'wcbloat_wp_footer_disable', 77 'Admin footer text', 78 'wcbloat_wp_footer_disable_callback', 79 'wcbloat-admin', 80 'wcbloat_clean_admin_section' 81 ); 82 register_setting( 83 'wcbloat-admin-options', 84 'wcbloat_wp_footer_disable', 85 array('sanitize_callback' => 'sanitize_key') 86 ); 87 88 // WordPress login page section 89 add_settings_section( 90 'wcbloat-admin-wp-login-page-section', 91 esc_attr__('WordPress login page', 'disable-dashboard-for-woocommerce'), 92 'wcbloat_admin_wp_login_page_section_callback', 93 'wcbloat-admin' 94 ); 95 96 // Hide WordPress logo on the WordPress Login Page PRO 97 add_settings_field( 98 'wcbloat_hide_wp_logo_on_login_page', 99 'Hide WordPress logo on the Login Page', 100 'wcbloat_hide_wp_logo_on_login_page_callback', 101 'wcbloat-admin', 102 'wcbloat-admin-wp-login-page-section' 103 ); 104 register_setting( 105 'wcbloat-admin-options', 106 'wcbloat_hide_wp_logo_on_login_page', 107 array('sanitize_callback' => 'sanitize_key') 108 ); 109 110 // Change the Logo URL on the WordPress Login Page PRO 111 add_settings_field( 112 'wcbloat_wp_logo_url_disable', 113 'Change the Logo Link', 114 'wcbloat_wp_logo_url_disable_callback', 115 'wcbloat-admin', 116 'wcbloat-admin-wp-login-page-section' 117 ); 118 register_setting( 119 'wcbloat-admin-options', 120 'wcbloat_wp_logo_url_disable', 121 array('sanitize_callback' => 'sanitize_key') 122 ); 123 124 // Change the Logo title the WordPress Login Page PRO 125 add_settings_field( 126 'wcbloat_wp_logo_title', 127 'Change the Logo title parameter', 128 'wcbloat_wp_logo_title_callback', 129 'wcbloat-admin', 130 'wcbloat-admin-wp-login-page-section' 131 ); 132 register_setting( 133 'wcbloat-admin-options', 134 'wcbloat_wp_logo_title', 135 array('sanitize_callback' => 'sanitize_key') 136 ); 137 138 // Disable WordPress Login Language Switcher PRO 139 add_settings_field( 140 'wcbloat_wp_language_select_disable', 141 'Disable WordPress Login Language Switcher', 142 'wcbloat_wp_language_select_disable_callback', 143 'wcbloat-admin', 144 'wcbloat-admin-wp-login-page-section' 145 ); 146 register_setting( 147 'wcbloat-admin-options', 148 'wcbloat_wp_language_select_disable', 149 array('sanitize_callback' => 'sanitize_key') 150 ); 124 151 } 125 152 126 153 // Display the fields added before 127 add_action( 'admin_init', 'wcbloat_admin_settings_init' ); 154 add_action('admin_init', 'wcbloat_admin_settings_init'); 155 128 156 // Fields callbacks 157 129 158 // Section's icon 130 159 function wcbloat_admin_desc_icon_callback() 131 160 { 132 _e( '<span class="dashicons dashicons-hammer"></span>');161 _e('<span class="dashicons dashicons-hammer"></span>'); 133 162 } 134 163 … … 136 165 function wcbloat_admin_desc_callback() 137 166 { 138 _e( 'By default, the WordPress admin panel is cluttered with preinstalled elements that may distract you from your work. You can simplify your WordPress admin panel by hiding or turning them off.<hr />', 'disable-dashboard-for-woocommerce');139 _e( wcbloat_buy_pro_bar() );167 _e('By default, the WordPress admin panel is cluttered with preinstalled elements that may distract you from your work. You can simplify your WordPress admin panel by hiding or turning them off.<hr />', 'disable-dashboard-for-woocommerce'); 168 _e ( wcbloat_buy_pro_bar() ); 140 169 } 141 170 … … 143 172 function wcbloat_clean_admin_desc_section_callback() 144 173 { 145 _e( 'If you love a simple and flexible interface, use the options below to maximize your performance while browsing through the WordPress admin panel. By removing unnecessary elements, you will be 100% focused on your tasks.', 'disable-dashboard-for-woocommerce');174 _e('If you love a simple and flexible interface, use the options below to maximize your performance while browsing through the WordPress admin panel. By removing unnecessary elements, you will be 100% focused on your tasks.', 'disable-dashboard-for-woocommerce'); 146 175 } 147 176 … … 149 178 function wcbloat_wp_update_nag_disable_callback() 150 179 { 151 $value = get_option( 'wcbloat_wp_update_nag_disable');152 ?>180 $value = get_option('wcbloat_wp_update_nag_disable'); 181 ?> 153 182 <input type='hidden' name='wcbloat_wp_update_nag_disable' value='no'> 154 <label><input type='checkbox' name='wcbloat_wp_update_nag_disable' <?php 155 checked( esc_attr( $value ), 'yes' ); 156 ?> value='yes'> <?php 157 esc_attr_e( 'Hide update notice for non-admin users', 'disable-dashboard-for-woocommerce' ); 158 ?></label> 159 <p><?php 160 _e( 'The next time any user with the Role set as Subscriber, Contributor, Author, or Editor access the WordPress back-end, they will not be prompted to update the WordPress core. The notification will continue to display for admin users.', 'disable-dashboard-for-woocommerce' ); 161 ?></p> 162 <?php 183 <label><input type='checkbox' name='wcbloat_wp_update_nag_disable' <?php checked(esc_attr($value), 'yes'); ?> value='yes'> <?php esc_attr_e('Hide update notice for non-admin users', 'disable-dashboard-for-woocommerce'); ?></label> 184 <p><?php _e('The next time any user with the Role set as Subscriber, Contributor, Author, or Editor access the WordPress back-end, they will not be prompted to update the WordPress core. The notification will continue to display for admin users.', 'disable-dashboard-for-woocommerce'); ?></p> 185 <?php 163 186 } 164 187 … … 166 189 function wcbloat_wp_dashboard_widgets_disable_callback() 167 190 { 168 $options = get_option( 'wcbloat_wp_dashboard_widgets_disable' ); 169 ?>191 $options = get_option('wcbloat_wp_dashboard_widgets_disable'); 192 ?> 170 193 <div class="wcbloat-select-unselect-buttons"> 171 <a <?php 172 ?> class="button button-secondary"<?php 173 echo wcbloat_is_pro_readonly() ; 174 ?>><?php 175 esc_attr_e( 'Select / Deselect All', 'disable-dashboard-for-woocommerce' ); 176 ?></a> 194 <a <?php if ( wcbloat_fs()->is__premium_only() ) { if ( wcbloat_fs()->is_plan( 'pro' ) ) { _e('id="select-all"'); }} ?> class="button button-secondary"<?php echo wcbloat_is_pro_readonly();?>><?php esc_attr_e('Select / Deselect All', 'disable-dashboard-for-woocommerce'); ?></a> 177 195 </div> 178 196 <table id="wcbloat-multi-checkbox-table"> 179 197 <tbody> 180 198 <tr> 181 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php 182 if ( !empty($options) ) { 183 if ( in_array( 'site_health', $options ) ) { 184 esc_attr_e( 'checked' ); 185 } 186 } 187 echo wcbloat_is_pro_readonly() ; 188 ?> value='site_health'><?php 189 esc_attr_e( 'Site Health Status', 'disable-dashboard-for-woocommerce' ); 190 ?></td> 191 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php 192 if ( !empty($options) ) { 193 if ( in_array( 'at_a_glance', $options ) ) { 194 esc_attr_e( 'checked' ); 195 } 196 } 197 echo wcbloat_is_pro_readonly() ; 198 ?> value='at_a_glance'><?php 199 esc_attr_e( 'At a Glance', 'disable-dashboard-for-woocommerce' ); 200 ?></td> 199 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php if (!empty($options)) { if (in_array('site_health', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='site_health'><?php esc_attr_e('Site Health Status', 'disable-dashboard-for-woocommerce'); ?></td> 200 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php if (!empty($options)) { if (in_array('at_a_glance', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='at_a_glance'><?php esc_attr_e('At a Glance', 'disable-dashboard-for-woocommerce'); ?></td> 201 201 </tr> 202 202 <tr> 203 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php 204 if ( !empty($options) ) { 205 if ( in_array( 'activity', $options ) ) { 206 esc_attr_e( 'checked' ); 207 } 208 } 209 echo wcbloat_is_pro_readonly() ; 210 ?> value='activity'><?php 211 esc_attr_e( 'Activity', 'disable-dashboard-for-woocommerce' ); 212 ?></td> 213 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php 214 if ( !empty($options) ) { 215 if ( in_array( 'draft', $options ) ) { 216 esc_attr_e( 'checked' ); 217 } 218 } 219 echo wcbloat_is_pro_readonly() ; 220 ?> value='draft'><?php 221 esc_attr_e( 'Quick Draft', 'disable-dashboard-for-woocommerce' ); 222 ?></td> 203 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php if (!empty($options)) { if (in_array('activity', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='activity'><?php esc_attr_e('Activity', 'disable-dashboard-for-woocommerce'); ?></td> 204 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php if (!empty($options)) { if (in_array('draft', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='draft'><?php esc_attr_e('Quick Draft', 'disable-dashboard-for-woocommerce'); ?></td> 223 205 </tr> 224 206 <tr> 225 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php 226 if ( !empty($options) ) { 227 if ( in_array( 'news', $options ) ) { 228 esc_attr_e( 'checked' ); 229 } 230 } 231 echo wcbloat_is_pro_readonly() ; 232 ?> value='news'><?php 233 esc_attr_e( 'WordPress Events and News', 'disable-dashboard-for-woocommerce' ); 234 ?></td> 235 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php 236 if ( !empty($options) ) { 237 if ( in_array( 'welcome', $options ) ) { 238 esc_attr_e( 'checked' ); 239 } 240 } 241 echo wcbloat_is_pro_readonly() ; 242 ?> value='welcome'><?php 243 esc_attr_e( 'Welcome panel', 'disable-dashboard-for-woocommerce' ); 244 ?></td> 207 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php if (!empty($options)) { if (in_array('news', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='news'><?php esc_attr_e('WordPress Events and News', 'disable-dashboard-for-woocommerce'); ?></td> 208 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php if (!empty($options)) { if (in_array('welcome', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='welcome'><?php esc_attr_e('Welcome panel', 'disable-dashboard-for-woocommerce'); ?></td> 245 209 </tr> 246 210 </tbody> 247 211 </table> 248 <p><?php 249 echo wcbloat_is_pro_badge() ; 250 _e( 'WordPress by default comes with a lot of Dashboard widgets installed. They often are not used at all, but can add backend load and front-end load. Choose which of the WordPress Dashboard Widgets should be disabled. The <strong>ones you choose will be disabled</strong>, and the <strong>ones that had not been selected</strong> will stay <strong>active</strong>.', 'disable-dashboard-for-woocommerce' ); 251 ?></p> 252 253 <?php 212 <p><?php echo wcbloat_is_pro_badge(); _e('WordPress by default comes with a lot of Dashboard widgets installed. They often are not used at all, but can add backend load and front-end load. Choose which of the WordPress Dashboard Widgets should be disabled. The <strong>ones you choose will be disabled</strong>, and the <strong>ones that had not been selected</strong> will stay <strong>active</strong>.', 'disable-dashboard-for-woocommerce'); ?></p> 213 214 <?php 254 215 } 255 216 … … 257 218 function wcbloat_w_logo_disable_callback() 258 219 { 259 $value = get_option( 'wcbloat_w_logo_disable');260 ?>220 $value = get_option('wcbloat_w_logo_disable'); 221 ?> 261 222 <input type='hidden' name='wcbloat_w_logo_disable' value='no'> 262 <label><input type='checkbox' name='wcbloat_w_logo_disable' <?php 263 checked( esc_attr( $value ), 'yes' ); 264 echo wcbloat_is_pro_readonly() ; 265 ?> value='yes'> <?php 266 esc_attr_e( 'Remove the WordPress logo (“W”) from the admin bar', 'disable-dashboard-for-woocommerce' ); 267 echo wcbloat_is_pro_badge() ; 268 ?></label> 269 <p><?php 270 _e( 'This option will hide the WordPress logo in the upper left corner. The logo won\'t be visible in your admin panel and in your site (on the admin bar visible on the front-end after logging in.', 'disable-dashboard-for-woocommerce' ); 271 ?></p> 272 <?php 223 <label><input type='checkbox' name='wcbloat_w_logo_disable' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove the WordPress logo (“W”) from the admin bar', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 224 <p><?php _e('This option will hide the WordPress logo in the upper left corner. The logo won\'t be visible in your admin panel and in your site (on the admin bar visible on the front-end after logging in.', 'disable-dashboard-for-woocommerce'); ?></p> 225 <?php 273 226 } 274 227 … … 276 229 function wcbloat_wp_footer_disable_callback() 277 230 { 278 $value = get_option( 'wcbloat_wp_footer_disable');279 ?>231 $value = get_option('wcbloat_wp_footer_disable'); 232 ?> 280 233 <input type='hidden' name='wcbloat_wp_footer_disable' value='no'> 281 <label><input type='checkbox' name='wcbloat_wp_footer_disable' <?php 282 checked( esc_attr( $value ), 'yes' ); 283 echo wcbloat_is_pro_readonly() ; 284 ?> value='yes'> <?php 285 esc_attr_e( 'Remove admin footer text', 'disable-dashboard-for-woocommerce' ); 286 echo wcbloat_is_pro_badge() ; 287 ?></label> 288 <p><?php 289 _e( 'This option hides the text at the bottom of the WordPress admin: <code>Thank you for creating with WordPress</code> on the bottom left, and the WordPress version on the bottom right.', 'disable-dashboard-for-woocommerce' ); 290 ?></p> 291 <?php 234 <label><input type='checkbox' name='wcbloat_wp_footer_disable' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove admin footer text', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 235 <p><?php _e('This option hides the text at the bottom of the WordPress admin: <code>Thank you for creating with WordPress</code> on the bottom left, and the WordPress version on the bottom right.', 'disable-dashboard-for-woocommerce'); ?></p> 236 <?php 292 237 } 293 238 … … 295 240 function wcbloat_admin_wp_login_page_section_callback() 296 241 { 297 _e( 'There are situations when you may prefer to hide or change the standard WordPress branding on the Login Page.', 'disable-dashboard-for-woocommerce');242 _e('There are situations when you may prefer to hide or change the standard WordPress branding on the Login Page.', 'disable-dashboard-for-woocommerce'); 298 243 } 299 244 … … 301 246 function wcbloat_hide_wp_logo_on_login_page_callback() 302 247 { 303 $value = get_option( 'wcbloat_hide_wp_logo_on_login_page');304 ?>248 $value = get_option('wcbloat_hide_wp_logo_on_login_page'); 249 ?> 305 250 <input type='hidden' name='wcbloat_hide_wp_logo_on_login_page' value='no'> 306 <label><input type='checkbox' name='wcbloat_hide_wp_logo_on_login_page' <?php 307 checked( esc_attr( $value ), 'yes' ); 308 echo wcbloat_is_pro_readonly() ; 309 ?> value='yes'> <?php 310 esc_attr_e( 'Hide WordPress logo on the WordPress Login Page', 'disable-dashboard-for-woocommerce' ); 311 echo wcbloat_is_pro_badge() ; 312 ?></label> 313 <p><?php 314 _e( 'Hide standard WordPress Logo from Login Page', 'disable-dashboard-for-woocommerce' ); 315 ?></p> 316 <?php 251 <label><input type='checkbox' name='wcbloat_hide_wp_logo_on_login_page' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Hide WordPress logo on the WordPress Login Page', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 252 <p><?php _e('Hide standard WordPress Logo from Login Page', 'disable-dashboard-for-woocommerce'); ?></p> 253 <?php 317 254 } 318 255 … … 320 257 function wcbloat_wp_logo_url_disable_callback() 321 258 { 322 $value = get_option( 'wcbloat_wp_logo_url_disable');323 ?>259 $value = get_option('wcbloat_wp_logo_url_disable'); 260 ?> 324 261 <input type='hidden' name='wcbloat_wp_logo_url_disable' value='no'> 325 <label><input type='checkbox' name='wcbloat_wp_logo_url_disable' <?php 326 checked( esc_attr( $value ), 'yes' ); 327 echo wcbloat_is_pro_readonly() ; 328 ?> value='yes'> <?php 329 esc_attr_e( 'Change the Logo Link on the WordPress Login Page', 'disable-dashboard-for-woocommerce' ); 330 echo wcbloat_is_pro_badge() ; 331 ?></label> 332 <p><?php 333 _e( 'By default, the WordPress login page displays the WordPress logo which is linking to WordPress.org site. After activating this option, the logo on the login page will be linking to your site\'s homepage.', 'disable-dashboard-for-woocommerce' ); 334 ?></p> 335 <?php 262 <label><input type='checkbox' name='wcbloat_wp_logo_url_disable' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Change the Logo Link on the WordPress Login Page', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 263 <p><?php _e('By default, the WordPress login page displays the WordPress logo which is linking to WordPress.org site. After activating this option, the logo on the login page will be linking to your site\'s homepage.', 'disable-dashboard-for-woocommerce'); ?></p> 264 <?php 336 265 } 337 266 … … 339 268 function wcbloat_wp_logo_title_callback() 340 269 { 341 $value = get_option( 'wcbloat_wp_logo_title');342 ?>270 $value = get_option('wcbloat_wp_logo_title'); 271 ?> 343 272 <input type='hidden' name='wcbloat_wp_logo_title' value='no'> 344 <label><input type='checkbox' name='wcbloat_wp_logo_title' <?php 345 checked( esc_attr( $value ), 'yes' ); 346 echo wcbloat_is_pro_readonly() ; 347 ?> value='yes'> <?php 348 esc_attr_e( 'Change the Logo title parameter on the WordPress Login Page', 'disable-dashboard-for-woocommerce' ); 349 echo wcbloat_is_pro_badge() ; 350 ?></label> 351 <p><?php 352 _e( 'By default, the WordPress Logo displayed on the WordPress Login Page has a title parameter that says <code>Powered by WordPress</code>. After activating this option, it will match your Site Name.', 'disable-dashboard-for-woocommerce' ); 353 ?></p> 354 <?php 273 <label><input type='checkbox' name='wcbloat_wp_logo_title' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Change the Logo title parameter on the WordPress Login Page', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 274 <p><?php _e('By default, the WordPress Logo displayed on the WordPress Login Page has a title parameter that says <code>Powered by WordPress</code>. After activating this option, it will match your Site Name.', 'disable-dashboard-for-woocommerce'); ?></p> 275 <?php 355 276 } 356 277 … … 358 279 function wcbloat_wp_language_select_disable_callback() 359 280 { 360 $value = get_option( 'wcbloat_wp_language_select_disable');361 ?>281 $value = get_option('wcbloat_wp_language_select_disable'); 282 ?> 362 283 <input type='hidden' name='wcbloat_wp_language_select_disable' value='no'> 363 <label><input type='checkbox' name='wcbloat_wp_language_select_disable' <?php 364 checked( esc_attr( $value ), 'yes' ); 365 echo wcbloat_is_pro_readonly() ; 366 ?> value='yes'> <?php 367 esc_attr_e( 'Disable WordPress Login Language Switcher', 'disable-dashboard-for-woocommerce' ); 368 echo wcbloat_is_pro_badge() ; 369 ?></label> 370 <p><?php 371 _e( 'This option will disable the language selector which allows users to switch languages from a dropdown on the login screen if more than one language is enabled on your WordPress installation.', 'disable-dashboard-for-woocommerce' ); 372 ?></p> 373 <?php 374 } 284 <label><input type='checkbox' name='wcbloat_wp_language_select_disable' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Disable WordPress Login Language Switcher', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 285 <p><?php _e('This option will disable the language selector which allows users to switch languages from a dropdown on the login screen if more than one language is enabled on your WordPress installation.', 'disable-dashboard-for-woocommerce'); ?></p> 286 <?php 287 } -
disable-dashboard-for-woocommerce/tags/3.2.7/includes/settings/class-disable-bloat-settings-performance.php
r2873201 r2930475 1 1 <?php 2 2 3 if ( !defined( 'ABSPATH' ) ) { 4 exit; 5 } 6 // Exit if accessed directly 3 if (!defined('ABSPATH')) exit; // Exit if accessed directly 4 7 5 // Add sections and fields on Main settings screen 8 6 function wcbloat_performance_settings_init() 9 7 { 10 // Section's icon 11 add_settings_section( 12 'wcbloat-performance-icon-section', 13 '', 14 'wcbloat_performance_icon_callback', 15 'wcbloat-performance' 16 ); 17 // Section's title and description 18 add_settings_section( 19 'wcbloat-site-performance-desc-section', 20 esc_attr__( 'Site performance', 'disable-dashboard-for-woocommerce' ), 21 'wcbloat_site_performance_desc_callback', 22 'wcbloat-performance' 23 ); 24 // Speed up your site section 25 add_settings_section( 26 'wcbloat-performance-speed-section', 27 esc_attr__( 'Speed up your site', 'disable-dashboard-for-woocommerce' ), 28 'wcbloat_performance_speed_section_callback', 29 'wcbloat-performance' 30 ); 31 // Disable Password Strength Meter 32 add_settings_field( 33 'wcbloat_password_meter_disable', 34 'Password Strength Meter', 35 'wcbloat_password_meter_disable_callback', 36 'wcbloat-performance', 37 'wcbloat-performance-speed-section' 38 ); 39 register_setting( 'wcbloat-performance-options', 'wcbloat_password_meter_disable', array( 40 'sanitize_callback' => 'sanitize_key', 41 ) ); 42 // Load comment script only when needed 43 add_settings_field( 44 'wcbloat_load_comment_scripts_when_needed', 45 'Comments scripts', 46 'wcbloat_load_comment_scripts_when_needed_callback', 47 'wcbloat-performance', 48 'wcbloat-performance-speed-section' 49 ); 50 register_setting( 'wcbloat-performance-options', 'wcbloat_load_comment_scripts_when_needed', array( 51 'sanitize_callback' => 'sanitize_key', 52 ) ); 53 // Prevent auto-linking URLs in comments 54 add_settings_field( 55 'wcbloat_prevent_linking_url_comments', 56 'Auto-linking URLs in comments', 57 'wcbloat_prevent_linking_url_comments_callback', 58 'wcbloat-performance', 59 'wcbloat-performance-speed-section' 60 ); 61 register_setting( 'wcbloat-performance-options', 'wcbloat_prevent_linking_url_comments', array( 62 'sanitize_callback' => 'sanitize_key', 63 ) ); 64 // Disable Dashicons 65 add_settings_field( 66 'wcbloat_disable_dashicons', 67 'Disable Dashicons', 68 'wcbloat_disable_dashicons_callback', 69 'wcbloat-performance', 70 'wcbloat-performance-speed-section' 71 ); 72 register_setting( 'wcbloat-performance-options', 'wcbloat_disable_dashicons', array( 73 'sanitize_callback' => 'sanitize_key', 74 ) ); 75 // Remove DNS prefetch to s.w.org PRO 76 add_settings_field( 77 'wcbloat_remove_dns_prefetch', 78 'DNS prefetch to s.w.org', 79 'wcbloat_remove_dns_prefetch_callback', 80 'wcbloat-performance', 81 'wcbloat-performance-speed-section' 82 ); 83 register_setting( 'wcbloat-performance-options', 'wcbloat_remove_dns_prefetch', array( 84 'sanitize_callback' => 'sanitize_key', 85 ) ); 86 // Disable jQuery Migrate PRO 87 add_settings_field( 88 'wcbloat_disable_jquery_migrate', 89 'Disable jQuery Migrate', 90 'wcbloat_disable_jquery_migrate_callback', 91 'wcbloat-performance', 92 'wcbloat-performance-speed-section' 93 ); 94 register_setting( 'wcbloat-performance-options', 'wcbloat_disable_jquery_migrate', array( 95 'sanitize_callback' => 'sanitize_key', 96 ) ); 97 // Disable Sidebar WordPress Widgets PRO 98 add_settings_field( 99 'wcbloat_wp_sidebar_widgets_disable', 100 esc_attr__( 'Disable Sidebar WordPress Widgets', 'disable-dashboard-for-woocommerce' ), 101 'wcbloat_wp_sidebar_widgets_disable_callback', 102 'wcbloat-performance', 103 'wcbloat-performance-speed-section' 104 ); 105 register_setting( 'wcbloat-performance-options', 'wcbloat_wp_sidebar_widgets_disable', 'validate_setting' ); 106 // Remove WordPress Meta Generator Tag PRO 107 add_settings_field( 108 'wcbloat_wp_meta_generator_disable', 109 'WordPress & WooCommerce Meta Generator Tag', 110 'wcbloat_wp_meta_generator_disable_callback', 111 'wcbloat-performance', 112 'wcbloat-performance-speed-section' 113 ); 114 register_setting( 'wcbloat-performance-options', 'wcbloat_wp_meta_generator_disable', array( 115 'sanitize_callback' => 'sanitize_key', 116 ) ); 117 // Remove emoji styles and scripts PRO 118 add_settings_field( 119 'wcbloat_remove_emoji_scripts', 120 'Emoji styles and scripts', 121 'wcbloat_remove_emoji_scripts_callback', 122 'wcbloat-performance', 123 'wcbloat-performance-speed-section' 124 ); 125 register_setting( 'wcbloat-performance-options', 'wcbloat_remove_emoji_scripts', array( 126 'sanitize_callback' => 'sanitize_key', 127 ) ); 128 // Disable wp-embed PRO 129 add_settings_field( 130 'wcbloat_disable_wp_embed', 131 'Disable wp-embed', 132 'wcbloat_disable_wp_embed_callback', 133 'wcbloat-performance', 134 'wcbloat-performance-speed-section' 135 ); 136 register_setting( 'wcbloat-performance-options', 'wcbloat_disable_wp_embed', array( 137 'sanitize_callback' => 'sanitize_key', 138 ) ); 139 // Remove unwanted scripts from header section 140 add_settings_section( 141 'wcbloat-site-performance-header-section', 142 esc_attr__( 'Remove scripts from Header', 'disable-dashboard-for-woocommerce' ), 143 'wcbloat_site_performance_header_section_callback', 144 'wcbloat-performance' 145 ); 146 // Remove RSS Feed Links PRO 147 add_settings_field( 148 'wcbloat_remove_rss_links', 149 'RSS Feed Links', 150 'wcbloat_remove_rss_links_callback', 151 'wcbloat-performance', 152 'wcbloat-site-performance-header-section' 153 ); 154 register_setting( 'wcbloat-performance-options', 'wcbloat_remove_rss_links', array( 155 'sanitize_callback' => 'sanitize_key', 156 ) ); 157 // Disable the RSS feeds PRO 158 add_settings_field( 159 'wcbloat_disable_all_feeds', 160 'RSS feeds', 161 'wcbloat_disable_all_feeds_callback', 162 'wcbloat-performance', 163 'wcbloat-site-performance-header-section' 164 ); 165 register_setting( 'wcbloat-performance-options', 'wcbloat_disable_all_feeds', array( 166 'sanitize_callback' => 'sanitize_key', 167 ) ); 168 // Remove Feed Generator Tag PRO 169 add_settings_field( 170 'wcbloat_remove_feed_generator_tag', 171 'Feed Generator Tag', 172 'wcbloat_remove_feed_generator_tag_callback', 173 'wcbloat-performance', 174 'wcbloat-site-performance-header-section' 175 ); 176 register_setting( 'wcbloat-performance-options', 'wcbloat_remove_feed_generator_tag', array( 177 'sanitize_callback' => 'sanitize_key', 178 ) ); 179 // Remove Link to the WLW Manifest File PRO 180 add_settings_field( 181 'wcbloat_disable_wlw_link', 182 'Windows Live Writer', 183 'wcbloat_disable_wlw_link_callback', 184 'wcbloat-performance', 185 'wcbloat-site-performance-header-section' 186 ); 187 register_setting( 'wcbloat-performance-options', 'wcbloat_disable_wlw_link', array( 188 'sanitize_callback' => 'sanitize_key', 189 ) ); 190 // Remove RSD link PRO 191 add_settings_field( 192 'wcbloat_disable_rsd_link', 193 'RSD Link', 194 'wcbloat_disable_rsd_link_callback', 195 'wcbloat-performance', 196 'wcbloat-site-performance-header-section' 197 ); 198 register_setting( 'wcbloat-performance-options', 'wcbloat_disable_rsd_link', array( 199 'sanitize_callback' => 'sanitize_key', 200 ) ); 201 // Remove RSD link PRO 202 add_settings_field( 203 'wcbloat_disable_rsd_link', 204 'RSD Link', 205 'wcbloat_disable_rsd_link_callback', 206 'wcbloat-performance', 207 'wcbloat-site-performance-header-section' 208 ); 209 register_setting( 'wcbloat-performance-options', 'wcbloat_disable_rsd_link', array( 210 'sanitize_callback' => 'sanitize_key', 211 ) ); 212 // Remove Shortlink From HTTP Header PRO 213 add_settings_field( 214 'wcbloat_remove_shortlink', 215 'Shortlink', 216 'wcbloat_remove_shortlink_callback', 217 'wcbloat-performance', 218 'wcbloat-site-performance-header-section' 219 ); 220 register_setting( 'wcbloat-performance-options', 'wcbloat_remove_shortlink', array( 221 'sanitize_callback' => 'sanitize_key', 222 ) ); 8 9 // Section's icon 10 add_settings_section( 11 'wcbloat-performance-icon-section', 12 '', 13 'wcbloat_performance_icon_callback', 14 'wcbloat-performance' 15 ); 16 17 // Section's title and description 18 add_settings_section( 19 'wcbloat-site-performance-desc-section', 20 esc_attr__('Site performance', 'disable-dashboard-for-woocommerce'), 21 'wcbloat_site_performance_desc_callback', 22 'wcbloat-performance' 23 ); 24 25 // Speed up your site section 26 add_settings_section( 27 'wcbloat-performance-speed-section', 28 esc_attr__('Speed up your site', 'disable-dashboard-for-woocommerce'), 29 'wcbloat_performance_speed_section_callback', 30 'wcbloat-performance' 31 ); 32 33 // Disable Password Strength Meter 34 add_settings_field( 35 'wcbloat_password_meter_disable', 36 'Password Strength Meter', 37 'wcbloat_password_meter_disable_callback', 38 'wcbloat-performance', 39 'wcbloat-performance-speed-section' 40 ); 41 register_setting( 42 'wcbloat-performance-options', 43 'wcbloat_password_meter_disable', 44 array('sanitize_callback' => 'sanitize_key') 45 ); 46 47 // Load comment script only when needed 48 add_settings_field( 49 'wcbloat_load_comment_scripts_when_needed', 50 'Comments scripts', 51 'wcbloat_load_comment_scripts_when_needed_callback', 52 'wcbloat-performance', 53 'wcbloat-performance-speed-section' 54 ); 55 register_setting( 56 'wcbloat-performance-options', 57 'wcbloat_load_comment_scripts_when_needed', 58 array('sanitize_callback' => 'sanitize_key') 59 ); 60 61 // Prevent auto-linking URLs in comments 62 add_settings_field( 63 'wcbloat_prevent_linking_url_comments', 64 'Auto-linking URLs in comments', 65 'wcbloat_prevent_linking_url_comments_callback', 66 'wcbloat-performance', 67 'wcbloat-performance-speed-section' 68 ); 69 register_setting( 70 'wcbloat-performance-options', 71 'wcbloat_prevent_linking_url_comments', 72 array('sanitize_callback' => 'sanitize_key') 73 ); 74 75 // Disable Dashicons 76 add_settings_field( 77 'wcbloat_disable_dashicons', 78 'Disable Dashicons', 79 'wcbloat_disable_dashicons_callback', 80 'wcbloat-performance', 81 'wcbloat-performance-speed-section' 82 ); 83 register_setting( 84 'wcbloat-performance-options', 85 'wcbloat_disable_dashicons', 86 array('sanitize_callback' => 'sanitize_key') 87 ); 88 89 // Remove DNS prefetch to s.w.org PRO 90 add_settings_field( 91 'wcbloat_remove_dns_prefetch', 92 'DNS prefetch to s.w.org', 93 'wcbloat_remove_dns_prefetch_callback', 94 'wcbloat-performance', 95 'wcbloat-performance-speed-section' 96 ); 97 register_setting( 98 'wcbloat-performance-options', 99 'wcbloat_remove_dns_prefetch', 100 array('sanitize_callback' => 'sanitize_key') 101 ); 102 103 // Disable jQuery Migrate PRO 104 add_settings_field( 105 'wcbloat_disable_jquery_migrate', 106 'Disable jQuery Migrate', 107 'wcbloat_disable_jquery_migrate_callback', 108 'wcbloat-performance', 109 'wcbloat-performance-speed-section' 110 ); 111 register_setting( 112 'wcbloat-performance-options', 113 'wcbloat_disable_jquery_migrate', 114 array('sanitize_callback' => 'sanitize_key') 115 ); 116 117 // Disable Sidebar WordPress Widgets PRO 118 add_settings_field( 119 'wcbloat_wp_sidebar_widgets_disable', 120 esc_attr__( 'Disable Sidebar WordPress Widgets', 'disable-dashboard-for-woocommerce' ), 121 'wcbloat_wp_sidebar_widgets_disable_callback', 122 'wcbloat-performance', 123 'wcbloat-performance-speed-section' ); 124 register_setting( 125 'wcbloat-performance-options', 126 'wcbloat_wp_sidebar_widgets_disable', 127 'validate_setting' 128 ); 129 130 // Remove WordPress Meta Generator Tag PRO 131 add_settings_field( 132 'wcbloat_wp_meta_generator_disable', 133 'WordPress & WooCommerce Meta Generator Tag', 134 'wcbloat_wp_meta_generator_disable_callback', 135 'wcbloat-performance', 136 'wcbloat-performance-speed-section' 137 ); 138 register_setting( 139 'wcbloat-performance-options', 140 'wcbloat_wp_meta_generator_disable', 141 array('sanitize_callback' => 'sanitize_key') 142 ); 143 144 // Remove emoji styles and scripts PRO 145 add_settings_field( 146 'wcbloat_remove_emoji_scripts', 147 'Emoji styles and scripts', 148 'wcbloat_remove_emoji_scripts_callback', 149 'wcbloat-performance', 150 'wcbloat-performance-speed-section' 151 ); 152 register_setting( 153 'wcbloat-performance-options', 154 'wcbloat_remove_emoji_scripts', 155 array('sanitize_callback' => 'sanitize_key') 156 ); 157 158 // Disable wp-embed PRO 159 add_settings_field( 160 'wcbloat_disable_wp_embed', 161 'Disable wp-embed', 162 'wcbloat_disable_wp_embed_callback', 163 'wcbloat-performance', 164 'wcbloat-performance-speed-section' 165 ); 166 register_setting( 167 'wcbloat-performance-options', 168 'wcbloat_disable_wp_embed', 169 array('sanitize_callback' => 'sanitize_key') 170 ); 171 172 // Remove unwanted scripts from header section 173 add_settings_section( 174 'wcbloat-site-performance-header-section', 175 esc_attr__('Remove scripts from Header', 'disable-dashboard-for-woocommerce'), 176 'wcbloat_site_performance_header_section_callback', 177 'wcbloat-performance' 178 ); 179 180 // Remove RSS Feed Links PRO 181 add_settings_field( 182 'wcbloat_remove_rss_links', 183 'RSS Feed Links', 184 'wcbloat_remove_rss_links_callback', 185 'wcbloat-performance', 186 'wcbloat-site-performance-header-section' 187 ); 188 register_setting( 189 'wcbloat-performance-options', 190 'wcbloat_remove_rss_links', 191 array('sanitize_callback' => 'sanitize_key') 192 ); 193 194 // Disable the RSS feeds PRO 195 add_settings_field( 196 'wcbloat_disable_all_feeds', 197 'RSS feeds', 198 'wcbloat_disable_all_feeds_callback', 199 'wcbloat-performance', 200 'wcbloat-site-performance-header-section' 201 ); 202 register_setting( 203 'wcbloat-performance-options', 204 'wcbloat_disable_all_feeds', 205 array('sanitize_callback' => 'sanitize_key') 206 ); 207 208 // Remove Feed Generator Tag PRO 209 add_settings_field( 210 'wcbloat_remove_feed_generator_tag', 211 'Feed Generator Tag', 212 'wcbloat_remove_feed_generator_tag_callback', 213 'wcbloat-performance', 214 'wcbloat-site-performance-header-section' 215 ); 216 register_setting( 217 'wcbloat-performance-options', 218 'wcbloat_remove_feed_generator_tag', 219 array('sanitize_callback' => 'sanitize_key') 220 ); 221 222 // Remove Link to the WLW Manifest File PRO 223 add_settings_field( 224 'wcbloat_disable_wlw_link', 225 'Windows Live Writer', 226 'wcbloat_disable_wlw_link_callback', 227 'wcbloat-performance', 228 'wcbloat-site-performance-header-section' 229 ); 230 register_setting( 231 'wcbloat-performance-options', 232 'wcbloat_disable_wlw_link', 233 array('sanitize_callback' => 'sanitize_key') 234 ); 235 236 // Remove RSD link PRO 237 add_settings_field( 238 'wcbloat_disable_rsd_link', 239 'RSD Link', 240 'wcbloat_disable_rsd_link_callback', 241 'wcbloat-performance', 242 'wcbloat-site-performance-header-section' 243 ); 244 register_setting( 245 'wcbloat-performance-options', 246 'wcbloat_disable_rsd_link', 247 array('sanitize_callback' => 'sanitize_key') 248 ); 249 250 // Remove RSD link PRO 251 add_settings_field( 252 'wcbloat_disable_rsd_link', 253 'RSD Link', 254 'wcbloat_disable_rsd_link_callback', 255 'wcbloat-performance', 256 'wcbloat-site-performance-header-section' 257 ); 258 register_setting( 259 'wcbloat-performance-options', 260 'wcbloat_disable_rsd_link', 261 array('sanitize_callback' => 'sanitize_key') 262 ); 263 264 // Remove Shortlink From HTTP Header PRO 265 add_settings_field( 266 'wcbloat_remove_shortlink', 267 'Shortlink', 268 'wcbloat_remove_shortlink_callback', 269 'wcbloat-performance', 270 'wcbloat-site-performance-header-section' 271 ); 272 register_setting( 273 'wcbloat-performance-options', 274 'wcbloat_remove_shortlink', 275 array('sanitize_callback' => 'sanitize_key') 276 ); 277 223 278 } 224 279 225 280 // Display the fields added before 226 add_action( 'admin_init', 'wcbloat_performance_settings_init' ); 281 add_action('admin_init', 'wcbloat_performance_settings_init'); 282 227 283 // Fields callbacks 284 228 285 // Section's icon 229 286 function wcbloat_performance_icon_callback() 230 287 { 231 _e( '<span class="dashicons dashicons-admin-site-alt"></span>');288 _e('<span class="dashicons dashicons-admin-site-alt"></span>'); 232 289 } 233 290 … … 235 292 function wcbloat_site_performance_desc_callback() 236 293 { 237 _e( 'Page load time is very important for your visitors. To improve page load time, try to disable scripts, features, and unnecessary queries:<hr />', 'disable-dashboard-for-woocommerce');294 _e('Page load time is very important for your visitors. To improve page load time, try to disable scripts, features, and unnecessary queries:<hr />', 'disable-dashboard-for-woocommerce'); 238 295 } 239 296 … … 241 298 function wcbloat_performance_speed_section_callback() 242 299 { 243 _e( 'Use the settings from this section to reduce page load time on the front-end of your WordPress site. Before disabling them, please make sure that you will not use any of these features - so they can be safely turned off.', 'disable-dashboard-for-woocommerce');244 _e( wcbloat_buy_pro_bar() );300 _e('Use the settings from this section to reduce page load time on the front-end of your WordPress site. Before disabling them, please make sure that you will not use any of these features - so they can be safely turned off.', 'disable-dashboard-for-woocommerce'); 301 _e ( wcbloat_buy_pro_bar() ); 245 302 } 246 303 … … 248 305 function wcbloat_password_meter_disable_callback() 249 306 { 250 $value = get_option( 'wcbloat_password_meter_disable');251 ?>307 $value = get_option('wcbloat_password_meter_disable'); 308 ?> 252 309 <input type='hidden' name='wcbloat_password_meter_disable' value='no'> 253 <label><input type='checkbox' name='wcbloat_password_meter_disable' <?php 254 checked( esc_attr( $value ), 'yes' ); 255 ?> value='yes'> <?php 256 esc_attr_e( 'Disable Password Strength Meter', 'disable-dashboard-for-woocommerce' ); 257 ?></label> 258 <p><?php 259 _e( 'Removes the WordPress and WooCommerce password strength meter scripts (over 400 KB) from non-essential pages.', 'disable-dashboard-for-woocommerce' ); 260 ?></p> 261 <?php 310 <label><input type='checkbox' name='wcbloat_password_meter_disable' <?php checked(esc_attr($value), 'yes'); ?> value='yes'> <?php esc_attr_e('Disable Password Strength Meter', 'disable-dashboard-for-woocommerce'); ?></label> 311 <p><?php _e('Removes the WordPress and WooCommerce password strength meter scripts (over 400 KB) from non-essential pages.', 'disable-dashboard-for-woocommerce'); ?></p> 312 <?php 262 313 } 263 314 … … 265 316 function wcbloat_load_comment_scripts_when_needed_callback() 266 317 { 267 $value = get_option( 'wcbloat_load_comment_scripts_when_needed');268 ?>318 $value = get_option('wcbloat_load_comment_scripts_when_needed'); 319 ?> 269 320 <input type='hidden' name='wcbloat_load_comment_scripts_when_needed' value='no'> 270 <label><input type='checkbox' name='wcbloat_load_comment_scripts_when_needed' <?php 271 checked( esc_attr( $value ), 'yes' ); 272 ?> value='yes'> <?php 273 esc_attr_e( 'Load Comments script only when needed', 'disable-dashboard-for-woocommerce' ); 274 ?></label> 275 <p><?php 276 _e( 'By default, WordPress Comments javascript files are loaded everywhere on your site. This option will load the Comments script only when needed (on single posts and pages with existing comments).', 'disable-dashboard-for-woocommerce' ); 277 ?></p> 278 <?php 321 <label><input type='checkbox' name='wcbloat_load_comment_scripts_when_needed' <?php checked(esc_attr($value), 'yes'); ?> value='yes'> <?php esc_attr_e('Load Comments script only when needed', 'disable-dashboard-for-woocommerce'); ?></label> 322 <p><?php _e('By default, WordPress Comments javascript files are loaded everywhere on your site. This option will load the Comments script only when needed (on single posts and pages with existing comments).', 'disable-dashboard-for-woocommerce'); ?></p> 323 <?php 279 324 } 280 325 … … 282 327 function wcbloat_prevent_linking_url_comments_callback() 283 328 { 284 $value = get_option( 'wcbloat_prevent_linking_url_comments');285 ?>329 $value = get_option('wcbloat_prevent_linking_url_comments'); 330 ?> 286 331 <input type='hidden' name='wcbloat_prevent_linking_url_comments' value='no'> 287 <label><input type='checkbox' name='wcbloat_prevent_linking_url_comments' <?php 288 checked( esc_attr( $value ), 'yes' ); 289 ?> value='yes'> <?php 290 esc_attr_e( 'Prevent auto-linking URLs in comments', 'disable-dashboard-for-woocommerce' ); 291 ?></label> 292 <p><?php 293 _e( 'In a standard WordPress installation, adding clickable links to the comments is made on the fly while generating the page which may be time- and resource-consuming. This option will prevent auto-linking URLs in comments.', 'disable-dashboard-for-woocommerce' ); 294 ?></p> 295 <?php 332 <label><input type='checkbox' name='wcbloat_prevent_linking_url_comments' <?php checked(esc_attr($value), 'yes'); ?> value='yes'> <?php esc_attr_e('Prevent auto-linking URLs in comments', 'disable-dashboard-for-woocommerce'); ?></label> 333 <p><?php _e('In a standard WordPress installation, adding clickable links to the comments is made on the fly while generating the page which may be time- and resource-consuming. This option will prevent auto-linking URLs in comments.', 'disable-dashboard-for-woocommerce'); ?></p> 334 <?php 296 335 } 297 336 … … 299 338 function wcbloat_disable_dashicons_callback() 300 339 { 301 $value = get_option( 'wcbloat_disable_dashicons');302 ?>340 $value = get_option('wcbloat_disable_dashicons'); 341 ?> 303 342 <input type='hidden' name='wcbloat_disable_dashicons' value='no'> 304 <label><input type='checkbox' name='wcbloat_disable_dashicons' <?php 305 checked( esc_attr( $value ), 'yes' ); 306 ?> value='yes'> <?php 307 esc_attr_e( 'Disable WordPress Dashicons on the front-end', 'disable-dashboard-for-woocommerce' ); 308 ?></label> 309 <p><?php 310 _e( 'Dashicons add additional overhead to your site, slowing it down, especially on slower computers or mobile devices. Disabling dashicons can help reduce the total size of your page and improve your site\'s performance.', 'disable-dashboard-for-woocommerce' ); 311 ?></p> 312 <?php 343 <label><input type='checkbox' name='wcbloat_disable_dashicons' <?php checked(esc_attr($value), 'yes'); ?> value='yes'> <?php esc_attr_e('Disable WordPress Dashicons on the front-end', 'disable-dashboard-for-woocommerce'); ?></label> 344 <p><?php _e('Dashicons add additional overhead to your site, slowing it down, especially on slower computers or mobile devices. Disabling dashicons can help reduce the total size of your page and improve your site\'s performance.', 'disable-dashboard-for-woocommerce'); ?></p> 345 <?php 313 346 } 314 347 … … 316 349 function wcbloat_disable_jquery_migrate_callback() 317 350 { 318 $value = get_option( 'wcbloat_disable_jquery_migrate');319 ?>351 $value = get_option('wcbloat_disable_jquery_migrate'); 352 ?> 320 353 <input type='hidden' name='wcbloat_disable_jquery_migrate' value='no'> 321 <label><input type='checkbox' name='wcbloat_disable_jquery_migrate' <?php 322 checked( esc_attr( $value ), 'yes' ); 323 echo wcbloat_is_pro_readonly() ; 324 ?> value='yes'> <?php 325 esc_attr_e( 'Disable jQuery Migrate', 'disable-dashboard-for-woocommerce' ); 326 echo wcbloat_is_pro_badge() ; 327 ?></label> 328 <p><?php 329 _e( 'The jQuery Migrate was introduced in WordPress to provide backward compatibility for older jQuery code. However, in recent versions of WordPress, many of the compatibility issues have been resolved, so it is no longer necessary in most cases. Disabling jQuery Migrate can improve the performance of your WordPress website by reducing the amount of JavaScript code that needs to be loaded, and by reducing the number of warnings and error messages that are output to the browser console. Additionally, by disabling the plugin, you can avoid potential security vulnerabilities that may arise from using outdated and unsupported code.', 'disable-dashboard-for-woocommerce' ); 330 ?></p> 331 <?php 354 <label><input type='checkbox' name='wcbloat_disable_jquery_migrate' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Disable jQuery Migrate', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 355 <p><?php _e('The jQuery Migrate was introduced in WordPress to provide backward compatibility for older jQuery code. However, in recent versions of WordPress, many of the compatibility issues have been resolved, so it is no longer necessary in most cases. Disabling jQuery Migrate can improve the performance of your WordPress website by reducing the amount of JavaScript code that needs to be loaded, and by reducing the number of warnings and error messages that are output to the browser console. Additionally, by disabling the plugin, you can avoid potential security vulnerabilities that may arise from using outdated and unsupported code.', 'disable-dashboard-for-woocommerce'); ?></p> 356 <?php 332 357 } 333 358 … … 335 360 function wcbloat_remove_dns_prefetch_callback() 336 361 { 337 $value = get_option( 'wcbloat_remove_dns_prefetch');338 ?>362 $value = get_option('wcbloat_remove_dns_prefetch'); 363 ?> 339 364 <input type='hidden' name='wcbloat_remove_dns_prefetch' value='no'> 340 <label><input type='checkbox' name='wcbloat_remove_dns_prefetch' <?php 341 checked( esc_attr( $value ), 'yes' ); 342 echo wcbloat_is_pro_readonly() ; 343 ?> value='yes'> <?php 344 esc_attr_e( 'Remove DNS prefetch to s.w.org', 'disable-dashboard-for-woocommerce' ); 345 echo wcbloat_is_pro_badge() ; 346 ?></label> 347 <p><?php 348 _e( 'DNS prefetching is an attempt to resolve domain names before a user tries to follow a link. Activating this option will remove DNS prefetch to s.w.org and may result in page load optimization.', 'disable-dashboard-for-woocommerce' ); 349 ?></p> 350 <?php 365 <label><input type='checkbox' name='wcbloat_remove_dns_prefetch' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove DNS prefetch to s.w.org', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 366 <p><?php _e('DNS prefetching is an attempt to resolve domain names before a user tries to follow a link. Activating this option will remove DNS prefetch to s.w.org and may result in page load optimization.', 'disable-dashboard-for-woocommerce'); ?></p> 367 <?php 351 368 } 352 369 … … 354 371 function wcbloat_wp_sidebar_widgets_disable_callback() 355 372 { 356 $options = get_option( 'wcbloat_wp_sidebar_widgets_disable' ); 357 ?>373 $options = get_option('wcbloat_wp_sidebar_widgets_disable'); 374 ?> 358 375 <div class="wcbloat-select-unselect-buttons"> 359 <a <?php 360 ?> class="button button-secondary"<?php 361 echo wcbloat_is_pro_readonly() ; 362 ?>><?php 363 esc_attr_e( 'Select / Deselect All', 'disable-dashboard-for-woocommerce' ); 364 ?></a> 376 <a <?php if ( wcbloat_fs()->is__premium_only() ) { if ( wcbloat_fs()->is_plan( 'pro' ) ) { _e('id="select-all"'); }} ?> class="button button-secondary"<?php echo wcbloat_is_pro_readonly();?>><?php esc_attr_e('Select / Deselect All', 'disable-dashboard-for-woocommerce'); ?></a> 365 377 </div> 366 378 <table id="wcbloat-multi-checkbox-table"> 367 379 <tbody> 368 380 <tr> 369 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 370 if ( !empty($options) ) { 371 if ( in_array( 'archives', $options ) ) { 372 esc_attr_e( 'checked' ); 373 } 374 } 375 echo wcbloat_is_pro_readonly() ; 376 ?> value='archives'><?php 377 esc_attr_e( 'Archives', 'disable-dashboard-for-woocommerce' ); 378 ?></td> 379 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 380 if ( !empty($options) ) { 381 if ( in_array( 'audio', $options ) ) { 382 esc_attr_e( 'checked' ); 383 } 384 } 385 echo wcbloat_is_pro_readonly() ; 386 ?> value='audio'><?php 387 esc_attr_e( 'Audio', 'disable-dashboard-for-woocommerce' ); 388 ?></td> 389 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 390 if ( !empty($options) ) { 391 if ( in_array( 'block', $options ) ) { 392 esc_attr_e( 'checked' ); 393 } 394 } 395 echo wcbloat_is_pro_readonly() ; 396 ?> value='block'><?php 397 esc_attr_e( 'Block', 'disable-dashboard-for-woocommerce' ); 398 ?></td> 381 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('archives', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='archives'><?php esc_attr_e('Archives', 'disable-dashboard-for-woocommerce'); ?></td> 382 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('audio', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='audio'><?php esc_attr_e('Audio', 'disable-dashboard-for-woocommerce'); ?></td> 383 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('block', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='block'><?php esc_attr_e('Block', 'disable-dashboard-for-woocommerce'); ?></td> 399 384 </tr> 400 385 <tr> 401 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 402 if ( !empty($options) ) { 403 if ( in_array( 'calendar', $options ) ) { 404 esc_attr_e( 'checked' ); 405 } 406 } 407 echo wcbloat_is_pro_readonly() ; 408 ?> value='calendar'><?php 409 esc_attr_e( 'Calendar', 'disable-dashboard-for-woocommerce' ); 410 ?></td> 411 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 412 if ( !empty($options) ) { 413 if ( in_array( 'categories', $options ) ) { 414 esc_attr_e( 'checked' ); 415 } 416 } 417 echo wcbloat_is_pro_readonly() ; 418 ?> value='categories'><?php 419 esc_attr_e( 'Categories', 'disable-dashboard-for-woocommerce' ); 420 ?></td> 421 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 422 if ( !empty($options) ) { 423 if ( in_array( 'html', $options ) ) { 424 esc_attr_e( 'checked' ); 425 } 426 } 427 echo wcbloat_is_pro_readonly() ; 428 ?> value='html'><?php 429 esc_attr_e( 'Custom HTML', 'disable-dashboard-for-woocommerce' ); 430 ?></td> 386 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('calendar', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='calendar'><?php esc_attr_e('Calendar', 'disable-dashboard-for-woocommerce'); ?></td> 387 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('categories', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='categories'><?php esc_attr_e('Categories', 'disable-dashboard-for-woocommerce'); ?></td> 388 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('html', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='html'><?php esc_attr_e('Custom HTML', 'disable-dashboard-for-woocommerce'); ?></td> 431 389 </tr> 432 390 <tr> 433 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 434 if ( !empty($options) ) { 435 if ( in_array( 'gallery', $options ) ) { 436 esc_attr_e( 'checked' ); 437 } 438 } 439 echo wcbloat_is_pro_readonly() ; 440 ?> value='gallery'><?php 441 esc_attr_e( 'Gallery', 'disable-dashboard-for-woocommerce' ); 442 ?></td> 443 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 444 if ( !empty($options) ) { 445 if ( in_array( 'image', $options ) ) { 446 esc_attr_e( 'checked' ); 447 } 448 } 449 echo wcbloat_is_pro_readonly() ; 450 ?> value='image'><?php 451 esc_attr_e( 'Image', 'disable-dashboard-for-woocommerce' ); 452 ?></td> 453 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 454 if ( !empty($options) ) { 455 if ( in_array( 'meta', $options ) ) { 456 esc_attr_e( 'checked' ); 457 } 458 } 459 echo wcbloat_is_pro_readonly() ; 460 ?> value='meta'><?php 461 esc_attr_e( 'Meta', 'disable-dashboard-for-woocommerce' ); 462 ?></td> 391 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('gallery', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='gallery'><?php esc_attr_e('Gallery', 'disable-dashboard-for-woocommerce'); ?></td> 392 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('image', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='image'><?php esc_attr_e('Image', 'disable-dashboard-for-woocommerce'); ?></td> 393 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('meta', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='meta'><?php esc_attr_e('Meta', 'disable-dashboard-for-woocommerce'); ?></td> 463 394 </tr> 464 395 <tr> 465 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 466 if ( !empty($options) ) { 467 if ( in_array( 'navigation', $options ) ) { 468 esc_attr_e( 'checked' ); 469 } 470 } 471 echo wcbloat_is_pro_readonly() ; 472 ?> value='navigation'><?php 473 esc_attr_e( 'Navigation Menu', 'disable-dashboard-for-woocommerce' ); 474 ?></td> 475 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 476 if ( !empty($options) ) { 477 if ( in_array( 'pages', $options ) ) { 478 esc_attr_e( 'checked' ); 479 } 480 } 481 echo wcbloat_is_pro_readonly() ; 482 ?> value='pages'><?php 483 esc_attr_e( 'Pages', 'disable-dashboard-for-woocommerce' ); 484 ?></td> 485 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 486 if ( !empty($options) ) { 487 if ( in_array( 'rss', $options ) ) { 488 esc_attr_e( 'checked' ); 489 } 490 } 491 echo wcbloat_is_pro_readonly() ; 492 ?> value='rss'><?php 493 esc_attr_e( 'RSS', 'disable-dashboard-for-woocommerce' ); 494 ?></td> 396 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('navigation', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='navigation'><?php esc_attr_e('Navigation Menu', 'disable-dashboard-for-woocommerce'); ?></td> 397 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('pages', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='pages'><?php esc_attr_e('Pages', 'disable-dashboard-for-woocommerce'); ?></td> 398 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('rss', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='rss'><?php esc_attr_e('RSS', 'disable-dashboard-for-woocommerce'); ?></td> 495 399 </tr> 496 400 <tr> 497 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 498 if ( !empty($options) ) { 499 if ( in_array( 'comments', $options ) ) { 500 esc_attr_e( 'checked' ); 501 } 502 } 503 echo wcbloat_is_pro_readonly() ; 504 ?> value='comments'><?php 505 esc_attr_e( 'Recent Comments', 'disable-dashboard-for-woocommerce' ); 506 ?></td> 507 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 508 if ( !empty($options) ) { 509 if ( in_array( 'posts', $options ) ) { 510 esc_attr_e( 'checked' ); 511 } 512 } 513 echo wcbloat_is_pro_readonly() ; 514 ?> value='posts'><?php 515 esc_attr_e( 'Recent Posts', 'disable-dashboard-for-woocommerce' ); 516 ?></td> 517 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 518 if ( !empty($options) ) { 519 if ( in_array( 'search', $options ) ) { 520 esc_attr_e( 'checked' ); 521 } 522 } 523 echo wcbloat_is_pro_readonly() ; 524 ?> value='search'><?php 525 esc_attr_e( 'Search', 'disable-dashboard-for-woocommerce' ); 526 ?></td> 401 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('comments', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='comments'><?php esc_attr_e('Recent Comments', 'disable-dashboard-for-woocommerce'); ?></td> 402 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('posts', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='posts'><?php esc_attr_e('Recent Posts', 'disable-dashboard-for-woocommerce'); ?></td> 403 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('search', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='search'><?php esc_attr_e('Search', 'disable-dashboard-for-woocommerce'); ?></td> 527 404 </tr> 528 405 <tr> 529 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 530 if ( !empty($options) ) { 531 if ( in_array( 'tag', $options ) ) { 532 esc_attr_e( 'checked' ); 533 } 534 } 535 echo wcbloat_is_pro_readonly() ; 536 ?> value='tag'><?php 537 esc_attr_e( 'Tag Cloud', 'disable-dashboard-for-woocommerce' ); 538 ?></td> 539 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 540 if ( !empty($options) ) { 541 if ( in_array( 'text', $options ) ) { 542 esc_attr_e( 'checked' ); 543 } 544 } 545 echo wcbloat_is_pro_readonly() ; 546 ?> value='text'><?php 547 esc_attr_e( 'Text', 'disable-dashboard-for-woocommerce' ); 548 ?></td> 549 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 550 if ( !empty($options) ) { 551 if ( in_array( 'video', $options ) ) { 552 esc_attr_e( 'checked' ); 553 } 554 } 555 echo wcbloat_is_pro_readonly() ; 556 ?> value='video'><?php 557 esc_attr_e( 'Video', 'disable-dashboard-for-woocommerce' ); 558 ?></td> 406 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('tag', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='tag'><?php esc_attr_e('Tag Cloud', 'disable-dashboard-for-woocommerce'); ?></td> 407 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('text', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='text'><?php esc_attr_e('Text', 'disable-dashboard-for-woocommerce'); ?></td> 408 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('video', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='video'><?php esc_attr_e('Video', 'disable-dashboard-for-woocommerce'); ?></td> 559 409 </tr> 560 410 </tbody> 561 411 </table> 562 <p><?php 563 echo wcbloat_is_pro_badge() ; 564 _e( 'WordPress by default comes with a lot of Dashboard widgets installed. They often are not used at all, but can add backend load and front-end load. Choose Dashboard Widgets you would like to disable for this site. The <strong>ones you choose will be disabled</strong>, and the <strong>ones that had not been selected will stay active</strong>. 565 566 ', 'disable-dashboard-for-woocommerce' ); 567 ?></p> 568 569 <?php 412 <p><?php echo wcbloat_is_pro_badge(); _e('WordPress by default comes with a lot of Dashboard widgets installed. They often are not used at all, but can add backend load and front-end load. Choose Dashboard Widgets you would like to disable for this site. The <strong>ones you choose will be disabled</strong>, and the <strong>ones that had not been selected will stay active</strong>. 413 414 ', 'disable-dashboard-for-woocommerce'); ?></p> 415 416 <?php 570 417 } 571 418 … … 573 420 function wcbloat_wp_meta_generator_disable_callback() 574 421 { 575 $value = get_option( 'wcbloat_wp_meta_generator_disable');576 ?>422 $value = get_option('wcbloat_wp_meta_generator_disable'); 423 ?> 577 424 <input type='hidden' name='wcbloat_wp_meta_generator_disable' value='no'> 578 <label><input type='checkbox' name='wcbloat_wp_meta_generator_disable' <?php 579 checked( esc_attr( $value ), 'yes' ); 580 echo wcbloat_is_pro_readonly() ; 581 ?> value='yes'> <?php 582 esc_attr_e( 'Remove WordPress & WooCommerce Meta Generator Tag', 'disable-dashboard-for-woocommerce' ); 583 echo wcbloat_is_pro_badge() ; 584 ?></label> 585 <p><?php 586 _e( 'Meta Generator Tag displays the WordPress & WooCommerce version number. Removing the meta generator tag protects you against attacks and may reduce your web page\'s size. Use this option to disable the Meta Tag generated by WordPress, WooCommerce, and many other plugins that hook up with the wp_generator action.', 'disable-dashboard-for-woocommerce' ); 587 ?></p> 588 <?php 425 <label><input type='checkbox' name='wcbloat_wp_meta_generator_disable' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove WordPress & WooCommerce Meta Generator Tag', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 426 <p><?php _e('Meta Generator Tag displays the WordPress & WooCommerce version number. Removing the meta generator tag protects you against attacks and may reduce your web page\'s size. Use this option to disable the Meta Tag generated by WordPress, WooCommerce, and many other plugins that hook up with the wp_generator action.', 'disable-dashboard-for-woocommerce'); ?></p> 427 <?php 589 428 } 590 429 … … 592 431 function wcbloat_remove_emoji_scripts_callback() 593 432 { 594 $value = get_option( 'wcbloat_remove_emoji_scripts');595 ?>433 $value = get_option('wcbloat_remove_emoji_scripts'); 434 ?> 596 435 <input type='hidden' name='wcbloat_remove_emoji_scripts' value='no'> 597 <label><input type='checkbox' name='wcbloat_remove_emoji_scripts' <?php 598 checked( esc_attr( $value ), 'yes' ); 599 echo wcbloat_is_pro_readonly() ; 600 ?> value='yes'> <?php 601 esc_attr_e( 'Remove emoji styles and scripts', 'disable-dashboard-for-woocommerce' ); 602 echo wcbloat_is_pro_badge() ; 603 ?></label> 604 <p><?php 605 _e( 'Remove the code bloat used to add support for emojis in older browsers. Emoticons and emojis will still work in browsers that have built-in support for them.', 'disable-dashboard-for-woocommerce' ); 606 ?></p> 607 <?php 436 <label><input type='checkbox' name='wcbloat_remove_emoji_scripts' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove emoji styles and scripts', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 437 <p><?php _e('Remove the code bloat used to add support for emojis in older browsers. Emoticons and emojis will still work in browsers that have built-in support for them.', 'disable-dashboard-for-woocommerce'); ?></p> 438 <?php 608 439 } 609 440 … … 611 442 function wcbloat_disable_wp_embed_callback() 612 443 { 613 $value = get_option( 'wcbloat_disable_wp_embed');614 ?>444 $value = get_option('wcbloat_disable_wp_embed'); 445 ?> 615 446 <input type='hidden' name='wcbloat_disable_wp_embed' value='no'> 616 <label><input type='checkbox' name='wcbloat_disable_wp_embed' <?php 617 checked( esc_attr( $value ), 'yes' ); 618 echo wcbloat_is_pro_readonly() ; 619 ?> value='yes'> <?php 620 esc_attr_e( 'Disable wp-embed', 'disable-dashboard-for-woocommerce' ); 621 echo wcbloat_is_pro_badge() ; 622 ?></label> 623 <p><?php 624 _e( 'Prevents the WordPress core feature known as wp-embed from loading on your website. The wp-embed feature allows you to embed videos, images, tweets, and other types of content from various platforms by pasting a URL into the WordPress editor. While this feature can be useful, it can also slow down your site\'s loading times, increase your server resources usage, and pose potential security risks.', 'disable-dashboard-for-woocommerce' ); 625 ?></p> 626 <?php 447 <label><input type='checkbox' name='wcbloat_disable_wp_embed' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Disable wp-embed', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 448 <p><?php _e('Prevents the WordPress core feature known as wp-embed from loading on your website. The wp-embed feature allows you to embed videos, images, tweets, and other types of content from various platforms by pasting a URL into the WordPress editor. While this feature can be useful, it can also slow down your site\'s loading times, increase your server resources usage, and pose potential security risks.', 'disable-dashboard-for-woocommerce'); ?></p> 449 <?php 627 450 } 628 451 … … 630 453 function wcbloat_site_performance_header_section_callback() 631 454 { 632 _e( 'Remove unwanted scripts from the Header section of your site. The header section is used on all of your subpages and in most cases you do not need to load all the default scripts. Use the option below to turn them off.', 'disable-dashboard-for-woocommerce');455 _e('Remove unwanted scripts from the Header section of your site. The header section is used on all of your subpages and in most cases you do not need to load all the default scripts. Use the option below to turn them off.', 'disable-dashboard-for-woocommerce'); 633 456 } 634 457 … … 636 459 function wcbloat_remove_rss_links_callback() 637 460 { 638 $value = get_option( 'wcbloat_remove_rss_links');639 ?>461 $value = get_option('wcbloat_remove_rss_links'); 462 ?> 640 463 <input type='hidden' name='wcbloat_remove_rss_links' value='no'> 641 <label><input type='checkbox' name='wcbloat_remove_rss_links' <?php 642 checked( esc_attr( $value ), 'yes' ); 643 echo wcbloat_is_pro_readonly() ; 644 ?> value='yes'> <?php 645 esc_attr_e( 'Remove RSS Feed Links', 'disable-dashboard-for-woocommerce' ); 646 echo wcbloat_is_pro_badge() ; 647 ?></label> 648 <p><?php 649 _e( 'If you do not use RSS feeds, you can safely turn them off without losing any functionality. Links to RSS Feeds will be removed from the plugin header, but the process of generating RSS feeds will still be active.', 'disable-dashboard-for-woocommerce' ); 650 ?></p> 651 <?php 464 <label><input type='checkbox' name='wcbloat_remove_rss_links' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove RSS Feed Links', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 465 <p><?php _e('If you do not use RSS feeds, you can safely turn them off without losing any functionality. Links to RSS Feeds will be removed from the plugin header, but the process of generating RSS feeds will still be active.', 'disable-dashboard-for-woocommerce'); ?></p> 466 <?php 652 467 } 653 468 … … 655 470 function wcbloat_disable_all_feeds_callback() 656 471 { 657 $value = get_option( 'wcbloat_disable_all_feeds');658 ?>472 $value = get_option('wcbloat_disable_all_feeds'); 473 ?> 659 474 <input type='hidden' name='wcbloat_disable_all_feeds' value='no'> 660 <label><input type='checkbox' name='wcbloat_disable_all_feeds' <?php 661 checked( esc_attr( $value ), 'yes' ); 662 echo wcbloat_is_pro_readonly() ; 663 ?> value='yes'> <?php 664 esc_attr_e( 'Disable all RSS feeds', 'disable-dashboard-for-woocommerce' ); 665 echo wcbloat_is_pro_badge() ; 666 ?></label> 667 <p><?php 668 _e( 'You can also completely disable the RSS generation process by activating this option. If it is a feature that you do not plan to use, you can disable RSS Feeds.', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce' ); 669 ?></p> 670 <?php 475 <label><input type='checkbox' name='wcbloat_disable_all_feeds' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Disable all RSS feeds', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 476 <p><?php _e('You can also completely disable the RSS generation process by activating this option. If it is a feature that you do not plan to use, you can disable RSS Feeds.', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce'); ?></p> 477 <?php 671 478 } 672 479 … … 674 481 function wcbloat_remove_feed_generator_tag_callback() 675 482 { 676 $value = get_option( 'wcbloat_remove_feed_generator_tag');677 ?>483 $value = get_option('wcbloat_remove_feed_generator_tag'); 484 ?> 678 485 <input type='hidden' name='wcbloat_remove_feed_generator_tag' value='no'> 679 <label><input type='checkbox' name='wcbloat_remove_feed_generator_tag' <?php 680 checked( esc_attr( $value ), 'yes' ); 681 echo wcbloat_is_pro_readonly() ; 682 ?> value='yes'> <?php 683 esc_attr_e( 'Remove the Generator Tag From RSS Feeds', 'disable-dashboard-for-woocommerce' ); 684 echo wcbloat_is_pro_badge() ; 685 ?></label> 686 <p><?php 687 _e( 'This option will Remove the Generator Tag From RSS Feeds', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce' ); 688 ?></p> 689 <?php 486 <label><input type='checkbox' name='wcbloat_remove_feed_generator_tag' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove the Generator Tag From RSS Feeds', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 487 <p><?php _e('This option will Remove the Generator Tag From RSS Feeds', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce'); ?></p> 488 <?php 690 489 } 691 490 … … 693 492 function wcbloat_disable_wlw_link_callback() 694 493 { 695 $value = get_option( 'wcbloat_disable_wlw_link');696 ?>494 $value = get_option('wcbloat_disable_wlw_link'); 495 ?> 697 496 <input type='hidden' name='wcbloat_disable_wlw_link' value='no'> 698 <label><input type='checkbox' name='wcbloat_disable_wlw_link' <?php 699 checked( esc_attr( $value ), 'yes' ); 700 echo wcbloat_is_pro_readonly() ; 701 ?> value='yes'> <?php 702 esc_attr_e( 'Remove Link to the Windows Live Writer Manifest File', 'disable-dashboard-for-woocommerce' ); 703 echo wcbloat_is_pro_badge() ; 704 ?></label> 705 <p><?php 706 _e( 'If are not using software called Windows Live Writer, you can safely turn off this feature that is added to your header by default.', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce' ); 707 ?></p> 708 <?php 497 <label><input type='checkbox' name='wcbloat_disable_wlw_link' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove Link to the Windows Live Writer Manifest File', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 498 <p><?php _e('If are not using software called Windows Live Writer, you can safely turn off this feature that is added to your header by default.', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce'); ?></p> 499 <?php 709 500 } 710 501 … … 712 503 function wcbloat_disable_rsd_link_callback() 713 504 { 714 $value = get_option( 'wcbloat_disable_rsd_link');715 ?>505 $value = get_option('wcbloat_disable_rsd_link'); 506 ?> 716 507 <input type='hidden' name='wcbloat_disable_rsd_link' value='no'> 717 <label><input type='checkbox' name='wcbloat_disable_rsd_link' <?php 718 checked( esc_attr( $value ), 'yes' ); 719 echo wcbloat_is_pro_readonly() ; 720 ?> value='yes'> <?php 721 esc_attr_e( 'Remove RSD link', 'disable-dashboard-for-woocommerce' ); 722 echo wcbloat_is_pro_badge() ; 723 ?></label> 724 <p><?php 725 _e( 'RSD link is a tag that is added to your Header by default. The RSD link is used by software blog clients. If you access your site admin panel from the browser then it is safe for you to remove the RSD Link.', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce' ); 726 ?></p> 727 <?php 508 <label><input type='checkbox' name='wcbloat_disable_rsd_link' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove RSD link', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 509 <p><?php _e('RSD link is a tag that is added to your Header by default. The RSD link is used by software blog clients. If you access your site admin panel from the browser then it is safe for you to remove the RSD Link.', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce'); ?></p> 510 <?php 728 511 } 729 512 … … 731 514 function wcbloat_remove_shortlink_callback() 732 515 { 733 $value = get_option( 'wcbloat_remove_shortlink');734 ?>516 $value = get_option('wcbloat_remove_shortlink'); 517 ?> 735 518 <input type='hidden' name='wcbloat_remove_shortlink' value='no'> 736 <label><input type='checkbox' name='wcbloat_remove_shortlink' <?php 737 checked( esc_attr( $value ), 'yes' ); 738 echo wcbloat_is_pro_readonly() ; 739 ?> value='yes'> <?php 740 esc_attr_e( 'Remove Shortlink From HTTP Header', 'disable-dashboard-for-woocommerce' ); 741 echo wcbloat_is_pro_badge() ; 742 ?></label> 743 <p><?php 744 _e( 'Shortlink is the shorter version of the post or page URL. Shortlink (enabled in WordPress by default) creates a separate request on every page.', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce' ); 745 ?></p> 746 <?php 747 } 519 <label><input type='checkbox' name='wcbloat_remove_shortlink' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove Shortlink From HTTP Header', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 520 <p><?php _e('Shortlink is the shorter version of the post or page URL. Shortlink (enabled in WordPress by default) creates a separate request on every page.', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce'); ?></p> 521 <?php 522 } -
disable-dashboard-for-woocommerce/tags/3.2.7/readme.txt
r2926554 r2930475 2 2 Contributors: disablebloat 3 3 Tags: WooCommerce, disable WooCommerce admin, remove bloat, debloat, unbloat, Yoast SEO, white label, speed up WordPress 4 Stable tag: trunk4 Stable tag: 3.2.7 5 5 Requires at least: 5.0 6 Tested up to: 6.3 6 Tested up to: 6.3.2 7 7 Requires PHP: 5.6 8 8 WC requires at least: 4.0 9 WC tested up to: 8.0 9 WC tested up to: 8.0.0 10 10 Donate link: https://disablebloat.com/ 11 11 License: GNU General Public License v3.0 -
disable-dashboard-for-woocommerce/trunk/disable-dashboard-for-woocommerce.php
r2926554 r2930475 5 5 * Plugin URI: https://disablebloat.com/ 6 6 * Description: All-in-One solution to speed up your WordPress & WooCommerce. Remove unnecessary features and make your site faster and cleaner. 7 * Version: 3.2. 67 * Version: 3.2.7 8 8 * Author: Disable Bloat 9 9 * Developer: Disable Bloat … … 19 19 * License URI: http://www.gnu.org/licenses/gpl-3.0.html 20 20 */ 21 if ( !defined( 'ABSPATH' ) ) { 21 22 if (!defined('ABSPATH')) { 22 23 exit; 23 24 } 24 25 25 if ( function_exists( 'wcbloat_fs' )) {26 wcbloat_fs()->set_basename( false, __FILE__);26 if (function_exists('wcbloat_fs')) { 27 wcbloat_fs()->set_basename(false, __FILE__); 27 28 } else { 28 29 // DO NOT REMOVE THIS IF, IT IS ESSENTIAL FOR THE `function_exists` CALL ABOVE TO PROPERLY WORK. 29 30 if ( !function_exists( 'wcbloat_fs' )) {30 31 if (!function_exists('wcbloat_fs')) { 31 32 // Actual Freemius integration snippet 32 33 if ( !function_exists( 'wcbloat_fs' )) {33 34 if (!function_exists('wcbloat_fs')) { 34 35 // Create a helper function for easy SDK access. 35 36 function wcbloat_fs() 36 37 { 37 global $wcbloat_fs ;38 39 if ( !isset( $wcbloat_fs )) {38 global $wcbloat_fs; 39 40 if (!isset($wcbloat_fs)) { 40 41 // Activate multisite network integration. 41 if ( !defined( 'WP_FS__PRODUCT_10157_MULTISITE' )) {42 define( 'WP_FS__PRODUCT_10157_MULTISITE', true);42 if (!defined('WP_FS__PRODUCT_10157_MULTISITE')) { 43 define('WP_FS__PRODUCT_10157_MULTISITE', true); 43 44 } 44 45 // Include Freemius SDK. 45 require_once dirname( __FILE__ ) . '/includes/freemius/start.php';46 $wcbloat_fs = fs_dynamic_init( array(46 require_once dirname(__FILE__) . '/vendor/freemius/wordpress-sdk/start.php'; 47 $wcbloat_fs = fs_dynamic_init(array( 47 48 'id' => '10157', 48 49 'slug' => 'disable-dashboard-for-woocommerce', … … 50 51 'type' => 'plugin', 51 52 'public_key' => 'pk_16f665643a809fd13e01f8a3d1381', 52 'is_premium' => false,53 'is_premium' => true, 53 54 'premium_suffix' => 'PRO', 54 55 'has_addons' => false, 55 56 'has_paid_plans' => true, 56 57 'menu' => array( 57 'contact' => false,58 'support' => false,59 'account' => false,60 'pricing' => false,61 ),58 'contact' => false, 59 'support' => false, 60 'account' => false, 61 'pricing' => false, 62 ), 62 63 'pricing' => false, 63 'anonymous_mode' => !function_exists( 'is_anonymous_mode_disabled__premium_only' ) || !is_anonymous_mode_disabled__premium_only(), 64 'is_live' => true, 65 ) ); 64 'anonymous_mode' => !function_exists('is_anonymous_mode_disabled__premium_only') || !is_anonymous_mode_disabled__premium_only(), 65 'secret_key' => 'sk_68M]h<4Kl5O:Q;[)&U.Usfc?{8D4o', 66 67 )); 66 68 } 67 69 68 70 return $wcbloat_fs; 69 71 } 70 72 71 73 // Init Freemius. 72 74 wcbloat_fs(); 73 75 // Signal that SDK was initiated. 74 do_action( 'wcbloat_fs_loaded');76 do_action('wcbloat_fs_loaded'); 75 77 } 76 77 if ( function_exists( 'fs_override_i18n' )) {78 fs_override_i18n( array(79 'opt-in' => __( '', 'disable-dashboard-for-woocommerce'),80 ), 'disable-dashboard-for-woocommerce' );78 79 if (function_exists('fs_override_i18n')) { 80 fs_override_i18n(array( 81 'opt-in' => __('', 'disable-dashboard-for-woocommerce'), 82 ), 'disable-dashboard-for-woocommerce'); 81 83 } 82 wcbloat_fs()->add_filter( 'default_to_anonymous_feedback', '__return_true');83 wcbloat_fs()->add_filter( 'hide_freemius_powered_by', '__return_true');84 wcbloat_fs()->add_filter( 'hide_billing_and_payments_info', '__return_true');84 wcbloat_fs()->add_filter('default_to_anonymous_feedback', '__return_true'); 85 wcbloat_fs()->add_filter('hide_freemius_powered_by', '__return_true'); 86 wcbloat_fs()->add_filter('hide_billing_and_payments_info', '__return_true'); 85 87 // Opt-In Icon Customization 86 88 function wcbloat_custom_plugin_icon() 87 89 { 88 return dirname( __FILE__) . '/assets/img/disable-dashboard-for-woocommerce.png';90 return dirname(__FILE__) . '/assets/img/disable-dashboard-for-woocommerce.png'; 89 91 } 90 91 wcbloat_fs()->add_filter( 'plugin_icon', 'wcbloat_custom_plugin_icon');92 93 wcbloat_fs()->add_filter('plugin_icon', 'wcbloat_custom_plugin_icon'); 92 94 // Freemius END 93 95 // load plugin text domain 94 96 function wcbloat_init() 95 97 { 96 load_plugin_textdomain( 'disable-dashboard-for-woocommerce', false, dirname( plugin_basename( __FILE__ ) ) . '/languages');98 load_plugin_textdomain('disable-dashboard-for-woocommerce', false, dirname(plugin_basename(__FILE__)) . '/languages'); 97 99 } 98 99 add_action( 'plugins_loaded', 'wcbloat_init');100 101 add_action('plugins_loaded', 'wcbloat_init'); 100 102 // Links on Plugins screen 101 function wcbloat_action_links( $links)103 function wcbloat_action_links($links) 102 104 { 103 $custom_links = [ '<a href="' . admin_url( 'options-general.php?page=disable-bloat' ) . '">' . __( 'Settings' ) . '</a>' ]; 104 if ( !wcbloat_fs()->is_premium() ) { 105 $custom_links[] = '<a href="https://disablebloat.com/?utm_source=plugins_list&utm_medium=referral&utm_campaign=Plugin+links" target="_blank"><b>' . __( 'Upgrade', 'disable-dashboard-for-woocommerce' ) . '</b></a>'; 105 $custom_links = ['<a href="' . admin_url('options-general.php?page=disable-bloat') . '">' . __('Settings') . '</a>']; 106 107 if (!wcbloat_fs()->is_premium()) { 108 $custom_links[] = '<a href="https://disablebloat.com/?utm_source=plugins_list&utm_medium=referral&utm_campaign=Plugin+links" target="_blank"><b>' . __('Upgrade', 'disable-dashboard-for-woocommerce') . '</b></a>'; 106 109 } 107 if ( wcbloat_fs()->is_plan( 'pro' ) ) { 108 $custom_links[] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( wcbloat_fs()->get_account_url() ), __( 'My Account', 'disable-dashboard-for-woocommerce' ) ); 110 111 if (wcbloat_fs()->is_plan('pro')) { 112 $custom_links[] = sprintf( 113 '<a href="%1$s">%2$s</a>', 114 esc_url(wcbloat_fs()->get_account_url()), 115 __('My Account', 'disable-dashboard-for-woocommerce') 116 ); 109 117 } 110 return array_merge( $custom_links, $links ); 118 119 return array_merge($custom_links, $links); 111 120 } 112 113 add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'wcbloat_action_links');121 122 add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'wcbloat_action_links'); 114 123 } 115 124 116 125 // Add CSS and JS to the plugin settings screens 117 126 function wcbloat_custom_wp_admin_assets() 118 127 { 119 $page = ( isset( $_GET['page'] ) ? $_GET['page'] : '' );120 121 if ( $page === 'disable-bloat') {122 wp_enqueue_style( 'wcbloat_wp_admin_css', plugin_dir_url( __FILE__ ) . 'assets/css/disable-bloat-admin-style.css');123 wp_enqueue_script( 'wcbloat_wp_admin_js', plugin_dir_url( __FILE__ ) . 'assets/js/disable-bloat-admin.js');128 $page = isset($_GET['page']) ? $_GET['page'] : ''; 129 130 if ($page === 'disable-bloat') { 131 wp_enqueue_style('wcbloat_wp_admin_css', plugin_dir_url(__FILE__) . 'assets/css/disable-bloat-admin-style.css'); 132 wp_enqueue_script('wcbloat_wp_admin_js', plugin_dir_url(__FILE__) . 'assets/js/disable-bloat-admin.js'); 124 133 } 125 126 134 } 127 128 add_action( 'admin_enqueue_scripts', 'wcbloat_custom_wp_admin_assets' ); 135 136 add_action('admin_enqueue_scripts', 'wcbloat_custom_wp_admin_assets'); 137 129 138 // Include WooCommerce integration 130 139 require_once 'includes/functions/disable-bloat-woocommerce.php'; 140 131 141 // Include functions files 132 142 require_once 'includes/functions/disable-bloat-functions_free.php'; 143 144 if (wcbloat_fs()->is__premium_only()) { 145 if (wcbloat_fs()->is_plan('pro')) { 146 require_once 'includes/functions/disable-bloat-functions_pro__premium_only.php'; 147 } 148 } 149 133 150 // Include Options pages 134 151 require_once 'includes/settings/class-disable-bloat-settings.php'; 152 135 153 // Include Uninstall Cleanup code 136 154 require_once 'includes/functions/disable-bloat-uninstall-cleanup.php'; 155 137 156 // Compatibility with WooCommerce HPOS (Custom order tables) - only if WooCommmerce is active 138 if ( wcbloat_is_woo_active()) {139 add_action( 'before_woocommerce_init', function () {140 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class )) {141 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true);157 if (wcbloat_is_woo_active()) { 158 add_action('before_woocommerce_init', function () { 159 if (class_exists(\Automattic\WooCommerce\Utilities\FeaturesUtil::class)) { 160 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true); 142 161 } 143 } );162 }); 144 163 } 164 145 165 // MAIN PLUGIN FILE END 146 166 // DO NOT REMOVE THE BRACKET BELOW, AS IT IS NEEDED FOR THE MECHANISM OF AUTO DEACTIVATING THE FREE VERSION DURING PRO ACTIVATION: -
disable-dashboard-for-woocommerce/trunk/includes/settings/class-disable-bloat-settings-admin.php
r2873201 r2930475 1 1 <?php 2 2 3 if ( !defined( 'ABSPATH' ) ) { 4 exit; 5 } 6 // Exit if accessed directly 3 if (!defined('ABSPATH')) exit; // Exit if accessed directly 4 7 5 // Add sections and fields on Main settings screen 8 6 function wcbloat_admin_settings_init() 9 7 { 10 // Section's icon 11 add_settings_section( 12 'wcbloat-admin-desc-icon-section', 13 '', 14 'wcbloat_admin_desc_icon_callback', 15 'wcbloat-admin' 16 ); 17 // Section's title and description 18 add_settings_section( 19 'wcbloat-admin-desc-section', 20 esc_attr__( 'Admin panel optimization', 'disable-dashboard-for-woocommerce' ), 21 'wcbloat_admin_desc_callback', 22 'wcbloat-admin' 23 ); 24 // Clean admin interface section 25 add_settings_section( 26 'wcbloat_clean_admin_section', 27 esc_attr__( 'Clean admin interface', 'disable-dashboard-for-woocommerce' ), 28 'wcbloat_clean_admin_desc_section_callback', 29 'wcbloat-admin' 30 ); 31 // Hide update notice for non-admin users 32 add_settings_field( 33 'wcbloat_wp_update_nag_disable', 34 'Hide update notice for non-admin users', 35 'wcbloat_wp_update_nag_disable_callback', 36 'wcbloat-admin', 37 'wcbloat_clean_admin_section' 38 ); 39 register_setting( 'wcbloat-admin-options', 'wcbloat_wp_update_nag_disable', array( 40 'sanitize_callback' => 'sanitize_key', 41 ) ); 42 // Disable Dashboard widgets PRO 43 add_settings_field( 44 'wcbloat_wp_dashboard_widgets_disable', 45 esc_attr__( 'Disable WordPress Dashboard widgets', 'disable-dashboard-for-woocommerce' ), 46 'wcbloat_wp_dashboard_widgets_disable_callback', 47 'wcbloat-admin', 48 'wcbloat_clean_admin_section' 49 ); 50 register_setting( 'wcbloat-admin-options', 'wcbloat_wp_dashboard_widgets_disable', 'validate_setting' ); 51 // Remove the WordPress logo ("W") from the admin bar PRO 52 add_settings_field( 53 'wcbloat_w_logo_disable', 54 'WordPress logo in the admin bar', 55 'wcbloat_w_logo_disable_callback', 56 'wcbloat-admin', 57 'wcbloat_clean_admin_section' 58 ); 59 register_setting( 'wcbloat-admin-options', 'wcbloat_w_logo_disable', array( 60 'sanitize_callback' => 'sanitize_key', 61 ) ); 62 // Remove admin footer text PRO 63 add_settings_field( 64 'wcbloat_wp_footer_disable', 65 'Admin footer text', 66 'wcbloat_wp_footer_disable_callback', 67 'wcbloat-admin', 68 'wcbloat_clean_admin_section' 69 ); 70 register_setting( 'wcbloat-admin-options', 'wcbloat_wp_footer_disable', array( 71 'sanitize_callback' => 'sanitize_key', 72 ) ); 73 // WordPress login page section 74 add_settings_section( 75 'wcbloat-admin-wp-login-page-section', 76 esc_attr__( 'WordPress login page', 'disable-dashboard-for-woocommerce' ), 77 'wcbloat_admin_wp_login_page_section_callback', 78 'wcbloat-admin' 79 ); 80 // Hide WordPress logo on the WordPress Login Page PRO 81 add_settings_field( 82 'wcbloat_hide_wp_logo_on_login_page', 83 'Hide WordPress logo on the Login Page', 84 'wcbloat_hide_wp_logo_on_login_page_callback', 85 'wcbloat-admin', 86 'wcbloat-admin-wp-login-page-section' 87 ); 88 register_setting( 'wcbloat-admin-options', 'wcbloat_hide_wp_logo_on_login_page', array( 89 'sanitize_callback' => 'sanitize_key', 90 ) ); 91 // Change the Logo URL on the WordPress Login Page PRO 92 add_settings_field( 93 'wcbloat_wp_logo_url_disable', 94 'Change the Logo Link', 95 'wcbloat_wp_logo_url_disable_callback', 96 'wcbloat-admin', 97 'wcbloat-admin-wp-login-page-section' 98 ); 99 register_setting( 'wcbloat-admin-options', 'wcbloat_wp_logo_url_disable', array( 100 'sanitize_callback' => 'sanitize_key', 101 ) ); 102 // Change the Logo title the WordPress Login Page PRO 103 add_settings_field( 104 'wcbloat_wp_logo_title', 105 'Change the Logo title parameter', 106 'wcbloat_wp_logo_title_callback', 107 'wcbloat-admin', 108 'wcbloat-admin-wp-login-page-section' 109 ); 110 register_setting( 'wcbloat-admin-options', 'wcbloat_wp_logo_title', array( 111 'sanitize_callback' => 'sanitize_key', 112 ) ); 113 // Disable WordPress Login Language Switcher PRO 114 add_settings_field( 115 'wcbloat_wp_language_select_disable', 116 'Disable WordPress Login Language Switcher', 117 'wcbloat_wp_language_select_disable_callback', 118 'wcbloat-admin', 119 'wcbloat-admin-wp-login-page-section' 120 ); 121 register_setting( 'wcbloat-admin-options', 'wcbloat_wp_language_select_disable', array( 122 'sanitize_callback' => 'sanitize_key', 123 ) ); 8 9 // Section's icon 10 add_settings_section( 11 'wcbloat-admin-desc-icon-section', 12 '', 13 'wcbloat_admin_desc_icon_callback', 14 'wcbloat-admin' 15 ); 16 17 // Section's title and description 18 add_settings_section( 19 'wcbloat-admin-desc-section', 20 esc_attr__('Admin panel optimization', 'disable-dashboard-for-woocommerce'), 21 'wcbloat_admin_desc_callback', 22 'wcbloat-admin' 23 ); 24 25 // Clean admin interface section 26 add_settings_section( 27 'wcbloat_clean_admin_section', 28 esc_attr__('Clean admin interface', 'disable-dashboard-for-woocommerce'), 29 'wcbloat_clean_admin_desc_section_callback', 30 'wcbloat-admin' 31 ); 32 33 // Hide update notice for non-admin users 34 add_settings_field( 35 'wcbloat_wp_update_nag_disable', 36 'Hide update notice for non-admin users', 37 'wcbloat_wp_update_nag_disable_callback', 38 'wcbloat-admin', 39 'wcbloat_clean_admin_section' 40 ); 41 register_setting( 42 'wcbloat-admin-options', 43 'wcbloat_wp_update_nag_disable', 44 array('sanitize_callback' => 'sanitize_key') 45 ); 46 47 // Disable Dashboard widgets PRO 48 add_settings_field( 49 'wcbloat_wp_dashboard_widgets_disable', 50 esc_attr__( 'Disable WordPress Dashboard widgets', 'disable-dashboard-for-woocommerce' ), 51 'wcbloat_wp_dashboard_widgets_disable_callback', 52 'wcbloat-admin', 53 'wcbloat_clean_admin_section' ); 54 register_setting( 55 'wcbloat-admin-options', 56 'wcbloat_wp_dashboard_widgets_disable', 57 'validate_setting' 58 ); 59 60 // Remove the WordPress logo ("W") from the admin bar PRO 61 add_settings_field( 62 'wcbloat_w_logo_disable', 63 'WordPress logo in the admin bar', 64 'wcbloat_w_logo_disable_callback', 65 'wcbloat-admin', 66 'wcbloat_clean_admin_section' 67 ); 68 register_setting( 69 'wcbloat-admin-options', 70 'wcbloat_w_logo_disable', 71 array('sanitize_callback' => 'sanitize_key') 72 ); 73 74 // Remove admin footer text PRO 75 add_settings_field( 76 'wcbloat_wp_footer_disable', 77 'Admin footer text', 78 'wcbloat_wp_footer_disable_callback', 79 'wcbloat-admin', 80 'wcbloat_clean_admin_section' 81 ); 82 register_setting( 83 'wcbloat-admin-options', 84 'wcbloat_wp_footer_disable', 85 array('sanitize_callback' => 'sanitize_key') 86 ); 87 88 // WordPress login page section 89 add_settings_section( 90 'wcbloat-admin-wp-login-page-section', 91 esc_attr__('WordPress login page', 'disable-dashboard-for-woocommerce'), 92 'wcbloat_admin_wp_login_page_section_callback', 93 'wcbloat-admin' 94 ); 95 96 // Hide WordPress logo on the WordPress Login Page PRO 97 add_settings_field( 98 'wcbloat_hide_wp_logo_on_login_page', 99 'Hide WordPress logo on the Login Page', 100 'wcbloat_hide_wp_logo_on_login_page_callback', 101 'wcbloat-admin', 102 'wcbloat-admin-wp-login-page-section' 103 ); 104 register_setting( 105 'wcbloat-admin-options', 106 'wcbloat_hide_wp_logo_on_login_page', 107 array('sanitize_callback' => 'sanitize_key') 108 ); 109 110 // Change the Logo URL on the WordPress Login Page PRO 111 add_settings_field( 112 'wcbloat_wp_logo_url_disable', 113 'Change the Logo Link', 114 'wcbloat_wp_logo_url_disable_callback', 115 'wcbloat-admin', 116 'wcbloat-admin-wp-login-page-section' 117 ); 118 register_setting( 119 'wcbloat-admin-options', 120 'wcbloat_wp_logo_url_disable', 121 array('sanitize_callback' => 'sanitize_key') 122 ); 123 124 // Change the Logo title the WordPress Login Page PRO 125 add_settings_field( 126 'wcbloat_wp_logo_title', 127 'Change the Logo title parameter', 128 'wcbloat_wp_logo_title_callback', 129 'wcbloat-admin', 130 'wcbloat-admin-wp-login-page-section' 131 ); 132 register_setting( 133 'wcbloat-admin-options', 134 'wcbloat_wp_logo_title', 135 array('sanitize_callback' => 'sanitize_key') 136 ); 137 138 // Disable WordPress Login Language Switcher PRO 139 add_settings_field( 140 'wcbloat_wp_language_select_disable', 141 'Disable WordPress Login Language Switcher', 142 'wcbloat_wp_language_select_disable_callback', 143 'wcbloat-admin', 144 'wcbloat-admin-wp-login-page-section' 145 ); 146 register_setting( 147 'wcbloat-admin-options', 148 'wcbloat_wp_language_select_disable', 149 array('sanitize_callback' => 'sanitize_key') 150 ); 124 151 } 125 152 126 153 // Display the fields added before 127 add_action( 'admin_init', 'wcbloat_admin_settings_init' ); 154 add_action('admin_init', 'wcbloat_admin_settings_init'); 155 128 156 // Fields callbacks 157 129 158 // Section's icon 130 159 function wcbloat_admin_desc_icon_callback() 131 160 { 132 _e( '<span class="dashicons dashicons-hammer"></span>');161 _e('<span class="dashicons dashicons-hammer"></span>'); 133 162 } 134 163 … … 136 165 function wcbloat_admin_desc_callback() 137 166 { 138 _e( 'By default, the WordPress admin panel is cluttered with preinstalled elements that may distract you from your work. You can simplify your WordPress admin panel by hiding or turning them off.<hr />', 'disable-dashboard-for-woocommerce');139 _e( wcbloat_buy_pro_bar() );167 _e('By default, the WordPress admin panel is cluttered with preinstalled elements that may distract you from your work. You can simplify your WordPress admin panel by hiding or turning them off.<hr />', 'disable-dashboard-for-woocommerce'); 168 _e ( wcbloat_buy_pro_bar() ); 140 169 } 141 170 … … 143 172 function wcbloat_clean_admin_desc_section_callback() 144 173 { 145 _e( 'If you love a simple and flexible interface, use the options below to maximize your performance while browsing through the WordPress admin panel. By removing unnecessary elements, you will be 100% focused on your tasks.', 'disable-dashboard-for-woocommerce');174 _e('If you love a simple and flexible interface, use the options below to maximize your performance while browsing through the WordPress admin panel. By removing unnecessary elements, you will be 100% focused on your tasks.', 'disable-dashboard-for-woocommerce'); 146 175 } 147 176 … … 149 178 function wcbloat_wp_update_nag_disable_callback() 150 179 { 151 $value = get_option( 'wcbloat_wp_update_nag_disable');152 ?>180 $value = get_option('wcbloat_wp_update_nag_disable'); 181 ?> 153 182 <input type='hidden' name='wcbloat_wp_update_nag_disable' value='no'> 154 <label><input type='checkbox' name='wcbloat_wp_update_nag_disable' <?php 155 checked( esc_attr( $value ), 'yes' ); 156 ?> value='yes'> <?php 157 esc_attr_e( 'Hide update notice for non-admin users', 'disable-dashboard-for-woocommerce' ); 158 ?></label> 159 <p><?php 160 _e( 'The next time any user with the Role set as Subscriber, Contributor, Author, or Editor access the WordPress back-end, they will not be prompted to update the WordPress core. The notification will continue to display for admin users.', 'disable-dashboard-for-woocommerce' ); 161 ?></p> 162 <?php 183 <label><input type='checkbox' name='wcbloat_wp_update_nag_disable' <?php checked(esc_attr($value), 'yes'); ?> value='yes'> <?php esc_attr_e('Hide update notice for non-admin users', 'disable-dashboard-for-woocommerce'); ?></label> 184 <p><?php _e('The next time any user with the Role set as Subscriber, Contributor, Author, or Editor access the WordPress back-end, they will not be prompted to update the WordPress core. The notification will continue to display for admin users.', 'disable-dashboard-for-woocommerce'); ?></p> 185 <?php 163 186 } 164 187 … … 166 189 function wcbloat_wp_dashboard_widgets_disable_callback() 167 190 { 168 $options = get_option( 'wcbloat_wp_dashboard_widgets_disable' ); 169 ?>191 $options = get_option('wcbloat_wp_dashboard_widgets_disable'); 192 ?> 170 193 <div class="wcbloat-select-unselect-buttons"> 171 <a <?php 172 ?> class="button button-secondary"<?php 173 echo wcbloat_is_pro_readonly() ; 174 ?>><?php 175 esc_attr_e( 'Select / Deselect All', 'disable-dashboard-for-woocommerce' ); 176 ?></a> 194 <a <?php if ( wcbloat_fs()->is__premium_only() ) { if ( wcbloat_fs()->is_plan( 'pro' ) ) { _e('id="select-all"'); }} ?> class="button button-secondary"<?php echo wcbloat_is_pro_readonly();?>><?php esc_attr_e('Select / Deselect All', 'disable-dashboard-for-woocommerce'); ?></a> 177 195 </div> 178 196 <table id="wcbloat-multi-checkbox-table"> 179 197 <tbody> 180 198 <tr> 181 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php 182 if ( !empty($options) ) { 183 if ( in_array( 'site_health', $options ) ) { 184 esc_attr_e( 'checked' ); 185 } 186 } 187 echo wcbloat_is_pro_readonly() ; 188 ?> value='site_health'><?php 189 esc_attr_e( 'Site Health Status', 'disable-dashboard-for-woocommerce' ); 190 ?></td> 191 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php 192 if ( !empty($options) ) { 193 if ( in_array( 'at_a_glance', $options ) ) { 194 esc_attr_e( 'checked' ); 195 } 196 } 197 echo wcbloat_is_pro_readonly() ; 198 ?> value='at_a_glance'><?php 199 esc_attr_e( 'At a Glance', 'disable-dashboard-for-woocommerce' ); 200 ?></td> 199 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php if (!empty($options)) { if (in_array('site_health', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='site_health'><?php esc_attr_e('Site Health Status', 'disable-dashboard-for-woocommerce'); ?></td> 200 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php if (!empty($options)) { if (in_array('at_a_glance', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='at_a_glance'><?php esc_attr_e('At a Glance', 'disable-dashboard-for-woocommerce'); ?></td> 201 201 </tr> 202 202 <tr> 203 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php 204 if ( !empty($options) ) { 205 if ( in_array( 'activity', $options ) ) { 206 esc_attr_e( 'checked' ); 207 } 208 } 209 echo wcbloat_is_pro_readonly() ; 210 ?> value='activity'><?php 211 esc_attr_e( 'Activity', 'disable-dashboard-for-woocommerce' ); 212 ?></td> 213 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php 214 if ( !empty($options) ) { 215 if ( in_array( 'draft', $options ) ) { 216 esc_attr_e( 'checked' ); 217 } 218 } 219 echo wcbloat_is_pro_readonly() ; 220 ?> value='draft'><?php 221 esc_attr_e( 'Quick Draft', 'disable-dashboard-for-woocommerce' ); 222 ?></td> 203 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php if (!empty($options)) { if (in_array('activity', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='activity'><?php esc_attr_e('Activity', 'disable-dashboard-for-woocommerce'); ?></td> 204 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php if (!empty($options)) { if (in_array('draft', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='draft'><?php esc_attr_e('Quick Draft', 'disable-dashboard-for-woocommerce'); ?></td> 223 205 </tr> 224 206 <tr> 225 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php 226 if ( !empty($options) ) { 227 if ( in_array( 'news', $options ) ) { 228 esc_attr_e( 'checked' ); 229 } 230 } 231 echo wcbloat_is_pro_readonly() ; 232 ?> value='news'><?php 233 esc_attr_e( 'WordPress Events and News', 'disable-dashboard-for-woocommerce' ); 234 ?></td> 235 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php 236 if ( !empty($options) ) { 237 if ( in_array( 'welcome', $options ) ) { 238 esc_attr_e( 'checked' ); 239 } 240 } 241 echo wcbloat_is_pro_readonly() ; 242 ?> value='welcome'><?php 243 esc_attr_e( 'Welcome panel', 'disable-dashboard-for-woocommerce' ); 244 ?></td> 207 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php if (!empty($options)) { if (in_array('news', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='news'><?php esc_attr_e('WordPress Events and News', 'disable-dashboard-for-woocommerce'); ?></td> 208 <td class="wcbloat-wp-widgets-disable-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_dashboard_widgets_disable[]' <?php if (!empty($options)) { if (in_array('welcome', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='welcome'><?php esc_attr_e('Welcome panel', 'disable-dashboard-for-woocommerce'); ?></td> 245 209 </tr> 246 210 </tbody> 247 211 </table> 248 <p><?php 249 echo wcbloat_is_pro_badge() ; 250 _e( 'WordPress by default comes with a lot of Dashboard widgets installed. They often are not used at all, but can add backend load and front-end load. Choose which of the WordPress Dashboard Widgets should be disabled. The <strong>ones you choose will be disabled</strong>, and the <strong>ones that had not been selected</strong> will stay <strong>active</strong>.', 'disable-dashboard-for-woocommerce' ); 251 ?></p> 252 253 <?php 212 <p><?php echo wcbloat_is_pro_badge(); _e('WordPress by default comes with a lot of Dashboard widgets installed. They often are not used at all, but can add backend load and front-end load. Choose which of the WordPress Dashboard Widgets should be disabled. The <strong>ones you choose will be disabled</strong>, and the <strong>ones that had not been selected</strong> will stay <strong>active</strong>.', 'disable-dashboard-for-woocommerce'); ?></p> 213 214 <?php 254 215 } 255 216 … … 257 218 function wcbloat_w_logo_disable_callback() 258 219 { 259 $value = get_option( 'wcbloat_w_logo_disable');260 ?>220 $value = get_option('wcbloat_w_logo_disable'); 221 ?> 261 222 <input type='hidden' name='wcbloat_w_logo_disable' value='no'> 262 <label><input type='checkbox' name='wcbloat_w_logo_disable' <?php 263 checked( esc_attr( $value ), 'yes' ); 264 echo wcbloat_is_pro_readonly() ; 265 ?> value='yes'> <?php 266 esc_attr_e( 'Remove the WordPress logo (“W”) from the admin bar', 'disable-dashboard-for-woocommerce' ); 267 echo wcbloat_is_pro_badge() ; 268 ?></label> 269 <p><?php 270 _e( 'This option will hide the WordPress logo in the upper left corner. The logo won\'t be visible in your admin panel and in your site (on the admin bar visible on the front-end after logging in.', 'disable-dashboard-for-woocommerce' ); 271 ?></p> 272 <?php 223 <label><input type='checkbox' name='wcbloat_w_logo_disable' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove the WordPress logo (“W”) from the admin bar', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 224 <p><?php _e('This option will hide the WordPress logo in the upper left corner. The logo won\'t be visible in your admin panel and in your site (on the admin bar visible on the front-end after logging in.', 'disable-dashboard-for-woocommerce'); ?></p> 225 <?php 273 226 } 274 227 … … 276 229 function wcbloat_wp_footer_disable_callback() 277 230 { 278 $value = get_option( 'wcbloat_wp_footer_disable');279 ?>231 $value = get_option('wcbloat_wp_footer_disable'); 232 ?> 280 233 <input type='hidden' name='wcbloat_wp_footer_disable' value='no'> 281 <label><input type='checkbox' name='wcbloat_wp_footer_disable' <?php 282 checked( esc_attr( $value ), 'yes' ); 283 echo wcbloat_is_pro_readonly() ; 284 ?> value='yes'> <?php 285 esc_attr_e( 'Remove admin footer text', 'disable-dashboard-for-woocommerce' ); 286 echo wcbloat_is_pro_badge() ; 287 ?></label> 288 <p><?php 289 _e( 'This option hides the text at the bottom of the WordPress admin: <code>Thank you for creating with WordPress</code> on the bottom left, and the WordPress version on the bottom right.', 'disable-dashboard-for-woocommerce' ); 290 ?></p> 291 <?php 234 <label><input type='checkbox' name='wcbloat_wp_footer_disable' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove admin footer text', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 235 <p><?php _e('This option hides the text at the bottom of the WordPress admin: <code>Thank you for creating with WordPress</code> on the bottom left, and the WordPress version on the bottom right.', 'disable-dashboard-for-woocommerce'); ?></p> 236 <?php 292 237 } 293 238 … … 295 240 function wcbloat_admin_wp_login_page_section_callback() 296 241 { 297 _e( 'There are situations when you may prefer to hide or change the standard WordPress branding on the Login Page.', 'disable-dashboard-for-woocommerce');242 _e('There are situations when you may prefer to hide or change the standard WordPress branding on the Login Page.', 'disable-dashboard-for-woocommerce'); 298 243 } 299 244 … … 301 246 function wcbloat_hide_wp_logo_on_login_page_callback() 302 247 { 303 $value = get_option( 'wcbloat_hide_wp_logo_on_login_page');304 ?>248 $value = get_option('wcbloat_hide_wp_logo_on_login_page'); 249 ?> 305 250 <input type='hidden' name='wcbloat_hide_wp_logo_on_login_page' value='no'> 306 <label><input type='checkbox' name='wcbloat_hide_wp_logo_on_login_page' <?php 307 checked( esc_attr( $value ), 'yes' ); 308 echo wcbloat_is_pro_readonly() ; 309 ?> value='yes'> <?php 310 esc_attr_e( 'Hide WordPress logo on the WordPress Login Page', 'disable-dashboard-for-woocommerce' ); 311 echo wcbloat_is_pro_badge() ; 312 ?></label> 313 <p><?php 314 _e( 'Hide standard WordPress Logo from Login Page', 'disable-dashboard-for-woocommerce' ); 315 ?></p> 316 <?php 251 <label><input type='checkbox' name='wcbloat_hide_wp_logo_on_login_page' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Hide WordPress logo on the WordPress Login Page', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 252 <p><?php _e('Hide standard WordPress Logo from Login Page', 'disable-dashboard-for-woocommerce'); ?></p> 253 <?php 317 254 } 318 255 … … 320 257 function wcbloat_wp_logo_url_disable_callback() 321 258 { 322 $value = get_option( 'wcbloat_wp_logo_url_disable');323 ?>259 $value = get_option('wcbloat_wp_logo_url_disable'); 260 ?> 324 261 <input type='hidden' name='wcbloat_wp_logo_url_disable' value='no'> 325 <label><input type='checkbox' name='wcbloat_wp_logo_url_disable' <?php 326 checked( esc_attr( $value ), 'yes' ); 327 echo wcbloat_is_pro_readonly() ; 328 ?> value='yes'> <?php 329 esc_attr_e( 'Change the Logo Link on the WordPress Login Page', 'disable-dashboard-for-woocommerce' ); 330 echo wcbloat_is_pro_badge() ; 331 ?></label> 332 <p><?php 333 _e( 'By default, the WordPress login page displays the WordPress logo which is linking to WordPress.org site. After activating this option, the logo on the login page will be linking to your site\'s homepage.', 'disable-dashboard-for-woocommerce' ); 334 ?></p> 335 <?php 262 <label><input type='checkbox' name='wcbloat_wp_logo_url_disable' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Change the Logo Link on the WordPress Login Page', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 263 <p><?php _e('By default, the WordPress login page displays the WordPress logo which is linking to WordPress.org site. After activating this option, the logo on the login page will be linking to your site\'s homepage.', 'disable-dashboard-for-woocommerce'); ?></p> 264 <?php 336 265 } 337 266 … … 339 268 function wcbloat_wp_logo_title_callback() 340 269 { 341 $value = get_option( 'wcbloat_wp_logo_title');342 ?>270 $value = get_option('wcbloat_wp_logo_title'); 271 ?> 343 272 <input type='hidden' name='wcbloat_wp_logo_title' value='no'> 344 <label><input type='checkbox' name='wcbloat_wp_logo_title' <?php 345 checked( esc_attr( $value ), 'yes' ); 346 echo wcbloat_is_pro_readonly() ; 347 ?> value='yes'> <?php 348 esc_attr_e( 'Change the Logo title parameter on the WordPress Login Page', 'disable-dashboard-for-woocommerce' ); 349 echo wcbloat_is_pro_badge() ; 350 ?></label> 351 <p><?php 352 _e( 'By default, the WordPress Logo displayed on the WordPress Login Page has a title parameter that says <code>Powered by WordPress</code>. After activating this option, it will match your Site Name.', 'disable-dashboard-for-woocommerce' ); 353 ?></p> 354 <?php 273 <label><input type='checkbox' name='wcbloat_wp_logo_title' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Change the Logo title parameter on the WordPress Login Page', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 274 <p><?php _e('By default, the WordPress Logo displayed on the WordPress Login Page has a title parameter that says <code>Powered by WordPress</code>. After activating this option, it will match your Site Name.', 'disable-dashboard-for-woocommerce'); ?></p> 275 <?php 355 276 } 356 277 … … 358 279 function wcbloat_wp_language_select_disable_callback() 359 280 { 360 $value = get_option( 'wcbloat_wp_language_select_disable');361 ?>281 $value = get_option('wcbloat_wp_language_select_disable'); 282 ?> 362 283 <input type='hidden' name='wcbloat_wp_language_select_disable' value='no'> 363 <label><input type='checkbox' name='wcbloat_wp_language_select_disable' <?php 364 checked( esc_attr( $value ), 'yes' ); 365 echo wcbloat_is_pro_readonly() ; 366 ?> value='yes'> <?php 367 esc_attr_e( 'Disable WordPress Login Language Switcher', 'disable-dashboard-for-woocommerce' ); 368 echo wcbloat_is_pro_badge() ; 369 ?></label> 370 <p><?php 371 _e( 'This option will disable the language selector which allows users to switch languages from a dropdown on the login screen if more than one language is enabled on your WordPress installation.', 'disable-dashboard-for-woocommerce' ); 372 ?></p> 373 <?php 374 } 284 <label><input type='checkbox' name='wcbloat_wp_language_select_disable' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Disable WordPress Login Language Switcher', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 285 <p><?php _e('This option will disable the language selector which allows users to switch languages from a dropdown on the login screen if more than one language is enabled on your WordPress installation.', 'disable-dashboard-for-woocommerce'); ?></p> 286 <?php 287 } -
disable-dashboard-for-woocommerce/trunk/includes/settings/class-disable-bloat-settings-performance.php
r2873201 r2930475 1 1 <?php 2 2 3 if ( !defined( 'ABSPATH' ) ) { 4 exit; 5 } 6 // Exit if accessed directly 3 if (!defined('ABSPATH')) exit; // Exit if accessed directly 4 7 5 // Add sections and fields on Main settings screen 8 6 function wcbloat_performance_settings_init() 9 7 { 10 // Section's icon 11 add_settings_section( 12 'wcbloat-performance-icon-section', 13 '', 14 'wcbloat_performance_icon_callback', 15 'wcbloat-performance' 16 ); 17 // Section's title and description 18 add_settings_section( 19 'wcbloat-site-performance-desc-section', 20 esc_attr__( 'Site performance', 'disable-dashboard-for-woocommerce' ), 21 'wcbloat_site_performance_desc_callback', 22 'wcbloat-performance' 23 ); 24 // Speed up your site section 25 add_settings_section( 26 'wcbloat-performance-speed-section', 27 esc_attr__( 'Speed up your site', 'disable-dashboard-for-woocommerce' ), 28 'wcbloat_performance_speed_section_callback', 29 'wcbloat-performance' 30 ); 31 // Disable Password Strength Meter 32 add_settings_field( 33 'wcbloat_password_meter_disable', 34 'Password Strength Meter', 35 'wcbloat_password_meter_disable_callback', 36 'wcbloat-performance', 37 'wcbloat-performance-speed-section' 38 ); 39 register_setting( 'wcbloat-performance-options', 'wcbloat_password_meter_disable', array( 40 'sanitize_callback' => 'sanitize_key', 41 ) ); 42 // Load comment script only when needed 43 add_settings_field( 44 'wcbloat_load_comment_scripts_when_needed', 45 'Comments scripts', 46 'wcbloat_load_comment_scripts_when_needed_callback', 47 'wcbloat-performance', 48 'wcbloat-performance-speed-section' 49 ); 50 register_setting( 'wcbloat-performance-options', 'wcbloat_load_comment_scripts_when_needed', array( 51 'sanitize_callback' => 'sanitize_key', 52 ) ); 53 // Prevent auto-linking URLs in comments 54 add_settings_field( 55 'wcbloat_prevent_linking_url_comments', 56 'Auto-linking URLs in comments', 57 'wcbloat_prevent_linking_url_comments_callback', 58 'wcbloat-performance', 59 'wcbloat-performance-speed-section' 60 ); 61 register_setting( 'wcbloat-performance-options', 'wcbloat_prevent_linking_url_comments', array( 62 'sanitize_callback' => 'sanitize_key', 63 ) ); 64 // Disable Dashicons 65 add_settings_field( 66 'wcbloat_disable_dashicons', 67 'Disable Dashicons', 68 'wcbloat_disable_dashicons_callback', 69 'wcbloat-performance', 70 'wcbloat-performance-speed-section' 71 ); 72 register_setting( 'wcbloat-performance-options', 'wcbloat_disable_dashicons', array( 73 'sanitize_callback' => 'sanitize_key', 74 ) ); 75 // Remove DNS prefetch to s.w.org PRO 76 add_settings_field( 77 'wcbloat_remove_dns_prefetch', 78 'DNS prefetch to s.w.org', 79 'wcbloat_remove_dns_prefetch_callback', 80 'wcbloat-performance', 81 'wcbloat-performance-speed-section' 82 ); 83 register_setting( 'wcbloat-performance-options', 'wcbloat_remove_dns_prefetch', array( 84 'sanitize_callback' => 'sanitize_key', 85 ) ); 86 // Disable jQuery Migrate PRO 87 add_settings_field( 88 'wcbloat_disable_jquery_migrate', 89 'Disable jQuery Migrate', 90 'wcbloat_disable_jquery_migrate_callback', 91 'wcbloat-performance', 92 'wcbloat-performance-speed-section' 93 ); 94 register_setting( 'wcbloat-performance-options', 'wcbloat_disable_jquery_migrate', array( 95 'sanitize_callback' => 'sanitize_key', 96 ) ); 97 // Disable Sidebar WordPress Widgets PRO 98 add_settings_field( 99 'wcbloat_wp_sidebar_widgets_disable', 100 esc_attr__( 'Disable Sidebar WordPress Widgets', 'disable-dashboard-for-woocommerce' ), 101 'wcbloat_wp_sidebar_widgets_disable_callback', 102 'wcbloat-performance', 103 'wcbloat-performance-speed-section' 104 ); 105 register_setting( 'wcbloat-performance-options', 'wcbloat_wp_sidebar_widgets_disable', 'validate_setting' ); 106 // Remove WordPress Meta Generator Tag PRO 107 add_settings_field( 108 'wcbloat_wp_meta_generator_disable', 109 'WordPress & WooCommerce Meta Generator Tag', 110 'wcbloat_wp_meta_generator_disable_callback', 111 'wcbloat-performance', 112 'wcbloat-performance-speed-section' 113 ); 114 register_setting( 'wcbloat-performance-options', 'wcbloat_wp_meta_generator_disable', array( 115 'sanitize_callback' => 'sanitize_key', 116 ) ); 117 // Remove emoji styles and scripts PRO 118 add_settings_field( 119 'wcbloat_remove_emoji_scripts', 120 'Emoji styles and scripts', 121 'wcbloat_remove_emoji_scripts_callback', 122 'wcbloat-performance', 123 'wcbloat-performance-speed-section' 124 ); 125 register_setting( 'wcbloat-performance-options', 'wcbloat_remove_emoji_scripts', array( 126 'sanitize_callback' => 'sanitize_key', 127 ) ); 128 // Disable wp-embed PRO 129 add_settings_field( 130 'wcbloat_disable_wp_embed', 131 'Disable wp-embed', 132 'wcbloat_disable_wp_embed_callback', 133 'wcbloat-performance', 134 'wcbloat-performance-speed-section' 135 ); 136 register_setting( 'wcbloat-performance-options', 'wcbloat_disable_wp_embed', array( 137 'sanitize_callback' => 'sanitize_key', 138 ) ); 139 // Remove unwanted scripts from header section 140 add_settings_section( 141 'wcbloat-site-performance-header-section', 142 esc_attr__( 'Remove scripts from Header', 'disable-dashboard-for-woocommerce' ), 143 'wcbloat_site_performance_header_section_callback', 144 'wcbloat-performance' 145 ); 146 // Remove RSS Feed Links PRO 147 add_settings_field( 148 'wcbloat_remove_rss_links', 149 'RSS Feed Links', 150 'wcbloat_remove_rss_links_callback', 151 'wcbloat-performance', 152 'wcbloat-site-performance-header-section' 153 ); 154 register_setting( 'wcbloat-performance-options', 'wcbloat_remove_rss_links', array( 155 'sanitize_callback' => 'sanitize_key', 156 ) ); 157 // Disable the RSS feeds PRO 158 add_settings_field( 159 'wcbloat_disable_all_feeds', 160 'RSS feeds', 161 'wcbloat_disable_all_feeds_callback', 162 'wcbloat-performance', 163 'wcbloat-site-performance-header-section' 164 ); 165 register_setting( 'wcbloat-performance-options', 'wcbloat_disable_all_feeds', array( 166 'sanitize_callback' => 'sanitize_key', 167 ) ); 168 // Remove Feed Generator Tag PRO 169 add_settings_field( 170 'wcbloat_remove_feed_generator_tag', 171 'Feed Generator Tag', 172 'wcbloat_remove_feed_generator_tag_callback', 173 'wcbloat-performance', 174 'wcbloat-site-performance-header-section' 175 ); 176 register_setting( 'wcbloat-performance-options', 'wcbloat_remove_feed_generator_tag', array( 177 'sanitize_callback' => 'sanitize_key', 178 ) ); 179 // Remove Link to the WLW Manifest File PRO 180 add_settings_field( 181 'wcbloat_disable_wlw_link', 182 'Windows Live Writer', 183 'wcbloat_disable_wlw_link_callback', 184 'wcbloat-performance', 185 'wcbloat-site-performance-header-section' 186 ); 187 register_setting( 'wcbloat-performance-options', 'wcbloat_disable_wlw_link', array( 188 'sanitize_callback' => 'sanitize_key', 189 ) ); 190 // Remove RSD link PRO 191 add_settings_field( 192 'wcbloat_disable_rsd_link', 193 'RSD Link', 194 'wcbloat_disable_rsd_link_callback', 195 'wcbloat-performance', 196 'wcbloat-site-performance-header-section' 197 ); 198 register_setting( 'wcbloat-performance-options', 'wcbloat_disable_rsd_link', array( 199 'sanitize_callback' => 'sanitize_key', 200 ) ); 201 // Remove RSD link PRO 202 add_settings_field( 203 'wcbloat_disable_rsd_link', 204 'RSD Link', 205 'wcbloat_disable_rsd_link_callback', 206 'wcbloat-performance', 207 'wcbloat-site-performance-header-section' 208 ); 209 register_setting( 'wcbloat-performance-options', 'wcbloat_disable_rsd_link', array( 210 'sanitize_callback' => 'sanitize_key', 211 ) ); 212 // Remove Shortlink From HTTP Header PRO 213 add_settings_field( 214 'wcbloat_remove_shortlink', 215 'Shortlink', 216 'wcbloat_remove_shortlink_callback', 217 'wcbloat-performance', 218 'wcbloat-site-performance-header-section' 219 ); 220 register_setting( 'wcbloat-performance-options', 'wcbloat_remove_shortlink', array( 221 'sanitize_callback' => 'sanitize_key', 222 ) ); 8 9 // Section's icon 10 add_settings_section( 11 'wcbloat-performance-icon-section', 12 '', 13 'wcbloat_performance_icon_callback', 14 'wcbloat-performance' 15 ); 16 17 // Section's title and description 18 add_settings_section( 19 'wcbloat-site-performance-desc-section', 20 esc_attr__('Site performance', 'disable-dashboard-for-woocommerce'), 21 'wcbloat_site_performance_desc_callback', 22 'wcbloat-performance' 23 ); 24 25 // Speed up your site section 26 add_settings_section( 27 'wcbloat-performance-speed-section', 28 esc_attr__('Speed up your site', 'disable-dashboard-for-woocommerce'), 29 'wcbloat_performance_speed_section_callback', 30 'wcbloat-performance' 31 ); 32 33 // Disable Password Strength Meter 34 add_settings_field( 35 'wcbloat_password_meter_disable', 36 'Password Strength Meter', 37 'wcbloat_password_meter_disable_callback', 38 'wcbloat-performance', 39 'wcbloat-performance-speed-section' 40 ); 41 register_setting( 42 'wcbloat-performance-options', 43 'wcbloat_password_meter_disable', 44 array('sanitize_callback' => 'sanitize_key') 45 ); 46 47 // Load comment script only when needed 48 add_settings_field( 49 'wcbloat_load_comment_scripts_when_needed', 50 'Comments scripts', 51 'wcbloat_load_comment_scripts_when_needed_callback', 52 'wcbloat-performance', 53 'wcbloat-performance-speed-section' 54 ); 55 register_setting( 56 'wcbloat-performance-options', 57 'wcbloat_load_comment_scripts_when_needed', 58 array('sanitize_callback' => 'sanitize_key') 59 ); 60 61 // Prevent auto-linking URLs in comments 62 add_settings_field( 63 'wcbloat_prevent_linking_url_comments', 64 'Auto-linking URLs in comments', 65 'wcbloat_prevent_linking_url_comments_callback', 66 'wcbloat-performance', 67 'wcbloat-performance-speed-section' 68 ); 69 register_setting( 70 'wcbloat-performance-options', 71 'wcbloat_prevent_linking_url_comments', 72 array('sanitize_callback' => 'sanitize_key') 73 ); 74 75 // Disable Dashicons 76 add_settings_field( 77 'wcbloat_disable_dashicons', 78 'Disable Dashicons', 79 'wcbloat_disable_dashicons_callback', 80 'wcbloat-performance', 81 'wcbloat-performance-speed-section' 82 ); 83 register_setting( 84 'wcbloat-performance-options', 85 'wcbloat_disable_dashicons', 86 array('sanitize_callback' => 'sanitize_key') 87 ); 88 89 // Remove DNS prefetch to s.w.org PRO 90 add_settings_field( 91 'wcbloat_remove_dns_prefetch', 92 'DNS prefetch to s.w.org', 93 'wcbloat_remove_dns_prefetch_callback', 94 'wcbloat-performance', 95 'wcbloat-performance-speed-section' 96 ); 97 register_setting( 98 'wcbloat-performance-options', 99 'wcbloat_remove_dns_prefetch', 100 array('sanitize_callback' => 'sanitize_key') 101 ); 102 103 // Disable jQuery Migrate PRO 104 add_settings_field( 105 'wcbloat_disable_jquery_migrate', 106 'Disable jQuery Migrate', 107 'wcbloat_disable_jquery_migrate_callback', 108 'wcbloat-performance', 109 'wcbloat-performance-speed-section' 110 ); 111 register_setting( 112 'wcbloat-performance-options', 113 'wcbloat_disable_jquery_migrate', 114 array('sanitize_callback' => 'sanitize_key') 115 ); 116 117 // Disable Sidebar WordPress Widgets PRO 118 add_settings_field( 119 'wcbloat_wp_sidebar_widgets_disable', 120 esc_attr__( 'Disable Sidebar WordPress Widgets', 'disable-dashboard-for-woocommerce' ), 121 'wcbloat_wp_sidebar_widgets_disable_callback', 122 'wcbloat-performance', 123 'wcbloat-performance-speed-section' ); 124 register_setting( 125 'wcbloat-performance-options', 126 'wcbloat_wp_sidebar_widgets_disable', 127 'validate_setting' 128 ); 129 130 // Remove WordPress Meta Generator Tag PRO 131 add_settings_field( 132 'wcbloat_wp_meta_generator_disable', 133 'WordPress & WooCommerce Meta Generator Tag', 134 'wcbloat_wp_meta_generator_disable_callback', 135 'wcbloat-performance', 136 'wcbloat-performance-speed-section' 137 ); 138 register_setting( 139 'wcbloat-performance-options', 140 'wcbloat_wp_meta_generator_disable', 141 array('sanitize_callback' => 'sanitize_key') 142 ); 143 144 // Remove emoji styles and scripts PRO 145 add_settings_field( 146 'wcbloat_remove_emoji_scripts', 147 'Emoji styles and scripts', 148 'wcbloat_remove_emoji_scripts_callback', 149 'wcbloat-performance', 150 'wcbloat-performance-speed-section' 151 ); 152 register_setting( 153 'wcbloat-performance-options', 154 'wcbloat_remove_emoji_scripts', 155 array('sanitize_callback' => 'sanitize_key') 156 ); 157 158 // Disable wp-embed PRO 159 add_settings_field( 160 'wcbloat_disable_wp_embed', 161 'Disable wp-embed', 162 'wcbloat_disable_wp_embed_callback', 163 'wcbloat-performance', 164 'wcbloat-performance-speed-section' 165 ); 166 register_setting( 167 'wcbloat-performance-options', 168 'wcbloat_disable_wp_embed', 169 array('sanitize_callback' => 'sanitize_key') 170 ); 171 172 // Remove unwanted scripts from header section 173 add_settings_section( 174 'wcbloat-site-performance-header-section', 175 esc_attr__('Remove scripts from Header', 'disable-dashboard-for-woocommerce'), 176 'wcbloat_site_performance_header_section_callback', 177 'wcbloat-performance' 178 ); 179 180 // Remove RSS Feed Links PRO 181 add_settings_field( 182 'wcbloat_remove_rss_links', 183 'RSS Feed Links', 184 'wcbloat_remove_rss_links_callback', 185 'wcbloat-performance', 186 'wcbloat-site-performance-header-section' 187 ); 188 register_setting( 189 'wcbloat-performance-options', 190 'wcbloat_remove_rss_links', 191 array('sanitize_callback' => 'sanitize_key') 192 ); 193 194 // Disable the RSS feeds PRO 195 add_settings_field( 196 'wcbloat_disable_all_feeds', 197 'RSS feeds', 198 'wcbloat_disable_all_feeds_callback', 199 'wcbloat-performance', 200 'wcbloat-site-performance-header-section' 201 ); 202 register_setting( 203 'wcbloat-performance-options', 204 'wcbloat_disable_all_feeds', 205 array('sanitize_callback' => 'sanitize_key') 206 ); 207 208 // Remove Feed Generator Tag PRO 209 add_settings_field( 210 'wcbloat_remove_feed_generator_tag', 211 'Feed Generator Tag', 212 'wcbloat_remove_feed_generator_tag_callback', 213 'wcbloat-performance', 214 'wcbloat-site-performance-header-section' 215 ); 216 register_setting( 217 'wcbloat-performance-options', 218 'wcbloat_remove_feed_generator_tag', 219 array('sanitize_callback' => 'sanitize_key') 220 ); 221 222 // Remove Link to the WLW Manifest File PRO 223 add_settings_field( 224 'wcbloat_disable_wlw_link', 225 'Windows Live Writer', 226 'wcbloat_disable_wlw_link_callback', 227 'wcbloat-performance', 228 'wcbloat-site-performance-header-section' 229 ); 230 register_setting( 231 'wcbloat-performance-options', 232 'wcbloat_disable_wlw_link', 233 array('sanitize_callback' => 'sanitize_key') 234 ); 235 236 // Remove RSD link PRO 237 add_settings_field( 238 'wcbloat_disable_rsd_link', 239 'RSD Link', 240 'wcbloat_disable_rsd_link_callback', 241 'wcbloat-performance', 242 'wcbloat-site-performance-header-section' 243 ); 244 register_setting( 245 'wcbloat-performance-options', 246 'wcbloat_disable_rsd_link', 247 array('sanitize_callback' => 'sanitize_key') 248 ); 249 250 // Remove RSD link PRO 251 add_settings_field( 252 'wcbloat_disable_rsd_link', 253 'RSD Link', 254 'wcbloat_disable_rsd_link_callback', 255 'wcbloat-performance', 256 'wcbloat-site-performance-header-section' 257 ); 258 register_setting( 259 'wcbloat-performance-options', 260 'wcbloat_disable_rsd_link', 261 array('sanitize_callback' => 'sanitize_key') 262 ); 263 264 // Remove Shortlink From HTTP Header PRO 265 add_settings_field( 266 'wcbloat_remove_shortlink', 267 'Shortlink', 268 'wcbloat_remove_shortlink_callback', 269 'wcbloat-performance', 270 'wcbloat-site-performance-header-section' 271 ); 272 register_setting( 273 'wcbloat-performance-options', 274 'wcbloat_remove_shortlink', 275 array('sanitize_callback' => 'sanitize_key') 276 ); 277 223 278 } 224 279 225 280 // Display the fields added before 226 add_action( 'admin_init', 'wcbloat_performance_settings_init' ); 281 add_action('admin_init', 'wcbloat_performance_settings_init'); 282 227 283 // Fields callbacks 284 228 285 // Section's icon 229 286 function wcbloat_performance_icon_callback() 230 287 { 231 _e( '<span class="dashicons dashicons-admin-site-alt"></span>');288 _e('<span class="dashicons dashicons-admin-site-alt"></span>'); 232 289 } 233 290 … … 235 292 function wcbloat_site_performance_desc_callback() 236 293 { 237 _e( 'Page load time is very important for your visitors. To improve page load time, try to disable scripts, features, and unnecessary queries:<hr />', 'disable-dashboard-for-woocommerce');294 _e('Page load time is very important for your visitors. To improve page load time, try to disable scripts, features, and unnecessary queries:<hr />', 'disable-dashboard-for-woocommerce'); 238 295 } 239 296 … … 241 298 function wcbloat_performance_speed_section_callback() 242 299 { 243 _e( 'Use the settings from this section to reduce page load time on the front-end of your WordPress site. Before disabling them, please make sure that you will not use any of these features - so they can be safely turned off.', 'disable-dashboard-for-woocommerce');244 _e( wcbloat_buy_pro_bar() );300 _e('Use the settings from this section to reduce page load time on the front-end of your WordPress site. Before disabling them, please make sure that you will not use any of these features - so they can be safely turned off.', 'disable-dashboard-for-woocommerce'); 301 _e ( wcbloat_buy_pro_bar() ); 245 302 } 246 303 … … 248 305 function wcbloat_password_meter_disable_callback() 249 306 { 250 $value = get_option( 'wcbloat_password_meter_disable');251 ?>307 $value = get_option('wcbloat_password_meter_disable'); 308 ?> 252 309 <input type='hidden' name='wcbloat_password_meter_disable' value='no'> 253 <label><input type='checkbox' name='wcbloat_password_meter_disable' <?php 254 checked( esc_attr( $value ), 'yes' ); 255 ?> value='yes'> <?php 256 esc_attr_e( 'Disable Password Strength Meter', 'disable-dashboard-for-woocommerce' ); 257 ?></label> 258 <p><?php 259 _e( 'Removes the WordPress and WooCommerce password strength meter scripts (over 400 KB) from non-essential pages.', 'disable-dashboard-for-woocommerce' ); 260 ?></p> 261 <?php 310 <label><input type='checkbox' name='wcbloat_password_meter_disable' <?php checked(esc_attr($value), 'yes'); ?> value='yes'> <?php esc_attr_e('Disable Password Strength Meter', 'disable-dashboard-for-woocommerce'); ?></label> 311 <p><?php _e('Removes the WordPress and WooCommerce password strength meter scripts (over 400 KB) from non-essential pages.', 'disable-dashboard-for-woocommerce'); ?></p> 312 <?php 262 313 } 263 314 … … 265 316 function wcbloat_load_comment_scripts_when_needed_callback() 266 317 { 267 $value = get_option( 'wcbloat_load_comment_scripts_when_needed');268 ?>318 $value = get_option('wcbloat_load_comment_scripts_when_needed'); 319 ?> 269 320 <input type='hidden' name='wcbloat_load_comment_scripts_when_needed' value='no'> 270 <label><input type='checkbox' name='wcbloat_load_comment_scripts_when_needed' <?php 271 checked( esc_attr( $value ), 'yes' ); 272 ?> value='yes'> <?php 273 esc_attr_e( 'Load Comments script only when needed', 'disable-dashboard-for-woocommerce' ); 274 ?></label> 275 <p><?php 276 _e( 'By default, WordPress Comments javascript files are loaded everywhere on your site. This option will load the Comments script only when needed (on single posts and pages with existing comments).', 'disable-dashboard-for-woocommerce' ); 277 ?></p> 278 <?php 321 <label><input type='checkbox' name='wcbloat_load_comment_scripts_when_needed' <?php checked(esc_attr($value), 'yes'); ?> value='yes'> <?php esc_attr_e('Load Comments script only when needed', 'disable-dashboard-for-woocommerce'); ?></label> 322 <p><?php _e('By default, WordPress Comments javascript files are loaded everywhere on your site. This option will load the Comments script only when needed (on single posts and pages with existing comments).', 'disable-dashboard-for-woocommerce'); ?></p> 323 <?php 279 324 } 280 325 … … 282 327 function wcbloat_prevent_linking_url_comments_callback() 283 328 { 284 $value = get_option( 'wcbloat_prevent_linking_url_comments');285 ?>329 $value = get_option('wcbloat_prevent_linking_url_comments'); 330 ?> 286 331 <input type='hidden' name='wcbloat_prevent_linking_url_comments' value='no'> 287 <label><input type='checkbox' name='wcbloat_prevent_linking_url_comments' <?php 288 checked( esc_attr( $value ), 'yes' ); 289 ?> value='yes'> <?php 290 esc_attr_e( 'Prevent auto-linking URLs in comments', 'disable-dashboard-for-woocommerce' ); 291 ?></label> 292 <p><?php 293 _e( 'In a standard WordPress installation, adding clickable links to the comments is made on the fly while generating the page which may be time- and resource-consuming. This option will prevent auto-linking URLs in comments.', 'disable-dashboard-for-woocommerce' ); 294 ?></p> 295 <?php 332 <label><input type='checkbox' name='wcbloat_prevent_linking_url_comments' <?php checked(esc_attr($value), 'yes'); ?> value='yes'> <?php esc_attr_e('Prevent auto-linking URLs in comments', 'disable-dashboard-for-woocommerce'); ?></label> 333 <p><?php _e('In a standard WordPress installation, adding clickable links to the comments is made on the fly while generating the page which may be time- and resource-consuming. This option will prevent auto-linking URLs in comments.', 'disable-dashboard-for-woocommerce'); ?></p> 334 <?php 296 335 } 297 336 … … 299 338 function wcbloat_disable_dashicons_callback() 300 339 { 301 $value = get_option( 'wcbloat_disable_dashicons');302 ?>340 $value = get_option('wcbloat_disable_dashicons'); 341 ?> 303 342 <input type='hidden' name='wcbloat_disable_dashicons' value='no'> 304 <label><input type='checkbox' name='wcbloat_disable_dashicons' <?php 305 checked( esc_attr( $value ), 'yes' ); 306 ?> value='yes'> <?php 307 esc_attr_e( 'Disable WordPress Dashicons on the front-end', 'disable-dashboard-for-woocommerce' ); 308 ?></label> 309 <p><?php 310 _e( 'Dashicons add additional overhead to your site, slowing it down, especially on slower computers or mobile devices. Disabling dashicons can help reduce the total size of your page and improve your site\'s performance.', 'disable-dashboard-for-woocommerce' ); 311 ?></p> 312 <?php 343 <label><input type='checkbox' name='wcbloat_disable_dashicons' <?php checked(esc_attr($value), 'yes'); ?> value='yes'> <?php esc_attr_e('Disable WordPress Dashicons on the front-end', 'disable-dashboard-for-woocommerce'); ?></label> 344 <p><?php _e('Dashicons add additional overhead to your site, slowing it down, especially on slower computers or mobile devices. Disabling dashicons can help reduce the total size of your page and improve your site\'s performance.', 'disable-dashboard-for-woocommerce'); ?></p> 345 <?php 313 346 } 314 347 … … 316 349 function wcbloat_disable_jquery_migrate_callback() 317 350 { 318 $value = get_option( 'wcbloat_disable_jquery_migrate');319 ?>351 $value = get_option('wcbloat_disable_jquery_migrate'); 352 ?> 320 353 <input type='hidden' name='wcbloat_disable_jquery_migrate' value='no'> 321 <label><input type='checkbox' name='wcbloat_disable_jquery_migrate' <?php 322 checked( esc_attr( $value ), 'yes' ); 323 echo wcbloat_is_pro_readonly() ; 324 ?> value='yes'> <?php 325 esc_attr_e( 'Disable jQuery Migrate', 'disable-dashboard-for-woocommerce' ); 326 echo wcbloat_is_pro_badge() ; 327 ?></label> 328 <p><?php 329 _e( 'The jQuery Migrate was introduced in WordPress to provide backward compatibility for older jQuery code. However, in recent versions of WordPress, many of the compatibility issues have been resolved, so it is no longer necessary in most cases. Disabling jQuery Migrate can improve the performance of your WordPress website by reducing the amount of JavaScript code that needs to be loaded, and by reducing the number of warnings and error messages that are output to the browser console. Additionally, by disabling the plugin, you can avoid potential security vulnerabilities that may arise from using outdated and unsupported code.', 'disable-dashboard-for-woocommerce' ); 330 ?></p> 331 <?php 354 <label><input type='checkbox' name='wcbloat_disable_jquery_migrate' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Disable jQuery Migrate', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 355 <p><?php _e('The jQuery Migrate was introduced in WordPress to provide backward compatibility for older jQuery code. However, in recent versions of WordPress, many of the compatibility issues have been resolved, so it is no longer necessary in most cases. Disabling jQuery Migrate can improve the performance of your WordPress website by reducing the amount of JavaScript code that needs to be loaded, and by reducing the number of warnings and error messages that are output to the browser console. Additionally, by disabling the plugin, you can avoid potential security vulnerabilities that may arise from using outdated and unsupported code.', 'disable-dashboard-for-woocommerce'); ?></p> 356 <?php 332 357 } 333 358 … … 335 360 function wcbloat_remove_dns_prefetch_callback() 336 361 { 337 $value = get_option( 'wcbloat_remove_dns_prefetch');338 ?>362 $value = get_option('wcbloat_remove_dns_prefetch'); 363 ?> 339 364 <input type='hidden' name='wcbloat_remove_dns_prefetch' value='no'> 340 <label><input type='checkbox' name='wcbloat_remove_dns_prefetch' <?php 341 checked( esc_attr( $value ), 'yes' ); 342 echo wcbloat_is_pro_readonly() ; 343 ?> value='yes'> <?php 344 esc_attr_e( 'Remove DNS prefetch to s.w.org', 'disable-dashboard-for-woocommerce' ); 345 echo wcbloat_is_pro_badge() ; 346 ?></label> 347 <p><?php 348 _e( 'DNS prefetching is an attempt to resolve domain names before a user tries to follow a link. Activating this option will remove DNS prefetch to s.w.org and may result in page load optimization.', 'disable-dashboard-for-woocommerce' ); 349 ?></p> 350 <?php 365 <label><input type='checkbox' name='wcbloat_remove_dns_prefetch' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove DNS prefetch to s.w.org', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 366 <p><?php _e('DNS prefetching is an attempt to resolve domain names before a user tries to follow a link. Activating this option will remove DNS prefetch to s.w.org and may result in page load optimization.', 'disable-dashboard-for-woocommerce'); ?></p> 367 <?php 351 368 } 352 369 … … 354 371 function wcbloat_wp_sidebar_widgets_disable_callback() 355 372 { 356 $options = get_option( 'wcbloat_wp_sidebar_widgets_disable' ); 357 ?>373 $options = get_option('wcbloat_wp_sidebar_widgets_disable'); 374 ?> 358 375 <div class="wcbloat-select-unselect-buttons"> 359 <a <?php 360 ?> class="button button-secondary"<?php 361 echo wcbloat_is_pro_readonly() ; 362 ?>><?php 363 esc_attr_e( 'Select / Deselect All', 'disable-dashboard-for-woocommerce' ); 364 ?></a> 376 <a <?php if ( wcbloat_fs()->is__premium_only() ) { if ( wcbloat_fs()->is_plan( 'pro' ) ) { _e('id="select-all"'); }} ?> class="button button-secondary"<?php echo wcbloat_is_pro_readonly();?>><?php esc_attr_e('Select / Deselect All', 'disable-dashboard-for-woocommerce'); ?></a> 365 377 </div> 366 378 <table id="wcbloat-multi-checkbox-table"> 367 379 <tbody> 368 380 <tr> 369 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 370 if ( !empty($options) ) { 371 if ( in_array( 'archives', $options ) ) { 372 esc_attr_e( 'checked' ); 373 } 374 } 375 echo wcbloat_is_pro_readonly() ; 376 ?> value='archives'><?php 377 esc_attr_e( 'Archives', 'disable-dashboard-for-woocommerce' ); 378 ?></td> 379 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 380 if ( !empty($options) ) { 381 if ( in_array( 'audio', $options ) ) { 382 esc_attr_e( 'checked' ); 383 } 384 } 385 echo wcbloat_is_pro_readonly() ; 386 ?> value='audio'><?php 387 esc_attr_e( 'Audio', 'disable-dashboard-for-woocommerce' ); 388 ?></td> 389 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 390 if ( !empty($options) ) { 391 if ( in_array( 'block', $options ) ) { 392 esc_attr_e( 'checked' ); 393 } 394 } 395 echo wcbloat_is_pro_readonly() ; 396 ?> value='block'><?php 397 esc_attr_e( 'Block', 'disable-dashboard-for-woocommerce' ); 398 ?></td> 381 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('archives', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='archives'><?php esc_attr_e('Archives', 'disable-dashboard-for-woocommerce'); ?></td> 382 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('audio', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='audio'><?php esc_attr_e('Audio', 'disable-dashboard-for-woocommerce'); ?></td> 383 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('block', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='block'><?php esc_attr_e('Block', 'disable-dashboard-for-woocommerce'); ?></td> 399 384 </tr> 400 385 <tr> 401 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 402 if ( !empty($options) ) { 403 if ( in_array( 'calendar', $options ) ) { 404 esc_attr_e( 'checked' ); 405 } 406 } 407 echo wcbloat_is_pro_readonly() ; 408 ?> value='calendar'><?php 409 esc_attr_e( 'Calendar', 'disable-dashboard-for-woocommerce' ); 410 ?></td> 411 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 412 if ( !empty($options) ) { 413 if ( in_array( 'categories', $options ) ) { 414 esc_attr_e( 'checked' ); 415 } 416 } 417 echo wcbloat_is_pro_readonly() ; 418 ?> value='categories'><?php 419 esc_attr_e( 'Categories', 'disable-dashboard-for-woocommerce' ); 420 ?></td> 421 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 422 if ( !empty($options) ) { 423 if ( in_array( 'html', $options ) ) { 424 esc_attr_e( 'checked' ); 425 } 426 } 427 echo wcbloat_is_pro_readonly() ; 428 ?> value='html'><?php 429 esc_attr_e( 'Custom HTML', 'disable-dashboard-for-woocommerce' ); 430 ?></td> 386 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('calendar', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='calendar'><?php esc_attr_e('Calendar', 'disable-dashboard-for-woocommerce'); ?></td> 387 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('categories', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='categories'><?php esc_attr_e('Categories', 'disable-dashboard-for-woocommerce'); ?></td> 388 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('html', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='html'><?php esc_attr_e('Custom HTML', 'disable-dashboard-for-woocommerce'); ?></td> 431 389 </tr> 432 390 <tr> 433 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 434 if ( !empty($options) ) { 435 if ( in_array( 'gallery', $options ) ) { 436 esc_attr_e( 'checked' ); 437 } 438 } 439 echo wcbloat_is_pro_readonly() ; 440 ?> value='gallery'><?php 441 esc_attr_e( 'Gallery', 'disable-dashboard-for-woocommerce' ); 442 ?></td> 443 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 444 if ( !empty($options) ) { 445 if ( in_array( 'image', $options ) ) { 446 esc_attr_e( 'checked' ); 447 } 448 } 449 echo wcbloat_is_pro_readonly() ; 450 ?> value='image'><?php 451 esc_attr_e( 'Image', 'disable-dashboard-for-woocommerce' ); 452 ?></td> 453 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 454 if ( !empty($options) ) { 455 if ( in_array( 'meta', $options ) ) { 456 esc_attr_e( 'checked' ); 457 } 458 } 459 echo wcbloat_is_pro_readonly() ; 460 ?> value='meta'><?php 461 esc_attr_e( 'Meta', 'disable-dashboard-for-woocommerce' ); 462 ?></td> 391 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('gallery', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='gallery'><?php esc_attr_e('Gallery', 'disable-dashboard-for-woocommerce'); ?></td> 392 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('image', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='image'><?php esc_attr_e('Image', 'disable-dashboard-for-woocommerce'); ?></td> 393 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('meta', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='meta'><?php esc_attr_e('Meta', 'disable-dashboard-for-woocommerce'); ?></td> 463 394 </tr> 464 395 <tr> 465 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 466 if ( !empty($options) ) { 467 if ( in_array( 'navigation', $options ) ) { 468 esc_attr_e( 'checked' ); 469 } 470 } 471 echo wcbloat_is_pro_readonly() ; 472 ?> value='navigation'><?php 473 esc_attr_e( 'Navigation Menu', 'disable-dashboard-for-woocommerce' ); 474 ?></td> 475 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 476 if ( !empty($options) ) { 477 if ( in_array( 'pages', $options ) ) { 478 esc_attr_e( 'checked' ); 479 } 480 } 481 echo wcbloat_is_pro_readonly() ; 482 ?> value='pages'><?php 483 esc_attr_e( 'Pages', 'disable-dashboard-for-woocommerce' ); 484 ?></td> 485 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 486 if ( !empty($options) ) { 487 if ( in_array( 'rss', $options ) ) { 488 esc_attr_e( 'checked' ); 489 } 490 } 491 echo wcbloat_is_pro_readonly() ; 492 ?> value='rss'><?php 493 esc_attr_e( 'RSS', 'disable-dashboard-for-woocommerce' ); 494 ?></td> 396 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('navigation', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='navigation'><?php esc_attr_e('Navigation Menu', 'disable-dashboard-for-woocommerce'); ?></td> 397 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('pages', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='pages'><?php esc_attr_e('Pages', 'disable-dashboard-for-woocommerce'); ?></td> 398 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('rss', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='rss'><?php esc_attr_e('RSS', 'disable-dashboard-for-woocommerce'); ?></td> 495 399 </tr> 496 400 <tr> 497 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 498 if ( !empty($options) ) { 499 if ( in_array( 'comments', $options ) ) { 500 esc_attr_e( 'checked' ); 501 } 502 } 503 echo wcbloat_is_pro_readonly() ; 504 ?> value='comments'><?php 505 esc_attr_e( 'Recent Comments', 'disable-dashboard-for-woocommerce' ); 506 ?></td> 507 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 508 if ( !empty($options) ) { 509 if ( in_array( 'posts', $options ) ) { 510 esc_attr_e( 'checked' ); 511 } 512 } 513 echo wcbloat_is_pro_readonly() ; 514 ?> value='posts'><?php 515 esc_attr_e( 'Recent Posts', 'disable-dashboard-for-woocommerce' ); 516 ?></td> 517 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 518 if ( !empty($options) ) { 519 if ( in_array( 'search', $options ) ) { 520 esc_attr_e( 'checked' ); 521 } 522 } 523 echo wcbloat_is_pro_readonly() ; 524 ?> value='search'><?php 525 esc_attr_e( 'Search', 'disable-dashboard-for-woocommerce' ); 526 ?></td> 401 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('comments', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='comments'><?php esc_attr_e('Recent Comments', 'disable-dashboard-for-woocommerce'); ?></td> 402 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('posts', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='posts'><?php esc_attr_e('Recent Posts', 'disable-dashboard-for-woocommerce'); ?></td> 403 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('search', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='search'><?php esc_attr_e('Search', 'disable-dashboard-for-woocommerce'); ?></td> 527 404 </tr> 528 405 <tr> 529 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 530 if ( !empty($options) ) { 531 if ( in_array( 'tag', $options ) ) { 532 esc_attr_e( 'checked' ); 533 } 534 } 535 echo wcbloat_is_pro_readonly() ; 536 ?> value='tag'><?php 537 esc_attr_e( 'Tag Cloud', 'disable-dashboard-for-woocommerce' ); 538 ?></td> 539 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 540 if ( !empty($options) ) { 541 if ( in_array( 'text', $options ) ) { 542 esc_attr_e( 'checked' ); 543 } 544 } 545 echo wcbloat_is_pro_readonly() ; 546 ?> value='text'><?php 547 esc_attr_e( 'Text', 'disable-dashboard-for-woocommerce' ); 548 ?></td> 549 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php 550 if ( !empty($options) ) { 551 if ( in_array( 'video', $options ) ) { 552 esc_attr_e( 'checked' ); 553 } 554 } 555 echo wcbloat_is_pro_readonly() ; 556 ?> value='video'><?php 557 esc_attr_e( 'Video', 'disable-dashboard-for-woocommerce' ); 558 ?></td> 406 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('tag', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='tag'><?php esc_attr_e('Tag Cloud', 'disable-dashboard-for-woocommerce'); ?></td> 407 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('text', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='text'><?php esc_attr_e('Text', 'disable-dashboard-for-woocommerce'); ?></td> 408 <td class="wcbloat-disable-sidebar-widgets-multi-checkbox"><label><input type='checkbox' name='wcbloat_wp_sidebar_widgets_disable[]' <?php if (!empty($options)) { if (in_array('video', $options)) { esc_attr_e('checked'); }} echo wcbloat_is_pro_readonly();?> value='video'><?php esc_attr_e('Video', 'disable-dashboard-for-woocommerce'); ?></td> 559 409 </tr> 560 410 </tbody> 561 411 </table> 562 <p><?php 563 echo wcbloat_is_pro_badge() ; 564 _e( 'WordPress by default comes with a lot of Dashboard widgets installed. They often are not used at all, but can add backend load and front-end load. Choose Dashboard Widgets you would like to disable for this site. The <strong>ones you choose will be disabled</strong>, and the <strong>ones that had not been selected will stay active</strong>. 565 566 ', 'disable-dashboard-for-woocommerce' ); 567 ?></p> 568 569 <?php 412 <p><?php echo wcbloat_is_pro_badge(); _e('WordPress by default comes with a lot of Dashboard widgets installed. They often are not used at all, but can add backend load and front-end load. Choose Dashboard Widgets you would like to disable for this site. The <strong>ones you choose will be disabled</strong>, and the <strong>ones that had not been selected will stay active</strong>. 413 414 ', 'disable-dashboard-for-woocommerce'); ?></p> 415 416 <?php 570 417 } 571 418 … … 573 420 function wcbloat_wp_meta_generator_disable_callback() 574 421 { 575 $value = get_option( 'wcbloat_wp_meta_generator_disable');576 ?>422 $value = get_option('wcbloat_wp_meta_generator_disable'); 423 ?> 577 424 <input type='hidden' name='wcbloat_wp_meta_generator_disable' value='no'> 578 <label><input type='checkbox' name='wcbloat_wp_meta_generator_disable' <?php 579 checked( esc_attr( $value ), 'yes' ); 580 echo wcbloat_is_pro_readonly() ; 581 ?> value='yes'> <?php 582 esc_attr_e( 'Remove WordPress & WooCommerce Meta Generator Tag', 'disable-dashboard-for-woocommerce' ); 583 echo wcbloat_is_pro_badge() ; 584 ?></label> 585 <p><?php 586 _e( 'Meta Generator Tag displays the WordPress & WooCommerce version number. Removing the meta generator tag protects you against attacks and may reduce your web page\'s size. Use this option to disable the Meta Tag generated by WordPress, WooCommerce, and many other plugins that hook up with the wp_generator action.', 'disable-dashboard-for-woocommerce' ); 587 ?></p> 588 <?php 425 <label><input type='checkbox' name='wcbloat_wp_meta_generator_disable' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove WordPress & WooCommerce Meta Generator Tag', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 426 <p><?php _e('Meta Generator Tag displays the WordPress & WooCommerce version number. Removing the meta generator tag protects you against attacks and may reduce your web page\'s size. Use this option to disable the Meta Tag generated by WordPress, WooCommerce, and many other plugins that hook up with the wp_generator action.', 'disable-dashboard-for-woocommerce'); ?></p> 427 <?php 589 428 } 590 429 … … 592 431 function wcbloat_remove_emoji_scripts_callback() 593 432 { 594 $value = get_option( 'wcbloat_remove_emoji_scripts');595 ?>433 $value = get_option('wcbloat_remove_emoji_scripts'); 434 ?> 596 435 <input type='hidden' name='wcbloat_remove_emoji_scripts' value='no'> 597 <label><input type='checkbox' name='wcbloat_remove_emoji_scripts' <?php 598 checked( esc_attr( $value ), 'yes' ); 599 echo wcbloat_is_pro_readonly() ; 600 ?> value='yes'> <?php 601 esc_attr_e( 'Remove emoji styles and scripts', 'disable-dashboard-for-woocommerce' ); 602 echo wcbloat_is_pro_badge() ; 603 ?></label> 604 <p><?php 605 _e( 'Remove the code bloat used to add support for emojis in older browsers. Emoticons and emojis will still work in browsers that have built-in support for them.', 'disable-dashboard-for-woocommerce' ); 606 ?></p> 607 <?php 436 <label><input type='checkbox' name='wcbloat_remove_emoji_scripts' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove emoji styles and scripts', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 437 <p><?php _e('Remove the code bloat used to add support for emojis in older browsers. Emoticons and emojis will still work in browsers that have built-in support for them.', 'disable-dashboard-for-woocommerce'); ?></p> 438 <?php 608 439 } 609 440 … … 611 442 function wcbloat_disable_wp_embed_callback() 612 443 { 613 $value = get_option( 'wcbloat_disable_wp_embed');614 ?>444 $value = get_option('wcbloat_disable_wp_embed'); 445 ?> 615 446 <input type='hidden' name='wcbloat_disable_wp_embed' value='no'> 616 <label><input type='checkbox' name='wcbloat_disable_wp_embed' <?php 617 checked( esc_attr( $value ), 'yes' ); 618 echo wcbloat_is_pro_readonly() ; 619 ?> value='yes'> <?php 620 esc_attr_e( 'Disable wp-embed', 'disable-dashboard-for-woocommerce' ); 621 echo wcbloat_is_pro_badge() ; 622 ?></label> 623 <p><?php 624 _e( 'Prevents the WordPress core feature known as wp-embed from loading on your website. The wp-embed feature allows you to embed videos, images, tweets, and other types of content from various platforms by pasting a URL into the WordPress editor. While this feature can be useful, it can also slow down your site\'s loading times, increase your server resources usage, and pose potential security risks.', 'disable-dashboard-for-woocommerce' ); 625 ?></p> 626 <?php 447 <label><input type='checkbox' name='wcbloat_disable_wp_embed' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Disable wp-embed', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 448 <p><?php _e('Prevents the WordPress core feature known as wp-embed from loading on your website. The wp-embed feature allows you to embed videos, images, tweets, and other types of content from various platforms by pasting a URL into the WordPress editor. While this feature can be useful, it can also slow down your site\'s loading times, increase your server resources usage, and pose potential security risks.', 'disable-dashboard-for-woocommerce'); ?></p> 449 <?php 627 450 } 628 451 … … 630 453 function wcbloat_site_performance_header_section_callback() 631 454 { 632 _e( 'Remove unwanted scripts from the Header section of your site. The header section is used on all of your subpages and in most cases you do not need to load all the default scripts. Use the option below to turn them off.', 'disable-dashboard-for-woocommerce');455 _e('Remove unwanted scripts from the Header section of your site. The header section is used on all of your subpages and in most cases you do not need to load all the default scripts. Use the option below to turn them off.', 'disable-dashboard-for-woocommerce'); 633 456 } 634 457 … … 636 459 function wcbloat_remove_rss_links_callback() 637 460 { 638 $value = get_option( 'wcbloat_remove_rss_links');639 ?>461 $value = get_option('wcbloat_remove_rss_links'); 462 ?> 640 463 <input type='hidden' name='wcbloat_remove_rss_links' value='no'> 641 <label><input type='checkbox' name='wcbloat_remove_rss_links' <?php 642 checked( esc_attr( $value ), 'yes' ); 643 echo wcbloat_is_pro_readonly() ; 644 ?> value='yes'> <?php 645 esc_attr_e( 'Remove RSS Feed Links', 'disable-dashboard-for-woocommerce' ); 646 echo wcbloat_is_pro_badge() ; 647 ?></label> 648 <p><?php 649 _e( 'If you do not use RSS feeds, you can safely turn them off without losing any functionality. Links to RSS Feeds will be removed from the plugin header, but the process of generating RSS feeds will still be active.', 'disable-dashboard-for-woocommerce' ); 650 ?></p> 651 <?php 464 <label><input type='checkbox' name='wcbloat_remove_rss_links' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove RSS Feed Links', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 465 <p><?php _e('If you do not use RSS feeds, you can safely turn them off without losing any functionality. Links to RSS Feeds will be removed from the plugin header, but the process of generating RSS feeds will still be active.', 'disable-dashboard-for-woocommerce'); ?></p> 466 <?php 652 467 } 653 468 … … 655 470 function wcbloat_disable_all_feeds_callback() 656 471 { 657 $value = get_option( 'wcbloat_disable_all_feeds');658 ?>472 $value = get_option('wcbloat_disable_all_feeds'); 473 ?> 659 474 <input type='hidden' name='wcbloat_disable_all_feeds' value='no'> 660 <label><input type='checkbox' name='wcbloat_disable_all_feeds' <?php 661 checked( esc_attr( $value ), 'yes' ); 662 echo wcbloat_is_pro_readonly() ; 663 ?> value='yes'> <?php 664 esc_attr_e( 'Disable all RSS feeds', 'disable-dashboard-for-woocommerce' ); 665 echo wcbloat_is_pro_badge() ; 666 ?></label> 667 <p><?php 668 _e( 'You can also completely disable the RSS generation process by activating this option. If it is a feature that you do not plan to use, you can disable RSS Feeds.', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce' ); 669 ?></p> 670 <?php 475 <label><input type='checkbox' name='wcbloat_disable_all_feeds' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Disable all RSS feeds', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 476 <p><?php _e('You can also completely disable the RSS generation process by activating this option. If it is a feature that you do not plan to use, you can disable RSS Feeds.', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce'); ?></p> 477 <?php 671 478 } 672 479 … … 674 481 function wcbloat_remove_feed_generator_tag_callback() 675 482 { 676 $value = get_option( 'wcbloat_remove_feed_generator_tag');677 ?>483 $value = get_option('wcbloat_remove_feed_generator_tag'); 484 ?> 678 485 <input type='hidden' name='wcbloat_remove_feed_generator_tag' value='no'> 679 <label><input type='checkbox' name='wcbloat_remove_feed_generator_tag' <?php 680 checked( esc_attr( $value ), 'yes' ); 681 echo wcbloat_is_pro_readonly() ; 682 ?> value='yes'> <?php 683 esc_attr_e( 'Remove the Generator Tag From RSS Feeds', 'disable-dashboard-for-woocommerce' ); 684 echo wcbloat_is_pro_badge() ; 685 ?></label> 686 <p><?php 687 _e( 'This option will Remove the Generator Tag From RSS Feeds', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce' ); 688 ?></p> 689 <?php 486 <label><input type='checkbox' name='wcbloat_remove_feed_generator_tag' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove the Generator Tag From RSS Feeds', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 487 <p><?php _e('This option will Remove the Generator Tag From RSS Feeds', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce'); ?></p> 488 <?php 690 489 } 691 490 … … 693 492 function wcbloat_disable_wlw_link_callback() 694 493 { 695 $value = get_option( 'wcbloat_disable_wlw_link');696 ?>494 $value = get_option('wcbloat_disable_wlw_link'); 495 ?> 697 496 <input type='hidden' name='wcbloat_disable_wlw_link' value='no'> 698 <label><input type='checkbox' name='wcbloat_disable_wlw_link' <?php 699 checked( esc_attr( $value ), 'yes' ); 700 echo wcbloat_is_pro_readonly() ; 701 ?> value='yes'> <?php 702 esc_attr_e( 'Remove Link to the Windows Live Writer Manifest File', 'disable-dashboard-for-woocommerce' ); 703 echo wcbloat_is_pro_badge() ; 704 ?></label> 705 <p><?php 706 _e( 'If are not using software called Windows Live Writer, you can safely turn off this feature that is added to your header by default.', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce' ); 707 ?></p> 708 <?php 497 <label><input type='checkbox' name='wcbloat_disable_wlw_link' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove Link to the Windows Live Writer Manifest File', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 498 <p><?php _e('If are not using software called Windows Live Writer, you can safely turn off this feature that is added to your header by default.', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce'); ?></p> 499 <?php 709 500 } 710 501 … … 712 503 function wcbloat_disable_rsd_link_callback() 713 504 { 714 $value = get_option( 'wcbloat_disable_rsd_link');715 ?>505 $value = get_option('wcbloat_disable_rsd_link'); 506 ?> 716 507 <input type='hidden' name='wcbloat_disable_rsd_link' value='no'> 717 <label><input type='checkbox' name='wcbloat_disable_rsd_link' <?php 718 checked( esc_attr( $value ), 'yes' ); 719 echo wcbloat_is_pro_readonly() ; 720 ?> value='yes'> <?php 721 esc_attr_e( 'Remove RSD link', 'disable-dashboard-for-woocommerce' ); 722 echo wcbloat_is_pro_badge() ; 723 ?></label> 724 <p><?php 725 _e( 'RSD link is a tag that is added to your Header by default. The RSD link is used by software blog clients. If you access your site admin panel from the browser then it is safe for you to remove the RSD Link.', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce' ); 726 ?></p> 727 <?php 508 <label><input type='checkbox' name='wcbloat_disable_rsd_link' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove RSD link', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 509 <p><?php _e('RSD link is a tag that is added to your Header by default. The RSD link is used by software blog clients. If you access your site admin panel from the browser then it is safe for you to remove the RSD Link.', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce'); ?></p> 510 <?php 728 511 } 729 512 … … 731 514 function wcbloat_remove_shortlink_callback() 732 515 { 733 $value = get_option( 'wcbloat_remove_shortlink');734 ?>516 $value = get_option('wcbloat_remove_shortlink'); 517 ?> 735 518 <input type='hidden' name='wcbloat_remove_shortlink' value='no'> 736 <label><input type='checkbox' name='wcbloat_remove_shortlink' <?php 737 checked( esc_attr( $value ), 'yes' ); 738 echo wcbloat_is_pro_readonly() ; 739 ?> value='yes'> <?php 740 esc_attr_e( 'Remove Shortlink From HTTP Header', 'disable-dashboard-for-woocommerce' ); 741 echo wcbloat_is_pro_badge() ; 742 ?></label> 743 <p><?php 744 _e( 'Shortlink is the shorter version of the post or page URL. Shortlink (enabled in WordPress by default) creates a separate request on every page.', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce' ); 745 ?></p> 746 <?php 747 } 519 <label><input type='checkbox' name='wcbloat_remove_shortlink' <?php checked(esc_attr($value), 'yes'); echo wcbloat_is_pro_readonly(); ?> value='yes'> <?php esc_attr_e('Remove Shortlink From HTTP Header', 'disable-dashboard-for-woocommerce'); echo wcbloat_is_pro_badge(); ?></label> 520 <p><?php _e('Shortlink is the shorter version of the post or page URL. Shortlink (enabled in WordPress by default) creates a separate request on every page.', 'disable-dashboard-for-woocommerce', 'disable-dashboard-for-woocommerce'); ?></p> 521 <?php 522 } -
disable-dashboard-for-woocommerce/trunk/readme.txt
r2926554 r2930475 2 2 Contributors: disablebloat 3 3 Tags: WooCommerce, disable WooCommerce admin, remove bloat, debloat, unbloat, Yoast SEO, white label, speed up WordPress 4 Stable tag: trunk4 Stable tag: 3.2.7 5 5 Requires at least: 5.0 6 Tested up to: 6.3 6 Tested up to: 6.3.2 7 7 Requires PHP: 5.6 8 8 WC requires at least: 4.0 9 WC tested up to: 8.0 9 WC tested up to: 8.0.0 10 10 Donate link: https://disablebloat.com/ 11 11 License: GNU General Public License v3.0
Note: See TracChangeset
for help on using the changeset viewer.