PluginProbe
Passster – Password Protect Pages and Content / 4.3.16
Passster – Password Protect Pages and Content v4.3.16
4.3.16 4.3.15 4.3.14 4.3.12 4.3.13 4.3.11 4.3.10 4.3.9 4.3.8 4.3.7 4.3.6 4.3.5 trunk 3.5.4 3.5.5.2 3.5.5.8 3.5.5.9 4.0 4.1.4 4.2.10 4.2.11 4.2.12 4.2.13 4.2.14 4.2.15 All 48 releases
← All changes | inc/freemius/includes/class-fs-api.php +8 -3 4.1.44.3.16 View file →
@@ -317,11 +317,14 @@
317 317 if ( WP_FS__DEV_MODE || $this->_api->IsSandbox() ) {
318 318 $flush = true;
319 319 }
320 320
321 - $cached_result = self::$_cache->get( $cache_key );
321 + $has_valid_cache = self::$_cache->has_valid( $cache_key, $expiration );
322 + $cached_result = $has_valid_cache ?
323 + self::$_cache->get( $cache_key ) :
324 + null;
322 325
323 - if ( $flush || ! self::$_cache->has_valid( $cache_key, $expiration ) ) {
326 + if ( $flush || is_null( $cached_result ) ) {
324 327 $result = $this->call( $path );
325 328
326 329 if ( ! is_object( $result ) || isset( $result->error ) ) {
327 330 // Api returned an error.
@@ -351,9 +354,11 @@
351 354 }
352 355 }
353 356 }
354 357
355 - self::$_cache->set( $cache_key, $result, $expiration );
358 + if ( is_numeric( $expiration ) ) {
359 + self::$_cache->set( $cache_key, $result, $expiration );
360 + }
356 361
357 362 $cached_result = $result;
358 363 } else {
359 364 $this->_logger->log( 'Using cached API result.' );