Changeset 3288536
- Timestamp:
- 05/06/2025 03:28:53 PM (11 months ago)
- Location:
- seowriting
- Files:
-
- 2 edited
- 7 copied
-
tags/1.11.3 (copied) (copied from seowriting/trunk)
-
tags/1.11.3/assets/css/admin.css (copied) (copied from seowriting/trunk/assets/css/admin.css)
-
tags/1.11.3/classes/api-client.php (copied) (copied from seowriting/trunk/classes/api-client.php)
-
tags/1.11.3/classes/settings-form.php (copied) (copied from seowriting/trunk/classes/settings-form.php)
-
tags/1.11.3/readme.txt (copied) (copied from seowriting/trunk/readme.txt) (2 diffs)
-
tags/1.11.3/seowriting.php (copied) (copied from seowriting/trunk/seowriting.php) (11 diffs)
-
tags/1.11.3/utils.php (copied) (copied from seowriting/trunk/utils.php)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/seowriting.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
seowriting/tags/1.11.3/readme.txt
r3288515 r3288536 5 5 Requires at least: 4.9 6 6 Requires PHP: 5.6.20 7 Stable tag: 1.11. 27 Stable tag: 1.11.3 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 22 22 23 23 == Changelog == 24 25 = 1.11.3 (2025/05/06) = 26 27 Fix: 28 * Custom CSS for Super Page 24 29 25 30 = 1.11.2 (2025/05/06) = -
seowriting/tags/1.11.3/seowriting.php
r3288515 r3288536 9 9 * Plugin Name: SEOWriting 10 10 * Description: SEOWriting - AI Writing Tool Plugin For Text Generation 11 * Version: 1.11. 211 * Version: 1.11.3 12 12 * Author: SEOWriting 13 13 * Author URI: https://seowriting.ai/?utm_source=wp_plugin … … 28 28 public $plugin_slug; 29 29 public $plugin_path; 30 public $version = '1.11. 2';30 public $version = '1.11.3'; 31 31 /** 32 32 * @var \SEOWriting\APIClient|null … … 37 37 private $css_file = __DIR__ . '/style.css'; 38 38 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"; 41 41 const SETTINGS_DEBUG_KEY = 'seowriting_debug'; 42 42 const SETTINGS_GENERATOR_NAME = 'seowriting'; 43 43 const SETTINGS_GENERATOR_NAME_KEY = 'seowriting_generator'; 44 const SETTINGS_INIT = 'seowriting_init'; 44 45 const SETTINGS_KEY = 'seowriting_settings'; 45 46 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'; 47 48 const REST_VERSION = 1; 48 49 const MB_ENCODING = 'UTF-8'; … … 112 113 113 114 add_action('wp_enqueue_scripts', [$this, 'injectCSS'], 999999); 115 add_action('init', [$this, 'onInit']); 114 116 } 115 117 … … 123 125 plugins_url('style.css', __FILE__), 124 126 [], 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))) 126 128 ); 127 129 } … … 129 131 public function onPluginsLoaded() 130 132 { 131 /** @phpstan-ignore-next-line */132 $prevVersion = (string)get_option(self::SETTINGS_PLUGIN_VERSION);133 133 /** @phpstan-ignore-next-line */ 134 134 $pluginName = (string)get_option(self::SETTINGS_PLUGIN_NAME_KEY); … … 142 142 public function activate() 143 143 { 144 $this->setPluginVersion(); 145 $this->setDefaultCSS(); 146 } 147 148 private function setDefaultCSS() 149 { 144 update_option(self::SETTINGS_PLUGIN_VERSION_KEY, $this->version); 150 145 $this->setCss(base64_decode(DEFAULT_CSS)); 151 146 } … … 244 239 foreach ($options['plugins'] as $plugin) { 245 240 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; 249 243 } 250 244 } … … 253 247 } 254 248 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); 257 257 } 258 258 … … 1012 1012 } 1013 1013 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)); 1016 1016 if ($res === 1) { 1017 1017 file_put_contents($this->css_file, $css); … … 1019 1019 return "cannot update css option"; 1020 1020 } 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))) { 1023 1023 return "cannot update css hash option"; 1024 1024 } -
seowriting/trunk/readme.txt
r3288515 r3288536 5 5 Requires at least: 4.9 6 6 Requires PHP: 5.6.20 7 Stable tag: 1.11. 27 Stable tag: 1.11.3 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 22 22 23 23 == Changelog == 24 25 = 1.11.3 (2025/05/06) = 26 27 Fix: 28 * Custom CSS for Super Page 24 29 25 30 = 1.11.2 (2025/05/06) = -
seowriting/trunk/seowriting.php
r3288515 r3288536 9 9 * Plugin Name: SEOWriting 10 10 * Description: SEOWriting - AI Writing Tool Plugin For Text Generation 11 * Version: 1.11. 211 * Version: 1.11.3 12 12 * Author: SEOWriting 13 13 * Author URI: https://seowriting.ai/?utm_source=wp_plugin … … 28 28 public $plugin_slug; 29 29 public $plugin_path; 30 public $version = '1.11. 2';30 public $version = '1.11.3'; 31 31 /** 32 32 * @var \SEOWriting\APIClient|null … … 37 37 private $css_file = __DIR__ . '/style.css'; 38 38 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"; 41 41 const SETTINGS_DEBUG_KEY = 'seowriting_debug'; 42 42 const SETTINGS_GENERATOR_NAME = 'seowriting'; 43 43 const SETTINGS_GENERATOR_NAME_KEY = 'seowriting_generator'; 44 const SETTINGS_INIT = 'seowriting_init'; 44 45 const SETTINGS_KEY = 'seowriting_settings'; 45 46 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'; 47 48 const REST_VERSION = 1; 48 49 const MB_ENCODING = 'UTF-8'; … … 112 113 113 114 add_action('wp_enqueue_scripts', [$this, 'injectCSS'], 999999); 115 add_action('init', [$this, 'onInit']); 114 116 } 115 117 … … 123 125 plugins_url('style.css', __FILE__), 124 126 [], 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))) 126 128 ); 127 129 } … … 129 131 public function onPluginsLoaded() 130 132 { 131 /** @phpstan-ignore-next-line */132 $prevVersion = (string)get_option(self::SETTINGS_PLUGIN_VERSION);133 133 /** @phpstan-ignore-next-line */ 134 134 $pluginName = (string)get_option(self::SETTINGS_PLUGIN_NAME_KEY); … … 142 142 public function activate() 143 143 { 144 $this->setPluginVersion(); 145 $this->setDefaultCSS(); 146 } 147 148 private function setDefaultCSS() 149 { 144 update_option(self::SETTINGS_PLUGIN_VERSION_KEY, $this->version); 150 145 $this->setCss(base64_decode(DEFAULT_CSS)); 151 146 } … … 244 239 foreach ($options['plugins'] as $plugin) { 245 240 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; 249 243 } 250 244 } … … 253 247 } 254 248 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); 257 257 } 258 258 … … 1012 1012 } 1013 1013 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)); 1016 1016 if ($res === 1) { 1017 1017 file_put_contents($this->css_file, $css); … … 1019 1019 return "cannot update css option"; 1020 1020 } 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))) { 1023 1023 return "cannot update css hash option"; 1024 1024 }
Note: See TracChangeset
for help on using the changeset viewer.