Plugin Directory

Changeset 3288536


Ignore:
Timestamp:
05/06/2025 03:28:53 PM (11 months ago)
Author:
seowriting
Message:

New version of plugin: 1.11.3

Location:
seowriting
Files:
2 edited
7 copied

Legend:

Unmodified
Added
Removed
  • seowriting/tags/1.11.3/readme.txt

    r3288515 r3288536  
    55Requires at least: 4.9
    66Requires PHP: 5.6.20
    7 Stable tag: 1.11.2
     7Stable tag: 1.11.3
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2222
    2323== Changelog ==
     24
     25= 1.11.3 (2025/05/06) =
     26
     27Fix:
     28* Custom CSS for Super Page
    2429
    2530= 1.11.2 (2025/05/06) =
  • seowriting/tags/1.11.3/seowriting.php

    r3288515 r3288536  
    99 * Plugin Name:       SEOWriting
    1010 * Description:       SEOWriting - AI Writing Tool Plugin For Text Generation
    11  * Version:           1.11.2
     11 * Version:           1.11.3
    1212 * Author:            SEOWriting
    1313 * Author URI:        https://seowriting.ai/?utm_source=wp_plugin
     
    2828        public $plugin_slug;
    2929        public $plugin_path;
    30         public $version = '1.11.2';
     30        public $version = '1.11.3';
    3131        /**
    3232         * @var \SEOWriting\APIClient|null
     
    3737        private $css_file = __DIR__ . '/style.css';
    3838
    39         const SETTINGS_CSS = "seowriting_css";
    40         const SETTINGS_CSS_HASH = "seowriting_css_hash";
     39        const SETTINGS_CSS_KEY = "seowriting_css";
     40        const SETTINGS_CSS_HASH_KEY = "seowriting_css_hash";
    4141        const SETTINGS_DEBUG_KEY = 'seowriting_debug';
    4242        const SETTINGS_GENERATOR_NAME = 'seowriting';
    4343        const SETTINGS_GENERATOR_NAME_KEY = 'seowriting_generator';
     44        const SETTINGS_INIT = 'seowriting_init';
    4445        const SETTINGS_KEY = 'seowriting_settings';
    4546        const SETTINGS_PLUGIN_NAME_KEY = 'seowriting_plugin_name';
    46         const SETTINGS_PLUGIN_VERSION = 'seowriting_plugin_version';
     47        const SETTINGS_PLUGIN_VERSION_KEY = 'seowriting_plugin_version';
    4748        const REST_VERSION = 1;
    4849        const MB_ENCODING = 'UTF-8';
     
    112113
    113114            add_action('wp_enqueue_scripts', [$this, 'injectCSS'], 999999);
     115            add_action('init', [$this, 'onInit']);
    114116        }
    115117
     
    123125                plugins_url('style.css', __FILE__),
    124126                [],
    125                 $this->version . '_' . get_option(self::SETTINGS_CSS_HASH, md5((string)microtime(true)))
     127                $this->version . '_' . get_option(self::SETTINGS_CSS_HASH_KEY, md5((string)microtime(true)))
    126128            );
    127129        }
     
    129131        public function onPluginsLoaded()
    130132        {
    131             /** @phpstan-ignore-next-line */
    132             $prevVersion = (string)get_option(self::SETTINGS_PLUGIN_VERSION);
    133133            /** @phpstan-ignore-next-line */
    134134            $pluginName = (string)get_option(self::SETTINGS_PLUGIN_NAME_KEY);
     
    142142        public function activate()
    143143        {
    144             $this->setPluginVersion();
    145             $this->setDefaultCSS();
    146         }
    147 
    148         private function setDefaultCSS()
    149         {
     144            update_option(self::SETTINGS_PLUGIN_VERSION_KEY, $this->version);
    150145            $this->setCss(base64_decode(DEFAULT_CSS));
    151146        }
     
    244239            foreach ($options['plugins'] as $plugin) {
    245240                if (strpos($plugin, 'seowriting.php') !== false) {
    246                     $this->setPluginVersion();
    247                     $this->setDefaultCSS();
    248                     return $this->getAPIClient()->update($this->version);
     241                    update_option(self::SETTINGS_INIT, true);
     242                    return true;
    249243                }
    250244            }
     
    253247        }
    254248
    255         private function setPluginVersion() {
    256             update_option(self::SETTINGS_PLUGIN_VERSION, $this->version);
     249        private function onInit()
     250        {
     251            if (!get_option(self::SETTINGS_INIT)) {
     252                return;
     253            }
     254            delete_option(self::SETTINGS_INIT);
     255            $this->activate();
     256            $this->getAPIClient()->update($this->version);
    257257        }
    258258
     
    10121012            }
    10131013
    1014             delete_option(self::SETTINGS_CSS);
    1015             $res = intval(update_option(self::SETTINGS_CSS, $css));
     1014            delete_option(self::SETTINGS_CSS_KEY);
     1015            $res = intval(update_option(self::SETTINGS_CSS_KEY, $css));
    10161016            if ($res === 1) {
    10171017                file_put_contents($this->css_file, $css);
     
    10191019                return "cannot update css option";
    10201020            }
    1021             delete_option(self::SETTINGS_CSS_HASH);
    1022             if (!update_option(self::SETTINGS_CSS_HASH, md5($css))) {
     1021            delete_option(self::SETTINGS_CSS_HASH_KEY);
     1022            if (!update_option(self::SETTINGS_CSS_HASH_KEY, md5($css))) {
    10231023                return "cannot update css hash option";
    10241024            }
  • seowriting/trunk/readme.txt

    r3288515 r3288536  
    55Requires at least: 4.9
    66Requires PHP: 5.6.20
    7 Stable tag: 1.11.2
     7Stable tag: 1.11.3
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2222
    2323== Changelog ==
     24
     25= 1.11.3 (2025/05/06) =
     26
     27Fix:
     28* Custom CSS for Super Page
    2429
    2530= 1.11.2 (2025/05/06) =
  • seowriting/trunk/seowriting.php

    r3288515 r3288536  
    99 * Plugin Name:       SEOWriting
    1010 * Description:       SEOWriting - AI Writing Tool Plugin For Text Generation
    11  * Version:           1.11.2
     11 * Version:           1.11.3
    1212 * Author:            SEOWriting
    1313 * Author URI:        https://seowriting.ai/?utm_source=wp_plugin
     
    2828        public $plugin_slug;
    2929        public $plugin_path;
    30         public $version = '1.11.2';
     30        public $version = '1.11.3';
    3131        /**
    3232         * @var \SEOWriting\APIClient|null
     
    3737        private $css_file = __DIR__ . '/style.css';
    3838
    39         const SETTINGS_CSS = "seowriting_css";
    40         const SETTINGS_CSS_HASH = "seowriting_css_hash";
     39        const SETTINGS_CSS_KEY = "seowriting_css";
     40        const SETTINGS_CSS_HASH_KEY = "seowriting_css_hash";
    4141        const SETTINGS_DEBUG_KEY = 'seowriting_debug';
    4242        const SETTINGS_GENERATOR_NAME = 'seowriting';
    4343        const SETTINGS_GENERATOR_NAME_KEY = 'seowriting_generator';
     44        const SETTINGS_INIT = 'seowriting_init';
    4445        const SETTINGS_KEY = 'seowriting_settings';
    4546        const SETTINGS_PLUGIN_NAME_KEY = 'seowriting_plugin_name';
    46         const SETTINGS_PLUGIN_VERSION = 'seowriting_plugin_version';
     47        const SETTINGS_PLUGIN_VERSION_KEY = 'seowriting_plugin_version';
    4748        const REST_VERSION = 1;
    4849        const MB_ENCODING = 'UTF-8';
     
    112113
    113114            add_action('wp_enqueue_scripts', [$this, 'injectCSS'], 999999);
     115            add_action('init', [$this, 'onInit']);
    114116        }
    115117
     
    123125                plugins_url('style.css', __FILE__),
    124126                [],
    125                 $this->version . '_' . get_option(self::SETTINGS_CSS_HASH, md5((string)microtime(true)))
     127                $this->version . '_' . get_option(self::SETTINGS_CSS_HASH_KEY, md5((string)microtime(true)))
    126128            );
    127129        }
     
    129131        public function onPluginsLoaded()
    130132        {
    131             /** @phpstan-ignore-next-line */
    132             $prevVersion = (string)get_option(self::SETTINGS_PLUGIN_VERSION);
    133133            /** @phpstan-ignore-next-line */
    134134            $pluginName = (string)get_option(self::SETTINGS_PLUGIN_NAME_KEY);
     
    142142        public function activate()
    143143        {
    144             $this->setPluginVersion();
    145             $this->setDefaultCSS();
    146         }
    147 
    148         private function setDefaultCSS()
    149         {
     144            update_option(self::SETTINGS_PLUGIN_VERSION_KEY, $this->version);
    150145            $this->setCss(base64_decode(DEFAULT_CSS));
    151146        }
     
    244239            foreach ($options['plugins'] as $plugin) {
    245240                if (strpos($plugin, 'seowriting.php') !== false) {
    246                     $this->setPluginVersion();
    247                     $this->setDefaultCSS();
    248                     return $this->getAPIClient()->update($this->version);
     241                    update_option(self::SETTINGS_INIT, true);
     242                    return true;
    249243                }
    250244            }
     
    253247        }
    254248
    255         private function setPluginVersion() {
    256             update_option(self::SETTINGS_PLUGIN_VERSION, $this->version);
     249        private function onInit()
     250        {
     251            if (!get_option(self::SETTINGS_INIT)) {
     252                return;
     253            }
     254            delete_option(self::SETTINGS_INIT);
     255            $this->activate();
     256            $this->getAPIClient()->update($this->version);
    257257        }
    258258
     
    10121012            }
    10131013
    1014             delete_option(self::SETTINGS_CSS);
    1015             $res = intval(update_option(self::SETTINGS_CSS, $css));
     1014            delete_option(self::SETTINGS_CSS_KEY);
     1015            $res = intval(update_option(self::SETTINGS_CSS_KEY, $css));
    10161016            if ($res === 1) {
    10171017                file_put_contents($this->css_file, $css);
     
    10191019                return "cannot update css option";
    10201020            }
    1021             delete_option(self::SETTINGS_CSS_HASH);
    1022             if (!update_option(self::SETTINGS_CSS_HASH, md5($css))) {
     1021            delete_option(self::SETTINGS_CSS_HASH_KEY);
     1022            if (!update_option(self::SETTINGS_CSS_HASH_KEY, md5($css))) {
    10231023                return "cannot update css hash option";
    10241024            }
Note: See TracChangeset for help on using the changeset viewer.