PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
plugins
/
admin-site-enhancements
/
classes
<?php namespace ASENHA\Classes; /** * Class for Disable Smaller Components module * * @since 6.9.5 */ class Disable_Smaller_Components { /** * Remove version number from URLs of static resources (CSS, JS) * * @since 5.8.0 */ public function remove_resource_version_number( $src ) { if ( ! is_user_logged_in() ) { // https://wordpress.org/support/topic/disable-smaller-components-version-can-be-hidden/ if ( strpos( $src, 'ver=' ) ) { $src = remove_query_arg( 'ver', $src ); } } return $src; } /** * Remove generator tag from RSS feed * * @since 7.3.3 */ public function remove_feed_generator_tag( $generator_type, $type ) { // e.g. <generator>https://wordpress.org/?v=6.6.1</generator> if ( false !== strpos( $generator_type, '<generator>https://wordpress.org/?v=' ) ) { return ''; } } /** * Disable loading of frontend public assets of dashicons * * @since 4.5.0 */ public function disable_dashicons_public_assets() { global $pagenow; if ( ! is_user_logged_in() ) { // This will get /path/file.php?param=val portion of the full URL $current_request_uri = sanitize_text_field( $_SERVER['REQUEST_URI'] ); if ( empty( $current_request_uri ) ) { // On the homepage wp_dequeue_style( 'dashicons' ); wp_deregister_style( 'dashicons' ); } else { // Exclude the login page, where dashicon assets are requred to properly style the page if ( false !== strpos( $current_request_uri, 'wp-login.php' ) || 'wp-login.php' === $pagenow ) { // On wp-login.php, so, do nothing } // Exclude password protection form elseif ( false !== strpos( $current_request_uri, 'protected-page=view' ) ) { // On protected-page=view, so, do nothing } else { // NOT on wp-login.php, e.g. www.example.com/an-article/, so, dequeue dashicons wp_dequeue_style( 'dashicons' ); wp_deregister_style( 'dashicons' ); } } } } /** * Disable emoji support * * @since 4.5.0 */ public function disable_emoji_support() { remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); remove_action( 'embed_head', 'print_emoji_detection_script' ); remove_action( 'wp_print_styles', 'print_emoji_styles' ); remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); add_action( 'admin_init', [ $this, 'disable_admin_emojis' ] ); add_filter( 'emoji_svg_url', '__return_false' ); add_filter( 'tiny_mce_plugins', [ $this, 'disable_emoji_for_tinymce' ] ); add_filter( 'wp_resource_hints', [ $this, 'disable_emoji_remove_dns_prefetch' ], 10, 2 ); add_filter( 'option_use_smilies', '__return_false' ); } /** * Disable jQuery Migrate * * @since 5.8.0 * @link https://plugins.trac.wordpress.org/browser/remove-jquery-migrate/trunk/remove-jquery-migrate.php * @param WP_Scripts $scripts WP_Scripts object. */ public function disable_jquery_migrate( $scripts ) { if ( ! is_admin() && isset( $scripts->registered['jquery'] ) ) { $script = $scripts->registered['jquery']; if ( ! empty( $script->deps ) ) { // Check whether the script has any dependencies $script->deps = array_diff( $script->deps, array( 'jquery-migrate' ) ); } } } /** * Remove the tinymce emoji plugin * * @since 4.5.0 */ public function disable_emoji_for_tinymce( $plugins ) { if ( is_array( $plugins ) ) { return array_diff( $plugins, array( 'wpemoji' ) ); } return array(); } /** * Remove emoji CDN hostname from DNS prefetching hints. * * @since 4.5.0 */ public function disable_emoji_remove_dns_prefetch( $urls, $relation_type ) { if ( 'dns-prefetch' == $relation_type ) { // Strip out any URLs referencing the WordPress.org emoji location $emoji_svg_url_base = 'https://s.w.org/images/core/emoji/'; foreach ( $urls as $key => $url ) { if ( is_string( $url ) && false !== strpos( $url, $emoji_svg_url_base ) ) { unset( $urls[$key] ); } } } return $urls; } /** * Disable emojis in wp-admin * * @since 4.7.2 */ public function disable_admin_emojis() { remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); remove_action( 'admin_print_styles', 'print_emoji_styles' ); } /** * Add loading="eager" attribute for featured images * * @link https://plugins.trac.wordpress.org/browser/disable-lazy-loading/tags/2.1/disable-lazy-loading.php * @since 7.3.0 */ public function eager_load_featured_images( $attr, $attachment = null ) { $attr['loading'] = 'eager'; return $attr; } /** * Disable plugin and theme editor * * @since 7.4.5 */ public function disable_plugin_theme_editor() { if ( wp_doing_ajax() || wp_doing_cron() ) { return; } if ( ! current_user_can( 'manage_options' ) ) { return; } $wp_config = new WP_Config_Transformer; if ( ! defined( 'DISALLOW_FILE_EDIT' ) ) { define( 'DISALLOW_FILE_EDIT', true ); } else { $is_wpconfig_writeable = $wp_config->wpconfig_file( 'writeability' ); if ( $is_wpconfig_writeable ) { $disallow_file_edit = $wp_config->get_value( 'constant', 'DISALLOW_FILE_EDIT' ); if ( 'false' == $disallow_file_edit ) { $wp_config_options = array( 'add' => true, // Add the config if missing. 'raw' => true, // Display value in raw format without quotes. 'normalize' => false, // Normalize config output using WP Coding Standards. ); $update_success = $wp_config->update( 'constant', 'DISALLOW_FILE_EDIT', 'true', $wp_config_options ); } } } } /** * Enable plugin and theme editor * * @since 7.4.5 */ public function enable_plugin_theme_editor() { if ( wp_doing_ajax() || wp_doing_cron() ) { return; } if ( ! current_user_can( 'manage_options' ) ) { return; } $wp_config = new WP_Config_Transformer; if ( ! defined( 'DISALLOW_FILE_EDIT' ) ) { define( 'DISALLOW_FILE_EDIT', false ); } else { $is_wpconfig_writeable = $wp_config->wpconfig_file( 'writeability' ); if ( $is_wpconfig_writeable ) { $disallow_file_edit = $wp_config->get_value( 'constant', 'DISALLOW_FILE_EDIT' ); if ( 'true' == $disallow_file_edit ) { $wp_config_options = array( 'add' => true, // Add the config if missing. 'raw' => true, // Display value in raw format without quotes. 'normalize' => false, // Normalize config output using WP Coding Standards. ); $update_success = $wp_config->update( 'constant', 'DISALLOW_FILE_EDIT', 'false', $wp_config_options ); } } } } }
[-] class-hide-admin-bar.php
[edit]
[-] class-svg-upload.php
[edit]
[-] class-disable-gutenberg.php
[edit]
[-] class-cleanup-admin-bar.php
[edit]
[-] class-disable-rest-api.php
[edit]
[-] class-multiple-user-roles.php
[edit]
[-] class-disable-updates.php
[edit]
[-] class-image-upload-control.php
[edit]
[-] class-hide-admin-notices.php
[edit]
[-] class-content-duplication.php
[edit]
[-] class-insert-head-body-footer-code.php
[edit]
[-] class-media-replacement.php
[edit]
[-] class-password-protection.php
[edit]
[-] class-heartbeat-control.php
[edit]
[-] class-email-address-obfuscator.php
[edit]
[-] class-settings-sanitization.php
[edit]
[-] class-wp-config-transformer.php
[edit]
[-] class-content-order.php
[edit]
[-] class-custom-css.php
[edit]
[-] class-enhance-list-tables.php
[edit]
[-] class-login-logout-menu.php
[edit]
[-] class-search-engines-visibility.php
[edit]
[-] class-limit-login-attempts.php
[edit]
[-] class-disable-xml-rpc.php
[edit]
[-] class-common-methods.php
[edit]
[-] class-email-delivery.php
[edit]
[-] class-obfuscate-author-slugs.php
[edit]
[-] class-external-permalinks.php
[edit]
[-] class-wider-admin-menu.php
[edit]
[-] class-display-system-summary.php
[edit]
[-] class-admin-menu-organizer.php
[edit]
[-] class-redirect-fourofour.php
[edit]
[-] class-manage-robots-txt.php
[edit]
[-] class-site-identity-on-login-page.php
[edit]
[-] class-avif-upload.php
[edit]
[-] class-disable-comments.php
[edit]
[-] class-manage-ads-appads-txt.php
[edit]
[-] class-various-admin-ui-enhancements.php
[edit]
[-] class-admin-menu-svg-icon-mask.php
[edit]
[-] class-deactivation.php
[edit]
[-] class-activation.php
[edit]
[-] class-view-admin-as-role.php
[edit]
[-] class-maintenance-mode.php
[edit]
[-] class-custom-body-class.php
[edit]
[-] class-disable-dashboard-widgets.php
[edit]
[-] class-login-id-type.php
[edit]
[-] class-image-sizes-panel.php
[edit]
[-] class-redirect-after-login.php
[edit]
[-] class-settings-sections-fields.php
[edit]
[-] class-auto-publish-posts-with-missed-schedule.php
[edit]
[-] class-revisions-control.php
[edit]
[+]
..
[-] class-registration-date-column.php
[edit]
[-] class-disable-embeds.php
[edit]
[-] class-show-custom-taxonomy-filters.php
[edit]
[-] class-custom-nav-menu-items-in-new-tab.php
[edit]
[-] class-disable-feeds.php
[edit]
[-] class-captcha-protection.php
[edit]
[-] class-custom-admin-footer-text.php
[edit]
[-] class-change-login-url.php
[edit]
[-] class-last-login-column.php
[edit]
[-] class-settings-fields-render.php
[edit]
[-] class-disable-smaller-components.php
[edit]
[-] class-disable-author-archives.php
[edit]
[-] class-redirect-after-logout.php
[edit]
[-] class-open-external-links-in-new-tab.php
[edit]