Changeset 2156347
- Timestamp:
- 09/13/2019 10:49:02 PM (6 years ago)
- File:
-
- 1 edited
-
runcache-purger/trunk/runcache-purger.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
runcache-purger/trunk/runcache-purger.php
r2156238 r2156347 5 5 * Plugin URI: https://wordpress.org/plugins/runcache-purger/ 6 6 * Description: This plugin will purge RunCloud.io NGINX fastcgi, Proxy Cache and Redis Object Cache. 7 * Version: 1. 8.07 * Version: 1.9.0 8 8 * Author: RunCloud 9 9 * Author URI: https://profiles.wordpress.org/runcloud/ … … 64 64 65 65 // version 66 private static $version = '1. 8.0';67 private static $version_prev = '1. 7.0';66 private static $version = '1.9.0'; 67 private static $version_prev = '1.8.0'; 68 68 69 69 // later … … 123 123 { 124 124 $scheme = parse_url(get_site_url(), PHP_URL_SCHEME); 125 return ( 'https' === $scheme ? true : false);125 return ('https' === $scheme ? true : false); 126 126 } 127 127 … … 1040 1040 //self::flush_object(); 1041 1041 1042 $type = (!empty($type) ? $type : self::request_purge_type());1043 1044 if ( empty($proto) && 'http' !== $proto && 'https' !== $proto) {1045 $proto = ( self::is_wp_ssl() ? 'https' : 'http');1046 } 1047 1048 $request_query = $proto .'://127.0.0.1/runcache-purgeall-' . $type;1042 $type = (!empty($type) ? $type : self::request_purge_type()); 1043 1044 if (empty($proto) && 'http' !== $proto && 'https' !== $proto) { 1045 $proto = (self::is_wp_ssl() ? 'https' : 'http'); 1046 } 1047 1048 $request_query = $proto . '://127.0.0.1/runcache-purgeall-' . $type; 1049 1049 return self::remote_request($request_query, ['method' => 'PURGE']); 1050 1050 } … … 1685 1685 * __shutdown. 1686 1686 */ 1687 private static function __shutdown() { 1688 add_action('shutdown', function() { 1687 private static function __shutdown() 1688 { 1689 add_action('shutdown', function () { 1689 1690 wp_cache_flush(0); 1690 1691 wp_cache_delete('alloptions', 'options'); 1691 1692 1692 if ( function_exists('wp_cache_self_remove') && defined('RUNCACHE_PURGER_DROPIN')) {1693 if (function_exists('wp_cache_self_remove') && defined('RUNCACHE_PURGER_DROPIN')) { 1693 1694 wp_cache_self_remove(); 1694 1695 } … … 1920 1921 1921 1922 // reset 1922 $host_url = (!empty($host) ? $host : get_site_url());1923 $proto = parse_url($host_url, PHP_URL_SCHEME);1923 $host_url = (!empty($host) ? $host : get_site_url()); 1924 $proto = parse_url($host_url, PHP_URL_SCHEME); 1924 1925 self::$hostname = parse_url($host_url, PHP_URL_HOST); 1926 1927 // maybe port 443 is open. Then check if we should use the https proto instead 1928 if ('https' !== $proto && fsockopen('tls://' . self::$hostname, 443)) { 1929 $proto = 'https'; 1930 } 1925 1931 1926 1932 self::request_purge_all($type, $proto);
Note: See TracChangeset
for help on using the changeset viewer.