Plugin Directory

Changeset 2580081


Ignore:
Timestamp:
08/09/2021 03:01:45 AM (4 years ago)
Author:
codetot
Message:

Update v1.0.12

Location:
ct-optimization
Files:
81 added
4 edited

Legend:

Unmodified
Added
Removed
  • ct-optimization/trunk/README.txt

    r2544009 r2580081  
    33Donate link: https://codetot.com
    44Tags: optimization, compress, settings
    5 Requires at least: 5.4
    6 Tested up to: 5.7
    7 Stable tag: 5.4
     5Requires at least: 5.0
     6Tested up to: 5.8
     7Stable tag: 1.0.12
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1414
    1515The optimization toolkit for optimizing WordPress sites, from hide, remove some WordPress cores to compress HTML and support CDN domain.
    16 This is a small plugin with no dependencies, however we official provide support with those plugins:
    1716
    18 - Advanced Custom Fields (Pro Version)
    19 - Gravity Forms (Tweak bundle to lazyload in footer)
    20 - Redis Object Cache
    21 - reSmush.it Image Optimizer
     17Main Features:
    2218
    23 You can enable/disable load below external scripts:
     19Disable some core WordPress features:
    2420
    25 - [lazysizes.min.js](https://github.com/aFarkas/lazysizes)
     211. Disable Gutenberg Block Editor
     222. Disable Gutenberg widgets
     233. Disable Emoji
     244. Hide WordPress version
     255. Disable oEmbed
     266. Disable XMLRPC
     277. Disable Heartbeat
     288. Disable Comments
     299. Disable Ping
     3010. Disable Feed
     3111. Disable Shortlink
     3212. Disable WLW Manifest
     3313. Disable Inline Comment styles
     34
     35Advanced Settings:
     36
     371. Compress HTML
     382. Enable CDN Domain (works with ACF fields)
     39
     40Extra Plugin Settings:
     41
     421. Disable Gravity Forms Default Styles
     432. Hide Gravity Forms Menus
     443. Load Gravity Forms in Footer
     454. Load [Lazysizes](https://github.com/aFarkas/lazysizes) scripts
    2646
    2747== Installation ==
     
    5171
    5272== Changelog ==
     73
     74= 1.0.12 =
     75
     76* Add option to disable Gutenberg widget admin UI.
     77
     78= 1.0.11 =
     79
     80* Disable more Gutenberg feature.
    5381
    5482= 1.0.10 =
  • ct-optimization/trunk/admin/class-codetot-optimization-admin.php

    r2486334 r2580081  
    8989    return [
    9090      'disable_gutenberg_block_editor' => __('Gutenberg Block Editor', 'codetot-optimization'),
     91      'disable_gutenberg_widgets' => __('Gutenberg Widgets', 'codetot-optimization'),
    9192      'disable_emoji' => __('Emoji', 'codetot-optimization'),
    9293      'hide_wordpress_version' => __('WordPress Version', 'codetot-optimization'),
  • ct-optimization/trunk/codetot-optimization.php

    r2544009 r2580081  
    99 * Plugin URI:        https://codetot.com
    1010 * Description:       Provides settings for enable/disable WordPress core features and some tweaks for ACF, Gravity Forms, such like Enable CDN, Lazyload assets.
    11  * Version:           1.0.10
     11 * Version:           1.0.12
    1212 * Author:            CODE TOT JSC
    1313 * Author URI:        https://codetot.com
     
    2323}
    2424
    25 define( 'CODETOT_OPTIMIZATION_VERSION', '1.0.10' );
     25define( 'CODETOT_OPTIMIZATION_VERSION', '1.0.12' );
    2626define( 'CODETOT_OPTIMIZATION_PATH', plugin_dir_path(__FILE__) );
    2727define( 'CODETOT_OPTIMIZATION_URL', plugin_dir_url(__FILE__) );
  • ct-optimization/trunk/includes/class-codetot-optimization-process.php

    r2544009 r2580081  
    7272    // Global Settings
    7373    add_action('init', array($this, 'check_gutenberg'));
     74    add_action('init', array($this, 'check_gutenberg_widget'));
    7475    add_action('init', array($this, 'check_emoji'));
    7576    add_action('init', array($this, 'check_generator_tag'));
     
    9394      add_action('use_block_editor_for_post', '__return_false');
    9495      add_action('wp_enqueue_scripts', array($this, 'disable_wp_block_assets'), 100);
     96
     97      remove_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' );
     98
     99      remove_action( 'admin_menu', 'gutenberg_menu' );
     100      remove_action( 'admin_init', 'gutenberg_redirect_demo' );
     101
     102      // Gutenberg 5.3+
     103      remove_action( 'wp_enqueue_scripts', 'gutenberg_register_scripts_and_styles' );
     104      remove_action( 'admin_enqueue_scripts', 'gutenberg_register_scripts_and_styles' );
     105      remove_action( 'admin_notices', 'gutenberg_wordpress_version_notice' );
     106      remove_action( 'rest_api_init', 'gutenberg_register_rest_widget_updater_routes' );
     107      remove_action( 'admin_print_styles', 'gutenberg_block_editor_admin_print_styles' );
     108      remove_action( 'admin_print_scripts', 'gutenberg_block_editor_admin_print_scripts' );
     109      remove_action( 'admin_print_footer_scripts', 'gutenberg_block_editor_admin_print_footer_scripts' );
     110      remove_action( 'admin_footer', 'gutenberg_block_editor_admin_footer' );
     111      remove_action( 'admin_enqueue_scripts', 'gutenberg_widgets_init' );
     112      remove_action( 'admin_notices', 'gutenberg_build_files_notice' );
     113
     114      remove_filter( 'load_script_translation_file', 'gutenberg_override_translation_file' );
     115      remove_filter( 'block_editor_settings', 'gutenberg_extend_block_editor_styles' );
     116      remove_filter( 'default_content', 'gutenberg_default_demo_content' );
     117      remove_filter( 'default_title', 'gutenberg_default_demo_title' );
     118      remove_filter( 'block_editor_settings', 'gutenberg_legacy_widget_settings' );
     119      remove_filter( 'rest_request_after_callbacks', 'gutenberg_filter_oembed_result' );
     120
     121      // Previously used, compat for older Gutenberg versions.
     122      remove_filter( 'wp_refresh_nonces', 'gutenberg_add_rest_nonce_to_heartbeat_response_headers' );
     123      remove_filter( 'get_edit_post_link', 'gutenberg_revisions_link_to_editor' );
     124      remove_filter( 'wp_prepare_revision_for_js', 'gutenberg_revisions_restore' );
     125
     126      remove_action( 'rest_api_init', 'gutenberg_register_rest_routes' );
     127      remove_action( 'rest_api_init', 'gutenberg_add_taxonomy_visibility_field' );
     128      remove_filter( 'registered_post_type', 'gutenberg_register_post_prepare_functions' );
     129
     130      remove_action( 'do_meta_boxes', 'gutenberg_meta_box_save' );
     131      remove_action( 'submitpost_box', 'gutenberg_intercept_meta_box_render' );
     132      remove_action( 'submitpage_box', 'gutenberg_intercept_meta_box_render' );
     133      remove_action( 'edit_page_form', 'gutenberg_intercept_meta_box_render' );
     134      remove_action( 'edit_form_advanced', 'gutenberg_intercept_meta_box_render' );
     135      remove_filter( 'redirect_post_location', 'gutenberg_meta_box_save_redirect' );
     136      remove_filter( 'filter_gutenberg_meta_boxes', 'gutenberg_filter_meta_boxes' );
     137
     138      remove_filter( 'body_class', 'gutenberg_add_responsive_body_class' );
     139      remove_filter( 'admin_url', 'gutenberg_modify_add_new_button_url' ); // old
     140      remove_action( 'admin_enqueue_scripts', 'gutenberg_check_if_classic_needs_warning_about_blocks' );
     141      remove_filter( 'register_post_type_args', 'gutenberg_filter_post_type_labels' );
     142    }
     143  }
     144
     145  public function check_gutenberg_widget() {
     146    if (!empty($this->options['disable_gutenberg_widgets'])) {
     147      add_filter( 'gutenberg_use_widgets_block_editor', '__return_false' );
     148      add_filter( 'use_widgets_block_editor', '__return_false' );
    95149    }
    96150  }
Note: See TracChangeset for help on using the changeset viewer.