Changeset 3802073
- Timestamp:
- 11/14/2026 02:22:20 PM (39 hours ago)
- Location:
- smart-sales-dashboard/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (3 diffs)
-
smart-sales-dashboard.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
smart-sales-dashboard/trunk/readme.txt
r3801973 r3802073 5 5 Tested up to: 7.1 6 6 Requires Plugins: woocommerce 7 Stable tag: 1.0 7 Stable tag: 1.0.3 8 8 License: GPLv2 or later 9 9 … … 28 28 1. In WordPress go to Plugins > Add New > Upload Plugin. 29 29 2. Select the ZIP file and activate it. 30 3. Open WooCommerce > Smart Sales.30 3. Open Smart Sales from the main WordPress admin menu. 31 31 32 32 == Notes == … … 40 40 41 41 == Changelog == 42 = 1.0.3 = 43 * Replace the custom SVG admin menu image with a native WordPress Dashicon. 44 * Apply a scoped purple badge style to prevent WordPress image filters from hiding the icon. 45 * No changes to WooCommerce analytics or permissions. 46 47 = 1.0.2 = 48 * Fix the custom purple WordPress admin menu icon appearing as a plain white square because of WordPress image filters. 49 * No changes to WooCommerce analytics, calculations, or permissions. 50 51 = 1.0.1 = 52 * Move Smart Sales Dashboard from the WooCommerce submenu to its own top-level WordPress admin menu item with a custom purple analytics icon. 53 * Preserve the existing dashboard URL, WooCommerce permissions, and analytics functionality. 54 42 55 = 1.0 = 43 56 * WordPress.org review update: use unique smdssd prefixes for PHP, AJAX actions, script identifiers, JavaScript configuration, and CSS/DOM selectors. -
smart-sales-dashboard/trunk/smart-sales-dashboard.php
r3801973 r3802073 3 3 * Plugin Name: Smart Sales Dashboard 4 4 * Description: Modern WooCommerce sales, orders, and top products dashboard with HPOS support. 5 * Version: 1.0 5 * Version: 1.0.3 6 6 * Requires at least: 6.2 7 7 * Requires PHP: 7.4 … … 28 28 29 29 final class SMDSSD_Smart_Sales_Dashboard { 30 private const VERSION = '1.0 ';30 private const VERSION = '1.0.3'; 31 31 private const PAGE_SLUG = 'smart-sales-dashboard'; 32 32 private const BATCH_SIZE = 100; … … 37 37 public static function init() { 38 38 add_action( 'admin_menu', array( __CLASS__, 'register_menu' ) ); 39 add_action( 'admin_head', array( __CLASS__, 'render_menu_icon_style' ) ); 39 40 add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) ); 40 41 add_action( 'admin_notices', array( __CLASS__, 'woocommerce_notice' ) ); … … 60 61 } 61 62 62 self::$page_hook = add_submenu_page( 63 'woocommerce', 63 // Show the dashboard as its own top-level admin menu item. 64 // Keep the same slug and capability to preserve existing links and access rules. 65 self::$page_hook = add_menu_page( 64 66 __( 'Smart Sales Dashboard', 'smart-sales-dashboard' ), 65 67 __( 'Smart Sales', 'smart-sales-dashboard' ), 66 68 'manage_woocommerce', 67 69 self::PAGE_SLUG, 68 array( __CLASS__, 'render_page' ) 70 array( __CLASS__, 'render_page' ), 71 'dashicons-chart-bar', 72 58 69 73 ); 70 74 if ( self::$page_hook ) { … … 72 76 add_action( 'load-' . self::$page_hook, array( __CLASS__, 'isolate_notices' ), 0 ); 73 77 } 78 } 79 80 /** 81 * Use WordPress native Dashicons rather than an SVG <img>. WordPress admin 82 * applies color filters to custom menu images, which can turn SVGs white. 83 * Styling the built-in icon glyph avoids the filter entirely. 84 */ 85 public static function render_menu_icon_style() { 86 if ( ! self::is_woocommerce_active() || ! current_user_can( 'manage_woocommerce' ) ) { 87 return; 88 } 89 ?> 90 <style id="smdssd-admin-menu-icon-v103"> 91 /* Scoped to Smart Sales only, including hovered/active menu states. */ 92 #adminmenu #toplevel_page_smart-sales-dashboard .wp-menu-image.dashicons-before::before { 93 color: #ffffff !important; 94 background: #8b5cf6 !important; 95 border-radius: 5px !important; 96 display: block !important; 97 box-sizing: border-box !important; 98 width: 21px !important; 99 height: 21px !important; 100 line-height: 21px !important; 101 font-size: 16px !important; 102 padding: 0 !important; 103 margin: 6px auto 0 !important; 104 opacity: 1 !important; 105 filter: none !important; 106 -webkit-filter: none !important; 107 text-shadow: none !important; 108 box-shadow: 0 0 0 1px rgba(167,139,250,.20) !important; 109 } 110 #adminmenu #toplevel_page_smart-sales-dashboard:hover .wp-menu-image.dashicons-before::before, 111 #adminmenu #toplevel_page_smart-sales-dashboard.wp-has-current-submenu .wp-menu-image.dashicons-before::before, 112 #adminmenu #toplevel_page_smart-sales-dashboard.current .wp-menu-image.dashicons-before::before { 113 background: #7c3aed !important; 114 } 115 </style> 116 <?php 74 117 } 75 118
Note:
See TracChangeset
for help on using the changeset viewer.