Plugin Directory

Changeset 3458804


Ignore:
Timestamp:
02/11/2026 09:14:58 AM (6 days ago)
Author:
beautifulplugins
Message:

Release 1.0.1

Location:
essential-elements
Files:
93 added
12 deleted
31 edited
1 copied

Legend:

Unmodified
Added
Removed
  • essential-elements/assets/banner-1544x500.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • essential-elements/assets/banner-772x250.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • essential-elements/assets/icon-128x128.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • essential-elements/assets/icon-256x256.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • essential-elements/assets/screenshot-1.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • essential-elements/tags/1.0.1/essential-elements.php

    r3270973 r3458804  
    44 * Plugin URI:        https://beautifulplugins.com/essential-elements/
    55 * Description:       Essential Elements for WordPress is a powerful plugin that provides essential elements to increase site functionality.
    6  * Version: 1.0.0
     6 * Version:           1.0.1
    77 * Requires at least: 5.0
    88 * Requires PHP:      7.4
     9 * Tested up to:      6.9
    910 * Author:            BeautifulPlugins
    1011 * Author URI:        https://beautifulplugins.com
     
    3132defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
    3233
    33 /**
    34  * Optimized autoload classes.
    35  *
    36  * @since 1.0.0
    37  */
     34// autoload optimized classes.
    3835require_once __DIR__ . '/vendor/autoload.php';
    3936
     
    4239 *
    4340 * @since 1.0.0
    44  * @return Plugin
     41 * @return Plugin The plugin instance.
    4542 */
    46 function esse_essential_elements() {
    47     return Plugin::create( __FILE__, '1.0.0' );
     43function essential_elements() {
     44    return Plugin::create( __FILE__, '1.0.1' );
    4845}
    4946
    5047// Initialize the plugin.
    51 esse_essential_elements();
     48essential_elements();
  • essential-elements/tags/1.0.1/includes/Admin/Admin.php

    r3270973 r3458804  
    66
    77/**
    8  * The main admin class.
     8 * Class Admin.
    99 *
    1010 * @since 1.0.0
    11  * @package EssentialElements/Admin
     11 * @package EssentialElements\Admin
    1212 */
    1313class Admin {
     
    1616     */
    1717    public function __construct() {
    18         // Create admin settings page under WordPress settings menu.
    19         add_action( 'admin_menu', array( $this, 'add_settings_page' ) );
    20 
    21         // Register settings.
     18        add_action( 'admin_menu', array( $this, 'admin_menu' ) );
     19        add_action( 'admin_menu', array( $this, 'modules_menu' ), 99 );
     20        add_action( 'admin_menu', array( $this, 'settings_menu' ), 100 );
    2221        add_action( 'admin_init', array( $this, 'register_settings' ) );
    23     }
    24 
    25     /**
    26      * Add settings page under WordPress settings menu.
    27      *
    28      * @since 1.0.0
    29      * @return void
    30      */
    31     public function add_settings_page() {
    32         add_options_page(
     22        add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
     23
     24        // Load page headers.
     25        add_action( 'esse_admin_page_before_main_content', array( $this, 'render_header' ) );
     26        add_action( 'esse_admin_page_after_content', array( $this, 'render_aside' ) );
     27
     28        // Enabling the modules.
     29        add_action( 'wp_ajax_esse_enable_module', array( $this, 'enable_module' ) );
     30    }
     31
     32    /**
     33     * Add menu page.
     34     *
     35     * @since 1.0.0
     36     * @return void
     37     */
     38    public function admin_menu() {
     39        add_menu_page(
    3340            __( 'Essential Elements', 'essential-elements' ),
    34             __( 'Essential Elements', 'essential-elements' ),
     41            __( 'Essentials', 'essential-elements' ),
    3542            'manage_options',
    3643            'essential-elements',
    37             array( $this, 'settings_page' )
     44            null,
     45            'dashicons-screenoptions',
     46            '25',
     47        );
     48
     49        // Add submenu page "Dashboard".
     50        add_submenu_page(
     51            'essential-elements',
     52            __( 'Dashboard', 'essential-elements' ),
     53            __( 'Dashboard', 'essential-elements' ),
     54            'manage_options',
     55            'essential-elements',
     56            array( $this, 'render_dashboard' ),
     57            1,
     58        );
     59    }
     60
     61    /**
     62     * Render dashboard page.
     63     *
     64     * @since 1.0.0
     65     * @return void
     66     */
     67    public function render_dashboard() {
     68        require __DIR__ . '/views/dashboard.php';
     69    }
     70
     71    /**
     72     * Add modules submenu page.
     73     *
     74     * @since 1.0.0
     75     * @return void
     76     */
     77    public function modules_menu() {
     78        add_submenu_page(
     79            'essential-elements',
     80            __( 'Modules', 'essential-elements' ),
     81            __( 'Modules', 'essential-elements' ),
     82            'manage_options',
     83            'esse-modules',
     84            array( $this, 'render_modules' ),
     85        );
     86    }
     87
     88    /**
     89     * Render modules page.
     90     *
     91     * @since 1.0.0
     92     * @return void
     93     */
     94    public function render_modules() {
     95        include __DIR__ . '/views/modules.php';
     96    }
     97
     98    /**
     99     * Add settings submenu page.
     100     *
     101     * @since 1.0.0
     102     * @return void
     103     */
     104    public function settings_menu() {
     105        add_submenu_page(
     106            'essential-elements',
     107            __( 'Settings', 'essential-elements' ),
     108            __( 'Settings', 'essential-elements' ),
     109            'manage_options',
     110            'esse-settings',
     111            array( $this, 'render_settings' ),
    38112        );
    39113    }
     
    45119     * @return void
    46120     */
    47     public function settings_page() {
    48         // Check user capabilities.
    49         if ( ! current_user_can( 'manage_options' ) ) {
    50             esse_essential_elements()->flash_notice( __( 'You do not have sufficient permissions to access this page.', 'essential-elements' ), 'error' );
    51             return;
    52         }
    53         ?>
    54         <div class="wrap">
    55             <h1><?php esc_html_e( 'Essential Elements Settings', 'essential-elements' ); ?></h1>
    56             <p><?php esc_html_e( 'Configure the settings for the Essential Elements plugin.', 'essential-elements' ); ?></p>
    57             <form method="post" action="<?php echo esc_url( admin_url( 'options.php' ) ); ?>">
    58                 <?php
    59                 settings_fields( 'essential_elements' );
    60                 do_settings_sections( 'essential-elements' );
    61                 submit_button();
    62                 ?>
    63             </form>
    64         </div>
    65         <?php
     121    public function render_settings() {
     122        include __DIR__ . '/views/settings.php';
    66123    }
    67124
     
    80137            __( 'General Settings', 'essential-elements' ),
    81138            array( $this, 'general_settings' ),
    82             'essential-elements'
     139            'esse-settings'
    83140        );
    84141
    85142        // Add settings field to enable the progress bar.
    86143        add_settings_field(
    87             'esse_progress_bar_is_enabled',
    88             __( 'Enable Progress Bar', 'essential-elements' ),
    89             array( $this, 'progress_bar_is_enabled' ),
    90             'essential-elements',
     144            'esse_delete_data',
     145            __( 'Delete plugin data', 'essential-elements' ),
     146            array( $this, 'delete_data' ),
     147            'esse-settings',
    91148            'esse_general_settings'
    92149        );
    93 
    94         // Progress bar position field.
    95         add_settings_field(
    96             'esse_progress_bar_position',
    97             __( 'Display Position', 'essential-elements' ),
    98             array( $this, 'progress_bar_position' ),
    99             'essential-elements',
    100             'esse_general_settings'
    101         );
    102 
    103         // Progress bar color field.
    104         add_settings_field(
    105             'esse_progress_bar_color',
    106             __( 'Color', 'essential-elements' ),
    107             array( $this, 'progress_progress_bar_color' ),
    108             'essential-elements',
    109             'esse_general_settings'
    110         );
    111 
    112         // Progress bar background color field.
    113         add_settings_field(
    114             'esse_progress_bar_bg_color',
    115             __( 'Background Color', 'essential-elements' ),
    116             array( $this, 'progress_progress_bar_bg_color' ),
    117             'essential-elements',
    118             'esse_general_settings'
    119         );
    120 
    121         // Scroll top is enabled field.
    122         add_settings_field(
    123             'esse_scroll_top_is_enabled',
    124             __( 'Enable Scroll Top', 'essential-elements' ),
    125             array( $this, 'scroll_top_is_enabled' ),
    126             'essential-elements',
    127             'esse_general_settings'
    128         );
    129 
    130         // Scroll top position field.
    131         add_settings_field(
    132             'esse_scroll_top_position',
    133             __( 'Display Position', 'essential-elements' ),
    134             array( $this, 'scroll_top_position' ),
    135             'essential-elements',
    136             'esse_general_settings'
    137         );
    138 
    139         // Scroll top button icon color field.
    140         add_settings_field(
    141             'esse_scroll_top_icon_color',
    142             __( 'Icon Color', 'essential-elements' ),
    143             array( $this, 'scroll_top_icon_color' ),
    144             'essential-elements',
    145             'esse_general_settings'
    146         );
    147 
    148         // Scroll top button background color field.
    149         add_settings_field(
    150             'esse_scroll_top_bg_color',
    151             __( 'Background Color', 'essential-elements' ),
    152             array( $this, 'scroll_top_bg_color' ),
    153             'essential-elements',
    154             'esse_general_settings'
    155         );
    156 
    157         // Scroll top button hover background color field.
    158         add_settings_field(
    159             'esse_scroll_top_hover_bg_color',
    160             __( 'Hover Background Color', 'essential-elements' ),
    161             array( $this, 'scroll_top_hover_bg_color' ),
    162             'essential-elements',
    163             'esse_general_settings'
    164         );
    165150    }
    166151
     
    172157     */
    173158    public function general_settings() {
    174         echo '<p>' . esc_html__( 'Configure the Essential Elements general settings.', 'essential-elements' ) . '</p>';
     159        echo '<p>' . esc_html__( 'Configure the general settings.', 'essential-elements' ) . '</p>';
    175160    }
    176161
     
    181166     * @return void
    182167     */
    183     public function progress_bar_is_enabled() {
    184         $progress_bar_is_enabled = esse_get_settings( 'progress_bar_is_enabled', 'yes' );
     168    public function delete_data() {
     169        $delete_data = esse_get_settings( 'esse_settings', 'delete_data', 'no' );
    185170        ?>
    186         <label for="esse_settings[progress_bar_is_enabled]">
    187             <input type="checkbox" name="esse_settings[progress_bar_is_enabled]" id="esse_settings[progress_bar_is_enabled]" value="yes" <?php checked( $progress_bar_is_enabled, 'yes' ); ?> />
    188             <?php esc_html_e( 'Enable to display the progress bar.', 'essential-elements' ); ?>
     171        <label for="esse_settings[delete_data]">
     172            <input type="checkbox" name="esse_settings[delete_data]" id="esse_settings[delete_data]" value="yes" <?php checked( $delete_data, 'yes' ); ?> />
     173            <?php esc_html_e( 'Delete plugin data on uninstall', 'essential-elements' ); ?>
    189174        </label>
    190         <p><?php esc_html_e( 'It will display the progress bar on the bottom/top of the page. Default is enabled.', 'essential-elements' ); ?></p>
    191         <?php
    192     }
    193 
    194     /**
    195      * Display progress bar position field.
    196      *
    197      * @since 1.0.0
    198      * @return void
    199      */
    200     public function progress_bar_position() {
    201         $progress_bar_position = esse_get_settings( 'progress_bar_position', 'bottom' );
    202         ?>
    203         <select name="esse_settings[progress_bar_position]" id="esse_settings[progress_bar_position]" class="regular-text">
    204             <option value="top" <?php selected( $progress_bar_position, 'top' ); ?>><?php esc_html_e( 'Top', 'essential-elements' ); ?></option>
    205             <option value="bottom" <?php selected( $progress_bar_position, 'bottom' ); ?>><?php esc_html_e( 'Bottom', 'essential-elements' ); ?></option>
    206             ?>
    207         </select>
    208         <p class="description"><?php esc_html_e( 'Chose the default position to display the progress bar. Default is bottom.', 'essential-elements' ); ?></p>
    209         <?php
    210     }
    211 
    212     /**
    213      * Display progress bar color field.
    214      *
    215      * @since 1.0.0
    216      * @return void
    217      */
    218     public function progress_progress_bar_color() {
    219         $progress_bar_color = esse_get_settings( 'progress_bar_color', '#FFFFFF' );
    220         ?>
    221         <input type="text" name="esse_settings[progress_bar_color]" id="esse_settings[progress_bar_color]" value="<?php echo esc_attr( $progress_bar_color ); ?>" class="regular-text" />
    222         <p class="description"><?php esc_html_e( 'Enter the color of the progress bar. Default is #FFFFFF.', 'essential-elements' ); ?></p>
    223         <?php
    224     }
    225 
    226     /**
    227      * Display progress bar background color field.
    228      *
    229      * @since 1.0.0
    230      * @return void
    231      */
    232     public function progress_progress_bar_bg_color() {
    233         $progress_bar_bg_color = esse_get_settings( 'progress_bar_bg_color', '#000000' );
    234         ?>
    235         <input type="text" name="esse_settings[progress_bar_bg_color]" id="esse_settings[progress_bar_bg_color]" value="<?php echo esc_attr( $progress_bar_bg_color ); ?>" class="regular-text" />
    236         <p class="description"><?php esc_html_e( 'Enter the background color of the progress bar. Default is #000000.', 'essential-elements' ); ?></p>
    237         <?php
    238     }
    239 
    240     /**
    241      * Display the scroll top is enabled field.
    242      *
    243      * @since 1.0.0
    244      * @return void
    245      */
    246     public function scroll_top_is_enabled() {
    247         $scroll_top_is_enabled = esse_get_settings( 'scroll_top_is_enabled', 'yes' );
    248         ?>
    249         <label for="esse_settings[scroll_top_is_enabled]">
    250             <input type="checkbox" name="esse_settings[scroll_top_is_enabled]" id="esse_settings[scroll_top_is_enabled]" value="yes" <?php checked( $scroll_top_is_enabled, 'yes' ); ?> />
    251             <?php esc_html_e( 'Enable to display the scroll top button.', 'essential-elements' ); ?>
    252         </label>
    253         <p><?php esc_html_e( 'It will display the scroll top button on the bottom left/right of the page. Default is enabled.', 'essential-elements' ); ?></p>
    254         <?php
    255     }
    256 
    257     /**
    258      * Display scroll top position field.
    259      *
    260      * @since 1.0.0
    261      * @return void
    262      */
    263     public function scroll_top_position() {
    264         $scroll_top_position = esse_get_settings( 'scroll_top_position', 'right' );
    265         ?>
    266         <select name="esse_settings[scroll_top_position]" id="esse_settings[scroll_top_position]" class="regular-text">
    267             <option value="left" <?php selected( $scroll_top_position, 'left' ); ?>><?php esc_html_e( 'Bottom Left', 'essential-elements' ); ?></option>
    268             <option value="right" <?php selected( $scroll_top_position, 'right' ); ?>><?php esc_html_e( 'Bottom Right', 'essential-elements' ); ?></option>
    269             ?>
    270         </select>
    271         <p class="description"><?php esc_html_e( 'Chose the default position to display the scroll top button. Default is bottom right.', 'essential-elements' ); ?></p>
    272         <?php
    273     }
    274 
    275     /**
    276      * Display scroll top button icon color field.
    277      *
    278      * @since 1.0.0
    279      * @return void
    280      */
    281     public function scroll_top_icon_color() {
    282         $scroll_top_icon_color = esse_get_settings( 'scroll_top_icon_color', '#ffffff' );
    283         ?>
    284         <input type="text" name="esse_settings[scroll_top_icon_color]" id="esse_settings[scroll_top_icon_color]" value="<?php echo esc_attr( $scroll_top_icon_color ); ?>" class="regular-text" />
    285         <p class="description"><?php esc_html_e( 'Enter the icon color of the scroll top button. Default is #ffffff.', 'essential-elements' ); ?></p>
    286         <?php
    287     }
    288 
    289     /**
    290      * Display scroll top button background color field.
    291      *
    292      * @since 1.0.0
    293      * @return void
    294      */
    295     public function scroll_top_bg_color() {
    296         $scroll_top_bg_color = esse_get_settings( 'scroll_top_bg_color', '#000000' );
    297         ?>
    298         <input type="text" name="esse_settings[scroll_top_bg_color]" id="esse_settings[scroll_top_bg_color]" value="<?php echo esc_attr( $scroll_top_bg_color ); ?>" class="regular-text" />
    299         <p class="description"><?php esc_html_e( 'Enter the background color of the scroll top button. Default is #000000.', 'essential-elements' ); ?></p>
    300         <?php
    301     }
    302 
    303     /**
    304      * Display scroll top button hover background color field.
    305      *
    306      * @since 1.0.0
    307      * @return void
    308      */
    309     public function scroll_top_hover_bg_color() {
    310         $scroll_top_hover_bg_color = esse_get_settings( 'scroll_top_hover_bg_color', '#333333' );
    311         ?>
    312         <input type="text" name="esse_settings[scroll_top_hover_bg_color]" id="esse_settings[scroll_top_hover_bg_color]" value="<?php echo esc_attr( $scroll_top_hover_bg_color ); ?>" class="regular-text" />
    313         <p class="description"><?php esc_html_e( 'Enter the hover background color of the scroll top button. Default is #333333.', 'essential-elements' ); ?></p>
     175        <p><?php esc_html_e( 'Enabling this will delete all the data while uninstalling the plugin.', 'essential-elements' ); ?></p>
    314176        <?php
    315177    }
     
    327189
    328190        // Sanitize the progress bar is enabled.
    329         $sanitized_settings['progress_bar_is_enabled'] = isset( $settings['progress_bar_is_enabled'] ) ? 'yes' : 'no';
    330 
    331         // Sanitize the progress bar position.
    332         $sanitized_settings['progress_bar_position'] = isset( $settings['progress_bar_position'] ) ? sanitize_text_field( $settings['progress_bar_position'] ) : 'bottom';
    333 
    334         // Sanitize the progress bar color.
    335         $sanitized_settings['progress_bar_color'] = isset( $settings['progress_bar_color'] ) ? sanitize_text_field( $settings['progress_bar_color'] ) : '#FFFFFF';
    336 
    337         // Sanitize the progress bar background color.
    338         $sanitized_settings['progress_bar_bg_color'] = isset( $settings['progress_bar_bg_color'] ) ? sanitize_text_field( $settings['progress_bar_bg_color'] ) : '#000000';
    339 
    340         // Sanitize the scroll top is enabled.
    341         $sanitized_settings['scroll_top_is_enabled'] = isset( $settings['scroll_top_is_enabled'] ) ? 'yes' : 'no';
    342 
    343         // Sanitize the scroll top position.
    344         $sanitized_settings['scroll_top_position'] = isset( $settings['scroll_top_position'] ) ? sanitize_text_field( $settings['scroll_top_position'] ) : 'right';
    345 
    346         // Sanitize the scroll top icon color.
    347         $sanitized_settings['scroll_top_icon_color'] = isset( $settings['scroll_top_icon_color'] ) ? sanitize_text_field( $settings['scroll_top_icon_color'] ) : '#FFFFFF';
    348 
    349         // Sanitize the scroll top background color.
    350         $sanitized_settings['scroll_top_bg_color'] = isset( $settings['scroll_top_bg_color'] ) ? sanitize_text_field( $settings['scroll_top_bg_color'] ) : '#000000';
    351 
    352         // Sanitize the scroll top hover background color.
    353         $sanitized_settings['scroll_top_hover_bg_color'] = isset( $settings['scroll_top_hover_bg_color'] ) ? sanitize_text_field( $settings['scroll_top_hover_bg_color'] ) : '#333333';
     191        $sanitized_settings['delete_data'] = isset( $settings['delete_data'] ) ? 'yes' : 'no';
    354192
    355193        return $sanitized_settings;
    356194    }
     195
     196    /**
     197     * Get screen IDs.
     198     *
     199     * @since 1.0.0
     200     */
     201    public static function get_screen_ids() {
     202        // Add a filter to allow custom screen IDs.
     203        return apply_filters(
     204            'esse_screen_ids',
     205            array(
     206                'toplevel_page_essential-elements',
     207                'essentials_page_esse-modules',
     208                'essentials_page_esse-settings',
     209            )
     210        );
     211    }
     212
     213    /**
     214     * Enqueue scripts.
     215     *
     216     * @param string $hook The current admin page.
     217     *
     218     * @since 1.0.0
     219     * @return void
     220     */
     221    public function enqueue_scripts( $hook ) {
     222        $screens = self::get_screen_ids();
     223
     224        if ( ! in_array( $hook, $screens, true ) ) {
     225            return;
     226        }
     227
     228        wp_enqueue_style( 'esse-admin', ESSE_ASSETS_URL . 'css/admin.css', array(), ESSE_VERSION );
     229    }
     230
     231    /**
     232     * Render header.
     233     *
     234     * @since 1.0.0
     235     * @return void
     236     */
     237    public function render_header() {
     238        wp_verify_nonce( '_nonce' );
     239        $page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
     240        include __DIR__ . '/views/header.php';
     241    }
     242
     243    /**
     244     * Render aside.
     245     *
     246     * @since 1.0.0
     247     * @return void
     248     */
     249    public function render_aside() {
     250        include __DIR__ . '/views/aside.php';
     251    }
     252
     253    /**
     254     * Enable module.
     255     *
     256     * @since 1.0.0
     257     * @return void
     258     */
     259    public function enable_module() {
     260        // Verify nonce to prevent CSRF.
     261        if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['_wpnonce'] ) ), 'esse_enable_module' ) ) {
     262            wp_send_json_error( array( 'message' => __( 'Invalid nonce provided.', 'essential-elements' ) ) );
     263        }
     264
     265        // Check user capabilities to prevent unauthorized access.
     266        if ( ! current_user_can( 'manage_options' ) ) {
     267            wp_send_json_error( array( 'message' => __( 'You do not have sufficient permissions to access this page.', 'essential-elements' ) ) );
     268        }
     269
     270        // Get the module data and save it to the database.
     271        $module = isset( $_POST['module'] ) ? sanitize_text_field( wp_unslash( $_POST['module'] ) ) : '';
     272        $status = isset( $_POST['status'] ) ? sanitize_text_field( wp_unslash( $_POST['status'] ) ) : '';
     273
     274        // If module is empty, send error response.
     275        if ( empty( $module ) ) {
     276            wp_send_json_error( array( 'message' => __( 'Module not found.', 'essential-elements' ) ) );
     277        }
     278
     279        // If status is empty, send error response.
     280        if ( empty( $status ) ) {
     281            wp_send_json_error( array( 'message' => __( 'Module status not found.', 'essential-elements' ) ) );
     282        }
     283
     284        $modules = get_option( 'esse_modules', array() );
     285
     286        // If status is true and module is not in the array, add it.
     287        if ( $status && ! in_array( $module, $modules, true ) ) {
     288            $modules[] = $module;
     289        } else {
     290            // If status is false and module is in the array, remove it.
     291            $modules = array_diff( $modules, array( $module ) );
     292        }
     293
     294        // Update the modules option.
     295        update_option( 'esse_modules', $modules );
     296
     297        // Send success response.
     298        wp_send_json_success( array( 'message' => __( 'Module status updated successfully.', 'essential-elements' ) ) );
     299        exit();
     300    }
    357301}
  • essential-elements/tags/1.0.1/includes/Plugin.php

    r3270973 r3458804  
    66
    77/**
    8  * The main plugin class.
     8 * Class Plugin.
    99 *
    1010 * @since 1.0.0
     
    4545     *
    4646     * @since 1.0.0
    47      * @return static
     47     * @return static The plugin instance.
    4848     */
    4949    final public static function create( $file, $version = '1.0.0' ) {
     
    6363     * @since 1.0.0
    6464     */
    65     protected function __construct( $file, $version ) {
     65    public function __construct( $file, $version ) {
    6666        $this->file    = $file;
    6767        $this->version = $version;
     
    7777     * @return void
    7878     */
    79     protected function define_constants() {
     79    private function define_constants() {
    8080        // Define the plugin version.
    8181        if ( ! defined( 'ESSE_VERSION' ) ) {
     
    125125     * @return void
    126126     */
    127     protected function init_hooks() {
     127    public function init_hooks() {
    128128        register_activation_hook( ESSE_FILE, array( $this, 'activate' ) );
    129         add_action( 'init', array( $this, 'load_textdomain' ) );
    130129        add_action( 'admin_notices', array( $this, 'display_flash_notices' ), 12 );
    131130        add_action( 'init', array( $this, 'init' ), 0 );
     
    134133    /**
    135134     * Activate the plugin.
    136      * This method is called when the plugin is activated.
    137135     *
    138136     * @since 1.0.0
     
    141139    public function activate() {
    142140        update_option( 'esse_version', ESSE_VERSION );
    143 
    144         // Default settings.
    145         $default_settings = array(
    146             'progress_bar_is_enabled'   => 'yes',
    147             'progress_bar_position'     => 'bottom',
    148             'progress_bar_color'        => '#FFFFFF',
    149             'progress_bar_bg_color'     => '#000000',
    150             'scroll_top_is_enabled'     => 'yes',
    151             'scroll_top_position'       => 'right',
    152             'scroll_top_icon_color'     => '#FFFFFF',
    153             'scroll_top_bg_color'       => '#000000',
    154             'scroll_top_hover_bg_color' => '#333333',
    155         );
     141        add_option( 'esse_installed', current_time( 'mysql' ) );
     142
     143        // Default settings for modules.
     144        $progress_bar_settings = array(
     145            'is_enabled' => 'yes',
     146            'position'   => 'bottom',
     147            'color'      => '#FFFFFF',
     148            'bg_color'   => '#000000',
     149        );
     150
     151        $scroll_bar_settings = array(
     152            'is_enabled'        => 'yes',
     153            'track_color'       => '#f1f1f1',
     154            'thumb_color'       => '#0073aa',
     155            'thumb_hover_color' => '#00a0d2',
     156            'width'             => 60,
     157        );
     158
     159        $scroll_top_settings = array(
     160            'is_enabled'     => 'yes',
     161            'position'       => 'right',
     162            'icon_color'     => '#FFFFFF',
     163            'bg_color'       => '#000000',
     164            'hover_bg_color' => '#333333',
     165        );
     166
    156167        // Update the default settings.
    157         update_option( 'esse_settings', $default_settings );
    158     }
    159 
    160     /**
    161      * Load the plugin text domain.
    162      * This method is used to load the plugin text domain.
    163      *
    164      * @since 1.0.0
    165      * @return void
    166      */
    167     public function load_textdomain() {
    168         load_plugin_textdomain( 'essential-elements', false, dirname( plugin_basename( ESSE_FILE ) ) . '/languages' );
     168        update_option( 'esse_progress_bar_settings', $progress_bar_settings );
     169        update_option( 'esse_scroll_bar_settings', $scroll_bar_settings );
     170        update_option( 'esse_scroll_top_settings', $scroll_top_settings );
    169171    }
    170172
     
    187189            $notices,
    188190            array(
    189                 'notice'      => wp_kses_post( $notice ),
    190                 'type'        => sanitize_key( $type ),
     191                'notice'      => $notice,
     192                'type'        => $type,
    191193                'dismissible' => $dismissible_text,
    192194            )
     
    207209
    208210        foreach ( $notices as $notice ) {
    209             echo wp_kses_post(
    210                 sprintf(
    211                     '<div class="notice notice-%1$s %2$s"><p>%3$s</p></div>',
    212                     esc_attr( $notice['type'] ),
    213                     esc_attr( $notice['dismissible'] ),
    214                     esc_html( $notice['notice'] ),
    215                 )
     211            printf(
     212                '<div class="notice notice-%1$s %2$s"><p>%3$s</p></div>',
     213                esc_attr( $notice['type'] ),
     214                esc_attr( $notice['dismissible'] ),
     215                esc_html( $notice['notice'] ),
    216216            );
    217217        }
     
    225225    /**
    226226     * Initialize the plugin.
    227      * This method is used to initialize the plugin.
    228227     *
    229228     * @since 1.0.0
     
    231230     */
    232231    public function init() {
    233         // Load the admin classes if it's an admin area.
     232        // Load admin classes.
    234233        if ( is_admin() ) {
    235234            new Admin\Admin();
    236235        }
    237236
    238         $progress_bar_is_enabled = esse_get_settings( 'progress_bar_is_enabled', 'yes' );
    239         $scroll_top_is_enabled   = esse_get_settings( 'scroll_top_is_enabled', 'yes' );
    240 
    241         if ( 'yes' === $progress_bar_is_enabled || 'yes' === $scroll_top_is_enabled ) {
    242             add_action( 'wp_footer', array( $this, 'display_frontend_assets' ) );
    243             add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
    244         }
    245     }
    246 
    247     /**
    248      * Display the frontend assets.
    249      *
    250      * @since 1.0.0
    251      * @return void
    252      */
    253     public function display_frontend_assets() {
    254         $progress_bar_is_enabled = esse_get_settings( 'progress_bar_is_enabled', 'yes' );
    255         $scroll_top_is_enabled   = esse_get_settings( 'scroll_top_is_enabled', 'yes' );
    256 
    257         if ( 'yes' === $progress_bar_is_enabled ) {
    258             ?>
    259             <div class="esse-progress-bar">
    260                 <div class="esse-progress-bar__indicator"></div>
    261                 <div class="esse-progress-bar__content"><?php esc_html( '0%' ); ?></div>
    262             </div>
    263             <?php
    264         }
    265 
    266         if ( 'yes' === $scroll_top_is_enabled ) {
    267             ?>
    268             <div class="esse-scroll-top is-rounded" data-on-devices="both">
    269             <span class="esse-scroll-top__icon">
    270                 <svg class="esse-scroll-top__arrow-svg" fill="currentColor" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20px" height="16.043px" viewBox="57 35.171 26 16.043" xml:space="preserve">
    271                     <path d="M57.5,38.193l12.5,12.5l12.5-12.5l-2.5-2.5l-10,10l-10-10L57.5,38.193z"></path>
    272                 </svg>
    273             </span>
    274                 <span class="screen-reader-text">Scroll to Top</span>
    275             </div>
    276             <?php
    277         }
    278     }
    279 
    280     /**
    281      * Enqueue scripts and styles.
    282      *
    283      * @since 1.0.0
    284      * @return void
    285      */
    286     public function enqueue_scripts() {
    287         wp_enqueue_style( 'esse-frontend', ESSE_ASSETS_URL . 'css/esse-frontend.css', array(), ESSE_VERSION );
    288         wp_enqueue_script( 'esse-frontend', ESSE_ASSETS_URL . 'js/esse-frontend.js', array( 'jquery' ), ESSE_VERSION, true );
    289 
    290         // Render Inline styles.
    291         $progress_bar_position     = esse_get_settings( 'progress_bar_position', 'bottom' );
    292         $progress_bar_color        = esse_get_settings( 'progress_bar_color', '#FFFFFF' );
    293         $progress_bar_bg_color     = esse_get_settings( 'progress_bar_bg_color', '#000000' );
    294         $scroll_top_position       = esse_get_settings( 'scroll_top_position', 'right' );
    295         $scroll_top_icon_color     = esse_get_settings( 'scroll_top_icon_color', '#FFFFFF' );
    296         $scroll_top_bg_color       = esse_get_settings( 'scroll_top_bg_color', '#000000' );
    297         $scroll_top_hover_bg_color = esse_get_settings( 'scroll_top_hover_bg_color', '#333333' );
    298 
    299         $styles = '
    300     .esse-progress-bar {
    301         ' . esc_attr( $progress_bar_position ) . ': 0;
    302     }
    303     .esse-progress-bar__indicator {
    304         background-color: ' . esc_attr( $progress_bar_bg_color ) . ';
    305     }
    306     .esse-progress-bar__content {
    307         color: ' . esc_attr( $progress_bar_color ) . ';
    308         background-color: ' . esc_attr( $progress_bar_bg_color ) . '15;
    309     }
    310     .esse-scroll-top {
    311         background-color: ' . esc_attr( $scroll_top_bg_color ) . ';
    312         ' . esc_attr( $scroll_top_position ) . ': 20px;
    313     }
    314     .esse-scroll-top__arrow-svg {
    315         color: ' . esc_attr( $scroll_top_icon_color ) . ';
    316     }
    317     .esse-scroll-top:hover {
    318         background-color: ' . esc_attr( $scroll_top_hover_bg_color ) . ';
    319     }
    320 ';
    321 
    322         wp_add_inline_style( 'esse-frontend', wp_strip_all_tags( $styles ) );
     237        // Load common classes.
     238        new Modules\Modules();
    323239    }
    324240}
  • essential-elements/tags/1.0.1/includes/functions.php

    r3270973 r3458804  
    77 *
    88 * @param string $option Option name.
     9 * @param string $key    Option key.
    910 * @param mixed  $default_value Default value.
    1011 *
    11  * @since 1.0.0
    12  * @retun mixed|null
     12 * @since  1.0.0
     13 * @return mixed|null
    1314 */
    14 function esse_get_settings( $option, $default_value = null ) {
    15     $options = get_option( 'esse_settings', array() );
     15function esse_get_settings( $option, $key, $default_value = null ) {
     16    if ( empty( $option ) || empty( $key ) ) {
     17        return $default_value;
     18    }
    1619
    17     return isset( $options[ $option ] ) ? $options[ $option ] : $default_value;
     20    $options = get_option( $option, array() );
     21
     22    return isset( $options[ $key ] ) ? $options[ $key ] : $default_value;
    1823}
  • essential-elements/tags/1.0.1/languages/essential-elements.pot

    r3270973 r3458804  
    1 # Copyright (C) 2025 BeautifulPlugins
     1# Copyright (C) 2026 BeautifulPlugins
    22# This file is distributed under the GPL v2 or later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Essential Elements for WordPress 1.0.0\n"
    6 "Report-Msgid-Bugs-To: https://beautifulplugins.com/support/\n"
    7 "POT-Creation-Date: 2025-04-11 10:30:00+00:00\n"
     5"Project-Id-Version: Essential Elements for WordPress 1.0.1\n"
     6"Report-Msgid-Bugs-To: https://beautifulplugins.com/support\n"
     7"POT-Creation-Date: 2026-02-11 09:04:31+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=utf-8\n"
    1010"Content-Transfer-Encoding: 8bit\n"
    11 "PO-Revision-Date: 2025-MO-DA HO:MI+ZONE\n"
     11"PO-Revision-Date: 2026-MO-DA HO:MI+ZONE\n"
    1212"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    1313"Language-Team: LANGUAGE <[email protected]>\n"
     
    2525"X-Generator: grunt-wp-i18n 1.0.3\n"
    2626
    27 #: includes/Admin/Admin.php:33 includes/Admin/Admin.php:34
     27#: includes/Admin/Admin.php:40 includes/Admin/views/header.php:16
    2828msgid "Essential Elements"
    2929msgstr ""
    3030
    31 #: includes/Admin/Admin.php:50
     31#: includes/Admin/Admin.php:41
     32msgid "Essentials"
     33msgstr ""
     34
     35#: includes/Admin/Admin.php:52 includes/Admin/Admin.php:53
     36#: includes/Admin/views/header.php:21
     37msgid "Dashboard"
     38msgstr ""
     39
     40#: includes/Admin/Admin.php:80 includes/Admin/Admin.php:81
     41#: includes/Admin/views/header.php:22
     42msgid "Modules"
     43msgstr ""
     44
     45#: includes/Admin/Admin.php:107 includes/Admin/Admin.php:108
     46#: includes/Admin/views/header.php:23
     47msgid "Settings"
     48msgstr ""
     49
     50#: includes/Admin/Admin.php:137 includes/Modules/ProgressBar/Settings.php:93
     51#: includes/Modules/ScrollBar/Settings.php:93
     52#: includes/Modules/ScrollTop/Settings.php:93
     53msgid "General Settings"
     54msgstr ""
     55
     56#: includes/Admin/Admin.php:145
     57msgid "Delete plugin data"
     58msgstr ""
     59
     60#: includes/Admin/Admin.php:159 includes/Modules/ProgressBar/Settings.php:142
     61#: includes/Modules/ScrollBar/Settings.php:151
     62#: includes/Modules/ScrollTop/Settings.php:151
     63msgid "Configure the general settings."
     64msgstr ""
     65
     66#: includes/Admin/Admin.php:173
     67msgid "Delete plugin data on uninstall"
     68msgstr ""
     69
     70#: includes/Admin/Admin.php:175
     71msgid "Enabling this will delete all the data while uninstalling the plugin."
     72msgstr ""
     73
     74#: includes/Admin/Admin.php:262
     75msgid "Invalid nonce provided."
     76msgstr ""
     77
     78#: includes/Admin/Admin.php:267
    3279msgid "You do not have sufficient permissions to access this page."
    3380msgstr ""
    3481
    35 #: includes/Admin/Admin.php:55
     82#: includes/Admin/Admin.php:276
     83msgid "Module not found."
     84msgstr ""
     85
     86#: includes/Admin/Admin.php:281
     87msgid "Module status not found."
     88msgstr ""
     89
     90#: includes/Admin/Admin.php:298
     91msgid "Module status updated successfully."
     92msgstr ""
     93
     94#: includes/Admin/views/aside.php:15
     95msgid "Need Help?"
     96msgstr ""
     97
     98#: includes/Admin/views/aside.php:18
     99msgid ""
     100"Essential Elements for WordPress is a collection of tools and modules to "
     101"help you manage your WordPress website."
     102msgstr ""
     103
     104#: includes/Admin/views/aside.php:19
     105msgid ""
     106"If you have any questions or need help, please visit the support page. Or, "
     107"directly contact us. We are here to help you!"
     108msgstr ""
     109
     110#: includes/Admin/views/aside.php:21
     111msgid "Get Support"
     112msgstr ""
     113
     114#: includes/Admin/views/aside.php:22
     115msgid "Contact Us"
     116msgstr ""
     117
     118#: includes/Admin/views/dashboard.php:28
     119msgid ""
     120"Welcome to Essential Elements - The Ultimate Essential Elements for "
     121"WordPress"
     122msgstr ""
     123
     124#: includes/Admin/views/dashboard.php:29
     125msgid ""
     126"Essential Elements for WordPress is a powerful plugin that adds essential "
     127"elements to your WordPress website. It is a must-have plugin for every "
     128"WordPress website. With Essential Elements, you can easily add essential "
     129"elements to your website without any coding knowledge."
     130msgstr ""
     131
     132#: includes/Admin/views/dashboard.php:33
     133msgid "Overview of Modules"
     134msgstr ""
     135
     136#: includes/Admin/views/dashboard.php:34 includes/Admin/views/modules.php:29
     137msgid ""
     138"Here are the top 3 modules that you can enable to improve your website "
     139"functionality."
     140msgstr ""
     141
     142#: includes/Admin/views/dashboard.php:37 includes/Admin/views/modules.php:32
     143#: includes/Modules/ProgressBar/Settings.php:46
     144#: includes/Modules/ProgressBar/Settings.php:47
     145msgid "Progress Bar"
     146msgstr ""
     147
     148#: includes/Admin/views/dashboard.php:38 includes/Admin/views/modules.php:33
     149msgid "Display a progress bar on your website."
     150msgstr ""
     151
     152#: includes/Admin/views/dashboard.php:39 includes/Admin/views/dashboard.php:44
     153#: includes/Admin/views/dashboard.php:49
     154msgid "Enable Module"
     155msgstr ""
     156
     157#: includes/Admin/views/dashboard.php:42 includes/Admin/views/modules.php:42
     158#: includes/Modules/ScrollTop/Settings.php:46
     159#: includes/Modules/ScrollTop/Settings.php:47
     160msgid "Scroll Top"
     161msgstr ""
     162
     163#: includes/Admin/views/dashboard.php:43 includes/Admin/views/modules.php:43
     164msgid "Add a scroll top button on your website."
     165msgstr ""
     166
     167#: includes/Admin/views/dashboard.php:47 includes/Admin/views/modules.php:52
     168#: includes/Modules/ScrollBar/Settings.php:46
     169#: includes/Modules/ScrollBar/Settings.php:47
     170msgid "Scroll Bar"
     171msgstr ""
     172
     173#: includes/Admin/views/dashboard.php:48 includes/Admin/views/modules.php:53
     174msgid "Customize the scroll bar on your website."
     175msgstr ""
     176
     177#: includes/Admin/views/dashboard.php:55
     178msgid "Join Our Community"
     179msgstr ""
     180
     181#: includes/Admin/views/dashboard.php:56
     182msgid ""
     183"Got a question about the plugin, want to share your awesome project or just "
     184"say hi? Join our wonderful community to get the latest updates, news, and "
     185"tutorials."
     186msgstr ""
     187
     188#: includes/Admin/views/dashboard.php:60
     189msgid "Facebook"
     190msgstr ""
     191
     192#: includes/Admin/views/dashboard.php:64
     193msgid "YouTube"
     194msgstr ""
     195
     196#: includes/Admin/views/dashboard.php:70
     197msgid "Rate Us"
     198msgstr ""
     199
     200#: includes/Admin/views/dashboard.php:80
     201msgid "Based on 5k+ reviews"
     202msgstr ""
     203
     204#: includes/Admin/views/dashboard.php:83
     205msgid ""
     206"If you like Essential Elements, please leave us a 5-star review on "
     207"WordPress.org. Your review will help us grow and improve the plugin."
     208msgstr ""
     209
     210#: includes/Admin/views/dashboard.php:84
     211msgid "Submit a Review →"
     212msgstr ""
     213
     214#: includes/Admin/views/header.php:25
     215msgid "Support"
     216msgstr ""
     217
     218#: includes/Admin/views/modules.php:28
     219msgid "All Modules"
     220msgstr ""
     221
     222#: includes/Admin/views/settings.php:27
    36223msgid "Essential Elements Settings"
    37224msgstr ""
    38225
    39 #: includes/Admin/Admin.php:56
    40 msgid "Configure the settings for the Essential Elements plugin."
    41 msgstr ""
    42 
    43 #: includes/Admin/Admin.php:80
    44 msgid "General Settings"
    45 msgstr ""
    46 
    47 #: includes/Admin/Admin.php:88
     226#: includes/Admin/views/settings.php:28
     227msgid "Configure the settings of the Essential Elements plugin."
     228msgstr ""
     229
     230#: includes/Modules/ProgressBar/Settings.php:61
     231#: includes/Modules/ProgressBar/views/settings.php:26
     232msgid "Progress Bar Settings"
     233msgstr ""
     234
     235#: includes/Modules/ProgressBar/Settings.php:101
    48236msgid "Enable Progress Bar"
    49237msgstr ""
    50238
    51 #: includes/Admin/Admin.php:97 includes/Admin/Admin.php:133
     239#: includes/Modules/ProgressBar/Settings.php:110
     240#: includes/Modules/ScrollTop/Settings.php:110
    52241msgid "Display Position"
    53242msgstr ""
    54243
    55 #: includes/Admin/Admin.php:106
     244#: includes/Modules/ProgressBar/Settings.php:119
    56245msgid "Color"
    57246msgstr ""
    58247
    59 #: includes/Admin/Admin.php:115 includes/Admin/Admin.php:151
     248#: includes/Modules/ProgressBar/Settings.php:128
     249#: includes/Modules/ScrollTop/Settings.php:128
    60250msgid "Background Color"
    61251msgstr ""
    62252
    63 #: includes/Admin/Admin.php:124
    64 msgid "Enable Scroll Top"
    65 msgstr ""
    66 
    67 #: includes/Admin/Admin.php:142
    68 msgid "Icon Color"
    69 msgstr ""
    70 
    71 #: includes/Admin/Admin.php:160
    72 msgid "Hover Background Color"
    73 msgstr ""
    74 
    75 #: includes/Admin/Admin.php:174
    76 msgid "Configure the Essential Elements general settings."
    77 msgstr ""
    78 
    79 #: includes/Admin/Admin.php:188
     253#: includes/Modules/ProgressBar/Settings.php:156
    80254msgid "Enable to display the progress bar."
    81255msgstr ""
    82256
    83 #: includes/Admin/Admin.php:190
     257#: includes/Modules/ProgressBar/Settings.php:158
    84258msgid ""
    85259"It will display the progress bar on the bottom/top of the page. Default is "
     
    87261msgstr ""
    88262
    89 #: includes/Admin/Admin.php:204
     263#: includes/Modules/ProgressBar/Settings.php:172
    90264msgid "Top"
    91265msgstr ""
    92266
    93 #: includes/Admin/Admin.php:205
     267#: includes/Modules/ProgressBar/Settings.php:173
    94268msgid "Bottom"
    95269msgstr ""
    96270
    97 #: includes/Admin/Admin.php:208
     271#: includes/Modules/ProgressBar/Settings.php:175
    98272msgid "Chose the default position to display the progress bar. Default is bottom."
    99273msgstr ""
    100274
    101 #: includes/Admin/Admin.php:222
     275#: includes/Modules/ProgressBar/Settings.php:189
    102276msgid "Enter the color of the progress bar. Default is #FFFFFF."
    103277msgstr ""
    104278
    105 #: includes/Admin/Admin.php:236
     279#: includes/Modules/ProgressBar/Settings.php:203
    106280msgid "Enter the background color of the progress bar. Default is #000000."
    107281msgstr ""
    108282
    109 #: includes/Admin/Admin.php:251
     283#: includes/Modules/ProgressBar/views/settings.php:27
     284msgid "Configure the settings of the Progress Bar module."
     285msgstr ""
     286
     287#: includes/Modules/ScrollBar/Settings.php:61
     288#: includes/Modules/ScrollBar/views/settings.php:26
     289msgid "Scroll Bar Settings"
     290msgstr ""
     291
     292#: includes/Modules/ScrollBar/Settings.php:101
     293msgid "Enable Scroll Bar"
     294msgstr ""
     295
     296#: includes/Modules/ScrollBar/Settings.php:110
     297msgid "Track Color"
     298msgstr ""
     299
     300#: includes/Modules/ScrollBar/Settings.php:119
     301msgid "Thumb Color"
     302msgstr ""
     303
     304#: includes/Modules/ScrollBar/Settings.php:128
     305msgid "Thumb Hover Color"
     306msgstr ""
     307
     308#: includes/Modules/ScrollBar/Settings.php:137
     309msgid "Width"
     310msgstr ""
     311
     312#: includes/Modules/ScrollBar/Settings.php:165
     313msgid "Enable to display the scroll bar on the page."
     314msgstr ""
     315
     316#: includes/Modules/ScrollBar/Settings.php:167
     317msgid "It will modify the scroll bar on the page. Default is enabled."
     318msgstr ""
     319
     320#: includes/Modules/ScrollBar/Settings.php:181
     321msgid "Enter the scroll bar track color. Default is #f1f1f1."
     322msgstr ""
     323
     324#: includes/Modules/ScrollBar/Settings.php:195
     325msgid "Enter the scroll bar thumb color. Default is #0073aa."
     326msgstr ""
     327
     328#: includes/Modules/ScrollBar/Settings.php:209
     329msgid "Enter the scroll bar thumb hover color. Default is #00a0d2."
     330msgstr ""
     331
     332#: includes/Modules/ScrollBar/Settings.php:223
     333msgid ""
     334"Enter the scroll bar width in pixels. Default is 60px. Remember to enter "
     335"only the number without \"px\" and also this may not properly work on some "
     336"browsers."
     337msgstr ""
     338
     339#: includes/Modules/ScrollBar/views/settings.php:27
     340msgid "Configure the settings of the Scroll Bar module."
     341msgstr ""
     342
     343#: includes/Modules/ScrollTop/ScrollTop.php:65
     344msgid "Scroll to Top"
     345msgstr ""
     346
     347#: includes/Modules/ScrollTop/Settings.php:61
     348#: includes/Modules/ScrollTop/views/settings.php:26
     349msgid "Scroll Top Settings"
     350msgstr ""
     351
     352#: includes/Modules/ScrollTop/Settings.php:101
     353msgid "Enable Scroll Top"
     354msgstr ""
     355
     356#: includes/Modules/ScrollTop/Settings.php:119
     357msgid "Icon Color"
     358msgstr ""
     359
     360#: includes/Modules/ScrollTop/Settings.php:137
     361msgid "Hover Background Color"
     362msgstr ""
     363
     364#: includes/Modules/ScrollTop/Settings.php:165
    110365msgid "Enable to display the scroll top button."
    111366msgstr ""
    112367
    113 #: includes/Admin/Admin.php:253
     368#: includes/Modules/ScrollTop/Settings.php:167
    114369msgid ""
    115370"It will display the scroll top button on the bottom left/right of the page. "
     
    117372msgstr ""
    118373
    119 #: includes/Admin/Admin.php:267
     374#: includes/Modules/ScrollTop/Settings.php:181
    120375msgid "Bottom Left"
    121376msgstr ""
    122377
    123 #: includes/Admin/Admin.php:268
     378#: includes/Modules/ScrollTop/Settings.php:182
    124379msgid "Bottom Right"
    125380msgstr ""
    126381
    127 #: includes/Admin/Admin.php:271
     382#: includes/Modules/ScrollTop/Settings.php:184
    128383msgid ""
    129384"Chose the default position to display the scroll top button. Default is "
     
    131386msgstr ""
    132387
    133 #: includes/Admin/Admin.php:285
     388#: includes/Modules/ScrollTop/Settings.php:198
    134389msgid "Enter the icon color of the scroll top button. Default is #ffffff."
    135390msgstr ""
    136391
    137 #: includes/Admin/Admin.php:299
     392#: includes/Modules/ScrollTop/Settings.php:212
    138393msgid "Enter the background color of the scroll top button. Default is #000000."
    139394msgstr ""
    140395
    141 #: includes/Admin/Admin.php:313
     396#: includes/Modules/ScrollTop/Settings.php:226
    142397msgid ""
    143398"Enter the hover background color of the scroll top button. Default is "
     
    145400msgstr ""
    146401
     402#: includes/Modules/ScrollTop/views/settings.php:27
     403msgid "Configure the settings of the Scroll Top module."
     404msgstr ""
     405
    147406#. Plugin Name of the plugin/theme
    148407msgid "Essential Elements for WordPress"
  • essential-elements/tags/1.0.1/readme.txt

    r3270973 r3458804  
    22Contributors: beautifulplugins
    33Tags: essentials, essential addons, essential elements, essential features, essential
    4 Tested up to: 6.7
    5 Stable tag: 1.0.0
     4Requires at least: 5.0
     5Tested up to: 6.9
     6Requires PHP: 7.4
     7Stable tag: 1.0.1
    68License: GPLv2 or later
    79License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2022- **🚀 Scroll to Top Button** - Easily add a scroll-to-top button to your website for improved navigation.
    2123- **📊 Progress Bar** - Showcase your skills and achievements with customizable progress bars.
    22 - **⏱️ Reading Time Estimation** - Display estimated reading time for your posts to keep readers informed.
    23 - **🔗 Social Share Buttons** - Add social share buttons to your posts and pages to encourage sharing on social media.
    24 - **👁️ Post Views Counter** - Display the number of views for your posts to increase engagement.
    25 - **🌐 External Links in New Tab** - Open external links in a new tab to improve user experience.
    26 - **🧭 Breadcrumbs Navigation** - Add breadcrumbs navigation to your website for better navigation and SEO.
    27 - **🖼️ SVG Upload Support** - Enable SVG uploads to enhance your website's design with scalable vector graphics.
    28 - **📚 Table of Contents** - Automatically generate a table of contents for your posts and pages to improve readability.
     24- **🎨 Custom Scroll Bar** - Customize the browser scroll bar with custom colors and styles.
     25- **⏱️ Reading Time Estimation** - Display estimated reading time for your posts to keep readers informed. *(Coming Soon)*
     26- **🔗 Social Share Buttons** - Add social share buttons to your posts and pages to encourage sharing on social media. *(Coming Soon)*
     27- **👁️ Post Views Counter** - Display the number of views for your posts to increase engagement. *(Coming Soon)*
     28- **🌐 External Links in New Tab** - Open external links in a new tab to improve user experience. *(Coming Soon)*
     29- **🧭 Breadcrumbs Navigation** - Add breadcrumbs navigation to your website for better navigation and SEO. *(Coming Soon)*
     30- **🖼️ SVG Upload Support** - Enable SVG uploads to enhance your website's design with scalable vector graphics. *(Coming Soon)*
     31- **📚 Table of Contents** - Automatically generate a table of contents for your posts and pages to improve readability. *(Coming Soon)*
    2932...and more coming soon!
    3033
     
    107110
    108111== Screenshots ==
    109 1. Essential Elements Settings
     1121. Progress Bar Settings
     1132. Scroll to Top Settings
     1143. Custom Scroll Bar Settings
     1154. All Modules Settings
    110116
    111117== Changelog ==
     118= 1.0.1 (11 February 2026) =
     119* New: Added new features and improvements.
     120* Fix: Fixed some bugs and issues.
     121
    112122= 1.0.0 (11 April 2025) =
    113123* Initial release of the plugin.
     
    117127* Initial release of the plugin. No upgrade necessary.
    118128
     129= 1.0.1 =
     130* Major update with new features and improvements. Please review the changelog for details.
     131
    119132== License ==
    120133Essential Elements for WordPress is distributed under the terms of the GNU General Public License v2 (GPLv2). You may use, modify, and distribute this software under the terms of the GPLv2 license. See http://www.gnu.org/licenses/gpl-2.0.html for more details.
    121 
  • essential-elements/tags/1.0.1/vendor/autoload.php

    r3270973 r3458804  
    1515        }
    1616    }
    17     trigger_error(
    18         $err,
    19         E_USER_ERROR
    20     );
     17    throw new RuntimeException($err);
    2118}
    2219
    2320require_once __DIR__ . '/composer/autoload_real.php';
    2421
    25 return ComposerAutoloaderInit364f768ac85bad335293fa2c57da2e09::getLoader();
     22return ComposerAutoloaderInit6027a90d3d77c32aebae2be9e77e3c6f::getLoader();
  • essential-elements/tags/1.0.1/vendor/composer/InstalledVersions.php

    r3270973 r3458804  
    2828{
    2929    /**
     30     * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
     31     * @internal
     32     */
     33    private static $selfDir = null;
     34
     35    /**
    3036     * @var mixed[]|null
    3137     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
    3238     */
    3339    private static $installed;
     40
     41    /**
     42     * @var bool
     43     */
     44    private static $installedIsLocalDir;
    3445
    3546    /**
     
    310321        self::$installed = $data;
    311322        self::$installedByVendor = array();
     323
     324        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     325        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     326        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     327        // all installed packages for example
     328        self::$installedIsLocalDir = false;
     329    }
     330
     331    /**
     332     * @return string
     333     */
     334    private static function getSelfDir()
     335    {
     336        if (self::$selfDir === null) {
     337            self::$selfDir = strtr(__DIR__, '\\', '/');
     338        }
     339
     340        return self::$selfDir;
    312341    }
    313342
     
    323352
    324353        $installed = array();
     354        $copiedLocalDir = false;
    325355
    326356        if (self::$canGetVendors) {
     357            $selfDir = self::getSelfDir();
    327358            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     359                $vendorDir = strtr($vendorDir, '\\', '/');
    328360                if (isset(self::$installedByVendor[$vendorDir])) {
    329361                    $installed[] = self::$installedByVendor[$vendorDir];
     
    331363                    /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
    332364                    $required = require $vendorDir.'/composer/installed.php';
    333                     $installed[] = self::$installedByVendor[$vendorDir] = $required;
    334                     if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
    335                         self::$installed = $installed[count($installed) - 1];
     365                    self::$installedByVendor[$vendorDir] = $required;
     366                    $installed[] = $required;
     367                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
     368                        self::$installed = $required;
     369                        self::$installedIsLocalDir = true;
    336370                    }
     371                }
     372                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     373                    $copiedLocalDir = true;
    337374                }
    338375            }
     
    351388        }
    352389
    353         if (self::$installed !== array()) {
     390        if (self::$installed !== array() && !$copiedLocalDir) {
    354391            $installed[] = self::$installed;
    355392        }
  • essential-elements/tags/1.0.1/vendor/composer/autoload_classmap.php

    r3270973 r3458804  
    99    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
    1010    'EssentialElements\\Admin\\Admin' => $baseDir . '/includes/Admin/Admin.php',
     11    'EssentialElements\\Modules\\Modules' => $baseDir . '/includes/Modules/Modules.php',
     12    'EssentialElements\\Modules\\ProgressBar\\ProgressBar' => $baseDir . '/includes/Modules/ProgressBar/ProgressBar.php',
     13    'EssentialElements\\Modules\\ProgressBar\\Settings' => $baseDir . '/includes/Modules/ProgressBar/Settings.php',
     14    'EssentialElements\\Modules\\ScrollBar\\ScrollBar' => $baseDir . '/includes/Modules/ScrollBar/ScrollBar.php',
     15    'EssentialElements\\Modules\\ScrollBar\\Settings' => $baseDir . '/includes/Modules/ScrollBar/Settings.php',
     16    'EssentialElements\\Modules\\ScrollTop\\ScrollTop' => $baseDir . '/includes/Modules/ScrollTop/ScrollTop.php',
     17    'EssentialElements\\Modules\\ScrollTop\\Settings' => $baseDir . '/includes/Modules/ScrollTop/Settings.php',
    1118    'EssentialElements\\Plugin' => $baseDir . '/includes/Plugin.php',
    1219);
  • essential-elements/tags/1.0.1/vendor/composer/autoload_real.php

    r3270973 r3458804  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit364f768ac85bad335293fa2c57da2e09
     5class ComposerAutoloaderInit6027a90d3d77c32aebae2be9e77e3c6f
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit364f768ac85bad335293fa2c57da2e09', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit6027a90d3d77c32aebae2be9e77e3c6f', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit364f768ac85bad335293fa2c57da2e09', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit6027a90d3d77c32aebae2be9e77e3c6f', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInit364f768ac85bad335293fa2c57da2e09::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit6027a90d3d77c32aebae2be9e77e3c6f::getInitializer($loader));
    3333
    3434        $loader->register(true);
  • essential-elements/tags/1.0.1/vendor/composer/autoload_static.php

    r3270973 r3458804  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit364f768ac85bad335293fa2c57da2e09
     7class ComposerStaticInit6027a90d3d77c32aebae2be9e77e3c6f
    88{
    99    public static $prefixLengthsPsr4 = array (
    10         'E' => 
     10        'E' =>
    1111        array (
    1212            'EssentialElements\\' => 18,
     
    1515
    1616    public static $prefixDirsPsr4 = array (
    17         'EssentialElements\\' => 
     17        'EssentialElements\\' =>
    1818        array (
    1919            0 => __DIR__ . '/../..' . '/includes',
     
    2424        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
    2525        'EssentialElements\\Admin\\Admin' => __DIR__ . '/../..' . '/includes/Admin/Admin.php',
     26        'EssentialElements\\Modules\\Modules' => __DIR__ . '/../..' . '/includes/Modules/Modules.php',
     27        'EssentialElements\\Modules\\ProgressBar\\ProgressBar' => __DIR__ . '/../..' . '/includes/Modules/ProgressBar/ProgressBar.php',
     28        'EssentialElements\\Modules\\ProgressBar\\Settings' => __DIR__ . '/../..' . '/includes/Modules/ProgressBar/Settings.php',
     29        'EssentialElements\\Modules\\ScrollBar\\ScrollBar' => __DIR__ . '/../..' . '/includes/Modules/ScrollBar/ScrollBar.php',
     30        'EssentialElements\\Modules\\ScrollBar\\Settings' => __DIR__ . '/../..' . '/includes/Modules/ScrollBar/Settings.php',
     31        'EssentialElements\\Modules\\ScrollTop\\ScrollTop' => __DIR__ . '/../..' . '/includes/Modules/ScrollTop/ScrollTop.php',
     32        'EssentialElements\\Modules\\ScrollTop\\Settings' => __DIR__ . '/../..' . '/includes/Modules/ScrollTop/Settings.php',
    2633        'EssentialElements\\Plugin' => __DIR__ . '/../..' . '/includes/Plugin.php',
    2734    );
     
    3037    {
    3138        return \Closure::bind(function () use ($loader) {
    32             $loader->prefixLengthsPsr4 = ComposerStaticInit364f768ac85bad335293fa2c57da2e09::$prefixLengthsPsr4;
    33             $loader->prefixDirsPsr4 = ComposerStaticInit364f768ac85bad335293fa2c57da2e09::$prefixDirsPsr4;
    34             $loader->classMap = ComposerStaticInit364f768ac85bad335293fa2c57da2e09::$classMap;
     39            $loader->prefixLengthsPsr4 = ComposerStaticInit6027a90d3d77c32aebae2be9e77e3c6f::$prefixLengthsPsr4;
     40            $loader->prefixDirsPsr4 = ComposerStaticInit6027a90d3d77c32aebae2be9e77e3c6f::$prefixDirsPsr4;
     41            $loader->classMap = ComposerStaticInit6027a90d3d77c32aebae2be9e77e3c6f::$classMap;
    3542
    3643        }, null, ClassLoader::class);
  • essential-elements/tags/1.0.1/vendor/composer/installed.php

    r3270973 r3458804  
    11<?php return array(
    22    'root' => array(
    3         'name' => 'beautifulplugins/essential-elements',
    4         'pretty_version' => 'dev-master',
    5         'version' => 'dev-master',
    6         'reference' => 'cbc577d8e63f04da4b46b47bea22d26ff5370f01',
     3        'name' => 'urldev/essential-elements',
     4        'pretty_version' => 'v1.0.1',
     5        'version' => '1.0.1.0',
     6        'reference' => '9bb3ab37b1d8a10c29ad7f6ea34a8f1d8bb9c6ba',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1111    ),
    1212    'versions' => array(
    13         'beautifulplugins/essential-elements' => array(
    14             'pretty_version' => 'dev-master',
    15             'version' => 'dev-master',
    16             'reference' => 'cbc577d8e63f04da4b46b47bea22d26ff5370f01',
     13        'urldev/essential-elements' => array(
     14            'pretty_version' => 'v1.0.1',
     15            'version' => '1.0.1.0',
     16            'reference' => '9bb3ab37b1d8a10c29ad7f6ea34a8f1d8bb9c6ba',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
  • essential-elements/tags/1.0.1/vendor/composer/platform_check.php

    r3270973 r3458804  
    2020        }
    2121    }
    22     trigger_error(
    23         'Composer detected issues in your platform: ' . implode(' ', $issues),
    24         E_USER_ERROR
     22    throw new \RuntimeException(
     23        'Composer detected issues in your platform: ' . implode(' ', $issues)
    2524    );
    2625}
  • essential-elements/trunk/essential-elements.php

    r3270973 r3458804  
    44 * Plugin URI:        https://beautifulplugins.com/essential-elements/
    55 * Description:       Essential Elements for WordPress is a powerful plugin that provides essential elements to increase site functionality.
    6  * Version: 1.0.0
     6 * Version:           1.0.1
    77 * Requires at least: 5.0
    88 * Requires PHP:      7.4
     9 * Tested up to:      6.9
    910 * Author:            BeautifulPlugins
    1011 * Author URI:        https://beautifulplugins.com
     
    3132defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
    3233
    33 /**
    34  * Optimized autoload classes.
    35  *
    36  * @since 1.0.0
    37  */
     34// autoload optimized classes.
    3835require_once __DIR__ . '/vendor/autoload.php';
    3936
     
    4239 *
    4340 * @since 1.0.0
    44  * @return Plugin
     41 * @return Plugin The plugin instance.
    4542 */
    46 function esse_essential_elements() {
    47     return Plugin::create( __FILE__, '1.0.0' );
     43function essential_elements() {
     44    return Plugin::create( __FILE__, '1.0.1' );
    4845}
    4946
    5047// Initialize the plugin.
    51 esse_essential_elements();
     48essential_elements();
  • essential-elements/trunk/includes/Admin/Admin.php

    r3270973 r3458804  
    66
    77/**
    8  * The main admin class.
     8 * Class Admin.
    99 *
    1010 * @since 1.0.0
    11  * @package EssentialElements/Admin
     11 * @package EssentialElements\Admin
    1212 */
    1313class Admin {
     
    1616     */
    1717    public function __construct() {
    18         // Create admin settings page under WordPress settings menu.
    19         add_action( 'admin_menu', array( $this, 'add_settings_page' ) );
    20 
    21         // Register settings.
     18        add_action( 'admin_menu', array( $this, 'admin_menu' ) );
     19        add_action( 'admin_menu', array( $this, 'modules_menu' ), 99 );
     20        add_action( 'admin_menu', array( $this, 'settings_menu' ), 100 );
    2221        add_action( 'admin_init', array( $this, 'register_settings' ) );
    23     }
    24 
    25     /**
    26      * Add settings page under WordPress settings menu.
    27      *
    28      * @since 1.0.0
    29      * @return void
    30      */
    31     public function add_settings_page() {
    32         add_options_page(
     22        add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
     23
     24        // Load page headers.
     25        add_action( 'esse_admin_page_before_main_content', array( $this, 'render_header' ) );
     26        add_action( 'esse_admin_page_after_content', array( $this, 'render_aside' ) );
     27
     28        // Enabling the modules.
     29        add_action( 'wp_ajax_esse_enable_module', array( $this, 'enable_module' ) );
     30    }
     31
     32    /**
     33     * Add menu page.
     34     *
     35     * @since 1.0.0
     36     * @return void
     37     */
     38    public function admin_menu() {
     39        add_menu_page(
    3340            __( 'Essential Elements', 'essential-elements' ),
    34             __( 'Essential Elements', 'essential-elements' ),
     41            __( 'Essentials', 'essential-elements' ),
    3542            'manage_options',
    3643            'essential-elements',
    37             array( $this, 'settings_page' )
     44            null,
     45            'dashicons-screenoptions',
     46            '25',
     47        );
     48
     49        // Add submenu page "Dashboard".
     50        add_submenu_page(
     51            'essential-elements',
     52            __( 'Dashboard', 'essential-elements' ),
     53            __( 'Dashboard', 'essential-elements' ),
     54            'manage_options',
     55            'essential-elements',
     56            array( $this, 'render_dashboard' ),
     57            1,
     58        );
     59    }
     60
     61    /**
     62     * Render dashboard page.
     63     *
     64     * @since 1.0.0
     65     * @return void
     66     */
     67    public function render_dashboard() {
     68        require __DIR__ . '/views/dashboard.php';
     69    }
     70
     71    /**
     72     * Add modules submenu page.
     73     *
     74     * @since 1.0.0
     75     * @return void
     76     */
     77    public function modules_menu() {
     78        add_submenu_page(
     79            'essential-elements',
     80            __( 'Modules', 'essential-elements' ),
     81            __( 'Modules', 'essential-elements' ),
     82            'manage_options',
     83            'esse-modules',
     84            array( $this, 'render_modules' ),
     85        );
     86    }
     87
     88    /**
     89     * Render modules page.
     90     *
     91     * @since 1.0.0
     92     * @return void
     93     */
     94    public function render_modules() {
     95        include __DIR__ . '/views/modules.php';
     96    }
     97
     98    /**
     99     * Add settings submenu page.
     100     *
     101     * @since 1.0.0
     102     * @return void
     103     */
     104    public function settings_menu() {
     105        add_submenu_page(
     106            'essential-elements',
     107            __( 'Settings', 'essential-elements' ),
     108            __( 'Settings', 'essential-elements' ),
     109            'manage_options',
     110            'esse-settings',
     111            array( $this, 'render_settings' ),
    38112        );
    39113    }
     
    45119     * @return void
    46120     */
    47     public function settings_page() {
    48         // Check user capabilities.
    49         if ( ! current_user_can( 'manage_options' ) ) {
    50             esse_essential_elements()->flash_notice( __( 'You do not have sufficient permissions to access this page.', 'essential-elements' ), 'error' );
    51             return;
    52         }
    53         ?>
    54         <div class="wrap">
    55             <h1><?php esc_html_e( 'Essential Elements Settings', 'essential-elements' ); ?></h1>
    56             <p><?php esc_html_e( 'Configure the settings for the Essential Elements plugin.', 'essential-elements' ); ?></p>
    57             <form method="post" action="<?php echo esc_url( admin_url( 'options.php' ) ); ?>">
    58                 <?php
    59                 settings_fields( 'essential_elements' );
    60                 do_settings_sections( 'essential-elements' );
    61                 submit_button();
    62                 ?>
    63             </form>
    64         </div>
    65         <?php
     121    public function render_settings() {
     122        include __DIR__ . '/views/settings.php';
    66123    }
    67124
     
    80137            __( 'General Settings', 'essential-elements' ),
    81138            array( $this, 'general_settings' ),
    82             'essential-elements'
     139            'esse-settings'
    83140        );
    84141
    85142        // Add settings field to enable the progress bar.
    86143        add_settings_field(
    87             'esse_progress_bar_is_enabled',
    88             __( 'Enable Progress Bar', 'essential-elements' ),
    89             array( $this, 'progress_bar_is_enabled' ),
    90             'essential-elements',
     144            'esse_delete_data',
     145            __( 'Delete plugin data', 'essential-elements' ),
     146            array( $this, 'delete_data' ),
     147            'esse-settings',
    91148            'esse_general_settings'
    92149        );
    93 
    94         // Progress bar position field.
    95         add_settings_field(
    96             'esse_progress_bar_position',
    97             __( 'Display Position', 'essential-elements' ),
    98             array( $this, 'progress_bar_position' ),
    99             'essential-elements',
    100             'esse_general_settings'
    101         );
    102 
    103         // Progress bar color field.
    104         add_settings_field(
    105             'esse_progress_bar_color',
    106             __( 'Color', 'essential-elements' ),
    107             array( $this, 'progress_progress_bar_color' ),
    108             'essential-elements',
    109             'esse_general_settings'
    110         );
    111 
    112         // Progress bar background color field.
    113         add_settings_field(
    114             'esse_progress_bar_bg_color',
    115             __( 'Background Color', 'essential-elements' ),
    116             array( $this, 'progress_progress_bar_bg_color' ),
    117             'essential-elements',
    118             'esse_general_settings'
    119         );
    120 
    121         // Scroll top is enabled field.
    122         add_settings_field(
    123             'esse_scroll_top_is_enabled',
    124             __( 'Enable Scroll Top', 'essential-elements' ),
    125             array( $this, 'scroll_top_is_enabled' ),
    126             'essential-elements',
    127             'esse_general_settings'
    128         );
    129 
    130         // Scroll top position field.
    131         add_settings_field(
    132             'esse_scroll_top_position',
    133             __( 'Display Position', 'essential-elements' ),
    134             array( $this, 'scroll_top_position' ),
    135             'essential-elements',
    136             'esse_general_settings'
    137         );
    138 
    139         // Scroll top button icon color field.
    140         add_settings_field(
    141             'esse_scroll_top_icon_color',
    142             __( 'Icon Color', 'essential-elements' ),
    143             array( $this, 'scroll_top_icon_color' ),
    144             'essential-elements',
    145             'esse_general_settings'
    146         );
    147 
    148         // Scroll top button background color field.
    149         add_settings_field(
    150             'esse_scroll_top_bg_color',
    151             __( 'Background Color', 'essential-elements' ),
    152             array( $this, 'scroll_top_bg_color' ),
    153             'essential-elements',
    154             'esse_general_settings'
    155         );
    156 
    157         // Scroll top button hover background color field.
    158         add_settings_field(
    159             'esse_scroll_top_hover_bg_color',
    160             __( 'Hover Background Color', 'essential-elements' ),
    161             array( $this, 'scroll_top_hover_bg_color' ),
    162             'essential-elements',
    163             'esse_general_settings'
    164         );
    165150    }
    166151
     
    172157     */
    173158    public function general_settings() {
    174         echo '<p>' . esc_html__( 'Configure the Essential Elements general settings.', 'essential-elements' ) . '</p>';
     159        echo '<p>' . esc_html__( 'Configure the general settings.', 'essential-elements' ) . '</p>';
    175160    }
    176161
     
    181166     * @return void
    182167     */
    183     public function progress_bar_is_enabled() {
    184         $progress_bar_is_enabled = esse_get_settings( 'progress_bar_is_enabled', 'yes' );
     168    public function delete_data() {
     169        $delete_data = esse_get_settings( 'esse_settings', 'delete_data', 'no' );
    185170        ?>
    186         <label for="esse_settings[progress_bar_is_enabled]">
    187             <input type="checkbox" name="esse_settings[progress_bar_is_enabled]" id="esse_settings[progress_bar_is_enabled]" value="yes" <?php checked( $progress_bar_is_enabled, 'yes' ); ?> />
    188             <?php esc_html_e( 'Enable to display the progress bar.', 'essential-elements' ); ?>
     171        <label for="esse_settings[delete_data]">
     172            <input type="checkbox" name="esse_settings[delete_data]" id="esse_settings[delete_data]" value="yes" <?php checked( $delete_data, 'yes' ); ?> />
     173            <?php esc_html_e( 'Delete plugin data on uninstall', 'essential-elements' ); ?>
    189174        </label>
    190         <p><?php esc_html_e( 'It will display the progress bar on the bottom/top of the page. Default is enabled.', 'essential-elements' ); ?></p>
    191         <?php
    192     }
    193 
    194     /**
    195      * Display progress bar position field.
    196      *
    197      * @since 1.0.0
    198      * @return void
    199      */
    200     public function progress_bar_position() {
    201         $progress_bar_position = esse_get_settings( 'progress_bar_position', 'bottom' );
    202         ?>
    203         <select name="esse_settings[progress_bar_position]" id="esse_settings[progress_bar_position]" class="regular-text">
    204             <option value="top" <?php selected( $progress_bar_position, 'top' ); ?>><?php esc_html_e( 'Top', 'essential-elements' ); ?></option>
    205             <option value="bottom" <?php selected( $progress_bar_position, 'bottom' ); ?>><?php esc_html_e( 'Bottom', 'essential-elements' ); ?></option>
    206             ?>
    207         </select>
    208         <p class="description"><?php esc_html_e( 'Chose the default position to display the progress bar. Default is bottom.', 'essential-elements' ); ?></p>
    209         <?php
    210     }
    211 
    212     /**
    213      * Display progress bar color field.
    214      *
    215      * @since 1.0.0
    216      * @return void
    217      */
    218     public function progress_progress_bar_color() {
    219         $progress_bar_color = esse_get_settings( 'progress_bar_color', '#FFFFFF' );
    220         ?>
    221         <input type="text" name="esse_settings[progress_bar_color]" id="esse_settings[progress_bar_color]" value="<?php echo esc_attr( $progress_bar_color ); ?>" class="regular-text" />
    222         <p class="description"><?php esc_html_e( 'Enter the color of the progress bar. Default is #FFFFFF.', 'essential-elements' ); ?></p>
    223         <?php
    224     }
    225 
    226     /**
    227      * Display progress bar background color field.
    228      *
    229      * @since 1.0.0
    230      * @return void
    231      */
    232     public function progress_progress_bar_bg_color() {
    233         $progress_bar_bg_color = esse_get_settings( 'progress_bar_bg_color', '#000000' );
    234         ?>
    235         <input type="text" name="esse_settings[progress_bar_bg_color]" id="esse_settings[progress_bar_bg_color]" value="<?php echo esc_attr( $progress_bar_bg_color ); ?>" class="regular-text" />
    236         <p class="description"><?php esc_html_e( 'Enter the background color of the progress bar. Default is #000000.', 'essential-elements' ); ?></p>
    237         <?php
    238     }
    239 
    240     /**
    241      * Display the scroll top is enabled field.
    242      *
    243      * @since 1.0.0
    244      * @return void
    245      */
    246     public function scroll_top_is_enabled() {
    247         $scroll_top_is_enabled = esse_get_settings( 'scroll_top_is_enabled', 'yes' );
    248         ?>
    249         <label for="esse_settings[scroll_top_is_enabled]">
    250             <input type="checkbox" name="esse_settings[scroll_top_is_enabled]" id="esse_settings[scroll_top_is_enabled]" value="yes" <?php checked( $scroll_top_is_enabled, 'yes' ); ?> />
    251             <?php esc_html_e( 'Enable to display the scroll top button.', 'essential-elements' ); ?>
    252         </label>
    253         <p><?php esc_html_e( 'It will display the scroll top button on the bottom left/right of the page. Default is enabled.', 'essential-elements' ); ?></p>
    254         <?php
    255     }
    256 
    257     /**
    258      * Display scroll top position field.
    259      *
    260      * @since 1.0.0
    261      * @return void
    262      */
    263     public function scroll_top_position() {
    264         $scroll_top_position = esse_get_settings( 'scroll_top_position', 'right' );
    265         ?>
    266         <select name="esse_settings[scroll_top_position]" id="esse_settings[scroll_top_position]" class="regular-text">
    267             <option value="left" <?php selected( $scroll_top_position, 'left' ); ?>><?php esc_html_e( 'Bottom Left', 'essential-elements' ); ?></option>
    268             <option value="right" <?php selected( $scroll_top_position, 'right' ); ?>><?php esc_html_e( 'Bottom Right', 'essential-elements' ); ?></option>
    269             ?>
    270         </select>
    271         <p class="description"><?php esc_html_e( 'Chose the default position to display the scroll top button. Default is bottom right.', 'essential-elements' ); ?></p>
    272         <?php
    273     }
    274 
    275     /**
    276      * Display scroll top button icon color field.
    277      *
    278      * @since 1.0.0
    279      * @return void
    280      */
    281     public function scroll_top_icon_color() {
    282         $scroll_top_icon_color = esse_get_settings( 'scroll_top_icon_color', '#ffffff' );
    283         ?>
    284         <input type="text" name="esse_settings[scroll_top_icon_color]" id="esse_settings[scroll_top_icon_color]" value="<?php echo esc_attr( $scroll_top_icon_color ); ?>" class="regular-text" />
    285         <p class="description"><?php esc_html_e( 'Enter the icon color of the scroll top button. Default is #ffffff.', 'essential-elements' ); ?></p>
    286         <?php
    287     }
    288 
    289     /**
    290      * Display scroll top button background color field.
    291      *
    292      * @since 1.0.0
    293      * @return void
    294      */
    295     public function scroll_top_bg_color() {
    296         $scroll_top_bg_color = esse_get_settings( 'scroll_top_bg_color', '#000000' );
    297         ?>
    298         <input type="text" name="esse_settings[scroll_top_bg_color]" id="esse_settings[scroll_top_bg_color]" value="<?php echo esc_attr( $scroll_top_bg_color ); ?>" class="regular-text" />
    299         <p class="description"><?php esc_html_e( 'Enter the background color of the scroll top button. Default is #000000.', 'essential-elements' ); ?></p>
    300         <?php
    301     }
    302 
    303     /**
    304      * Display scroll top button hover background color field.
    305      *
    306      * @since 1.0.0
    307      * @return void
    308      */
    309     public function scroll_top_hover_bg_color() {
    310         $scroll_top_hover_bg_color = esse_get_settings( 'scroll_top_hover_bg_color', '#333333' );
    311         ?>
    312         <input type="text" name="esse_settings[scroll_top_hover_bg_color]" id="esse_settings[scroll_top_hover_bg_color]" value="<?php echo esc_attr( $scroll_top_hover_bg_color ); ?>" class="regular-text" />
    313         <p class="description"><?php esc_html_e( 'Enter the hover background color of the scroll top button. Default is #333333.', 'essential-elements' ); ?></p>
     175        <p><?php esc_html_e( 'Enabling this will delete all the data while uninstalling the plugin.', 'essential-elements' ); ?></p>
    314176        <?php
    315177    }
     
    327189
    328190        // Sanitize the progress bar is enabled.
    329         $sanitized_settings['progress_bar_is_enabled'] = isset( $settings['progress_bar_is_enabled'] ) ? 'yes' : 'no';
    330 
    331         // Sanitize the progress bar position.
    332         $sanitized_settings['progress_bar_position'] = isset( $settings['progress_bar_position'] ) ? sanitize_text_field( $settings['progress_bar_position'] ) : 'bottom';
    333 
    334         // Sanitize the progress bar color.
    335         $sanitized_settings['progress_bar_color'] = isset( $settings['progress_bar_color'] ) ? sanitize_text_field( $settings['progress_bar_color'] ) : '#FFFFFF';
    336 
    337         // Sanitize the progress bar background color.
    338         $sanitized_settings['progress_bar_bg_color'] = isset( $settings['progress_bar_bg_color'] ) ? sanitize_text_field( $settings['progress_bar_bg_color'] ) : '#000000';
    339 
    340         // Sanitize the scroll top is enabled.
    341         $sanitized_settings['scroll_top_is_enabled'] = isset( $settings['scroll_top_is_enabled'] ) ? 'yes' : 'no';
    342 
    343         // Sanitize the scroll top position.
    344         $sanitized_settings['scroll_top_position'] = isset( $settings['scroll_top_position'] ) ? sanitize_text_field( $settings['scroll_top_position'] ) : 'right';
    345 
    346         // Sanitize the scroll top icon color.
    347         $sanitized_settings['scroll_top_icon_color'] = isset( $settings['scroll_top_icon_color'] ) ? sanitize_text_field( $settings['scroll_top_icon_color'] ) : '#FFFFFF';
    348 
    349         // Sanitize the scroll top background color.
    350         $sanitized_settings['scroll_top_bg_color'] = isset( $settings['scroll_top_bg_color'] ) ? sanitize_text_field( $settings['scroll_top_bg_color'] ) : '#000000';
    351 
    352         // Sanitize the scroll top hover background color.
    353         $sanitized_settings['scroll_top_hover_bg_color'] = isset( $settings['scroll_top_hover_bg_color'] ) ? sanitize_text_field( $settings['scroll_top_hover_bg_color'] ) : '#333333';
     191        $sanitized_settings['delete_data'] = isset( $settings['delete_data'] ) ? 'yes' : 'no';
    354192
    355193        return $sanitized_settings;
    356194    }
     195
     196    /**
     197     * Get screen IDs.
     198     *
     199     * @since 1.0.0
     200     */
     201    public static function get_screen_ids() {
     202        // Add a filter to allow custom screen IDs.
     203        return apply_filters(
     204            'esse_screen_ids',
     205            array(
     206                'toplevel_page_essential-elements',
     207                'essentials_page_esse-modules',
     208                'essentials_page_esse-settings',
     209            )
     210        );
     211    }
     212
     213    /**
     214     * Enqueue scripts.
     215     *
     216     * @param string $hook The current admin page.
     217     *
     218     * @since 1.0.0
     219     * @return void
     220     */
     221    public function enqueue_scripts( $hook ) {
     222        $screens = self::get_screen_ids();
     223
     224        if ( ! in_array( $hook, $screens, true ) ) {
     225            return;
     226        }
     227
     228        wp_enqueue_style( 'esse-admin', ESSE_ASSETS_URL . 'css/admin.css', array(), ESSE_VERSION );
     229    }
     230
     231    /**
     232     * Render header.
     233     *
     234     * @since 1.0.0
     235     * @return void
     236     */
     237    public function render_header() {
     238        wp_verify_nonce( '_nonce' );
     239        $page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
     240        include __DIR__ . '/views/header.php';
     241    }
     242
     243    /**
     244     * Render aside.
     245     *
     246     * @since 1.0.0
     247     * @return void
     248     */
     249    public function render_aside() {
     250        include __DIR__ . '/views/aside.php';
     251    }
     252
     253    /**
     254     * Enable module.
     255     *
     256     * @since 1.0.0
     257     * @return void
     258     */
     259    public function enable_module() {
     260        // Verify nonce to prevent CSRF.
     261        if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['_wpnonce'] ) ), 'esse_enable_module' ) ) {
     262            wp_send_json_error( array( 'message' => __( 'Invalid nonce provided.', 'essential-elements' ) ) );
     263        }
     264
     265        // Check user capabilities to prevent unauthorized access.
     266        if ( ! current_user_can( 'manage_options' ) ) {
     267            wp_send_json_error( array( 'message' => __( 'You do not have sufficient permissions to access this page.', 'essential-elements' ) ) );
     268        }
     269
     270        // Get the module data and save it to the database.
     271        $module = isset( $_POST['module'] ) ? sanitize_text_field( wp_unslash( $_POST['module'] ) ) : '';
     272        $status = isset( $_POST['status'] ) ? sanitize_text_field( wp_unslash( $_POST['status'] ) ) : '';
     273
     274        // If module is empty, send error response.
     275        if ( empty( $module ) ) {
     276            wp_send_json_error( array( 'message' => __( 'Module not found.', 'essential-elements' ) ) );
     277        }
     278
     279        // If status is empty, send error response.
     280        if ( empty( $status ) ) {
     281            wp_send_json_error( array( 'message' => __( 'Module status not found.', 'essential-elements' ) ) );
     282        }
     283
     284        $modules = get_option( 'esse_modules', array() );
     285
     286        // If status is true and module is not in the array, add it.
     287        if ( $status && ! in_array( $module, $modules, true ) ) {
     288            $modules[] = $module;
     289        } else {
     290            // If status is false and module is in the array, remove it.
     291            $modules = array_diff( $modules, array( $module ) );
     292        }
     293
     294        // Update the modules option.
     295        update_option( 'esse_modules', $modules );
     296
     297        // Send success response.
     298        wp_send_json_success( array( 'message' => __( 'Module status updated successfully.', 'essential-elements' ) ) );
     299        exit();
     300    }
    357301}
  • essential-elements/trunk/includes/Plugin.php

    r3270973 r3458804  
    66
    77/**
    8  * The main plugin class.
     8 * Class Plugin.
    99 *
    1010 * @since 1.0.0
     
    4545     *
    4646     * @since 1.0.0
    47      * @return static
     47     * @return static The plugin instance.
    4848     */
    4949    final public static function create( $file, $version = '1.0.0' ) {
     
    6363     * @since 1.0.0
    6464     */
    65     protected function __construct( $file, $version ) {
     65    public function __construct( $file, $version ) {
    6666        $this->file    = $file;
    6767        $this->version = $version;
     
    7777     * @return void
    7878     */
    79     protected function define_constants() {
     79    private function define_constants() {
    8080        // Define the plugin version.
    8181        if ( ! defined( 'ESSE_VERSION' ) ) {
     
    125125     * @return void
    126126     */
    127     protected function init_hooks() {
     127    public function init_hooks() {
    128128        register_activation_hook( ESSE_FILE, array( $this, 'activate' ) );
    129         add_action( 'init', array( $this, 'load_textdomain' ) );
    130129        add_action( 'admin_notices', array( $this, 'display_flash_notices' ), 12 );
    131130        add_action( 'init', array( $this, 'init' ), 0 );
     
    134133    /**
    135134     * Activate the plugin.
    136      * This method is called when the plugin is activated.
    137135     *
    138136     * @since 1.0.0
     
    141139    public function activate() {
    142140        update_option( 'esse_version', ESSE_VERSION );
    143 
    144         // Default settings.
    145         $default_settings = array(
    146             'progress_bar_is_enabled'   => 'yes',
    147             'progress_bar_position'     => 'bottom',
    148             'progress_bar_color'        => '#FFFFFF',
    149             'progress_bar_bg_color'     => '#000000',
    150             'scroll_top_is_enabled'     => 'yes',
    151             'scroll_top_position'       => 'right',
    152             'scroll_top_icon_color'     => '#FFFFFF',
    153             'scroll_top_bg_color'       => '#000000',
    154             'scroll_top_hover_bg_color' => '#333333',
    155         );
     141        add_option( 'esse_installed', current_time( 'mysql' ) );
     142
     143        // Default settings for modules.
     144        $progress_bar_settings = array(
     145            'is_enabled' => 'yes',
     146            'position'   => 'bottom',
     147            'color'      => '#FFFFFF',
     148            'bg_color'   => '#000000',
     149        );
     150
     151        $scroll_bar_settings = array(
     152            'is_enabled'        => 'yes',
     153            'track_color'       => '#f1f1f1',
     154            'thumb_color'       => '#0073aa',
     155            'thumb_hover_color' => '#00a0d2',
     156            'width'             => 60,
     157        );
     158
     159        $scroll_top_settings = array(
     160            'is_enabled'     => 'yes',
     161            'position'       => 'right',
     162            'icon_color'     => '#FFFFFF',
     163            'bg_color'       => '#000000',
     164            'hover_bg_color' => '#333333',
     165        );
     166
    156167        // Update the default settings.
    157         update_option( 'esse_settings', $default_settings );
    158     }
    159 
    160     /**
    161      * Load the plugin text domain.
    162      * This method is used to load the plugin text domain.
    163      *
    164      * @since 1.0.0
    165      * @return void
    166      */
    167     public function load_textdomain() {
    168         load_plugin_textdomain( 'essential-elements', false, dirname( plugin_basename( ESSE_FILE ) ) . '/languages' );
     168        update_option( 'esse_progress_bar_settings', $progress_bar_settings );
     169        update_option( 'esse_scroll_bar_settings', $scroll_bar_settings );
     170        update_option( 'esse_scroll_top_settings', $scroll_top_settings );
    169171    }
    170172
     
    187189            $notices,
    188190            array(
    189                 'notice'      => wp_kses_post( $notice ),
    190                 'type'        => sanitize_key( $type ),
     191                'notice'      => $notice,
     192                'type'        => $type,
    191193                'dismissible' => $dismissible_text,
    192194            )
     
    207209
    208210        foreach ( $notices as $notice ) {
    209             echo wp_kses_post(
    210                 sprintf(
    211                     '<div class="notice notice-%1$s %2$s"><p>%3$s</p></div>',
    212                     esc_attr( $notice['type'] ),
    213                     esc_attr( $notice['dismissible'] ),
    214                     esc_html( $notice['notice'] ),
    215                 )
     211            printf(
     212                '<div class="notice notice-%1$s %2$s"><p>%3$s</p></div>',
     213                esc_attr( $notice['type'] ),
     214                esc_attr( $notice['dismissible'] ),
     215                esc_html( $notice['notice'] ),
    216216            );
    217217        }
     
    225225    /**
    226226     * Initialize the plugin.
    227      * This method is used to initialize the plugin.
    228227     *
    229228     * @since 1.0.0
     
    231230     */
    232231    public function init() {
    233         // Load the admin classes if it's an admin area.
     232        // Load admin classes.
    234233        if ( is_admin() ) {
    235234            new Admin\Admin();
    236235        }
    237236
    238         $progress_bar_is_enabled = esse_get_settings( 'progress_bar_is_enabled', 'yes' );
    239         $scroll_top_is_enabled   = esse_get_settings( 'scroll_top_is_enabled', 'yes' );
    240 
    241         if ( 'yes' === $progress_bar_is_enabled || 'yes' === $scroll_top_is_enabled ) {
    242             add_action( 'wp_footer', array( $this, 'display_frontend_assets' ) );
    243             add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
    244         }
    245     }
    246 
    247     /**
    248      * Display the frontend assets.
    249      *
    250      * @since 1.0.0
    251      * @return void
    252      */
    253     public function display_frontend_assets() {
    254         $progress_bar_is_enabled = esse_get_settings( 'progress_bar_is_enabled', 'yes' );
    255         $scroll_top_is_enabled   = esse_get_settings( 'scroll_top_is_enabled', 'yes' );
    256 
    257         if ( 'yes' === $progress_bar_is_enabled ) {
    258             ?>
    259             <div class="esse-progress-bar">
    260                 <div class="esse-progress-bar__indicator"></div>
    261                 <div class="esse-progress-bar__content"><?php esc_html( '0%' ); ?></div>
    262             </div>
    263             <?php
    264         }
    265 
    266         if ( 'yes' === $scroll_top_is_enabled ) {
    267             ?>
    268             <div class="esse-scroll-top is-rounded" data-on-devices="both">
    269             <span class="esse-scroll-top__icon">
    270                 <svg class="esse-scroll-top__arrow-svg" fill="currentColor" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20px" height="16.043px" viewBox="57 35.171 26 16.043" xml:space="preserve">
    271                     <path d="M57.5,38.193l12.5,12.5l12.5-12.5l-2.5-2.5l-10,10l-10-10L57.5,38.193z"></path>
    272                 </svg>
    273             </span>
    274                 <span class="screen-reader-text">Scroll to Top</span>
    275             </div>
    276             <?php
    277         }
    278     }
    279 
    280     /**
    281      * Enqueue scripts and styles.
    282      *
    283      * @since 1.0.0
    284      * @return void
    285      */
    286     public function enqueue_scripts() {
    287         wp_enqueue_style( 'esse-frontend', ESSE_ASSETS_URL . 'css/esse-frontend.css', array(), ESSE_VERSION );
    288         wp_enqueue_script( 'esse-frontend', ESSE_ASSETS_URL . 'js/esse-frontend.js', array( 'jquery' ), ESSE_VERSION, true );
    289 
    290         // Render Inline styles.
    291         $progress_bar_position     = esse_get_settings( 'progress_bar_position', 'bottom' );
    292         $progress_bar_color        = esse_get_settings( 'progress_bar_color', '#FFFFFF' );
    293         $progress_bar_bg_color     = esse_get_settings( 'progress_bar_bg_color', '#000000' );
    294         $scroll_top_position       = esse_get_settings( 'scroll_top_position', 'right' );
    295         $scroll_top_icon_color     = esse_get_settings( 'scroll_top_icon_color', '#FFFFFF' );
    296         $scroll_top_bg_color       = esse_get_settings( 'scroll_top_bg_color', '#000000' );
    297         $scroll_top_hover_bg_color = esse_get_settings( 'scroll_top_hover_bg_color', '#333333' );
    298 
    299         $styles = '
    300     .esse-progress-bar {
    301         ' . esc_attr( $progress_bar_position ) . ': 0;
    302     }
    303     .esse-progress-bar__indicator {
    304         background-color: ' . esc_attr( $progress_bar_bg_color ) . ';
    305     }
    306     .esse-progress-bar__content {
    307         color: ' . esc_attr( $progress_bar_color ) . ';
    308         background-color: ' . esc_attr( $progress_bar_bg_color ) . '15;
    309     }
    310     .esse-scroll-top {
    311         background-color: ' . esc_attr( $scroll_top_bg_color ) . ';
    312         ' . esc_attr( $scroll_top_position ) . ': 20px;
    313     }
    314     .esse-scroll-top__arrow-svg {
    315         color: ' . esc_attr( $scroll_top_icon_color ) . ';
    316     }
    317     .esse-scroll-top:hover {
    318         background-color: ' . esc_attr( $scroll_top_hover_bg_color ) . ';
    319     }
    320 ';
    321 
    322         wp_add_inline_style( 'esse-frontend', wp_strip_all_tags( $styles ) );
     237        // Load common classes.
     238        new Modules\Modules();
    323239    }
    324240}
  • essential-elements/trunk/includes/functions.php

    r3270973 r3458804  
    77 *
    88 * @param string $option Option name.
     9 * @param string $key    Option key.
    910 * @param mixed  $default_value Default value.
    1011 *
    11  * @since 1.0.0
    12  * @retun mixed|null
     12 * @since  1.0.0
     13 * @return mixed|null
    1314 */
    14 function esse_get_settings( $option, $default_value = null ) {
    15     $options = get_option( 'esse_settings', array() );
     15function esse_get_settings( $option, $key, $default_value = null ) {
     16    if ( empty( $option ) || empty( $key ) ) {
     17        return $default_value;
     18    }
    1619
    17     return isset( $options[ $option ] ) ? $options[ $option ] : $default_value;
     20    $options = get_option( $option, array() );
     21
     22    return isset( $options[ $key ] ) ? $options[ $key ] : $default_value;
    1823}
  • essential-elements/trunk/languages/essential-elements.pot

    r3270973 r3458804  
    1 # Copyright (C) 2025 BeautifulPlugins
     1# Copyright (C) 2026 BeautifulPlugins
    22# This file is distributed under the GPL v2 or later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Essential Elements for WordPress 1.0.0\n"
    6 "Report-Msgid-Bugs-To: https://beautifulplugins.com/support/\n"
    7 "POT-Creation-Date: 2025-04-11 10:30:00+00:00\n"
     5"Project-Id-Version: Essential Elements for WordPress 1.0.1\n"
     6"Report-Msgid-Bugs-To: https://beautifulplugins.com/support\n"
     7"POT-Creation-Date: 2026-02-11 09:04:31+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=utf-8\n"
    1010"Content-Transfer-Encoding: 8bit\n"
    11 "PO-Revision-Date: 2025-MO-DA HO:MI+ZONE\n"
     11"PO-Revision-Date: 2026-MO-DA HO:MI+ZONE\n"
    1212"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    1313"Language-Team: LANGUAGE <[email protected]>\n"
     
    2525"X-Generator: grunt-wp-i18n 1.0.3\n"
    2626
    27 #: includes/Admin/Admin.php:33 includes/Admin/Admin.php:34
     27#: includes/Admin/Admin.php:40 includes/Admin/views/header.php:16
    2828msgid "Essential Elements"
    2929msgstr ""
    3030
    31 #: includes/Admin/Admin.php:50
     31#: includes/Admin/Admin.php:41
     32msgid "Essentials"
     33msgstr ""
     34
     35#: includes/Admin/Admin.php:52 includes/Admin/Admin.php:53
     36#: includes/Admin/views/header.php:21
     37msgid "Dashboard"
     38msgstr ""
     39
     40#: includes/Admin/Admin.php:80 includes/Admin/Admin.php:81
     41#: includes/Admin/views/header.php:22
     42msgid "Modules"
     43msgstr ""
     44
     45#: includes/Admin/Admin.php:107 includes/Admin/Admin.php:108
     46#: includes/Admin/views/header.php:23
     47msgid "Settings"
     48msgstr ""
     49
     50#: includes/Admin/Admin.php:137 includes/Modules/ProgressBar/Settings.php:93
     51#: includes/Modules/ScrollBar/Settings.php:93
     52#: includes/Modules/ScrollTop/Settings.php:93
     53msgid "General Settings"
     54msgstr ""
     55
     56#: includes/Admin/Admin.php:145
     57msgid "Delete plugin data"
     58msgstr ""
     59
     60#: includes/Admin/Admin.php:159 includes/Modules/ProgressBar/Settings.php:142
     61#: includes/Modules/ScrollBar/Settings.php:151
     62#: includes/Modules/ScrollTop/Settings.php:151
     63msgid "Configure the general settings."
     64msgstr ""
     65
     66#: includes/Admin/Admin.php:173
     67msgid "Delete plugin data on uninstall"
     68msgstr ""
     69
     70#: includes/Admin/Admin.php:175
     71msgid "Enabling this will delete all the data while uninstalling the plugin."
     72msgstr ""
     73
     74#: includes/Admin/Admin.php:262
     75msgid "Invalid nonce provided."
     76msgstr ""
     77
     78#: includes/Admin/Admin.php:267
    3279msgid "You do not have sufficient permissions to access this page."
    3380msgstr ""
    3481
    35 #: includes/Admin/Admin.php:55
     82#: includes/Admin/Admin.php:276
     83msgid "Module not found."
     84msgstr ""
     85
     86#: includes/Admin/Admin.php:281
     87msgid "Module status not found."
     88msgstr ""
     89
     90#: includes/Admin/Admin.php:298
     91msgid "Module status updated successfully."
     92msgstr ""
     93
     94#: includes/Admin/views/aside.php:15
     95msgid "Need Help?"
     96msgstr ""
     97
     98#: includes/Admin/views/aside.php:18
     99msgid ""
     100"Essential Elements for WordPress is a collection of tools and modules to "
     101"help you manage your WordPress website."
     102msgstr ""
     103
     104#: includes/Admin/views/aside.php:19
     105msgid ""
     106"If you have any questions or need help, please visit the support page. Or, "
     107"directly contact us. We are here to help you!"
     108msgstr ""
     109
     110#: includes/Admin/views/aside.php:21
     111msgid "Get Support"
     112msgstr ""
     113
     114#: includes/Admin/views/aside.php:22
     115msgid "Contact Us"
     116msgstr ""
     117
     118#: includes/Admin/views/dashboard.php:28
     119msgid ""
     120"Welcome to Essential Elements - The Ultimate Essential Elements for "
     121"WordPress"
     122msgstr ""
     123
     124#: includes/Admin/views/dashboard.php:29
     125msgid ""
     126"Essential Elements for WordPress is a powerful plugin that adds essential "
     127"elements to your WordPress website. It is a must-have plugin for every "
     128"WordPress website. With Essential Elements, you can easily add essential "
     129"elements to your website without any coding knowledge."
     130msgstr ""
     131
     132#: includes/Admin/views/dashboard.php:33
     133msgid "Overview of Modules"
     134msgstr ""
     135
     136#: includes/Admin/views/dashboard.php:34 includes/Admin/views/modules.php:29
     137msgid ""
     138"Here are the top 3 modules that you can enable to improve your website "
     139"functionality."
     140msgstr ""
     141
     142#: includes/Admin/views/dashboard.php:37 includes/Admin/views/modules.php:32
     143#: includes/Modules/ProgressBar/Settings.php:46
     144#: includes/Modules/ProgressBar/Settings.php:47
     145msgid "Progress Bar"
     146msgstr ""
     147
     148#: includes/Admin/views/dashboard.php:38 includes/Admin/views/modules.php:33
     149msgid "Display a progress bar on your website."
     150msgstr ""
     151
     152#: includes/Admin/views/dashboard.php:39 includes/Admin/views/dashboard.php:44
     153#: includes/Admin/views/dashboard.php:49
     154msgid "Enable Module"
     155msgstr ""
     156
     157#: includes/Admin/views/dashboard.php:42 includes/Admin/views/modules.php:42
     158#: includes/Modules/ScrollTop/Settings.php:46
     159#: includes/Modules/ScrollTop/Settings.php:47
     160msgid "Scroll Top"
     161msgstr ""
     162
     163#: includes/Admin/views/dashboard.php:43 includes/Admin/views/modules.php:43
     164msgid "Add a scroll top button on your website."
     165msgstr ""
     166
     167#: includes/Admin/views/dashboard.php:47 includes/Admin/views/modules.php:52
     168#: includes/Modules/ScrollBar/Settings.php:46
     169#: includes/Modules/ScrollBar/Settings.php:47
     170msgid "Scroll Bar"
     171msgstr ""
     172
     173#: includes/Admin/views/dashboard.php:48 includes/Admin/views/modules.php:53
     174msgid "Customize the scroll bar on your website."
     175msgstr ""
     176
     177#: includes/Admin/views/dashboard.php:55
     178msgid "Join Our Community"
     179msgstr ""
     180
     181#: includes/Admin/views/dashboard.php:56
     182msgid ""
     183"Got a question about the plugin, want to share your awesome project or just "
     184"say hi? Join our wonderful community to get the latest updates, news, and "
     185"tutorials."
     186msgstr ""
     187
     188#: includes/Admin/views/dashboard.php:60
     189msgid "Facebook"
     190msgstr ""
     191
     192#: includes/Admin/views/dashboard.php:64
     193msgid "YouTube"
     194msgstr ""
     195
     196#: includes/Admin/views/dashboard.php:70
     197msgid "Rate Us"
     198msgstr ""
     199
     200#: includes/Admin/views/dashboard.php:80
     201msgid "Based on 5k+ reviews"
     202msgstr ""
     203
     204#: includes/Admin/views/dashboard.php:83
     205msgid ""
     206"If you like Essential Elements, please leave us a 5-star review on "
     207"WordPress.org. Your review will help us grow and improve the plugin."
     208msgstr ""
     209
     210#: includes/Admin/views/dashboard.php:84
     211msgid "Submit a Review →"
     212msgstr ""
     213
     214#: includes/Admin/views/header.php:25
     215msgid "Support"
     216msgstr ""
     217
     218#: includes/Admin/views/modules.php:28
     219msgid "All Modules"
     220msgstr ""
     221
     222#: includes/Admin/views/settings.php:27
    36223msgid "Essential Elements Settings"
    37224msgstr ""
    38225
    39 #: includes/Admin/Admin.php:56
    40 msgid "Configure the settings for the Essential Elements plugin."
    41 msgstr ""
    42 
    43 #: includes/Admin/Admin.php:80
    44 msgid "General Settings"
    45 msgstr ""
    46 
    47 #: includes/Admin/Admin.php:88
     226#: includes/Admin/views/settings.php:28
     227msgid "Configure the settings of the Essential Elements plugin."
     228msgstr ""
     229
     230#: includes/Modules/ProgressBar/Settings.php:61
     231#: includes/Modules/ProgressBar/views/settings.php:26
     232msgid "Progress Bar Settings"
     233msgstr ""
     234
     235#: includes/Modules/ProgressBar/Settings.php:101
    48236msgid "Enable Progress Bar"
    49237msgstr ""
    50238
    51 #: includes/Admin/Admin.php:97 includes/Admin/Admin.php:133
     239#: includes/Modules/ProgressBar/Settings.php:110
     240#: includes/Modules/ScrollTop/Settings.php:110
    52241msgid "Display Position"
    53242msgstr ""
    54243
    55 #: includes/Admin/Admin.php:106
     244#: includes/Modules/ProgressBar/Settings.php:119
    56245msgid "Color"
    57246msgstr ""
    58247
    59 #: includes/Admin/Admin.php:115 includes/Admin/Admin.php:151
     248#: includes/Modules/ProgressBar/Settings.php:128
     249#: includes/Modules/ScrollTop/Settings.php:128
    60250msgid "Background Color"
    61251msgstr ""
    62252
    63 #: includes/Admin/Admin.php:124
    64 msgid "Enable Scroll Top"
    65 msgstr ""
    66 
    67 #: includes/Admin/Admin.php:142
    68 msgid "Icon Color"
    69 msgstr ""
    70 
    71 #: includes/Admin/Admin.php:160
    72 msgid "Hover Background Color"
    73 msgstr ""
    74 
    75 #: includes/Admin/Admin.php:174
    76 msgid "Configure the Essential Elements general settings."
    77 msgstr ""
    78 
    79 #: includes/Admin/Admin.php:188
     253#: includes/Modules/ProgressBar/Settings.php:156
    80254msgid "Enable to display the progress bar."
    81255msgstr ""
    82256
    83 #: includes/Admin/Admin.php:190
     257#: includes/Modules/ProgressBar/Settings.php:158
    84258msgid ""
    85259"It will display the progress bar on the bottom/top of the page. Default is "
     
    87261msgstr ""
    88262
    89 #: includes/Admin/Admin.php:204
     263#: includes/Modules/ProgressBar/Settings.php:172
    90264msgid "Top"
    91265msgstr ""
    92266
    93 #: includes/Admin/Admin.php:205
     267#: includes/Modules/ProgressBar/Settings.php:173
    94268msgid "Bottom"
    95269msgstr ""
    96270
    97 #: includes/Admin/Admin.php:208
     271#: includes/Modules/ProgressBar/Settings.php:175
    98272msgid "Chose the default position to display the progress bar. Default is bottom."
    99273msgstr ""
    100274
    101 #: includes/Admin/Admin.php:222
     275#: includes/Modules/ProgressBar/Settings.php:189
    102276msgid "Enter the color of the progress bar. Default is #FFFFFF."
    103277msgstr ""
    104278
    105 #: includes/Admin/Admin.php:236
     279#: includes/Modules/ProgressBar/Settings.php:203
    106280msgid "Enter the background color of the progress bar. Default is #000000."
    107281msgstr ""
    108282
    109 #: includes/Admin/Admin.php:251
     283#: includes/Modules/ProgressBar/views/settings.php:27
     284msgid "Configure the settings of the Progress Bar module."
     285msgstr ""
     286
     287#: includes/Modules/ScrollBar/Settings.php:61
     288#: includes/Modules/ScrollBar/views/settings.php:26
     289msgid "Scroll Bar Settings"
     290msgstr ""
     291
     292#: includes/Modules/ScrollBar/Settings.php:101
     293msgid "Enable Scroll Bar"
     294msgstr ""
     295
     296#: includes/Modules/ScrollBar/Settings.php:110
     297msgid "Track Color"
     298msgstr ""
     299
     300#: includes/Modules/ScrollBar/Settings.php:119
     301msgid "Thumb Color"
     302msgstr ""
     303
     304#: includes/Modules/ScrollBar/Settings.php:128
     305msgid "Thumb Hover Color"
     306msgstr ""
     307
     308#: includes/Modules/ScrollBar/Settings.php:137
     309msgid "Width"
     310msgstr ""
     311
     312#: includes/Modules/ScrollBar/Settings.php:165
     313msgid "Enable to display the scroll bar on the page."
     314msgstr ""
     315
     316#: includes/Modules/ScrollBar/Settings.php:167
     317msgid "It will modify the scroll bar on the page. Default is enabled."
     318msgstr ""
     319
     320#: includes/Modules/ScrollBar/Settings.php:181
     321msgid "Enter the scroll bar track color. Default is #f1f1f1."
     322msgstr ""
     323
     324#: includes/Modules/ScrollBar/Settings.php:195
     325msgid "Enter the scroll bar thumb color. Default is #0073aa."
     326msgstr ""
     327
     328#: includes/Modules/ScrollBar/Settings.php:209
     329msgid "Enter the scroll bar thumb hover color. Default is #00a0d2."
     330msgstr ""
     331
     332#: includes/Modules/ScrollBar/Settings.php:223
     333msgid ""
     334"Enter the scroll bar width in pixels. Default is 60px. Remember to enter "
     335"only the number without \"px\" and also this may not properly work on some "
     336"browsers."
     337msgstr ""
     338
     339#: includes/Modules/ScrollBar/views/settings.php:27
     340msgid "Configure the settings of the Scroll Bar module."
     341msgstr ""
     342
     343#: includes/Modules/ScrollTop/ScrollTop.php:65
     344msgid "Scroll to Top"
     345msgstr ""
     346
     347#: includes/Modules/ScrollTop/Settings.php:61
     348#: includes/Modules/ScrollTop/views/settings.php:26
     349msgid "Scroll Top Settings"
     350msgstr ""
     351
     352#: includes/Modules/ScrollTop/Settings.php:101
     353msgid "Enable Scroll Top"
     354msgstr ""
     355
     356#: includes/Modules/ScrollTop/Settings.php:119
     357msgid "Icon Color"
     358msgstr ""
     359
     360#: includes/Modules/ScrollTop/Settings.php:137
     361msgid "Hover Background Color"
     362msgstr ""
     363
     364#: includes/Modules/ScrollTop/Settings.php:165
    110365msgid "Enable to display the scroll top button."
    111366msgstr ""
    112367
    113 #: includes/Admin/Admin.php:253
     368#: includes/Modules/ScrollTop/Settings.php:167
    114369msgid ""
    115370"It will display the scroll top button on the bottom left/right of the page. "
     
    117372msgstr ""
    118373
    119 #: includes/Admin/Admin.php:267
     374#: includes/Modules/ScrollTop/Settings.php:181
    120375msgid "Bottom Left"
    121376msgstr ""
    122377
    123 #: includes/Admin/Admin.php:268
     378#: includes/Modules/ScrollTop/Settings.php:182
    124379msgid "Bottom Right"
    125380msgstr ""
    126381
    127 #: includes/Admin/Admin.php:271
     382#: includes/Modules/ScrollTop/Settings.php:184
    128383msgid ""
    129384"Chose the default position to display the scroll top button. Default is "
     
    131386msgstr ""
    132387
    133 #: includes/Admin/Admin.php:285
     388#: includes/Modules/ScrollTop/Settings.php:198
    134389msgid "Enter the icon color of the scroll top button. Default is #ffffff."
    135390msgstr ""
    136391
    137 #: includes/Admin/Admin.php:299
     392#: includes/Modules/ScrollTop/Settings.php:212
    138393msgid "Enter the background color of the scroll top button. Default is #000000."
    139394msgstr ""
    140395
    141 #: includes/Admin/Admin.php:313
     396#: includes/Modules/ScrollTop/Settings.php:226
    142397msgid ""
    143398"Enter the hover background color of the scroll top button. Default is "
     
    145400msgstr ""
    146401
     402#: includes/Modules/ScrollTop/views/settings.php:27
     403msgid "Configure the settings of the Scroll Top module."
     404msgstr ""
     405
    147406#. Plugin Name of the plugin/theme
    148407msgid "Essential Elements for WordPress"
  • essential-elements/trunk/readme.txt

    r3270973 r3458804  
    22Contributors: beautifulplugins
    33Tags: essentials, essential addons, essential elements, essential features, essential
    4 Tested up to: 6.7
    5 Stable tag: 1.0.0
     4Requires at least: 5.0
     5Tested up to: 6.9
     6Requires PHP: 7.4
     7Stable tag: 1.0.1
    68License: GPLv2 or later
    79License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2022- **🚀 Scroll to Top Button** - Easily add a scroll-to-top button to your website for improved navigation.
    2123- **📊 Progress Bar** - Showcase your skills and achievements with customizable progress bars.
    22 - **⏱️ Reading Time Estimation** - Display estimated reading time for your posts to keep readers informed.
    23 - **🔗 Social Share Buttons** - Add social share buttons to your posts and pages to encourage sharing on social media.
    24 - **👁️ Post Views Counter** - Display the number of views for your posts to increase engagement.
    25 - **🌐 External Links in New Tab** - Open external links in a new tab to improve user experience.
    26 - **🧭 Breadcrumbs Navigation** - Add breadcrumbs navigation to your website for better navigation and SEO.
    27 - **🖼️ SVG Upload Support** - Enable SVG uploads to enhance your website's design with scalable vector graphics.
    28 - **📚 Table of Contents** - Automatically generate a table of contents for your posts and pages to improve readability.
     24- **🎨 Custom Scroll Bar** - Customize the browser scroll bar with custom colors and styles.
     25- **⏱️ Reading Time Estimation** - Display estimated reading time for your posts to keep readers informed. *(Coming Soon)*
     26- **🔗 Social Share Buttons** - Add social share buttons to your posts and pages to encourage sharing on social media. *(Coming Soon)*
     27- **👁️ Post Views Counter** - Display the number of views for your posts to increase engagement. *(Coming Soon)*
     28- **🌐 External Links in New Tab** - Open external links in a new tab to improve user experience. *(Coming Soon)*
     29- **🧭 Breadcrumbs Navigation** - Add breadcrumbs navigation to your website for better navigation and SEO. *(Coming Soon)*
     30- **🖼️ SVG Upload Support** - Enable SVG uploads to enhance your website's design with scalable vector graphics. *(Coming Soon)*
     31- **📚 Table of Contents** - Automatically generate a table of contents for your posts and pages to improve readability. *(Coming Soon)*
    2932...and more coming soon!
    3033
     
    107110
    108111== Screenshots ==
    109 1. Essential Elements Settings
     1121. Progress Bar Settings
     1132. Scroll to Top Settings
     1143. Custom Scroll Bar Settings
     1154. All Modules Settings
    110116
    111117== Changelog ==
     118= 1.0.1 (11 February 2026) =
     119* New: Added new features and improvements.
     120* Fix: Fixed some bugs and issues.
     121
    112122= 1.0.0 (11 April 2025) =
    113123* Initial release of the plugin.
     
    117127* Initial release of the plugin. No upgrade necessary.
    118128
     129= 1.0.1 =
     130* Major update with new features and improvements. Please review the changelog for details.
     131
    119132== License ==
    120133Essential Elements for WordPress is distributed under the terms of the GNU General Public License v2 (GPLv2). You may use, modify, and distribute this software under the terms of the GPLv2 license. See http://www.gnu.org/licenses/gpl-2.0.html for more details.
    121 
  • essential-elements/trunk/vendor/autoload.php

    r3270973 r3458804  
    1515        }
    1616    }
    17     trigger_error(
    18         $err,
    19         E_USER_ERROR
    20     );
     17    throw new RuntimeException($err);
    2118}
    2219
    2320require_once __DIR__ . '/composer/autoload_real.php';
    2421
    25 return ComposerAutoloaderInit364f768ac85bad335293fa2c57da2e09::getLoader();
     22return ComposerAutoloaderInit6027a90d3d77c32aebae2be9e77e3c6f::getLoader();
  • essential-elements/trunk/vendor/composer/InstalledVersions.php

    r3270973 r3458804  
    2828{
    2929    /**
     30     * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
     31     * @internal
     32     */
     33    private static $selfDir = null;
     34
     35    /**
    3036     * @var mixed[]|null
    3137     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
    3238     */
    3339    private static $installed;
     40
     41    /**
     42     * @var bool
     43     */
     44    private static $installedIsLocalDir;
    3445
    3546    /**
     
    310321        self::$installed = $data;
    311322        self::$installedByVendor = array();
     323
     324        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     325        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     326        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     327        // all installed packages for example
     328        self::$installedIsLocalDir = false;
     329    }
     330
     331    /**
     332     * @return string
     333     */
     334    private static function getSelfDir()
     335    {
     336        if (self::$selfDir === null) {
     337            self::$selfDir = strtr(__DIR__, '\\', '/');
     338        }
     339
     340        return self::$selfDir;
    312341    }
    313342
     
    323352
    324353        $installed = array();
     354        $copiedLocalDir = false;
    325355
    326356        if (self::$canGetVendors) {
     357            $selfDir = self::getSelfDir();
    327358            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     359                $vendorDir = strtr($vendorDir, '\\', '/');
    328360                if (isset(self::$installedByVendor[$vendorDir])) {
    329361                    $installed[] = self::$installedByVendor[$vendorDir];
     
    331363                    /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
    332364                    $required = require $vendorDir.'/composer/installed.php';
    333                     $installed[] = self::$installedByVendor[$vendorDir] = $required;
    334                     if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
    335                         self::$installed = $installed[count($installed) - 1];
     365                    self::$installedByVendor[$vendorDir] = $required;
     366                    $installed[] = $required;
     367                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
     368                        self::$installed = $required;
     369                        self::$installedIsLocalDir = true;
    336370                    }
     371                }
     372                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     373                    $copiedLocalDir = true;
    337374                }
    338375            }
     
    351388        }
    352389
    353         if (self::$installed !== array()) {
     390        if (self::$installed !== array() && !$copiedLocalDir) {
    354391            $installed[] = self::$installed;
    355392        }
  • essential-elements/trunk/vendor/composer/autoload_classmap.php

    r3270973 r3458804  
    99    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
    1010    'EssentialElements\\Admin\\Admin' => $baseDir . '/includes/Admin/Admin.php',
     11    'EssentialElements\\Modules\\Modules' => $baseDir . '/includes/Modules/Modules.php',
     12    'EssentialElements\\Modules\\ProgressBar\\ProgressBar' => $baseDir . '/includes/Modules/ProgressBar/ProgressBar.php',
     13    'EssentialElements\\Modules\\ProgressBar\\Settings' => $baseDir . '/includes/Modules/ProgressBar/Settings.php',
     14    'EssentialElements\\Modules\\ScrollBar\\ScrollBar' => $baseDir . '/includes/Modules/ScrollBar/ScrollBar.php',
     15    'EssentialElements\\Modules\\ScrollBar\\Settings' => $baseDir . '/includes/Modules/ScrollBar/Settings.php',
     16    'EssentialElements\\Modules\\ScrollTop\\ScrollTop' => $baseDir . '/includes/Modules/ScrollTop/ScrollTop.php',
     17    'EssentialElements\\Modules\\ScrollTop\\Settings' => $baseDir . '/includes/Modules/ScrollTop/Settings.php',
    1118    'EssentialElements\\Plugin' => $baseDir . '/includes/Plugin.php',
    1219);
  • essential-elements/trunk/vendor/composer/autoload_real.php

    r3270973 r3458804  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit364f768ac85bad335293fa2c57da2e09
     5class ComposerAutoloaderInit6027a90d3d77c32aebae2be9e77e3c6f
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit364f768ac85bad335293fa2c57da2e09', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit6027a90d3d77c32aebae2be9e77e3c6f', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit364f768ac85bad335293fa2c57da2e09', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit6027a90d3d77c32aebae2be9e77e3c6f', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInit364f768ac85bad335293fa2c57da2e09::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit6027a90d3d77c32aebae2be9e77e3c6f::getInitializer($loader));
    3333
    3434        $loader->register(true);
  • essential-elements/trunk/vendor/composer/autoload_static.php

    r3270973 r3458804  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit364f768ac85bad335293fa2c57da2e09
     7class ComposerStaticInit6027a90d3d77c32aebae2be9e77e3c6f
    88{
    99    public static $prefixLengthsPsr4 = array (
    10         'E' => 
     10        'E' =>
    1111        array (
    1212            'EssentialElements\\' => 18,
     
    1515
    1616    public static $prefixDirsPsr4 = array (
    17         'EssentialElements\\' => 
     17        'EssentialElements\\' =>
    1818        array (
    1919            0 => __DIR__ . '/../..' . '/includes',
     
    2424        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
    2525        'EssentialElements\\Admin\\Admin' => __DIR__ . '/../..' . '/includes/Admin/Admin.php',
     26        'EssentialElements\\Modules\\Modules' => __DIR__ . '/../..' . '/includes/Modules/Modules.php',
     27        'EssentialElements\\Modules\\ProgressBar\\ProgressBar' => __DIR__ . '/../..' . '/includes/Modules/ProgressBar/ProgressBar.php',
     28        'EssentialElements\\Modules\\ProgressBar\\Settings' => __DIR__ . '/../..' . '/includes/Modules/ProgressBar/Settings.php',
     29        'EssentialElements\\Modules\\ScrollBar\\ScrollBar' => __DIR__ . '/../..' . '/includes/Modules/ScrollBar/ScrollBar.php',
     30        'EssentialElements\\Modules\\ScrollBar\\Settings' => __DIR__ . '/../..' . '/includes/Modules/ScrollBar/Settings.php',
     31        'EssentialElements\\Modules\\ScrollTop\\ScrollTop' => __DIR__ . '/../..' . '/includes/Modules/ScrollTop/ScrollTop.php',
     32        'EssentialElements\\Modules\\ScrollTop\\Settings' => __DIR__ . '/../..' . '/includes/Modules/ScrollTop/Settings.php',
    2633        'EssentialElements\\Plugin' => __DIR__ . '/../..' . '/includes/Plugin.php',
    2734    );
     
    3037    {
    3138        return \Closure::bind(function () use ($loader) {
    32             $loader->prefixLengthsPsr4 = ComposerStaticInit364f768ac85bad335293fa2c57da2e09::$prefixLengthsPsr4;
    33             $loader->prefixDirsPsr4 = ComposerStaticInit364f768ac85bad335293fa2c57da2e09::$prefixDirsPsr4;
    34             $loader->classMap = ComposerStaticInit364f768ac85bad335293fa2c57da2e09::$classMap;
     39            $loader->prefixLengthsPsr4 = ComposerStaticInit6027a90d3d77c32aebae2be9e77e3c6f::$prefixLengthsPsr4;
     40            $loader->prefixDirsPsr4 = ComposerStaticInit6027a90d3d77c32aebae2be9e77e3c6f::$prefixDirsPsr4;
     41            $loader->classMap = ComposerStaticInit6027a90d3d77c32aebae2be9e77e3c6f::$classMap;
    3542
    3643        }, null, ClassLoader::class);
  • essential-elements/trunk/vendor/composer/installed.php

    r3270973 r3458804  
    11<?php return array(
    22    'root' => array(
    3         'name' => 'beautifulplugins/essential-elements',
    4         'pretty_version' => 'dev-master',
    5         'version' => 'dev-master',
    6         'reference' => 'cbc577d8e63f04da4b46b47bea22d26ff5370f01',
     3        'name' => 'urldev/essential-elements',
     4        'pretty_version' => 'v1.0.1',
     5        'version' => '1.0.1.0',
     6        'reference' => '9bb3ab37b1d8a10c29ad7f6ea34a8f1d8bb9c6ba',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1111    ),
    1212    'versions' => array(
    13         'beautifulplugins/essential-elements' => array(
    14             'pretty_version' => 'dev-master',
    15             'version' => 'dev-master',
    16             'reference' => 'cbc577d8e63f04da4b46b47bea22d26ff5370f01',
     13        'urldev/essential-elements' => array(
     14            'pretty_version' => 'v1.0.1',
     15            'version' => '1.0.1.0',
     16            'reference' => '9bb3ab37b1d8a10c29ad7f6ea34a8f1d8bb9c6ba',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
  • essential-elements/trunk/vendor/composer/platform_check.php

    r3270973 r3458804  
    2020        }
    2121    }
    22     trigger_error(
    23         'Composer detected issues in your platform: ' . implode(' ', $issues),
    24         E_USER_ERROR
     22    throw new \RuntimeException(
     23        'Composer detected issues in your platform: ' . implode(' ', $issues)
    2524    );
    2625}
Note: See TracChangeset for help on using the changeset viewer.