Plugin Directory

Changeset 3802073


Ignore:
Timestamp:
11/14/2026 02:22:20 PM (39 hours ago)
Author:
smdigital1
Message:

Release Smart Sales Dashboard 1.0.3 - fix admin menu icon

Location:
smart-sales-dashboard/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • smart-sales-dashboard/trunk/readme.txt

    r3801973 r3802073  
    55Tested up to: 7.1
    66Requires Plugins: woocommerce
    7 Stable tag: 1.0
     7Stable tag: 1.0.3
    88License: GPLv2 or later
    99
    … …  
    28281. In WordPress go to Plugins > Add New > Upload Plugin.
    29292. Select the ZIP file and activate it.
    30 3. Open WooCommerce > Smart Sales.
     303. Open Smart Sales from the main WordPress admin menu.
    3131
    3232== Notes ==
    … …  
    4040
    4141== 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
    4255= 1.0 =
    4356* 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  
    33 * Plugin Name: Smart Sales Dashboard
    44 * Description: Modern WooCommerce sales, orders, and top products dashboard with HPOS support.
    5  * Version: 1.0
     5 * Version: 1.0.3
    66 * Requires at least: 6.2
    77 * Requires PHP: 7.4
    … …  
    2828
    2929final class SMDSSD_Smart_Sales_Dashboard {
    30     private const VERSION = '1.0';
     30    private const VERSION = '1.0.3';
    3131    private const PAGE_SLUG = 'smart-sales-dashboard';
    3232    private const BATCH_SIZE = 100;
    … …  
    3737    public static function init() {
    3838        add_action( 'admin_menu', array( __CLASS__, 'register_menu' ) );
     39        add_action( 'admin_head', array( __CLASS__, 'render_menu_icon_style' ) );
    3940        add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
    4041        add_action( 'admin_notices', array( __CLASS__, 'woocommerce_notice' ) );
    … …  
    6061        }
    6162
    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(
    6466            __( 'Smart Sales Dashboard', 'smart-sales-dashboard' ),
    6567            __( 'Smart Sales', 'smart-sales-dashboard' ),
    6668            'manage_woocommerce',
    6769            self::PAGE_SLUG,
    68             array( __CLASS__, 'render_page' )
     70            array( __CLASS__, 'render_page' ),
     71            'dashicons-chart-bar',
     72            58
    6973        );
    7074        if ( self::$page_hook ) {
    … …  
    7276            add_action( 'load-' . self::$page_hook, array( __CLASS__, 'isolate_notices' ), 0 );
    7377        }
     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
    74117    }
    75118
Note: See TracChangeset for help on using the changeset viewer.