Plugin Directory

Changeset 3361437


Ignore:
Timestamp:
09/15/2025 12:12:21 AM (7 months ago)
Author:
mohsinwebs
Message:

design update

Location:
speedox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • speedox/tags/1.1.2/speedox.php

    r3361433 r3361437  
    2424SpeedOx_Logger::init();
    2525
    26 // version constant — keep in sync with plugin header
    27 if (!defined('SPEEDOX_VERSION')) {
    28     define('SPEEDOX_VERSION', '1.1.3');
    29 }
    30 
     26define('SPEEDOX_VERSION', '1.1.4'); // update on each release
    3127define('SPEEDOX_PLUGIN_DIR', plugin_dir_path(__FILE__));
    3228define('SPEEDOX_PLUGIN_URL', plugin_dir_url(__FILE__));
     
    4036require_once SPEEDOX_PLUGIN_DIR . 'includes/admin-bar.php';
    4137
    42 // Enqueue admin styles and scripts (robust detection)
    43 add_action('admin_enqueue_scripts', 'speedox_enqueue_admin_assets');
    44 function speedox_enqueue_admin_assets($hook) {
    45     // Be flexible: check if the current admin page relates to SpeedOx
    46     if (false === strpos($hook, 'speedox')) {
    47         return;
    48     }
    49 
    50     // Ensure WP icons are available
    51     wp_enqueue_style('dashicons');
    52 
    53     // Plugin admin CSS/JS — use plugin_dir_url to ensure correct path after WP.org installs
     38// Enqueue admin styles and scripts
     39add_action('admin_enqueue_scripts', 'speedox_admin_enqueue');
     40function speedox_admin_enqueue($hook) {
     41    if (strpos($hook, 'speedox') !== false) {
     42        wp_enqueue_style(
     43            'speedox-admin',
     44            plugin_dir_url(__FILE__) . 'assets/css/admin.css',
     45            array(),
     46            SPEEDOX_VERSION
     47        );
     48        wp_enqueue_script(
     49            'speedox-admin',
     50            plugin_dir_url(__FILE__) . 'assets/js/admin.js',
     51            array('jquery'),
     52            SPEEDOX_VERSION,
     53            true
     54        );
     55        wp_enqueue_style('dashicons');
     56    }
     57}
     58
     59// Custom emoji icon for admin menu using enqueued CSS file
     60add_action('admin_enqueue_scripts', 'speedox_custom_menu_icon_style');
     61function speedox_custom_menu_icon_style() {
    5462    wp_enqueue_style(
    55         'speedox-admin-css',
    56         plugin_dir_url(__FILE__) . 'assets/css/admin.css',
     63        'speedox-admin-menu-icon',
     64        plugin_dir_url(__FILE__) . 'assets/css/admin-menu-icon.css',
    5765        array(),
    5866        SPEEDOX_VERSION
    5967    );
    60 
    61     wp_enqueue_script(
    62         'speedox-admin-js',
    63         plugin_dir_url(__FILE__) . 'assets/js/admin.js',
    64         array('jquery'),
    65         SPEEDOX_VERSION,
    66         true
    67     );
    68 }
    69 
    70 // NOTE: We use inline CSS for the custom menu icon below — avoid enqueuing a separate admin-menu-icon.css
     68}
     69
    7170// Activation: schedule cache-clearing event if not already scheduled
    7271register_activation_hook(__FILE__, 'speedox_activate');
     
    9998function speedox_add_admin_menu() {
    10099    add_menu_page(
    101         'SpeedOx Dashboard',
    102         'SpeedOx',
    103         'manage_options',
    104         'speedox-dashboard',
    105         'speedox_admin_dashboard_page',
    106         '', // We'll style the icon via inline CSS
    107         30
    108     );
     100    'SpeedOx Dashboard',
     101    'SpeedOx',
     102    'manage_options',
     103    'speedox-dashboard',
     104    'speedox_admin_dashboard_page',
     105    '', // Don't use dashicons, allow custom CSS
     106    30
     107  );
    109108}
    110109
     
    264263}
    265264
    266 // ✅ Add custom emoji icon (⚡) to admin menu via inline CSS
     265// ✅ Add custom emoji icon (⚡) to admin menu
    267266add_action('admin_head', 'speedox_custom_menu_icon_inline_css');
    268267function speedox_custom_menu_icon_inline_css() {
  • speedox/trunk/speedox.php

    r3361433 r3361437  
    2424SpeedOx_Logger::init();
    2525
    26 // version constant — keep in sync with plugin header
    27 if (!defined('SPEEDOX_VERSION')) {
    28     define('SPEEDOX_VERSION', '1.1.3');
    29 }
    30 
     26define('SPEEDOX_VERSION', '1.1.4'); // update on each release
    3127define('SPEEDOX_PLUGIN_DIR', plugin_dir_path(__FILE__));
    3228define('SPEEDOX_PLUGIN_URL', plugin_dir_url(__FILE__));
     
    4036require_once SPEEDOX_PLUGIN_DIR . 'includes/admin-bar.php';
    4137
    42 // Enqueue admin styles and scripts (robust detection)
    43 add_action('admin_enqueue_scripts', 'speedox_enqueue_admin_assets');
    44 function speedox_enqueue_admin_assets($hook) {
    45     // Be flexible: check if the current admin page relates to SpeedOx
    46     if (false === strpos($hook, 'speedox')) {
    47         return;
    48     }
    49 
    50     // Ensure WP icons are available
    51     wp_enqueue_style('dashicons');
    52 
    53     // Plugin admin CSS/JS — use plugin_dir_url to ensure correct path after WP.org installs
     38// Enqueue admin styles and scripts
     39add_action('admin_enqueue_scripts', 'speedox_admin_enqueue');
     40function speedox_admin_enqueue($hook) {
     41    if (strpos($hook, 'speedox') !== false) {
     42        wp_enqueue_style(
     43            'speedox-admin',
     44            plugin_dir_url(__FILE__) . 'assets/css/admin.css',
     45            array(),
     46            SPEEDOX_VERSION
     47        );
     48        wp_enqueue_script(
     49            'speedox-admin',
     50            plugin_dir_url(__FILE__) . 'assets/js/admin.js',
     51            array('jquery'),
     52            SPEEDOX_VERSION,
     53            true
     54        );
     55        wp_enqueue_style('dashicons');
     56    }
     57}
     58
     59// Custom emoji icon for admin menu using enqueued CSS file
     60add_action('admin_enqueue_scripts', 'speedox_custom_menu_icon_style');
     61function speedox_custom_menu_icon_style() {
    5462    wp_enqueue_style(
    55         'speedox-admin-css',
    56         plugin_dir_url(__FILE__) . 'assets/css/admin.css',
     63        'speedox-admin-menu-icon',
     64        plugin_dir_url(__FILE__) . 'assets/css/admin-menu-icon.css',
    5765        array(),
    5866        SPEEDOX_VERSION
    5967    );
    60 
    61     wp_enqueue_script(
    62         'speedox-admin-js',
    63         plugin_dir_url(__FILE__) . 'assets/js/admin.js',
    64         array('jquery'),
    65         SPEEDOX_VERSION,
    66         true
    67     );
    68 }
    69 
    70 // NOTE: We use inline CSS for the custom menu icon below — avoid enqueuing a separate admin-menu-icon.css
     68}
     69
    7170// Activation: schedule cache-clearing event if not already scheduled
    7271register_activation_hook(__FILE__, 'speedox_activate');
     
    9998function speedox_add_admin_menu() {
    10099    add_menu_page(
    101         'SpeedOx Dashboard',
    102         'SpeedOx',
    103         'manage_options',
    104         'speedox-dashboard',
    105         'speedox_admin_dashboard_page',
    106         '', // We'll style the icon via inline CSS
    107         30
    108     );
     100    'SpeedOx Dashboard',
     101    'SpeedOx',
     102    'manage_options',
     103    'speedox-dashboard',
     104    'speedox_admin_dashboard_page',
     105    '', // Don't use dashicons, allow custom CSS
     106    30
     107  );
    109108}
    110109
     
    264263}
    265264
    266 // ✅ Add custom emoji icon (⚡) to admin menu via inline CSS
     265// ✅ Add custom emoji icon (⚡) to admin menu
    267266add_action('admin_head', 'speedox_custom_menu_icon_inline_css');
    268267function speedox_custom_menu_icon_inline_css() {
Note: See TracChangeset for help on using the changeset viewer.