Plugin Directory

Changeset 3461137


Ignore:
Timestamp:
02/14/2026 12:58:22 AM (6 weeks ago)
Author:
limchik
Message:

Release 1.0.1 (update trunk)

Location:
smt-toolkit/trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • smt-toolkit/trunk/includes/class-smt-admin.php

    r3439002 r3461137  
    4141            SMTTOOL_URL . 'assets/css/admin.css',
    4242            [],
    43             '1.0.0'
     43            SMTTOOL_VERSION
    4444        );
    4545        wp_enqueue_script(
     
    4747            SMTTOOL_URL . 'assets/js/admin.js',
    4848            ['jquery'],
    49             '1.0.0',
     49            SMTTOOL_VERSION,
    5050            true
    5151        );     
     
    7777                    SMTTOOL_URL . 'includes/modules/transliteration/assets/css/translit-admin.css',
    7878                    ['smttool-admin'],
    79                     '1.0.0'
     79                    SMTTOOL_VERSION
    8080                );
    8181
     
    8484                    SMTTOOL_URL . 'includes/modules/transliteration/assets/js/translit-admin.js',
    8585                    ['jquery', 'smttool-admin'],
    86                     '1.0.0',
     86                    SMTTOOL_VERSION,
    8787                    true
    8888                );
     
    9999                    SMTTOOL_URL . 'includes/modules/discounts/assets/css/discounts-admin.css',
    100100                    ['smttool-admin'],
    101                     '1.0.0'
     101                    SMTTOOL_VERSION
    102102                );
    103103
     
    108108                    SMTTOOL_URL . 'includes/modules/discounts/assets/js/discounts-admin.js',
    109109                    ['jquery', 'smttool-admin'],
    110                     '1.0.0',
     110                    SMTTOOL_VERSION,
    111111                    true
    112112                );
     
    124124                ]);
    125125                break;
     126               
     127            case 'store_settings':
     128                wp_enqueue_style(
     129                    'smttool-store-settings-admin',
     130                    SMTTOOL_URL . 'includes/modules/store-settings/assets/css/store-settings-admin.css',
     131                    ['smttool-admin'],
     132                    SMTTOOL_VERSION
     133                );
     134
     135                wp_enqueue_script(
     136                    'smttool-store-settings-admin',
     137                    SMTTOOL_URL . 'includes/modules/store-settings/assets/js/store-settings-admin.js',
     138                    ['smttool-admin'],
     139                    SMTTOOL_VERSION,
     140                    true
     141                );
     142
     143                wp_localize_script(
     144                    'smttool-store-settings-admin',
     145                    'SMTTOOL_STORE_SETTINGS',
     146                    [
     147                        'ajax' => [
     148                            'url'   => admin_url('admin-ajax.php'),
     149                            'nonce' => wp_create_nonce('smttool_store_settings_nonce'),
     150                        ],
     151                    ]
     152                );
     153                break;
    126154
    127155            case 'gdi':
     
    130158                    SMTTOOL_URL . 'includes/modules/google-drive-importer/assets/css/gdi-admin.css',
    131159                    ['smttool-admin'],
    132                     '1.0.0'
     160                    SMTTOOL_VERSION
    133161                );
    134162
     
    137165                    SMTTOOL_URL . 'includes/modules/google-drive-importer/assets/js/gdi-admin.js',
    138166                    ['jquery', 'smttool-admin'],
    139                     '1.0.0',
     167                    SMTTOOL_VERSION,
    140168                    true
    141169                );
  • smt-toolkit/trunk/includes/class-smt-module-loader.php

    r3439002 r3461137  
    4545                'requires'    => 'woocommerce',
    4646            ],
     47            'store_settings' => [
     48                'file'        => SMTTOOL_PATH . 'includes/modules/store-settings/class-store-settings-module.php',
     49                'class'       => 'SMTTOOL_Store_Settings_Module',
     50                'title'       => 'Store Configuration',
     51                'description' => 'Centralized store behavior, performance and UI configuration.',
     52                'icon'        => 'dashicons-admin-generic',
     53                'requires'    => 'woocommerce',
     54            ],
    4755        ];
    4856    }
     
    6169            }
    6270           
    63             // 🔹 Dependency check
     71            // Dependency check
    6472            if (($mod['requires'] ?? '') === 'woocommerce' && !class_exists('WooCommerce')) {
    6573                continue;
     
    7886            $class = $mod['class'];
    7987
    80             // 🔹 DB install / upgrade (module-owned)
     88            // DB install / upgrade (module-owned)
    8189            if (
    8290                method_exists($class, 'install') &&
     
    96104            }
    97105
    98             // 🔹 Init module
     106            // Init module
    99107            $instance = new $class();
    100108
  • smt-toolkit/trunk/includes/modules/discounts/admin-view.php

    r3439002 r3461137  
    6868        <tbody id="smt-discounts-table-body">
    6969
    70         <?php if (!empty($profiles)) : foreach ($profiles as $p) : ?>
     70        <?php // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
     71         if (!empty($profiles)) : foreach ($profiles as $p) : ?>
    7172
    7273            <tr data-id="<?php echo esc_attr($p['id']); ?>">
  • smt-toolkit/trunk/includes/modules/discounts/assets/css/discounts-admin.css

    r3439002 r3461137  
    220220    margin-left: 10px;
    221221    padding: 4px 10px;
     222    border: 1px solid #ddd;
    222223    border-radius: 8px;
    223     background: #4e8cff;
    224     color: #fff;
     224    background: transparent;
     225    color: #111;
    225226    font-size: 13px;
    226227}
  • smt-toolkit/trunk/includes/modules/discounts/assets/js/discounts-admin.js

    r3439002 r3461137  
    3232        });
    3333
    34         // ⛔️ міняємо ТІЛЬКИ якщо значення реально невалідне
    3534        if (!$op.find(`option[value="${$op.val()}"]:visible`).length) {
    3635            $op.val(allowed[0]);
     
    212211        const $values = $row.find('.smt-rule-values');
    213212
    214         // 🧹 ОЧИЩАЄМО СТАРІ ДАНІ
    215213        $tags.empty();
    216214        $values.val('[]');
     
    221219        updateOperators($row);
    222220
    223         // 🔁 Переініціалізація autocomplete
    224221        initRuleAutocomplete($row);
    225222    });
     
    250247        row.remove();
    251248   
    252         // якщо видалили останній — новий останній ховає AND/OR
    253249        if (isLast) {
    254250            $('.smt-discount-rule-row').last()
     
    276272            });
    277273
    278         // 🔑 SVG reflow hack (обовʼязково)
     274        // SVG reflow hack
    279275        $preview.find('svg use').each(function () {
    280276            const $use = $(this);
     
    338334                    const $row = addRuleRow();
    339335
    340                     // Виставляємо тип правила
    341336                    $row.find('[name="rules[][condition_type]"]').val(r.condition_type);
    342337                    updateOperators($row);
    343338
    344                     // Виставляємо оператор
    345339                    $row.find('[name="rules[][operator]"]').val(r.operator);
    346 
    347                     // Виставляємо AND / OR
    348340                    $row.find('[name="rules[][logic_op]"]').val(r.logic_op || 'and');
    349341
    350                     // ТІЛЬКИ ТЕПЕР ініціалізуємо autocomplete / price
    351342                    initRuleAutocomplete($row);
    352343                   
     
    382373        });
    383374    });
    384 
    385     $(document).on('click', '#smt-discounts-cancel', function () {
    386         $('#smt-discounts-modal').fadeOut(150);
     375   
     376    $(document).on('click', '#smt-discounts-cancel', function () {
     377        const modal = $('#smt-discounts-modal');
     378        const form  = modal.find('form');
     379
     380        form[0].reset();
     381        form.find('[name=id]').val('');
     382        $('#smt-discounts-rules').empty();
     383
     384        modal.fadeOut(150);
    387385    });
    388386   
  • smt-toolkit/trunk/includes/modules/discounts/class-discounts-ajax.php

    r3439002 r3461137  
    235235
    236236        // --- badge fields ---
    237         $badge_text_raw   = wp_kses_post($post['badge_text'] ?? '');
     237        $badge_text_raw = trim((string)($post['badge_text'] ?? ''));
    238238        $badge_text_color = sanitize_hex_color($post['badge_text_color'] ?? '');
    239239        $badge_bg_color   = sanitize_hex_color($post['badge_bg_color'] ?? '');
  • smt-toolkit/trunk/includes/modules/discounts/class-discounts-cron.php

    r3439002 r3461137  
    527527            return false;
    528528        }
    529 
    530         $regular = (float)$regular;
     529       
     530        $decimals  = wc_get_price_decimals();
     531
     532        $regular = (float) wc_format_decimal($regular, $decimals);
     533       
     534        // Read current state once
     535        $cur_price     = get_post_meta($product_id, '_price', true);
     536        $cur_sale      = get_post_meta($product_id, '_sale_price', true);
     537        $cur_from      = get_post_meta($product_id, '_sale_price_dates_from', true);
     538        $cur_to        = get_post_meta($product_id, '_sale_price_dates_to', true);
     539        $cur_profile   = (int) get_post_meta($product_id, $meta_profile, true);
     540
     541        $changed = false;
    531542
    532543        if ($profile) {
    533544
    534             $discount = (float)($profile['discount_value'] ?? 0);
    535             if ($discount <= 0) return false;
    536 
    537             $new_price = ($profile['discount_type'] === 'fixed')
     545            $discount = (float) ($profile['discount_value'] ?? 0);
     546            if ($discount <= 0) {
     547                return false;
     548            }
     549
     550            $type = (string) ($profile['discount_type'] ?? '');
     551            $new_price = ($type === 'fixed')
    538552                ? max(0, $regular - $discount)
    539553                : max(0, $regular * (1 - $discount / 100));
    540 
    541             update_post_meta($product_id, '_sale_price', $new_price);
    542             update_post_meta($product_id, '_price', $new_price);
    543 
     554               
     555            $new_price = (float) wc_format_decimal($new_price, $decimals);
     556
     557            $cur_price = (float) wc_format_decimal($cur_price, $decimals);
     558            $cur_sale  = (float) wc_format_decimal($cur_sale,  $decimals);
     559
     560            // Dates
    544561            $date_from = strtotime(($profile['date_start'] ?? '') . ' ' . ($profile['time_start'] ?: '00:00:00'));
    545562            $date_to   = strtotime(($profile['date_end']   ?? '') . ' ' . ($profile['time_end']   ?: '23:59:59'));
    546563
    547             $date_from ? update_post_meta($product_id, '_sale_price_dates_from', $date_from)
    548                        : delete_post_meta($product_id, '_sale_price_dates_from');
    549 
    550             $date_to   ? update_post_meta($product_id, '_sale_price_dates_to',   $date_to)
    551                        : delete_post_meta($product_id, '_sale_price_dates_to');
    552 
    553             update_post_meta($product_id, $meta_profile, (int)$profile['id']);
    554 
    555             wc_delete_product_transients($product_id);
    556             return true;
     564            $new_profile_id = (int) ($profile['id'] ?? 0);
     565
     566            // 1) _sale_price
     567            if ($cur_sale !== $new_price) {
     568                update_post_meta($product_id, '_sale_price', $new_price);
     569                $changed = true;
     570            }
     571
     572            // 2) _price (should match sale during active discount)
     573            if ($cur_price !== $new_price) {
     574                update_post_meta($product_id, '_price', $new_price);
     575                $changed = true;
     576            }
     577
     578            // 3) dates_from
     579            $cur_from_i = $cur_from !== '' ? (int)$cur_from : 0;
     580            $new_from_i = $date_from ? (int)$date_from : 0;
     581            if ($cur_from_i !== $new_from_i) {
     582                $new_from_i ? update_post_meta($product_id, '_sale_price_dates_from', $new_from_i)
     583                            : delete_post_meta($product_id, '_sale_price_dates_from');
     584                $changed = true;
     585            }
     586
     587            // 4) dates_to
     588            $cur_to_i = $cur_to !== '' ? (int)$cur_to : 0;
     589            $new_to_i = $date_to ? (int)$date_to : 0;
     590            if ($cur_to_i !== $new_to_i) {
     591                $new_to_i ? update_post_meta($product_id, '_sale_price_dates_to', $new_to_i)
     592                          : delete_post_meta($product_id, '_sale_price_dates_to');
     593                $changed = true;
     594            }
     595
     596            // 5) active profile marker
     597            if ($cur_profile !== $new_profile_id) {
     598                update_post_meta($product_id, $meta_profile, $new_profile_id);
     599                $changed = true;
     600            }
     601
     602            if ($changed) {
     603                wc_delete_product_transients($product_id);
     604            }
     605
     606            return $changed;
    557607
    558608        } else {
    559609
    560             $current_profile_id = get_post_meta($product_id, $meta_profile, true);
    561             if (!$current_profile_id) return false;
    562 
    563             update_post_meta($product_id, '_price', $regular);
    564 
    565             delete_post_meta($product_id, '_sale_price');
    566             delete_post_meta($product_id, '_sale_price_dates_from');
    567             delete_post_meta($product_id, '_sale_price_dates_to');
     610            if (!$cur_profile) {
     611                return false;
     612            }
     613
     614            // Restore _price to regular if needed
     615            if (!$eq_price($cur_price, $regular)) {
     616                update_post_meta($product_id, '_price', $regular);
     617                $changed = true;
     618            }
     619
     620            // Remove sale meta only if exists
     621            if ($cur_sale !== '' && $cur_sale !== null) {
     622                delete_post_meta($product_id, '_sale_price');
     623                $changed = true;
     624            }
     625            if ($cur_from !== '' && $cur_from !== null) {
     626                delete_post_meta($product_id, '_sale_price_dates_from');
     627                $changed = true;
     628            }
     629            if ($cur_to !== '' && $cur_to !== null) {
     630                delete_post_meta($product_id, '_sale_price_dates_to');
     631                $changed = true;
     632            }
     633
    568634            delete_post_meta($product_id, $meta_profile);
    569 
    570             wc_delete_product_transients($product_id);
    571             return true;
     635            $changed = true;
     636
     637            if ($changed) {
     638                wc_delete_product_transients($product_id);
     639            }
     640
     641            return $changed;
    572642        }
    573643    }
  • smt-toolkit/trunk/includes/modules/discounts/class-discounts-module.php

    r3439002 r3461137  
    5959            discount_type ENUM('percent','fixed') NOT NULL DEFAULT 'percent',
    6060            discount_value DECIMAL(10,2) NOT NULL DEFAULT 0,
    61             badge_text VARCHAR(100) NULL,
     61            badge_text MEDIUMTEXT NULL,
    6262            badge_text_color VARCHAR(20) NULL,
    6363            badge_bg_color VARCHAR(20) NULL,
  • smt-toolkit/trunk/includes/modules/discounts/class-discounts-svg.php

    r3439002 r3461137  
    66    public static function init() {
    77        add_action('wp_footer', [__CLASS__, 'discounts_badge']);
    8         add_filter('woocommerce_sale_flash', [__CLASS__, 'render_discount_badge'], 9999, 3);
    9         add_action( 'wp_enqueue_scripts', [ __CLASS__, 'enqueue_badge_script' ] );
     8       
     9        $modules = get_option('smttool_modules', []);
     10        $settings = get_option('smttool_store_settings', []);
     11
     12        $store_settings_enabled = !empty($modules['store_settings']['enabled']);
     13        $onsale_badge_enabled = !empty($settings['badges']['onsale']['enabled']);
     14
     15        if ($store_settings_enabled && $onsale_badge_enabled) {
     16            add_filter('smttool_sale_badge', [__CLASS__, 'render_discount_badge'], 9999, 3);
     17        } else {
     18            add_filter('woocommerce_sale_flash', [__CLASS__, 'render_discount_badge'], 9999, 3);
     19        }
    1020    }
    1121
     
    1626
    1727        $html = trim($html);
    18         if ($html === '') return '';
     28        if ($html === '') {
     29            return '';
     30        }
     31       
     32        if (strlen($html) > 20000) {
     33            return '';
     34        }
    1935
    20         $html = wp_kses($html, [
    21             'svg'  => [
    22                 'xmlns' => true,
    23                 'viewBox' => true,
    24                 'width' => true,
    25                 'height'=> true,
    26                 'fill'  => true,
    27                 'class' => true,
    28             ],
    29             'path' => [
    30                 'd' => true,
    31                 'fill' => true,
    32             ],
    33             'span' => [
    34                 'class' => true,
    35                 'style' => true,
    36             ],
    37             'b' => [],
    38             'i' => [],
    39             'strong' => [],
    40         ]);
     36        // --- SVG ---
     37        if (preg_match('/^\s*<svg\b/i', $html)) {
     38            return self::optimize_svg($html);
     39        }
    4140
    42         $html = preg_replace('/\s{2,}/', ' ', $html);
    43         $html = str_replace(["\n", "\r", "\t"], '', $html);
     41        // --- Font Awesome / icon fonts ---
     42        if (preg_match('/^\s*<(i|span)\b/i', $html)) {
     43            return wp_kses($html, [
     44                'i' => [
     45                    'class' => true,
     46                    'aria-hidden' => true,
     47                ],
     48                'span' => [
     49                    'class' => true,
     50                ],
     51            ]);
     52        }
    4453
    45         return trim($html);
     54        // --- Plain text / emoji ---
     55        return sanitize_text_field($html);
     56    }
     57   
     58    protected static function optimize_svg(string $svg): string {
     59
     60        // Remove XML / DOCTYPE
     61        $svg = preg_replace('/<\?xml.*?\?>/i', '', $svg);
     62        $svg = preg_replace('/<!DOCTYPE.*?>/i', '', $svg);
     63
     64        // Remove scripts & foreignObject (XSS)
     65        $svg = preg_replace('#<script.*?</script>#is', '', $svg);
     66        $svg = preg_replace('#<foreignObject.*?</foreignObject>#is', '', $svg);
     67
     68        // Remove on* attributes
     69        $svg = preg_replace('/\son\w+="[^"]*"/i', '', $svg);
     70        $svg = preg_replace("/\son\w+='[^']*'/i", '', $svg);
     71
     72        // Remove javascript: links
     73        $svg = preg_replace('/xlink:href="javascript:[^"]*"/i', '', $svg);
     74        $svg = preg_replace('/href="javascript:[^"]*"/i', '', $svg);
     75
     76        // Remove comments
     77        $svg = preg_replace('/<!--.*?-->/s', '', $svg);
     78
     79        // Minify whitespace
     80        $svg = preg_replace('/>\s+</', '><', $svg);
     81        $svg = preg_replace('/\s{2,}/', ' ', $svg);
     82        $svg = preg_replace('/\s*=\s*/', '=', $svg);
     83
     84        return trim($svg);
    4685    }
    4786
    4887    /**
    49      * js footer.
     88     * footer.
    5089     */
    5190    public static function discounts_badge() {
     
    5392        $profiles = SMTTOOL_Discounts_Module::get_active_profiles();
    5493        if (!$profiles) return;
     94       
     95        $huge_svg = false;
    5596
    5697        foreach ($profiles as $profile) {
    5798
    58             if (empty($profile['badge_text'])) continue;
     99            $badge = $profile['badge_text'];
     100            if (empty($badge) || strlen($badge) < 2000) continue;
    59101
    60             $style = '';
    61             if (!empty($profile['badge_text_color'])) {
    62                 $style .= 'color:' . esc_attr($profile['badge_text_color']) . ';';
    63             }
    64             if (!empty($profile['badge_bg_color'])) {
    65                 $style .= 'background:' . esc_attr($profile['badge_bg_color']) . ';';
    66             }
    67 
    68             echo '<template id="smt-badge-profile-' . (int)$profile['id'] . '">';
    69             echo '<span class="onsale smt-discount-badge" style="' . esc_attr($style) . '">';
    70             echo esc_html( $profile['badge_text'] );
    71             echo '</span>';
     102            $huge_svg = true;
     103            echo '<template id="smt-badge-onsale-' . (int)$profile['id'] . '">';
     104            echo $badge;
    72105            echo '</template>';
     106        }
     107       
     108        if ($huge_svg && !wp_script_is('smttool-badge', 'enqueued')) {
     109            self::enqueue_badge_script();
    73110        }
    74111    }
     
    76113    public static function enqueue_badge_script() {
    77114
    78         $profiles = SMTTOOL_Discounts_Module::get_active_profiles();
    79         if ( ! $profiles ) {
    80             return;
    81         }
     115        wp_register_script('smttool-badge', '', [], '1.0.0', true);
    82116
    83         wp_register_script('smttool-discount-badge',    '', [], '1.0.0', true);
    84 
    85         wp_enqueue_script( 'smttool-discount-badge' );
     117        wp_enqueue_script( 'smttool-badge' );
    86118
    87119        wp_add_inline_script(
    88             'smttool-discount-badge',
     120            'smttool-badge',
    89121            '(function () {
    90122                const apply = root => {
    91                     root.querySelectorAll(".smt-discount-badge[data-profile]").forEach(el => {
     123                    root.querySelectorAll(".smt-badge[data-badge]").forEach(el => {
    92124                        if (el.dataset.applied) return;
    93                         const tpl = document.getElementById("smt-badge-profile-" + el.dataset.profile);
     125                        const tpl = document.getElementById("smt-badge-" + el.dataset.badge);
    94126                        if (!tpl) return;
    95                         el.replaceWith(tpl.content.cloneNode(true));
     127                        el.appendChild(tpl.content.cloneNode(true));
     128                        el.dataset.applied = "1";
    96129                    });
    97130                };
     
    128161            return $html;
    129162        }
    130         return preg_replace(
    131             '#<span([^>]*)class="([^"]*onsale[^"]*)"([^>]*)>.*?</span>#i',
    132             '<span class="onsale smt-discount-badge" data-profile="' . esc_attr($profile_id) . '"></span>',
    133             $html
    134         );
     163       
     164        $profile = SMTTOOL_Discounts_Module::get_profile($profile_id);
     165        $badge = $profile['badge_text'];
     166        if (empty($badge)) {
     167            return $html;
     168        }
     169       
     170        $style = '';
     171        if (!empty($profile['badge_text_color'])) {
     172            $style .= 'color:' . esc_attr($profile['badge_text_color']) . ';';
     173        }
     174        if (!empty($profile['badge_bg_color'])) {
     175            $style .= 'background:' . esc_attr($profile['badge_bg_color']) . ';';
     176        }
     177       
     178        if (strlen($badge) > 2000) {
     179            return '<span class="smt-badge onsale" data-badge="onsale-' . esc_attr($profile_id) . '" style="' . esc_attr($style) . '"></span>';
     180        } else {
     181            // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped --
     182            // To allow sanitized svg and html and intentionally printed raw.
     183            return '<span class="smt-badge onsale" data-badge="onsale" style="' . esc_attr($style) . '">' . $badge . '</span>';
     184        }
     185       
    135186    }
    136187}
  • smt-toolkit/trunk/readme.txt

    r3439002 r3461137  
    55Requires at least: 5.8
    66Tested up to: 6.9
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    114114---
    115115
     116Store Settings Module
     117
     118The Store Settings module centralizes WooCommerce configuration in one place — no need to edit theme files or functions.php.
     119
     120It allows you to safely manage store behavior, performance tweaks, product badges, and Classic checkout fields through a clean admin interface.
     121
     122**Key Features**
     123- Disable unused frontend scripts and styles
     124- Add context-based inline CSS and JavaScript
     125- Clean up unnecessary WordPress and WooCommerce head output
     126- Configure product badges (Sale, New, Sold Out, Featured, Best Seller)
     127- Customize Classic WooCommerce checkout fields
     128
     129Checkout customization works with Classic WooCommerce checkout (shortcode).
     130Blocks checkout is automatically detected.
     131
     132---
     133
    116134### Modular Architecture
    117135
     
    186204
    187205== Changelog ==
     206
     207= 1.0.1 =
     208* Added Store Settings module (assets control, cleanup, inline CSS/JS, checkout fields)
     209* Checkout customization refactored (Classic checkout only, Block checkout detection added)
     210* Fixed WooCommerce checkout field re-rendering (wc-checkout handling)
     211* Improved checkout field diff-based saving (no translation overwrite)
     212* Added reset option for checkout fields
     213* Enhanced badge system (heavy SVG handling, template injection, mutation observer)
     214* Optimized best-seller query with transient caching
     215* Improved security sanitization (wp_unslash handling, SVG hardening)
     216* Added advanced cleanup options (WooCommerce blocks, cart fragments, brands)
     217* Performance improvements and codebase stabilization
     218* Multiple security and Plugin Check compliance fixes
    188219
    189220= 1.0.0 =
  • smt-toolkit/trunk/smt-toolkit.php

    r3439002 r3461137  
    33 * Plugin Name: SMT Toolkit for WooCommerce
    44 * Description: Modular toolkit for store automation: imports, discounts, transliteration and cron-based workflows.
    5  * Version: 1.0.0
     5 * Version: 1.0.1
    66 * Author: limchik
    77 * Text Domain: smt-toolkit
     
    2020define('SMTTOOL_PATH', plugin_dir_path(__FILE__));
    2121define('SMTTOOL_URL',  plugin_dir_url(__FILE__));
     22define('SMTTOOL_VERSION',  '1.0.1');
    2223
    2324/**
  • smt-toolkit/trunk/uninstall.php

    r3439002 r3461137  
    1717
    1818// Remove GDI logs directory
     19// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
    1920$upload = wp_upload_dir();
     21// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
    2022$dir    = trailingslashit( $upload['basedir'] ) . 'smttool-gdi-logs/';
    2123
     
    2628delete_option( 'smttool_gdi_profiles' );
    2729
     30// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
    2831global $wpdb;
    29 
     32// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
    3033$like = $wpdb->esc_like( 'smttool_gdi_last_' ) . '%';
    3134// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
     
    3841
    3942if ( $keys ) {
     43    // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
    4044    foreach ( $keys as $key ) {
    4145        delete_option( $key );
     
    4549   1. Remove options
    4650===================================================== */
    47 
     51// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
    4852$option_prefixes = [
    4953    'smttool_',
    5054];
    51 
     55// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
    5256foreach ($option_prefixes as $prefix) {
    5357    // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
Note: See TracChangeset for help on using the changeset viewer.