// Aggressive sidebar alphabetization with diagnostics add_action('admin_menu', function(){ global $menu; if (!is_array($menu)) return; if (!current_user_can('manage_options')) return; $fixed = []; $to_sort = []; foreach ($menu as $k=>$v) { if (isset($v[2]) && ($v[2] === 'index.php' || strpos($v[2],'separator') === 0)) { $fixed[$k] = $v; } else { $to_sort[$k] = $v; } } uasort($to_sort, function($a, $b){ return strcasecmp($a[0], $b[0]); }); $menu = $fixed + $to_sort; // Diagnostic output add_action('admin_notices', function(){ echo '
NDABOX3.0 menu sort executed. Menu items: '.count($menu).'
'; }); }, 99999); // Dashboard notice if folder/main file is misnamed or not loaded add_action('admin_notices', function(){ $expected_folder = 'NDABOX3.0'; $expected_file = 'ndabox3.php'; $plugin_dir = basename(dirname(__FILE__)); $plugin_file = basename(__FILE__); if (strtolower($plugin_dir) !== strtolower($expected_folder) || strtolower($plugin_file) !== strtolower($expected_file)) { echo '
NDABOX3.0 plugin folder or main file may be misnamed. Folder: '.esc_html($plugin_dir).' | File: '.esc_html($plugin_file).'. Please ensure the folder is "NDABOX3.0" and the main file is "ndabox3.php" for full compatibility.
'; } }); // Alphabetize left sidebar menu items in WP admin dashboard add_action('admin_menu', function(){ global $menu; if (!is_array($menu)) return; // Only alphabetize for admins if (!current_user_can('manage_options')) return; // Preserve Dashboard and separator at top $fixed = []; foreach ($menu as $k=>$v) { if (isset($v[2]) && ($v[2] === 'index.php' || $v[2] === 'separator1')) { $fixed[$k] = $v; unset($menu[$k]); } } // Sort remaining menu items alphabetically by label uasort($menu, function($a, $b){ return strcasecmp($a[0], $b[0]); }); // Merge fixed items back to top $menu = $fixed + $menu; }, 9999); // Enhanced Utility Console menu registration and admin bar shortcut add_action('admin_menu', function(){ $callback = function(){ try { if (class_exists('Ndabox3\\Modules\\UtilityConsole\\Module')) { $mod = new \Ndabox3\Modules\UtilityConsole\Module(); $mod->render_page(); } else { throw new \Exception('UtilityConsole module not found.'); } } catch (\Throwable $e) { echo '

Ndabox3 Utility Console

Error: '.esc_html($e->getMessage()).'

'; } // Add help tab for context $screen = get_current_screen(); if ($screen && method_exists($screen, 'add_help_tab')) { $screen->add_help_tab([ 'id' => 'ndabox3_utility_console_help', 'title' => 'Utility Console Help', 'content' => '

This is the central admin console for all NDABOX3.0 modules and utilities. Use this page to manage features, view diagnostics, and run automation.

' ]); } }; if (function_exists('add_management_page')) { add_management_page('Ndabox3 Utility Console','Ndabox3 Utility Console','manage_options','ndabox3-console',$callback); } if (function_exists('add_menu_page')) { add_menu_page('Ndabox3 Utility Console','Ndabox3 Utility Console','manage_options','ndabox3-console',$callback,'dashicons-admin-tools',3); } }, 1); // Add admin bar shortcut for Utility Console add_action('admin_bar_menu', function($wp_admin_bar){ if (!current_user_can('manage_options')) return; $wp_admin_bar->add_node([ 'id' => 'ndabox3_utility_console', 'title' => ' Ndabox3 Utility Console', 'href' => admin_url('tools.php?page=ndabox3-console'), 'meta' => ['class'=>'ndabox3-utility-console-bar'] ]); }, 100); // Radical fallback: register Utility Console menu in both Tools and Dashboard add_action('admin_menu', function(){ $callback = function(){ try { if (class_exists('Ndabox3\\Modules\\UtilityConsole\\Module')) { $mod = new \Ndabox3\Modules\UtilityConsole\Module(); $mod->render_page(); } else { throw new \Exception('UtilityConsole module not found.'); } } catch (\Throwable $e) { echo '

Ndabox3 Utility Console

Error: '.esc_html($e->getMessage()).'

'; } }; if (function_exists('add_management_page')) { add_management_page('Ndabox3 Utility Console','Ndabox3 Utility Console','manage_options','ndabox3-console',$callback); } if (function_exists('add_menu_page')) { add_menu_page('Ndabox3 Utility Console','Ndabox3 Utility Console','manage_options','ndabox3-console',$callback,'dashicons-admin-tools',3); } }, 1); // Admin notice if menu not loaded add_action('admin_notices', function(){ global $pagenow; if ($pagenow === 'tools.php' || $pagenow === 'index.php') { if (!class_exists('Ndabox3\\Modules\\UtilityConsole\\Module')) { echo '

Ndabox3 Utility Console menu fallback loaded, but module not found. Please check plugin files and autoloading.

'; } } }); // Absolute fallback: always show Utility Console menu in Tools add_action('admin_menu', function(){ if (!function_exists('add_submenu_page')) return; add_submenu_page( 'tools.php', 'Ndabox3 Utility Console', 'Ndabox3 Utility Console', 'manage_options', 'ndabox3-console', function(){ try { if (class_exists('Ndabox3\\Modules\\UtilityConsole\\Module')) { $mod = new \Ndabox3\Modules\UtilityConsole\Module(); $mod->render_page(); } else { throw new \Exception('UtilityConsole module not found.'); } } catch (\Throwable $e) { echo '

Ndabox3 Utility Console

Error: '.esc_html($e->getMessage()).'

'; } } ); }, 999); // Add 'Settings' link to plugin row (robust fallback) foreach ([basename(__FILE__), 'ndabox3.php', 'NDABOX3.0/ndabox3.php', 'NDABOX3.0.php'] as $slug) { add_filter('plugin_action_links_' . $slug, function($links){ $settings_url = admin_url('tools.php?page=ndabox3-console'); array_unshift($links, 'Settings'); return $links; }); } // Fallback Utility Console menu registration (always add to Tools) add_action('admin_menu', function(){ if (!function_exists('add_submenu_page')) return; add_submenu_page( 'tools.php', 'Ndabox3 Utility Console', 'Ndabox3 Utility Console', 'manage_options', 'ndabox3-console', function(){ if (class_exists('Ndabox3\Modules\UtilityConsole\Module')) { $mod = new \Ndabox3\Modules\UtilityConsole\Module(); $mod->render_page(); } else { echo '

Ndabox3 Utility Console

Module not found or not loaded.

'; } } ); }, 99); https://validator.w3.org/feed/docs/rss2.html NDA Live Secure Chat NDA AI Commission Split Calculator Rumor Feed Rumor Predict Rumor Leaderboard Buyer Mandate Mandate Matches Valuation Broker Dashboard NCNDA Inquiry Profile Listings Add Listing Onboarding / Community Registration NDA Gate Demo Elementor #15891 The Final Blind Spot in $50B Events: Momentify Closes It Owning the Vineyard Land No One Else Can Touch Rare First Mover AI Cybersecurity Opportunity, Backed by Multiple LOIs, Limited Window From Concierge to Capital: The Next $1T Disruptor $5.5B Credit Line Backed by Prime Florida Hospitality Real Estate, Exclusive Investor Access Prime 2.5-Acre Industrial & Residential Estate, Brooksville, FL Buyer Portal page Disaster-Proof Returns: Invest in the Future of Off-Grid Housing with Patented Green Tech Rare Generational Opportunity: $964M Phase 1 of Wyoming’s Largest Private Oil Development Rare Strategic Entry: $11B LNG Export Terminal on Prime Mississippi Riverfront The First Regulated Sports Equity Exchange, A Once-in-a-Lifetime Market Disruption High-Margin Real Estate SaaS Platform – First of It’s Kind! Mandate Matcher UNPRICED Distressed Notes Portfolio, 67 Assets, Florida & New York only SBA Appraised, Janitorial & P Washing Business (40 Years & Commercial Only), Sarasota & Lakewood Ranch, FL NDA Box AI Negotiator NDA Swipe My Removed Listings Liked Listings A Rare Entry into the $200B Video Economy, Before the Market Floodgates Open Unlock Exceptional Returns with Oak Proof’s $30M Bourbon Barrel Investment, Ride the Wave of a Booming Premium Spirits Market Secure Long-Term, High-Margin, Inflation Resistant Cash Flow with Vulcan Metal Streaming’s $1–5 Billion Capital Raise Unlock High-Growth Potential in Digital BNPL with Blinc, Tapping a $21B Market with Proven Founders 3 Properties, Vacation Rental Portfolio, Siesta Key, FL Rare Access: Strategic EV Acquisition with OEM Contracts, $50M Left in Fast-Moving $150M Raise Rare, De-Risked Land-Backed Bridge in PA, Momentum-Ready Project, Time-Sensitive Window Class A Asset in Booming Chicago Submarket, 19% Projected IRR Ultra-Rare $220M Urban Core Portfolio Refi — Control Driven, Cashflow Ready, Chicago Stronghold Direo Directory Blog