options = get_option('adminfly_settings'); // Apply optimizations if active if (!empty($this->options['activate_optimisation']) && empty($this->options['debug_disable_all'])) { $this->apply_optimizations(); } } /* ========================================================================= SETTINGS REGISTRATION ========================================================================= */ public function page_init() { // We use the same option group so data is preserved from the original AdminFly register_setting('adminfly_option_group', 'adminfly_settings'); add_settings_section('engine_section', 'Optimization Engine', null, 'adminfly-main-settings'); foreach (array( 'admin_styling' => array('Admin Styling', 'Switch to a premium Dark Mode aesthetic.', 'Transform the admin area with a sleek dark theme and blue accents for a premium feel.'), 'nag_shield' => array('Nag Shield', 'Kill all annoying plugin notices and popups.', 'Forcefully suppresses all dashboard banners, update nags, "Please Review" requests, and trial reminders from third-party plugins.'), 'remove_howdy' => array('Clean Admin Bar', 'Strip Howdy, Comments, and +New buttons.', 'Creates a distraction-free top toolbar by removing the "Howdy" greeting, the comments notification bubble, and the quick "+ New" content creation menu.'), ) as $id => $d) $this->add_field($id, $d, 'engine_section'); add_settings_field('accent_color', 'Accent Color', array($this, 'render_color_row'), 'adminfly-main-settings', 'engine_section'); foreach (array( 'hide_dash_widgets' => array('Hide Dashboard', 'Completely strip all standard dashboard widgets.', 'Removes "At a Glance", "Activity", "Quick Draft", and "WP Events" from the homepage.'), 'hide_help_tabs' => array('Help & Options', 'Hide Help tabs and Screen Options for a cleaner look.', 'Removes the Help and Screen Options pull-down tabs from the top-right of every admin page.') ) as $id => $d) $this->add_field($id, $d, 'engine_section'); // Performance & System foreach (array( 'disable_gutenberg' => array('Gutenberg Editor', 'Disable the Block Editor and use the Classic Editor.', 'Bypasses the modern Gutenberg editor entirely, restoring the faster, lightweight Classic Editor.'), 'remove_block_bloat' => array('Block Patterns', 'Strip all background core block patterns and styles.', 'Stops WordPress from generating and loading unnecessary CSS patterns for blocks you aren\'t using.'), 'disable_heartbeat' => array('Heartbeat API', 'Disable AJAX heartbeat to save server resources.', 'Stops the browser from pinging the server every 15-60 seconds while you have the admin open.'), 'disable_wp_cron' => array('WP Cron', 'Remove the default internal WordPress cron hook.', 'Unbinds wp-cron from page loads. Recommended for high-traffic sites using external system crons.'), 'disable_updates' => array('Force Stop Updates', 'Disable all background core/plugin/theme checks.', 'Stops WordPress from checking for updates in the background. Improves admin speed significantly.'), 'extreme_init_cleanup' => array('Init Scrubbing', 'Extreme unhooking of smilies, widgets, and preview logic.', 'Removes legacy core callbacks from the INIT hook like smilies, widgets_init, and preview functions.'), 'extreme_head_cleanup' => array('Head Scrubbing', 'Forcefully remove robots, hints, preloads from
.', 'Aggressively strips the of robots, feed links, and resource hints.'), 'extreme_footer_cleanup' => array('Footer Scrubbing', 'Strip duotone assets and global styles from footer.', 'Removes modern block-related clutter like Duotone SVG filters from the footer.'), 'disable_gravatars' => array('Kill Gravatars', 'Disable all external Gravatar requests.', 'Stops WordPress from fetching user images from Gravatar.com. Prevents slow DNS lookups and external HTTP dependencies.'), 'block_external_http' => array('Nuclear HTTP Block', 'Block ALL external network requests.', 'Prevents WordPress from communicating with any external server. Use this to eliminate all network-related slowness and timeouts.'), 'disable_comments' => array('Disable Comments', 'Global shutdown of all comment systems.', 'Hard-disables the commenting system site-wide.'), 'disable_emojis' => array('Kill Emojis', 'Remove emoji detection script and CSS.', 'Removes the script that converts text emojis to images.'), 'disable_privacy_tools' => array('Privacy Tools', 'Disable the internal WP privacy policy content.', 'Removes suggested privacy content and text change checks.'), 'clean_head_standard' => array('Standard Head Tags', 'Strip RSD, Generator, and WLW Manifest tags.', 'Removes standard metadata like WordPress version (Security).'), 'relocate_plugin_menus' => array('Relocate Plugin Menus', 'Move plugin menus to be sub-menus under "Plugins".', 'Moves third-party plugin icons into the Plugins sub-menu.'), 'white_label_branding' => array('White Label', 'Remove WP logo, version, and footer credits.', 'Strips the WordPress logo/About menu from the top bar and all version/credit text from the footer.'), 'hide_admin_bar' => array('Hide Admin Bar', 'Hide the top admin bar on the frontend.', 'Hides the black toolbar from the top of your public website.') ) as $id => $d) $this->add_field($id, $d, 'engine_section'); add_settings_section('sidebar_section', 'Sidebar Whitelist', array($this, 'render_sidebar_desc'), 'adminfly-main-settings'); add_settings_field('sidebar_filtering', 'Enable Sidebar Filtering', array($this, 'render_sidebar_master'), 'adminfly-main-settings', 'sidebar_section'); $menus = array( 'index.php' => 'Dashboard', 'edit.php' => 'Posts', 'upload.php' => 'Media', 'edit.php?post_type=page' => 'Pages', 'edit-comments.php' => 'Comments', 'themes.php' => 'Appearance', 'plugins.php' => 'Plugins', 'users.php' => 'Users', 'tools.php' => 'Tools', 'options-general.php' => 'Settings' ); foreach ($menus as $slug => $title) add_settings_field('menu_'.md5($slug), $title, array($this, 'render_whitelist_row'), 'adminfly-main-settings', 'sidebar_section', array('id' => 'menu_'.md5($slug), 'title' => $title)); } private function add_field($id, $data, $section) { add_settings_field($id, $data[0], array($this, 'render_vue_row'), 'adminfly-main-settings', $section, array('id' => $id, 'title' => $data[0], 'desc' => $data[1], 'tooltip' => $data[2])); } /* ========================================================================= RENDER METHODS (For the UI) ========================================================================= */ public function render_optimise_tab() { ?>Completely wipe all AdminFly settings and restore defaults.
| Hook | Pri | Callback |
|---|---|---|
| $p |
AdminFly is built with a single goal: to strip down WordPress to its bare essentials while providing a premium, high-speed interface. It targets the "hidden bloat" that slows down your dashboard and cleans up the source code for better SEO and performance.
Hand-crafted with precision by Pranav MT.
Thank you for using AdminFly to power your minimal WordPress experience.
Choose menus to keep.
'; } public function render_sidebar_master() { $checked = isset($this->options['sidebar_filtering']) ? 'checked' : ''; echo '