Plugin Directory

Changeset 3379070


Ignore:
Timestamp:
10/15/2025 05:49:58 PM (5 months ago)
Author:
clicksmith
Message:

Release 1.1.13: icon path fix + fallback logic

Location:
clicksmith-pdf-viewer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • clicksmith-pdf-viewer/assets/menu-icon-20x20.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • clicksmith-pdf-viewer/trunk/clicksmith-pdf-viewer.php

    r3379061 r3379070  
    44 * Plugin URI: https://clicksmith.net/wordpress-plugins/clicksmith-pdf-viewer/
    55 * Description: Upload PDFs and display them via shortcode. Includes a UI to configure width/height and copy the shortcode/template include.
    6  * Version: 1.1.12
     6 * Version: 1.1.13
    77 * Author: Clicksmith Digital Marketing
    88 * Author URI: https://clicksmith.net
     
    1818
    1919class Clicksmith_PDF_Viewer {
    20     const VERSION  = '1.1.12';
     20    const VERSION  = '1.1.13';
    2121    const SLUG     = 'clicksmith-pdf-viewer';
    2222    const NONCE    = 'clicksmith_pdf_upload_nonce';
     
    5757     * Admin: CPT & Menu
    5858     * ------------------------- */
    59     public function register_cpt() {
    60         register_post_type(self::CPT, [
    61             'label' => 'PDF Embeds',
    62             'labels' => [
    63                 'name' => 'PDF Embeds',
    64                 'singular_name' => 'PDF Embed',
    65                 'add_new_item' => 'Add New PDF Embed',
    66                 'edit_item' => 'Edit PDF Embed',
    67                 'new_item' => 'New PDF Embed',
    68                 'view_item' => 'View PDF Embed',
    69                 'search_items' => 'Search PDF Embeds',
    70                 'not_found' => 'No PDF Embeds found',
    71             ],
    72             'public' => false,
    73             'show_ui' => true,
    74             'show_in_menu' => true,
    75             // Use custom image icon (with CSS sizing fixes in admin_assets)
    76             'menu_icon' => $this->icon_url(),
    77             'supports' => ['title'],
    78         ]);
    79     }
     59    public function register_cpt() {
     60        $icon_file = plugin_dir_path(__FILE__) . 'assets/menu-icon-20x20.png';
     61        $icon_url  = plugins_url('assets/menu-icon-20x20.png', __FILE__);
     62        $menu_icon = file_exists($icon_file) ? $icon_url : 'dashicons-media-document';
     63   
     64        register_post_type(self::CPT, [
     65            'label' => 'PDF Embeds',
     66            'public' => false,
     67            'show_ui' => true,
     68            'show_in_menu' => true,
     69            'menu_icon' => $menu_icon,
     70            'supports' => ['title'],
     71            'labels' => [ /* … your labels … */ ],
     72        ]);
     73   
     74        // Optional: admin notice if missing
     75        if ( ! file_exists($icon_file) && current_user_can('manage_options') ) {
     76            add_action('admin_notices', function() use ($icon_file, $icon_url) {
     77                echo '<div class="notice notice-warning"><p><strong>Clicksmith PDF Viewer:</strong> menu icon not found.<br>Expected file: <code>'
     78                     . esc_html($icon_file) . '</code><br>URL: <code>' . esc_html($icon_url) . '</code></p></div>';
     79            });
     80        }
     81    }
    8082
    8183    public function add_menu() {
  • clicksmith-pdf-viewer/trunk/readme.txt

    r3379061 r3379070  
    55Tested up to: 6.8.2
    66Requires PHP: 7.4
    7 Stable tag: 1.1.11
     7Stable tag: 1.1.13
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    4747
    4848== Screenshots ==
    49 1. Admin generator and shortcode list
     491. Admin generator and shortcode list 
    50502. Frontend PDF embed
    5151
    5252== Changelog ==
     53
     54= 1.1.13 =
     55* Fix: Corrected icon path resolution when plugin is installed under alternate folder names. 
     56* Enhancement: Added graceful Dashicons fallback and admin notice to display expected icon path. 
     57* Internal: Updated CSS and tested under WordPress 6.8.2.
     58
    5359= 1.1.12 =
    54 * Fix: Admin menu icon now uses a 20×20 PNG with cross-browser CSS constraints (Chrome/Windows & Safari/macOS). No functional changes.
     60* Fix: Admin menu icon now uses a 20×20 PNG with cross-browser CSS constraints (Chrome/Windows & Safari/macOS). 
     61* No functional changes.
    5562
    5663= 1.1.11 =
    57 * Fix: Admin menu icon now uses a 20×20 PNG with cross-browser CSS constraints (Chrome/Windows & Safari/macOS). No functional changes.
     64* Fix: Admin menu icon now uses a 20×20 PNG with cross-browser CSS constraints (Chrome/Windows & Safari/macOS). 
     65* No functional changes.
    5866
    5967= 1.1.9 =
     
    7381
    7482= 1.1.4 =
    75 * Removed 'Powered by Clicksmith' from all admin/dashboard views.
     83* Removed “Powered by Clicksmith” from all admin/dashboard views.
    7684
    7785= 1.1.3 =
     
    9199
    92100== Upgrade Notice ==
    93 = 1.1.12 =
    94 Admin menu icon rendering fix across browsers. Safe to update.
     101= 1.1.13 =
     102Fixes for icon path resolution and adds fallback support. Safe to update.
Note: See TracChangeset for help on using the changeset viewer.