Plugin Directory

Changeset 3465858


Ignore:
Timestamp:
02/20/2026 02:17:19 PM (6 weeks ago)
Author:
selektable
Message:

Update to version 1.5.0 from GitHub

Location:
selektable
Files:
2 added
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • selektable/tags/1.5.0/includes/class-selektable-admin.php

    r3465660 r3465858  
    7979        if (!current_user_can('manage_options')) {
    8080            return;
     81        }
     82
     83        if (isset($_POST['selektable_store_id'])) {
     84            update_option('selektable_store_id', sanitize_text_field(wp_unslash($_POST['selektable_store_id'])));
    8185        }
    8286
     
    129133                </div>
    130134                <?php endif; ?>
     135
     136                <!-- General Settings -->
     137                <div class="selektable-general-settings">
     138                    <h2><?php esc_html_e('General Settings', 'selektable'); ?></h2>
     139                    <form method="post" action="">
     140                        <?php wp_nonce_field('selektable_save_settings', 'selektable_save_settings_nonce'); ?>
     141                        <table class="form-table">
     142                            <tr>
     143                                <th scope="row">
     144                                    <label for="selektable_store_id"><?php esc_html_e('Store ID', 'selektable'); ?> <span class="required">*</span></label>
     145                                </th>
     146                                <td>
     147                                    <input type="text"
     148                                           name="selektable_store_id"
     149                                           id="selektable_store_id"
     150                                           value="<?php echo esc_attr(get_option('selektable_store_id', '')); ?>"
     151                                           class="regular-text"
     152                                           placeholder="store_xxx"
     153                                           required
     154                                    />
     155                                    <p class="description"><?php esc_html_e('Your Selektable Store ID. Find this in your Selektable dashboard under your store settings.', 'selektable'); ?></p>
     156                                    <?php if (empty(get_option('selektable_store_id', ''))): ?>
     157                                    <p class="description" style="color: #d63638;"><?php esc_html_e('Store ID is required for the widget to function.', 'selektable'); ?></p>
     158                                    <?php endif; ?>
     159                                </td>
     160                            </tr>
     161                        </table>
     162                        <?php submit_button(__('Save Settings', 'selektable')); ?>
     163                    </form>
     164                </div>
    131165
    132166                <!-- Integrations Section -->
  • selektable/tags/1.5.0/includes/class-selektable-frontend.php

    r3465660 r3465858  
    3535        // Enqueue scripts (embed.js always, WC-specific scripts conditionally)
    3636        add_action('wp_enqueue_scripts', [$this, 'enqueue_scripts']);
     37
     38        // Add data-store-id attribute to the embed script tag
     39        add_filter('script_loader_tag', [$this, 'add_store_id_to_embed_script'], 10, 3);
    3740    }
    3841
     
    471474
    472475    /**
     476     * Add data-store-id attribute to the Selektable embed script tag
     477     */
     478    public function add_store_id_to_embed_script($tag, $handle, $src) {
     479        if ($handle !== 'selektable-embed') {
     480            return $tag;
     481        }
     482
     483        $store_id = get_option('selektable_store_id', '');
     484        if (!empty($store_id)) {
     485            $tag = str_replace('<script ', '<script data-store-id="' . esc_attr($store_id) . '" ', $tag);
     486        }
     487
     488        return $tag;
     489    }
     490
     491    /**
    473492     * Enqueue frontend scripts
    474493     */
  • selektable/tags/1.5.0/selektable.php

    r3465660 r3465858  
    44 * Plugin URI: https://selektable.com
    55 * Description: Integrate the Selektable widget for virtual try-on and room visualization on your WordPress site.
    6  * Version: 1.4.0
     6 * Version: 1.5.0
    77 * Author: Selektable
    88 * Author URI: https://selektable.com/about
     
    2020
    2121// Plugin constants
    22 define('SELEKTABLE_VERSION', '1.4.0');
     22define('SELEKTABLE_VERSION', '1.5.0');
    2323define('SELEKTABLE_DB_VERSION', '1.1.0');
    2424define('SELEKTABLE_PLUGIN_FILE', __FILE__);
     
    7676    if (get_option('selektable_app_url') === false) {
    7777        add_option('selektable_app_url', 'https://app.selektable.com');
     78    }
     79    if (get_option('selektable_store_id') === false) {
     80        add_option('selektable_store_id', '');
    7881    }
    7982    if (get_option('selektable_integrations') === false) {
  • selektable/trunk/includes/class-selektable-admin.php

    r3465660 r3465858  
    7979        if (!current_user_can('manage_options')) {
    8080            return;
     81        }
     82
     83        if (isset($_POST['selektable_store_id'])) {
     84            update_option('selektable_store_id', sanitize_text_field(wp_unslash($_POST['selektable_store_id'])));
    8185        }
    8286
     
    129133                </div>
    130134                <?php endif; ?>
     135
     136                <!-- General Settings -->
     137                <div class="selektable-general-settings">
     138                    <h2><?php esc_html_e('General Settings', 'selektable'); ?></h2>
     139                    <form method="post" action="">
     140                        <?php wp_nonce_field('selektable_save_settings', 'selektable_save_settings_nonce'); ?>
     141                        <table class="form-table">
     142                            <tr>
     143                                <th scope="row">
     144                                    <label for="selektable_store_id"><?php esc_html_e('Store ID', 'selektable'); ?> <span class="required">*</span></label>
     145                                </th>
     146                                <td>
     147                                    <input type="text"
     148                                           name="selektable_store_id"
     149                                           id="selektable_store_id"
     150                                           value="<?php echo esc_attr(get_option('selektable_store_id', '')); ?>"
     151                                           class="regular-text"
     152                                           placeholder="store_xxx"
     153                                           required
     154                                    />
     155                                    <p class="description"><?php esc_html_e('Your Selektable Store ID. Find this in your Selektable dashboard under your store settings.', 'selektable'); ?></p>
     156                                    <?php if (empty(get_option('selektable_store_id', ''))): ?>
     157                                    <p class="description" style="color: #d63638;"><?php esc_html_e('Store ID is required for the widget to function.', 'selektable'); ?></p>
     158                                    <?php endif; ?>
     159                                </td>
     160                            </tr>
     161                        </table>
     162                        <?php submit_button(__('Save Settings', 'selektable')); ?>
     163                    </form>
     164                </div>
    131165
    132166                <!-- Integrations Section -->
  • selektable/trunk/includes/class-selektable-frontend.php

    r3465660 r3465858  
    3535        // Enqueue scripts (embed.js always, WC-specific scripts conditionally)
    3636        add_action('wp_enqueue_scripts', [$this, 'enqueue_scripts']);
     37
     38        // Add data-store-id attribute to the embed script tag
     39        add_filter('script_loader_tag', [$this, 'add_store_id_to_embed_script'], 10, 3);
    3740    }
    3841
     
    471474
    472475    /**
     476     * Add data-store-id attribute to the Selektable embed script tag
     477     */
     478    public function add_store_id_to_embed_script($tag, $handle, $src) {
     479        if ($handle !== 'selektable-embed') {
     480            return $tag;
     481        }
     482
     483        $store_id = get_option('selektable_store_id', '');
     484        if (!empty($store_id)) {
     485            $tag = str_replace('<script ', '<script data-store-id="' . esc_attr($store_id) . '" ', $tag);
     486        }
     487
     488        return $tag;
     489    }
     490
     491    /**
    473492     * Enqueue frontend scripts
    474493     */
  • selektable/trunk/selektable.php

    r3465660 r3465858  
    44 * Plugin URI: https://selektable.com
    55 * Description: Integrate the Selektable widget for virtual try-on and room visualization on your WordPress site.
    6  * Version: 1.4.0
     6 * Version: 1.5.0
    77 * Author: Selektable
    88 * Author URI: https://selektable.com/about
     
    2020
    2121// Plugin constants
    22 define('SELEKTABLE_VERSION', '1.4.0');
     22define('SELEKTABLE_VERSION', '1.5.0');
    2323define('SELEKTABLE_DB_VERSION', '1.1.0');
    2424define('SELEKTABLE_PLUGIN_FILE', __FILE__);
     
    7676    if (get_option('selektable_app_url') === false) {
    7777        add_option('selektable_app_url', 'https://app.selektable.com');
     78    }
     79    if (get_option('selektable_store_id') === false) {
     80        add_option('selektable_store_id', '');
    7881    }
    7982    if (get_option('selektable_integrations') === false) {
Note: See TracChangeset for help on using the changeset viewer.