Changeset 3144108
- Timestamp:
- 08/30/2024 07:37:43 AM (19 months ago)
- Location:
- claspo/trunk
- Files:
-
- 2 edited
-
claspo.php (modified) (7 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
claspo/trunk/claspo.php
r3137558 r3144108 5 5 * Plugin URI: https://github.com/Claspo/claspo-wordpress-plugin 6 6 * Description: Adds the Claspo script to all pages of the site. 7 * Version: 1.0. 07 * Version: 1.0.2 8 8 * Author: Claspo 9 9 * Author URI: https://github.com/Claspo … … 61 61 set_transient( 'claspo_success_message', true, 30 ); 62 62 delete_transient( 'claspo_api_error' ); 63 64 claspo_clear_cache(); 63 65 } else { 64 66 set_transient( 'claspo_api_error', 'Invalid response from API', 30 ); … … 139 141 set_transient( 'claspo_success_message', true, 30 ); 140 142 delete_transient( 'claspo_api_error' ); 143 144 claspo_clear_cache(); 141 145 } else { 142 146 set_transient( 'claspo_api_error', 'Invalid response from API', 30 ); … … 160 164 delete_option( 'claspo_script_id' ); 161 165 delete_option( 'claspo_script_code' ); 166 167 claspo_clear_cache(); 162 168 163 169 wp_safe_redirect( admin_url( 'admin.php?page=claspo_script_plugin' ) ); … … 213 219 $to = 'integrations.feedback@claspo.io'; 214 220 $subject = 'Feedback from WordPress plugin'; 215 $body = "Domain: " . $wp_domain . "\n\nScript ID: " . esc_html($script_id) . "\n\nFeedback:\n" . esc_html($feedback); 221 $body = "Domain: " . $wp_domain 222 . "\n\nScript ID: " . esc_html($script_id) 223 . "\n\nFeedback:\n" . esc_html($feedback) 224 . "\n\nPlugin version:\n" . esc_html( get_plugin_data( __FILE__ )['Version'] ) 225 . "\n\nWordPress version:\n" . esc_html( get_bloginfo( 'version' ) ) 226 . "\n\nPHP version:\n" . esc_html( phpversion() ); 227 ; 216 228 217 229 wp_mail( $to, $subject, $body ); … … 221 233 222 234 deactivate_plugins( plugin_basename( __FILE__ ), true ); 235 236 claspo_clear_cache(); 223 237 wp_safe_redirect( admin_url( 'plugins.php?deactivated=true' ) ); 224 238 exit; … … 250 264 // Додаємо дію для виконання редіректу після ініціалізації адміністративної частини 251 265 add_action('admin_init', 'claspo_plugin_redirect'); 266 267 268 function claspo_clear_cache() { 269 try { 270 global $wp_fastest_cache; 271 // if W3 Total Cache is being used, clear the cache 272 if (function_exists('w3tc_flush_all')) { 273 w3tc_flush_all(); 274 } 275 /* if WP Super Cache is being used, clear the cache */ 276 if (function_exists('wp_cache_clean_cache')) { 277 global $file_prefix, $supercachedir; 278 if (empty($supercachedir) && function_exists('get_supercache_dir')) { 279 $supercachedir = get_supercache_dir(); 280 } 281 wp_cache_clean_cache($file_prefix); 282 } 283 284 if (method_exists('WpFastestCache', 'deleteCache') && !empty($wp_fastest_cache)) { 285 $wp_fastest_cache->deleteCache(); 286 } 287 if (function_exists('rocket_clean_domain')) { 288 rocket_clean_domain(); 289 // Preload cache. 290 if (function_exists('run_rocket_sitemap_preload')) { 291 run_rocket_sitemap_preload(); 292 } 293 } 294 295 if (class_exists("autoptimizeCache") && method_exists("autoptimizeCache", "clearall")) { 296 autoptimizeCache::clearall(); 297 } 298 299 if (class_exists("LiteSpeed_Cache_API") && method_exists("autoptimizeCache", "purge_all")) { 300 LiteSpeed_Cache_API::purge_all(); 301 } 302 303 if (class_exists('\Hummingbird\Core\Utils')) { 304 $modules = \Hummingbird\Core\Utils::get_active_cache_modules(); 305 foreach ($modules as $module => $name) { 306 $mod = \Hummingbird\Core\Utils::get_module($module); 307 308 if ($mod->is_active()) { 309 if ('minify' === $module) { 310 $mod->clear_files(); 311 } else { 312 $mod->clear_cache(); 313 } 314 } 315 } 316 } 317 } catch (Exception $e) { 318 // do nothing 319 } 320 } 321 322 323 ?> -
claspo/trunk/readme.txt
r3137558 r3144108 4 4 Requires at least: 1.0 5 5 Tested up to: 6.6 6 Stable tag: 1.0. 16 Stable tag: 1.0.2 7 7 Requires PHP: 7.0 8 8 Plugin URI: https://www.claspo.io … … 258 258 == Changelog == 259 259 260 = 1.0.2 = 261 * Introduced compatibility with popular caching plugins such as WP Rocket, WP Fastest Cache, LiteSpeed Cache, Autoptimize, and Hummingbird. 262 260 263 = 1.0.1 = 261 264 * Bug fixes.
Note: See TracChangeset
for help on using the changeset viewer.