Changeset 2177211
- Timestamp:
- 10/21/2019 10:59:42 PM (6 years ago)
- Location:
- cache-ultra
- Files:
-
- 1 deleted
- 14 edited
- 1 copied
-
tags/1.1.3 (deleted)
-
tags/1.1.6 (copied) (copied from cache-ultra/trunk)
-
tags/1.1.6/README.md (modified) (2 diffs)
-
tags/1.1.6/index.php (modified) (2 diffs)
-
tags/1.1.6/src/Controllers/ResourceController.php (modified) (2 diffs)
-
tags/1.1.6/src/Controllers/SnapshotController.php (modified) (2 diffs)
-
tags/1.1.6/src/Services/Cache.php (modified) (6 diffs)
-
tags/1.1.6/src/Services/Request.php (modified) (1 diff)
-
tags/1.1.6/src/Services/Resource.php (modified) (2 diffs)
-
trunk/README.md (modified) (2 diffs)
-
trunk/index.php (modified) (2 diffs)
-
trunk/src/Controllers/ResourceController.php (modified) (2 diffs)
-
trunk/src/Controllers/SnapshotController.php (modified) (2 diffs)
-
trunk/src/Services/Cache.php (modified) (6 diffs)
-
trunk/src/Services/Request.php (modified) (1 diff)
-
trunk/src/Services/Resource.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cache-ultra/tags/1.1.6/README.md
r2177143 r2177211 8 8 Author: Limelight Department 9 9 Tested up to: 5.2.3 10 Stable tag: "1.1. 5"11 Version 1.1. 510 Stable tag: "1.1.6" 11 Version 1.1.6 12 12 License: GPLv2 or later 13 13 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 47 47 48 48 == Changelog == 49 50 1.1.6 51 - Fixed issue with mismatching md5 hashes for tmp files. 49 52 50 53 1.1.5 -
cache-ultra/tags/1.1.6/index.php
r2177143 r2177211 4 4 * Plugin URI: https://limelighttheme.com/cache-ultra/ 5 5 * Description: Cache Ultra Plugin for Wordpress 6 * Version: 1.1. 56 * Version: 1.1.6 7 7 * Author: Limelight Department 8 8 * Author URI: https://limelighttheme.com/ … … 17 17 define('CACHE_ULTRA_DIR', __DIR__); 18 18 19 define('CACHE_ULTRA_VERSION', '1.1. 5');19 define('CACHE_ULTRA_VERSION', '1.1.6'); 20 20 21 21 define('CACHE_ULTRA_MODE', 'prod'); -
cache-ultra/tags/1.1.6/src/Controllers/ResourceController.php
r2177127 r2177211 25 25 26 26 private function __construct() { 27 $this->url = CACHE_ULTRA_API_MODE == 'dev' ? 'https:// fced6fcb.ngrok.io/' : 'https://cache.limelightdept.com/';27 $this->url = CACHE_ULTRA_API_MODE == 'dev' ? 'https://b0b4686c.ngrok.io/' : 'https://cache.limelightdept.com/'; 28 28 } 29 29 … … 185 185 'url' => $permalink, 186 186 ]; 187 RequestService::getInstance()->request($request_data,$this->url.'api/resources/process/'.$cache['id'] );187 RequestService::getInstance()->request($request_data,$this->url.'api/resources/process/'.$cache['id'],'map_resources'); 188 188 return new \WP_REST_Response( [ 189 189 'success' => 1, -
cache-ultra/tags/1.1.6/src/Controllers/SnapshotController.php
r2177127 r2177211 17 17 18 18 private function __construct() { 19 $this->url = CACHE_ULTRA_API_MODE == 'dev' ? 'https:// fced6fcb.ngrok.io/' : 'https://cache.limelightdept.com/';19 $this->url = CACHE_ULTRA_API_MODE == 'dev' ? 'https://b0b4686c.ngrok.io/' : 'https://cache.limelightdept.com/'; 20 20 } 21 21 … … 261 261 'cache' => $cache, 262 262 ]; 263 RequestService::getInstance()->request($request_data,$this->url.'api/snapshot/process/'.$cache['id'] );263 RequestService::getInstance()->request($request_data,$this->url.'api/snapshot/process/'.$cache['id'],'snapshot'); 264 264 return new \WP_REST_Response( [ 265 265 'success' => 1, -
cache-ultra/tags/1.1.6/src/Services/Cache.php
r2177143 r2177211 7 7 use CacheUltra\Models\Resource; 8 8 use CacheUltra\Services\Security; 9 use CacheUltra\Services\Resource AS ResourceService; 9 10 use CacheUltra\Services\Request AS RequestService; 11 10 12 class Cache { 11 13 … … 15 17 16 18 public function __construct() { 17 $this->url = CACHE_ULTRA_API_MODE == 'dev' ? 'https:// fced6fcb.ngrok.io/' : 'https://cache.limelightdept.com/';19 $this->url = CACHE_ULTRA_API_MODE == 'dev' ? 'https://b0b4686c.ngrok.io/' : 'https://cache.limelightdept.com/'; 18 20 add_filter('cron_schedules',[$this, 'CronSchedule']); 19 21 if ( ! wp_next_scheduled( 'cu_CheckCaches' ) ) { … … 42 44 ]; 43 45 try{ 44 RequestService::getInstance()->request($request_data,$this->url.'api/snapshot/performance/'.$cache['id'] );46 RequestService::getInstance()->request($request_data,$this->url.'api/snapshot/performance/'.$cache['id'],'performance'); 45 47 }catch(\Exception $e) { 46 48 return true; … … 50 52 public function CheckCaches() { 51 53 $caches = CacheModel::getEnabled(); 52 $messages = [];54 //$messages = []; 53 55 foreach($caches AS $cache) { 54 $messages[$cache['id']] = $this->processCache($cache); 56 57 if($cache['status'] != '1') return 'this cache is processing.'; 58 $timestamp = time(); 59 $checkTime = $timestamp - $cache['timestamp']; 60 if($checkTime < 28800) return 'has not yet been eight hours.'; 61 62 ResourceService::getInstance()->process($cache,['javascript','css'],$cache['timestamp']); 63 //$messages[$cache['id']] = $this->processCache($cache); 55 64 } 56 65 } … … 136 145 'cache' => $cache, 137 146 ]; 138 RequestService::getInstance()->request($request_data,$this->url.'api/snapshot/process/'.$cache['id'] );147 RequestService::getInstance()->request($request_data,$this->url.'api/snapshot/process/'.$cache['id'],'snapshot'); 139 148 return new \WP_REST_Response( [ 140 149 'success' => 1, … … 266 275 'cache' => $cache, 267 276 ]; 268 RequestService::getInstance()->request($request_data,$this->url.'api/snapshot/process/'.$cache['id'] );277 RequestService::getInstance()->request($request_data,$this->url.'api/snapshot/process/'.$cache['id'],'snapshot'); 269 278 270 279 }catch(\Exception $e){ -
cache-ultra/tags/1.1.6/src/Services/Request.php
r2175848 r2177211 12 12 13 13 } 14 public function request($data,$api ){15 $tmp_file = CACHE_ULTRA_TMP_DIR.'/'.md5($data['cache']['id'] . \get_site_url() . $data['time'] );14 public function request($data,$api,$type){ 15 $tmp_file = CACHE_ULTRA_TMP_DIR.'/'.md5($data['cache']['id'] . \get_site_url() . $data['time'] . $type); 16 16 file_put_contents($tmp_file,base64_encode(serialize($data))); 17 17 $client = new \GuzzleHttp\Client(); -
cache-ultra/tags/1.1.6/src/Services/Resource.php
r2177127 r2177211 26 26 27 27 private function __construct() { 28 $this->url = CACHE_ULTRA_API_MODE == 'dev' ? 'https:// fced6fcb.ngrok.io/' : 'https://cache.limelightdept.com/';28 $this->url = CACHE_ULTRA_API_MODE == 'dev' ? 'https://b0b4686c.ngrok.io/' : 'https://cache.limelightdept.com/'; 29 29 } 30 30 … … 64 64 $headers = ['Referrer' => \get_site_url()]; 65 65 try{ 66 RequestService::getInstance()->request($request_data,$this->url.'api/resources/process/'.$cache['id'] );66 RequestService::getInstance()->request($request_data,$this->url.'api/resources/process/'.$cache['id'],'map_resources'); 67 67 return $cache; 68 68 }catch(\Exception $e){ -
cache-ultra/trunk/README.md
r2177143 r2177211 8 8 Author: Limelight Department 9 9 Tested up to: 5.2.3 10 Stable tag: "1.1. 5"11 Version 1.1. 510 Stable tag: "1.1.6" 11 Version 1.1.6 12 12 License: GPLv2 or later 13 13 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 47 47 48 48 == Changelog == 49 50 1.1.6 51 - Fixed issue with mismatching md5 hashes for tmp files. 49 52 50 53 1.1.5 -
cache-ultra/trunk/index.php
r2177143 r2177211 4 4 * Plugin URI: https://limelighttheme.com/cache-ultra/ 5 5 * Description: Cache Ultra Plugin for Wordpress 6 * Version: 1.1. 56 * Version: 1.1.6 7 7 * Author: Limelight Department 8 8 * Author URI: https://limelighttheme.com/ … … 17 17 define('CACHE_ULTRA_DIR', __DIR__); 18 18 19 define('CACHE_ULTRA_VERSION', '1.1. 5');19 define('CACHE_ULTRA_VERSION', '1.1.6'); 20 20 21 21 define('CACHE_ULTRA_MODE', 'prod'); -
cache-ultra/trunk/src/Controllers/ResourceController.php
r2177127 r2177211 25 25 26 26 private function __construct() { 27 $this->url = CACHE_ULTRA_API_MODE == 'dev' ? 'https:// fced6fcb.ngrok.io/' : 'https://cache.limelightdept.com/';27 $this->url = CACHE_ULTRA_API_MODE == 'dev' ? 'https://b0b4686c.ngrok.io/' : 'https://cache.limelightdept.com/'; 28 28 } 29 29 … … 185 185 'url' => $permalink, 186 186 ]; 187 RequestService::getInstance()->request($request_data,$this->url.'api/resources/process/'.$cache['id'] );187 RequestService::getInstance()->request($request_data,$this->url.'api/resources/process/'.$cache['id'],'map_resources'); 188 188 return new \WP_REST_Response( [ 189 189 'success' => 1, -
cache-ultra/trunk/src/Controllers/SnapshotController.php
r2177127 r2177211 17 17 18 18 private function __construct() { 19 $this->url = CACHE_ULTRA_API_MODE == 'dev' ? 'https:// fced6fcb.ngrok.io/' : 'https://cache.limelightdept.com/';19 $this->url = CACHE_ULTRA_API_MODE == 'dev' ? 'https://b0b4686c.ngrok.io/' : 'https://cache.limelightdept.com/'; 20 20 } 21 21 … … 261 261 'cache' => $cache, 262 262 ]; 263 RequestService::getInstance()->request($request_data,$this->url.'api/snapshot/process/'.$cache['id'] );263 RequestService::getInstance()->request($request_data,$this->url.'api/snapshot/process/'.$cache['id'],'snapshot'); 264 264 return new \WP_REST_Response( [ 265 265 'success' => 1, -
cache-ultra/trunk/src/Services/Cache.php
r2177143 r2177211 7 7 use CacheUltra\Models\Resource; 8 8 use CacheUltra\Services\Security; 9 use CacheUltra\Services\Resource AS ResourceService; 9 10 use CacheUltra\Services\Request AS RequestService; 11 10 12 class Cache { 11 13 … … 15 17 16 18 public function __construct() { 17 $this->url = CACHE_ULTRA_API_MODE == 'dev' ? 'https:// fced6fcb.ngrok.io/' : 'https://cache.limelightdept.com/';19 $this->url = CACHE_ULTRA_API_MODE == 'dev' ? 'https://b0b4686c.ngrok.io/' : 'https://cache.limelightdept.com/'; 18 20 add_filter('cron_schedules',[$this, 'CronSchedule']); 19 21 if ( ! wp_next_scheduled( 'cu_CheckCaches' ) ) { … … 42 44 ]; 43 45 try{ 44 RequestService::getInstance()->request($request_data,$this->url.'api/snapshot/performance/'.$cache['id'] );46 RequestService::getInstance()->request($request_data,$this->url.'api/snapshot/performance/'.$cache['id'],'performance'); 45 47 }catch(\Exception $e) { 46 48 return true; … … 50 52 public function CheckCaches() { 51 53 $caches = CacheModel::getEnabled(); 52 $messages = [];54 //$messages = []; 53 55 foreach($caches AS $cache) { 54 $messages[$cache['id']] = $this->processCache($cache); 56 57 if($cache['status'] != '1') return 'this cache is processing.'; 58 $timestamp = time(); 59 $checkTime = $timestamp - $cache['timestamp']; 60 if($checkTime < 28800) return 'has not yet been eight hours.'; 61 62 ResourceService::getInstance()->process($cache,['javascript','css'],$cache['timestamp']); 63 //$messages[$cache['id']] = $this->processCache($cache); 55 64 } 56 65 } … … 136 145 'cache' => $cache, 137 146 ]; 138 RequestService::getInstance()->request($request_data,$this->url.'api/snapshot/process/'.$cache['id'] );147 RequestService::getInstance()->request($request_data,$this->url.'api/snapshot/process/'.$cache['id'],'snapshot'); 139 148 return new \WP_REST_Response( [ 140 149 'success' => 1, … … 266 275 'cache' => $cache, 267 276 ]; 268 RequestService::getInstance()->request($request_data,$this->url.'api/snapshot/process/'.$cache['id'] );277 RequestService::getInstance()->request($request_data,$this->url.'api/snapshot/process/'.$cache['id'],'snapshot'); 269 278 270 279 }catch(\Exception $e){ -
cache-ultra/trunk/src/Services/Request.php
r2175848 r2177211 12 12 13 13 } 14 public function request($data,$api ){15 $tmp_file = CACHE_ULTRA_TMP_DIR.'/'.md5($data['cache']['id'] . \get_site_url() . $data['time'] );14 public function request($data,$api,$type){ 15 $tmp_file = CACHE_ULTRA_TMP_DIR.'/'.md5($data['cache']['id'] . \get_site_url() . $data['time'] . $type); 16 16 file_put_contents($tmp_file,base64_encode(serialize($data))); 17 17 $client = new \GuzzleHttp\Client(); -
cache-ultra/trunk/src/Services/Resource.php
r2177127 r2177211 26 26 27 27 private function __construct() { 28 $this->url = CACHE_ULTRA_API_MODE == 'dev' ? 'https:// fced6fcb.ngrok.io/' : 'https://cache.limelightdept.com/';28 $this->url = CACHE_ULTRA_API_MODE == 'dev' ? 'https://b0b4686c.ngrok.io/' : 'https://cache.limelightdept.com/'; 29 29 } 30 30 … … 64 64 $headers = ['Referrer' => \get_site_url()]; 65 65 try{ 66 RequestService::getInstance()->request($request_data,$this->url.'api/resources/process/'.$cache['id'] );66 RequestService::getInstance()->request($request_data,$this->url.'api/resources/process/'.$cache['id'],'map_resources'); 67 67 return $cache; 68 68 }catch(\Exception $e){
Note: See TracChangeset
for help on using the changeset viewer.