Plugin Directory

Changeset 3412300


Ignore:
Timestamp:
12/05/2025 02:51:31 PM (3 months ago)
Author:
wpcoder75
Message:

### = 2.2.0 [5th December 2025] =

  • Fixed: Early translation loading error — resolved "_load_textdomain_just_in_time was called incorrectly" notice by loading the text domain properly on the init hook according to WordPress 6.7+ standards.
  • Improved: Translation system compatibility with WordPress Core.
  • Enhanced: Code structure for better stability and premium-theme compatibility.
Location:
daily-slider
Files:
36 added
5 edited

Legend:

Unmodified
Added
Removed
  • daily-slider/trunk/admin/dashboard.php

    r3412246 r3412300  
    77   
    88    public function __construct() {
    9         add_action('admin_menu', array($this, 'add_admin_menu'));
     9        add_action('admin_menu', array($this, 'add_admin_menu'), 9);
    1010        add_action('admin_init', array($this, 'register_settings'));
    1111        add_action('wp_ajax_daily_slider_save_settings', array($this, 'save_settings_ajax'));
     
    100100    }
    101101}
    102 
    103 // Initialize the dashboard
    104 new DailySliderDashboard();
  • daily-slider/trunk/admin/welcome-page.php

    r3412246 r3412300  
    88    public static function render() {
    99        ?>
    10         <div class="wrap daily-slider-welcome">
     10        <div class="daily-slider-welcome">
    1111           
    1212            <!-- Header Section -->
  • daily-slider/trunk/admin/widget-manager.php

    r3412246 r3412300  
    178178        }
    179179        ?>
    180         <div class="wrap daily-slider-widgets-manager">
     180        <div class="daily-slider-widgets-manager">
    181181           
    182182            <!-- Show success message after saving -->
     
    276276        .daily-slider-widgets-manager {
    277277            max-width: 1200px;
    278             margin: 20px 0;
     278            margin: 15px 0;
    279279            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    280280        }
     
    326326            display: flex;
    327327            align-items: center;
    328             gap: 30px;
     328            gap: 20px;
    329329        }
    330330
     
    332332            display: inline-flex;
    333333            align-items: center;
    334             gap: 8px;
    335             padding: 12px 24px !important;
    336             font-size: 14px !important;
     334            gap: 6px;
     335            padding: 10px 20px !important;
     336            font-size: 13px !important;
    337337            font-weight: 600;
    338338            border-radius: 8px;
     
    347347
    348348        .header-save-btn .dashicons {
    349             font-size: 16px;
     349            font-size: 14px;
    350350            margin-right: 0;
    351351        }
     
    355355            display: flex;
    356356            flex-direction: column;
    357             gap: 30px;
     357            gap: 20px;
    358358        }
    359359
     
    362362            background: white;
    363363            border-radius: 12px;
    364             padding: 40px;
    365             box-shadow: 0 2px 10px rgba(0,0,0,0.08);
     364            padding: 25px;
     365            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    366366        }
    367367
     
    370370            justify-content: space-between;
    371371            align-items: center;
    372             margin-bottom: 30px;
    373             padding-bottom: 20px;
     372            margin-bottom: 20px;
     373            padding-bottom: 15px;
    374374            border-bottom: 2px solid #f1f1f1;
    375375        }
     
    377377        .section-header h2 {
    378378            margin: 0;
    379             font-size: 24px;
     379            font-size: 20px;
    380380            color: #1e1e1e;
    381381        }
     
    387387
    388388        .bulk-actions .button {
    389             padding: 8px 16px;
    390             font-size: 14px;
     389            padding: 6px 14px;
     390            font-size: 13px;
    391391        }
    392392
     
    394394            background: #000000;
    395395            color: white;
    396             padding: 8px 20px;
    397             border-radius: 20px;
    398             font-size: 12px;
     396            padding: 6px 16px;
     397            border-radius: 18px;
     398            font-size: 11px;
    399399            font-weight: 600;
    400400            text-transform: uppercase;
     
    405405        .widgets-grid {
    406406            display: grid;
    407             grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    408             gap: 25px;
     407            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
     408            gap: 18px;
    409409        }
    410410
    411411        .widget-card {
    412412            border: 2px solid #e1e1e1;
    413             border-radius: 12px;
    414             padding: 25px;
     413            border-radius: 10px;
     414            padding: 20px;
    415415            transition: all 0.3s ease;
    416416            background: #fafafa;
     
    428428            justify-content: space-between;
    429429            align-items: center;
    430             margin-bottom: 20px;
     430            margin-bottom: 15px;
    431431        }
    432432
    433433        .widget-icon {
    434             width: 50px;
    435             height: 50px;
     434            width: 42px;
     435            height: 42px;
    436436            background: #000000;
    437             border-radius: 12px;
     437            border-radius: 10px;
    438438            display: flex;
    439439            align-items: center;
     
    442442
    443443        .widget-icon .dashicons {
    444             font-size: 24px;
     444            font-size: 20px;
    445445            color: white;
    446446        }
     
    450450            position: relative;
    451451            display: inline-block;
    452             width: 60px;
    453             height: 34px;
     452            width: 52px;
     453            height: 28px;
    454454        }
    455455
     
    475475            position: absolute;
    476476            content: "";
    477             height: 26px;
    478             width: 26px;
    479             left: 4px;
    480             bottom: 4px;
     477            height: 22px;
     478            width: 22px;
     479            left: 3px;
     480            bottom: 3px;
    481481            background-color: white;
    482482            transition: .4s;
     
    489489
    490490        .widget-checkbox:checked + .toggle-slider:before {
    491             transform: translateX(26px);
     491            transform: translateX(24px);
    492492        }
    493493
    494494        /* Widget Content */
    495495        .widget-content h3 {
    496             margin: 0 0 10px;
    497             font-size: 20px;
     496            margin: 0 0 8px;
     497            font-size: 18px;
    498498            color: #1e1e1e;
    499499            font-weight: 600;
     
    501501
    502502        .widget-description {
    503             margin: 0 0 20px;
     503            margin: 0 0 15px;
    504504            color: #666;
    505             line-height: 1.5;
     505            line-height: 1.4;
     506            font-size: 13px;
    506507        }
    507508
    508509        .widget-features h4 {
    509             margin: 0 0 10px;
    510             font-size: 14px;
     510            margin: 0 0 8px;
     511            font-size: 13px;
    511512            color: #1e1e1e;
    512513            font-weight: 600;
     
    514515
    515516        .features-list {
    516             margin: 0 0 20px;
     517            margin: 0 0 15px;
    517518            padding: 0;
    518519            list-style: none;
     
    520521
    521522        .features-list li {
    522             padding: 4px 0 4px 20px;
     523            padding: 3px 0 3px 16px;
    523524            color: #666;
    524             font-size: 13px;
     525            font-size: 12px;
    525526            position: relative;
    526527        }
     
    570571        @media (max-width: 768px) {
    571572            .daily-slider-widgets-manager {
    572                 margin: 10px;
     573                margin: 8px;
    573574            }
    574575
    575576            .widgets-header {
    576577                flex-direction: column;
    577                 gap: 20px;
     578                gap: 15px;
    578579                text-align: center;
    579                 padding: 25px;
     580                padding: 18px;
    580581                align-items: stretch;
    581582            }
     
    583584            .header-actions {
    584585                flex-direction: column;
    585                 gap: 20px;
     586                gap: 15px;
    586587            }
    587588
     
    595596
    596597            .widgets-section {
    597                 padding: 25px 20px;
     598                padding: 18px 15px;
    598599            }
    599600
    600601            .section-header {
    601602                flex-direction: column;
    602                 gap: 15px;
     603                gap: 12px;
    603604                align-items: stretch;
    604605            }
  • daily-slider/trunk/daily-slider.php

    r3412251 r3412300  
    33 * Plugin Name: Daily Slider
    44 * Description: Enhance Elementor with customizable hero sliders, review carousels, and portfolio showcases, featuring responsive design, animations, and hover effects.
    5  * Version: 2.1.0
     5 * Version: 2.2.0
    66 * Author: wpcoder75
    77 * Author URI: https://github.com/asikwp75
     
    1919
    2020class DailySliderPlugin {
    21     const VERSION = '2.1.0';
     21    const VERSION = '2.2.0';
    2222    const MINIMUM_ELEMENTOR_VERSION = '3.26.0';
    2323    const MINIMUM_PHP_VERSION = '7.4';
     
    3333
    3434    public function __construct() {
    35         add_action( 'plugins_loaded', array( $this, 'init' ) );
    36        
    37         // Include dashboard
     35        add_action( 'init', array( $this, 'init' ) );
     36    }
     37
     38    public function init() {
     39        // Load text domain first thing in init
     40        load_plugin_textdomain( 'daily-slider', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
     41       
     42        // Load dashboard after text domain is loaded
    3843        if ( is_admin() ) {
    39             require_once plugin_dir_path( __FILE__ ) . 'admin/dashboard.php';
    40         }
    41     }
    42 
    43     public function init() {
    44         // Load text domain for translations
    45         load_plugin_textdomain( 'daily-slider', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
    46        
     44            $this->load_dashboard();
     45        }
     46
     47        // Check Elementor after text domain is loaded so admin notices can use translations
     48        $this->check_elementor_and_register();
     49    }
     50   
     51    public function load_dashboard() {
     52        require_once plugin_dir_path( __FILE__ ) . 'admin/dashboard.php';
     53        new DailySliderDashboard();
     54    }
     55   
     56    public function check_elementor_and_register() {
    4757        if ( ! did_action( 'elementor/loaded' ) ) {
    4858            add_action( 'admin_notices', array( $this, 'admin_notice_missing_main_plugin' ) );
     
    6070        }
    6171
     72        // Register Elementor hooks immediately when Elementor is available
     73        $this->register_elementor_hooks();
     74    }
     75   
     76    public function register_elementor_hooks() {
    6277        add_action( 'elementor/elements/categories_registered', array( $this, 'add_elementor_category' ) );
    6378        add_action( 'elementor/widgets/register', array( $this, 'register_widgets' ) );
     
    201216        ));
    202217
     218        // Debug: Log widget registration
     219        if (defined('WP_DEBUG') && WP_DEBUG) {
     220            error_log('Daily Slider: Registering widgets. Enabled widgets: ' . print_r($enabled_widgets, true));
     221        }
     222
    203223        // Register Eldorado Widget if enabled
    204224        if (isset($enabled_widgets['eldorado']) && $enabled_widgets['eldorado']) {
    205225            require_once plugin_dir_path( __FILE__ ) . 'widgets/eldorado/eldorado.php';
    206226            $widgets_manager->register( new \DailySlider\Widgets\Eldorado_Widget() );
     227            if (defined('WP_DEBUG') && WP_DEBUG) {
     228                error_log('Daily Slider: Eldorado widget registered');
     229            }
    207230        }
    208231
     
    211234            require_once plugin_dir_path( __FILE__ ) . 'widgets/pixel/pixel.php';
    212235            $widgets_manager->register( new \DailySlider\Widgets\Pixel_Widget() );
     236            if (defined('WP_DEBUG') && WP_DEBUG) {
     237                error_log('Daily Slider: Pixel widget registered');
     238            }
    213239        }
    214240
     
    217243            require_once plugin_dir_path( __FILE__ ) . 'widgets/review-carousel/review-carousel.php';
    218244            $widgets_manager->register( new \DailySlider\Widgets\ReviewCarousel_Widget() );
     245            if (defined('WP_DEBUG') && WP_DEBUG) {
     246                error_log('Daily Slider: Review Carousel widget registered');
     247            }
    219248        }
    220249
     
    223252            require_once plugin_dir_path( __FILE__ ) . 'widgets/marquee/marquee.php';
    224253            $widgets_manager->register( new \DailySlider\Widgets\Marquee_Widget() );
     254            if (defined('WP_DEBUG') && WP_DEBUG) {
     255                error_log('Daily Slider: Marquee widget registered');
     256            }
    225257        }
    226258    }
     
    229261    public function admin_notice_missing_main_plugin() {
    230262        $message = sprintf(
    231             // translators: %1$s is the plugin name, %2$s is the required plugin name.
    232             esc_html__( '"%1$s" requires "%2$s" to be installed and activated.', 'daily-slider' ),
    233             '<strong>' . esc_html__( 'DailySlider', 'daily-slider' ) . '</strong>',
    234             '<strong>' . esc_html__( 'Elementor', 'daily-slider' ) . '</strong>'
     263            '"%s" requires "%s" to be installed and activated.',
     264            '<strong>DailySlider</strong>',
     265            '<strong>Elementor</strong>'
    235266        );
    236267        printf( '<div class="notice notice-warning daily-slider-notice is-dismissible"><p>%s</p></div>', wp_kses_post( $message ) );
     
    239270    public function admin_notice_minimum_php_version() {
    240271        $message = sprintf(
    241             // translators: %1$s is the plugin name, %2$s is "PHP", %3$s is the required PHP version.
    242             esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'daily-slider' ),
    243             '<strong>' . esc_html__( 'DailySlider', 'daily-slider' ) . '</strong>',
    244             '<strong>' . esc_html__( 'PHP', 'daily-slider' ) . '</strong>',
     272            '"%s" requires "%s" version %s or greater.',
     273            '<strong>DailySlider</strong>',
     274            '<strong>PHP</strong>',
    245275            esc_html( self::MINIMUM_PHP_VERSION )
    246276        );
     
    250280    public function admin_notice_minimum_elementor_version() {
    251281        $message = sprintf(
    252             // translators: %1$s is the plugin name, %2$s is "Elementor", %3$s is the required Elementor version.
    253             esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'daily-slider' ),
    254             '<strong>' . esc_html__( 'DailySlider', 'daily-slider' ) . '</strong>',
    255             '<strong>' . esc_html__( 'Elementor', 'daily-slider' ) . '</strong>',
     282            '"%s" requires "%s" version %s or greater.',
     283            '<strong>DailySlider</strong>',
     284            '<strong>Elementor</strong>',
    256285            esc_html( self::MINIMUM_ELEMENTOR_VERSION )
    257286        );
  • daily-slider/trunk/readme.txt

    r3412246 r3412300  
    44Requires at least: 5.0
    55Tested up to: 6.8
    6 Stable Tag: 2.1.0
     6Stable Tag: 2.2.0
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    7070== Changelog ==
    7171
    72 = 2.1.0 [27th August 2025] =
     72### = 2.2.0 [5th December 2025] =
     73
     74* Fixed: Early translation loading error — resolved "_load_textdomain_just_in_time was called incorrectly" notice by loading the text domain properly on the `init` hook according to WordPress 6.7+ standards.
     75* Improved: Translation system compatibility with WordPress Core.
     76* Enhanced: Code structure for better stability and premium-theme compatibility.
     77
     78
     79### = 2.1.0 [5th December 2025] =
    7380
    7481- Added new customization options for all slider widgets
Note: See TracChangeset for help on using the changeset viewer.