Changeset 2633085
- Timestamp:
- 11/20/2021 11:26:40 PM (4 years ago)
- Location:
- jch-optimize/trunk
- Files:
-
- 8 edited
-
Awf/Mvc/Model.php (modified) (2 diffs)
-
jch-optimize.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
src/Platform/Cache.php (modified) (6 diffs)
-
vendor/composer/installed.json (modified) (2 diffs)
-
vendor/composer/installed.php (modified) (3 diffs)
-
vendor/jchoptimize/core/src/Browser.php (modified) (4 diffs)
-
version.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
jch-optimize/trunk/Awf/Mvc/Model.php
r2624891 r2633085 82 82 protected $config = array(); 83 83 84 private $hash; 85 84 86 85 87 /** … … 342 344 public function getHash() 343 345 { 344 static $hash = null; 345 346 if (is_null($hash)) 347 { 348 $hash = ucfirst($this->container->application->getName()) . '.' . $this->getName() . '.'; 349 } 350 351 return $hash; 346 if (is_null($this->hash)) 347 { 348 $this->hash = ucfirst($this->container->application->getName()) . '.' . $this->getName() . '.'; 349 } 350 351 return $this->hash; 352 352 } 353 353 -
jch-optimize/trunk/jch-optimize.php
r2625145 r2633085 5 5 * Plugin URI: http://www.jch-optimize.net/ 6 6 * Description: JCH Optimize performs several front-end optimizations to your webpages for fast downloads 7 * Version: 3.0. 17 * Version: 3.0.2 8 8 * Author: Samuel Marshall 9 9 * License: GNU/GPLv3 … … 30 30 define( 'JCH_PLUGIN_URL', plugin_dir_url( JCH_PLUGIN_FILE ) ); 31 31 define( 'JCH_PLUGIN_DIR', plugin_dir_path( JCH_PLUGIN_FILE ) ); 32 define( 'JCH_CACHE_DIR', WP_CONTENT_DIR . '/cache/jch-optimize/' ); 32 33 33 34 require_once( JCH_PLUGIN_DIR . 'autoload.php' ); -
jch-optimize/trunk/readme.txt
r2625145 r2633085 3 3 Contributors: codealfa 4 4 Tags: performance, pagespeed, cache, optimize, seo 5 Tested up to: 5.8. 16 Stable tag: 3.0. 15 Tested up to: 5.8.2 6 Stable tag: 3.0.2 7 7 License: GPLv3 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 73 73 74 74 == Changelog == 75 76 = 3.0.2 = 77 * Bug Fix: Fix issue with sites using FTP to upgrade 75 78 76 79 = 3.0.1 = -
jch-optimize/trunk/src/Platform/Cache.php
r2624891 r2633085 62 62 if ( ! isset( self::$wp_filesystem ) ) 63 63 { 64 // Set the permission constants if not already set. 65 if ( ! defined( 'FS_CHMOD_DIR' ) ) 66 { 67 define( 'FS_CHMOD_DIR', ( fileperms( ABSPATH ) & 0777 | 0755 ) ); 68 } 69 if ( ! defined( 'FS_CHMOD_FILE' ) ) 70 { 71 define( 'FS_CHMOD_FILE', ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 ) ); 72 } 73 74 require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'; 75 require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php'; 76 77 self::$wp_filesystem = new \WP_Filesystem_Direct( true ); 78 79 64 80 /** @var \WP_Filesystem_Base $wp_filesystem */ 81 /* 65 82 global $wp_filesystem; 66 67 83 $wp_filesystem_cache = $wp_filesystem; 68 84 … … 77 93 ), 10, 7 ); 78 94 79 if ( false === ( $creds = request_filesystem_credentials( admin_url( 'options-general.php?page=jchoptimize-settings' ), '', false, 95 96 if ( false === ( $creds = request_filesystem_credentials( admin_url( 'options-general.php?page=jch_optimize' ), '', false, 80 97 WP_CONTENT_DIR, null, true ) ) ) 81 98 { … … 120 137 121 138 $wp_filesystem = $wp_filesystem_cache; 139 140 */ 122 141 } 123 142 124 143 return self::$wp_filesystem; 125 }126 127 /**128 *129 * @param string $id130 * @param bool $page_cache131 *132 * @return string133 */134 private static function _getFileName( $id, $page_cache = false )135 {136 return JCH_CACHE_DIR . ( $page_cache ? 'page/' : '' ) . md5( NONCE_SALT . $id );137 144 } 138 145 … … 168 175 169 176 return self::_getCacheFile( $file, $wp_filesystem ); 170 }171 172 protected static function getLifetime( $page_cache = false )173 {174 static $lifetime, $page_cache_lifetime;175 176 if ( $page_cache )177 {178 if ( ! $page_cache_lifetime )179 {180 $params = Plugin::getPluginParams();181 $page_cache_lifetime = $params->get( 'page_cache_lifetime', '900' );182 }183 184 return (int) $page_cache_lifetime;185 }186 187 if ( ! $lifetime )188 {189 $params = Plugin::getPluginParams();190 191 $lifetime = $params->get( 'cache_lifetime', '900' );192 }193 194 return (int) $lifetime;195 }196 197 /**198 *199 * @param string $file200 * @param \WP_Filesystem_Base $wp_filesystem201 *202 * @return string203 */204 private static function _getCacheFile( $file, $wp_filesystem )205 {206 $content = $wp_filesystem->get_contents( $file );207 208 return unserialize( base64_decode( $content ) );209 177 } 210 178 … … 311 279 if ( in_array( '', $credentials ) ) 312 280 { 313 return false;281 return $value; 314 282 } 315 283 … … 414 382 return true; 415 383 } 384 385 protected static function getLifetime( $page_cache = false ) 386 { 387 static $lifetime, $page_cache_lifetime; 388 389 if ( $page_cache ) 390 { 391 if ( ! $page_cache_lifetime ) 392 { 393 $params = Plugin::getPluginParams(); 394 $page_cache_lifetime = $params->get( 'page_cache_lifetime', '900' ); 395 } 396 397 return (int) $page_cache_lifetime; 398 } 399 400 if ( ! $lifetime ) 401 { 402 $params = Plugin::getPluginParams(); 403 404 $lifetime = $params->get( 'cache_lifetime', '900' ); 405 } 406 407 return (int) $lifetime; 408 } 409 410 /** 411 * 412 * @param string $id 413 * @param bool $page_cache 414 * 415 * @return string 416 */ 417 private static function _getFileName( $id, $page_cache = false ) 418 { 419 return JCH_CACHE_DIR . ( $page_cache ? 'page/' : '' ) . md5( NONCE_SALT . $id ); 420 } 421 422 /** 423 * 424 * @param string $file 425 * @param \WP_Filesystem_Base $wp_filesystem 426 * 427 * @return string 428 */ 429 private static function _getCacheFile( $file, $wp_filesystem ) 430 { 431 $content = $wp_filesystem->get_contents( $file ); 432 433 return unserialize( base64_decode( $content ) ); 434 } 416 435 } -
jch-optimize/trunk/vendor/composer/installed.json
r2624891 r2633085 155 155 "type": "git", 156 156 "url": "[email protected]:jchoptimize/core.git", 157 "reference": " a33911b719d87c865995452c320f7add6b56c6af"158 }, 159 "dist": { 160 "type": "zip", 161 "url": "https://api.github.com/repos/jchoptimize/core/zipball/ a33911b719d87c865995452c320f7add6b56c6af",162 "reference": " a33911b719d87c865995452c320f7add6b56c6af",157 "reference": "d0efaf5ffe9904fddb8393ca6d897fb29f690329" 158 }, 159 "dist": { 160 "type": "zip", 161 "url": "https://api.github.com/repos/jchoptimize/core/zipball/d0efaf5ffe9904fddb8393ca6d897fb29f690329", 162 "reference": "d0efaf5ffe9904fddb8393ca6d897fb29f690329", 163 163 "shasum": "" 164 164 }, … … 167 167 "php": ">=7" 168 168 }, 169 "time": "2021-1 0-31T00:13:46+00:00",169 "time": "2021-11-17T18:25:31+00:00", 170 170 "default-branch": true, 171 171 "type": "jchoptimize-core", -
jch-optimize/trunk/vendor/composer/installed.php
r2625145 r2633085 6 6 'install_path' => __DIR__ . '/../../', 7 7 'aliases' => array(), 8 'reference' => ' 769fb84a26db9112daa91512eb9a9fd1a1eb8f84',8 'reference' => '6feba8f0724bfdb3ee6b89606b04975dc599b606', 9 9 'name' => 'jchoptimize/wordpress-platform', 10 10 'dev' => false, … … 52 52 0 => '9999999-dev', 53 53 ), 54 'reference' => ' a33911b719d87c865995452c320f7add6b56c6af',54 'reference' => 'd0efaf5ffe9904fddb8393ca6d897fb29f690329', 55 55 'dev_requirement' => false, 56 56 ), … … 61 61 'install_path' => __DIR__ . '/../../', 62 62 'aliases' => array(), 63 'reference' => ' 769fb84a26db9112daa91512eb9a9fd1a1eb8f84',63 'reference' => '6feba8f0724bfdb3ee6b89606b04975dc599b606', 64 64 'dev_requirement' => false, 65 65 ), -
jch-optimize/trunk/vendor/jchoptimize/core/src/Browser.php
r2624891 r2633085 29 29 { 30 30 31 $this->oClient = new \Browser( $userAgent);31 $this->oClient = Utility::userAgent($userAgent); 32 32 $this->calculateFontHash(); 33 33 } … … 35 35 protected function calculateFontHash() 36 36 { 37 $this->fontHash .= $this->oClient-> getPlatform(). '/';37 $this->fontHash .= $this->oClient->os . '/'; 38 38 39 $sVersion = $this->oClient-> getVersion();39 $sVersion = $this->oClient->browserVersion; 40 40 41 switch ( $this->oClient-> getBrowser())41 switch ( $this->oClient->browser ) 42 42 { 43 43 case 'Chrome': … … 155 155 public function getBrowser() 156 156 { 157 return $this->oClient-> getBrowser();157 return $this->oClient->browser; 158 158 } 159 159 … … 165 165 public function getVersion() 166 166 { 167 return $this->oClient-> getVersion();167 return $this->oClient->browserVersion; 168 168 } 169 169 -
jch-optimize/trunk/version.php
r2625145 r2633085 15 15 defined( '_JCH_EXEC' ) or die; 16 16 17 const JCH_VERSION = '3.0. 1';18 const JCH_DATE = '2021-11- 05';17 const JCH_VERSION = '3.0.2'; 18 const JCH_DATE = '2021-11-20'; 19 19 const JCH_PRO = '0'; 20 20 const JCH_PLATFORM = 'WordPress';
Note: See TracChangeset
for help on using the changeset viewer.