Plugin Directory

Changeset 3299691


Ignore:
Timestamp:
05/24/2025 06:55:54 AM (9 months ago)
Author:
spiraclethemes
Message:

updating to ver 1.5.1

Location:
spiraclethemes-site-library
Files:
176 added
7 edited

Legend:

Unmodified
Added
Removed
  • spiraclethemes-site-library/trunk/Changelogs.txt

    r3298065 r3299691  
    11
    22== Changelog ==
     3
     4== 1.5.1 ==
     5- Fixed deprecated issue warning in dashboard widget
    36
    47== 1.5.0 ==
  • spiraclethemes-site-library/trunk/README.txt

    r3298065 r3299691  
    33Contributors: spiraclethemes
    44Tags: spiraclethemes, demo, import, themes
    5 Stable tag: 1.5.0
     5Stable tag: 1.5.1
    66Requires at least: 5.0
    77Requires PHP: 5.6
  • spiraclethemes-site-library/trunk/admin/admin-init.php

    r3298065 r3299691  
    1313ob_start();
    1414
    15 class SSL_Admin {
     15class Spiraclethemes_site_library_Admin {
    1616
    1717    /**
     
    4343        }
    4444
    45         $this->ssl_init_hooks();
     45        $this->spiraclethemes_site_library_init_hooks();
    4646    }
    4747
     
    4949     * Register admin menu.
    5050     */
    51     public function ssl_register_admin_menu() {
     51    public function spiraclethemes_site_library_register_admin_menu() {
    5252        add_menu_page(
    5353            esc_html__('Spiraclethemes Site Library', 'spiraclethemes-site-library'),
     
    5555            'manage_options',
    5656            'ssl-settings',
    57             [$this, 'ssl_display_settings_pages'],
     57            [$this, 'spiraclethemes_site_library_display_settings_pages'],
    5858            'dashicons-art'
    5959        );
     
    6363     * Initialize hooks.
    6464     */
    65     public function ssl_init_hooks() {
    66         add_action('admin_menu', [$this, 'ssl_register_admin_menu']);
    67         add_action('admin_enqueue_scripts', [$this, 'ssl_enqueue_scripts']);
    68         add_action('wp_ajax_ssl_save_settings', [$this, 'ssl_save_settings']);
     65    public function spiraclethemes_site_library_init_hooks() {
     66        add_action('admin_menu', [$this, 'spiraclethemes_site_library_register_admin_menu']);
     67        add_action('admin_enqueue_scripts', [$this, 'spiraclethemes_site_library_enqueue_scripts']);
     68        add_action('wp_ajax_ssl_save_settings', [$this, 'spiraclethemes_site_library_save_settings']);
    6969    }
    7070
     
    7474     * @param string $hook The current admin page hook.
    7575     */
    76     public function ssl_enqueue_scripts($hook) {
     76    public function spiraclethemes_site_library_enqueue_scripts($hook) {
    7777        if ('toplevel_page_ssl-settings' !== $hook) {
    7878            return;
     
    111111     * Save settings via AJAX.
    112112     */
    113     public function ssl_save_settings() {
     113    public function spiraclethemes_site_library_save_settings() {
    114114        // Verify nonce
    115115        if (!check_ajax_referer(self::NONCE_NAME, 'nonce', false)) {
     
    222222     * Display settings pages.
    223223     */
    224     public function ssl_display_settings_pages() {
     224    public function spiraclethemes_site_library_display_settings_pages() {
    225225        // Explicit capability check
    226226        if (!current_user_can('manage_options')) {
     
    292292                                <?php
    293293                                // Assume ssl_get_sysinfo() is properly sanitized
    294                                 echo wp_kses_post(nl2br(ssl_get_sysinfo()));
     294                                echo wp_kses_post(nl2br(spiraclethemes_site_library_get_sysinfo()));
    295295                                ?>
    296296                            </div>
     
    303303                                <?php
    304304                                // Assume ssl_get_syssettings() is properly sanitized
    305                                 echo ssl_get_syssettings();
     305                                echo spiraclethemes_site_library_get_syssettings();
    306306                                ?>
    307307                                <p class="submit">
     
    324324}
    325325
    326 new SSL_Admin();
     326new Spiraclethemes_site_library_Admin();
  • spiraclethemes-site-library/trunk/admin/includes/system-info.php

    r3298065 r3299691  
    33if (!defined('ABSPATH')) exit; // Exit if accessed directly
    44
    5 function ssl_get_sysinfo() {
     5function spiraclethemes_site_library_get_sysinfo() {
    66    global $wpdb;
    77
  • spiraclethemes-site-library/trunk/admin/includes/system-settings.php

    r3298065 r3299691  
    22if (!defined('ABSPATH')) exit;
    33
    4 function ssl_get_syssettings() {
     4function spiraclethemes_site_library_get_syssettings() {
    55    ob_start();
    66    ?>
  • spiraclethemes-site-library/trunk/inc/widget/widget.php

    r3298065 r3299691  
    4747
    4848    if ("1" === get_option('ssl_disable_discount_widget')) {
     49        if (!current_user_can('manage_options')) {
     50            echo '<p>' . esc_html__('You do not have permission to view this content.', 'spiraclethemes-site-library') . '</p>';
     51            return;
     52        }
     53
    4954        $cache_key = 'spiraclethemes_discount_data';
    5055        $xml_body = get_transient($cache_key);
    5156
    52         if (false === $xml_body) {
     57        if (false === $xml_body || !is_string($xml_body) || empty($xml_body)) {
    5358            $api_url = esc_url_raw('https://api.spiraclethemes.com/discounts/disapi.php');
    5459            $response = wp_safe_remote_get($api_url, [
     
    7277        }
    7378
    74         libxml_disable_entity_loader(true);
     79        if (version_compare(PHP_VERSION, '8.0.0', '<')) {
     80            libxml_disable_entity_loader(true);
     81        }
    7582        libxml_use_internal_errors(true);
    7683        $xml = simplexml_load_string($xml_body, 'SimpleXMLElement', LIBXML_NOCDATA);
    7784
    7885        if ($xml === false) {
     86            if (defined('WP_DEBUG') && WP_DEBUG) {
     87                error_log('Spiraclethemes Site Library: XML parsing errors: ' . print_r(libxml_get_errors(), true));
     88            }
    7989            echo '<p>' . esc_html__('Error parsing XML data.', 'spiraclethemes-site-library') . '</p>';
    8090            libxml_clear_errors();
     
    8696        foreach ($xml->theme as $theme) {
    8797            if ((string) $theme->slug === $theme_slug) {
    88                 $theme_discount = (string) $theme->sale;
    89                 $theme_url = (string) $theme->purchase_url;
     98                $theme_discount = !empty($theme->sale) ? (string) $theme->sale : null;
     99                $theme_url = !empty($theme->purchase_url) ? (string) $theme->purchase_url : null;
    90100                break;
    91101            }
  • spiraclethemes-site-library/trunk/spiraclethemes-site-library.php

    r3298065 r3299691  
    44 * Plugin URI:        https://wordpress.org/plugins/spiraclethemes-site-library/
    55 * Description:       A plugin by Spiracle Themes that adds one-click demo import, theme customization, starter templates, and page builder support to its free themes.
    6  * Version:           1.5.0
     6 * Version:           1.5.1
    77 * Author:            SpiracleThemes
    88 * Author URI:        https://spiraclethemes.com
Note: See TracChangeset for help on using the changeset viewer.