Plugin Directory

Changeset 3395661


Ignore:
Timestamp:
11/14/2025 10:31:18 AM (5 months ago)
Author:
lenochat
Message:

Release version 1.0.2: Add custom menu icon and move to top-level admin menu

Location:
lenochat
Files:
26 added
4 edited

Legend:

Unmodified
Added
Removed
  • lenochat/trunk/admin/class-lenochat-submenu.php

    r3295761 r3395661  
    11<?php /**
    2  * Creates the submenu item for the plugin.
     2 * Creates the top-level menu item for the plugin.
    33 *
    4  * Registers a new menu item under 'Settings' and uses the dependency passed into
    5  * the constructor in order to display the page corresponding to this menu item.
     4 * Registers a new top-level menu item in the WordPress admin sidebar and uses
     5 * the dependency passed into the constructor in order to display the page
     6 * corresponding to this menu item.
    67 */
    78class LenoChat_Submenu
    89{
    910    /**
    10      * A reference the class responsible for rendering the submenu page.
     11     * A reference the class responsible for rendering the menu page.
    1112     *
    1213     * @var    Submenu_Page
     
    2728
    2829    /**
    29      * Adds a submenu for this plugin to the 'Settings' menu.
     30     * Adds a top-level menu for this plugin to the WordPress admin sidebar.
    3031     */
    3132    public function init()
    3233    {
    33         add_action("admin_menu", [$this, "add_options_page"]);
     34        add_action("admin_menu", [$this, "add_menu_page"]);
     35        add_action("admin_head", [$this, "add_menu_icon_styles"]);
    3436    }
    3537
    3638    /**
    37      * Creates the submenu item and calls on the Submenu Page object to render
     39     * Creates the top-level menu item and calls on the Submenu Page object to render
    3840     * the actual contents of the page.
    3941     */
    40     public function add_options_page()
     42    public function add_menu_page()
    4143    {
    42         add_options_page(
     44        // Get menu icon URL from environment config
     45        $menu_icon = "dashicons-format-chat"; // Default fallback
     46        try {
     47            require_once plugin_dir_path(__FILE__) . "lenochat-env-functions.php";
     48            $env = lenochat_load_env_func();
     49            if (isset($env["LENOCHAT_MENU_ICON_URL"]) && !empty($env["LENOCHAT_MENU_ICON_URL"])) {
     50                $menu_icon = esc_url($env["LENOCHAT_MENU_ICON_URL"]);
     51            }
     52        } catch (Exception $e) {
     53            // Use default icon if env loading fails
     54        }
     55
     56        add_menu_page(
    4357            "LenoChat",
    44             "LenoChat Settings",
     58            "LenoChat",
    4559            "manage_options",
    4660            "lenochat",
    47             [$this->submenu_page, "render"]
     61            [$this->submenu_page, "render"],
     62            $menu_icon,
     63            30
    4864        );
    4965    }
     66
     67    /**
     68     * Adds custom CSS styles for the menu icon.
     69     */
     70    public function add_menu_icon_styles()
     71    {
     72        echo '<style>
     73            #toplevel_page_lenochat .wp-menu-image img {
     74                width: 20px;
     75                height: 20px;
     76                padding: 0px;
     77                margin: 7px 0;
     78                border-radius: 3px;
     79            }
     80        </style>';
     81    }
    5082}
  • lenochat/trunk/data-env.php

    r3395638 r3395661  
    66    "LENOCHAT_URL" => "https://www.lenochat.com/",
    77    "LENOCHAT_APP_URL" => "https://my.lenochat.com/",
    8     "LENOCHAT_LOGO_URL" => "https://stg-cdn.lenochat.com/assets/lenochat/lenochatbanner.svg",
     8    "LENOCHAT_LOGO_URL" => "https://my-cdn.lenochat.com/assets/lenochat/lenochatbanner.svg",
     9    "LENOCHAT_MENU_ICON_URL" => "https://my-cdn.lenochat.com/assets/lenochat/lenochaticon-blue.png",
    910];
  • lenochat/trunk/lenochat.php

    r3395638 r3395661  
    44 *
    55 * @link              http://www.lenochat.com
    6  * @since             1.0.1
     6 * @since             1.0.2
    77 * @package           LenoChat
    88 *
     
    1111 * Plugin URI:        http://www.lenochat.com
    1212 * Description:       Real-Time Conversations Made Simple! Enjoy engaging with your website visitors in real-time using LenoChat. Max out Customer Experience & Skyrocket Your Business Growth Deliver better support, faster responses, and stronger connections.
    13  * Version:           1.0.1
     13 * Version:           1.0.2
    1414 * Author:            LenoChat
    1515 * Author URI:        https://www.lenochat.com
     
    2424
    2525// Define constants for the plugin
    26 define("LENOCHAT_VERSION", "1.0.1");
     26define("LENOCHAT_VERSION", "1.0.2");
    2727define("LENOCHAT_PLUGIN_DIR", plugin_dir_path(__FILE__));
    2828define("LENOCHAT_PLUGIN_URL", plugin_dir_url(__FILE__));
     
    4646            "LENOCHAT_JS_URL" => "https://my-cdn.lenochat.com/lenochat.js",
    4747            "AUTH_URL" => "https://8twcxgmmjb.execute-api.us-east-1.amazonaws.com/prod/v1/public/auth",
     48            "LENOCHAT_MENU_ICON_URL" => "https://my-cdn.lenochat.com/assets/lenochat/lenochaticon.png",
    4849        ];
    4950    }
  • lenochat/trunk/readme.txt

    r3395638 r3395661  
    55Requires PHP: 7.2
    66Tested up to: 6.8
    7 Stable tag: 1.0.1
     7Stable tag: 1.0.2
    88Donate link: https://www.lenochat.com
    99License: GPL-2.0+
     
    113113
    114114== Changelog ==
     115= 1.0.2 =
     116* Added custom menu icon with styling
     117* Moved menu from Settings submenu to top-level sidebar menu
     118
    115119= 1.0.1 =
    116120* Updated AUTH_URL endpoint
     
    120124
    121125== Upgrade Notice ==
     126= 1.0.2 =
     127Added custom menu icon and moved LenoChat to top-level admin menu.
     128
    122129= 1.0.1 =
    123130Updated authentication endpoint URL.
Note: See TracChangeset for help on using the changeset viewer.