Changeset 2360273
- Timestamp:
- 08/13/2020 03:06:01 PM (6 years ago)
- Location:
- pagecdn
- Files:
-
- 11 added
- 3 edited
-
tags/5.11 (added)
-
tags/5.11/admin-functions.php (added)
-
tags/5.11/data (added)
-
tags/5.11/data/data.json (added)
-
tags/5.11/font-functions.php (added)
-
tags/5.11/functions.php (added)
-
tags/5.11/init-functions.php (added)
-
tags/5.11/pagecdn.php (added)
-
tags/5.11/readme.md (added)
-
tags/5.11/readme.txt (added)
-
tags/5.11/settings.php (added)
-
trunk/admin-functions.php (modified) (2 diffs)
-
trunk/init-functions.php (modified) (3 diffs)
-
trunk/pagecdn.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pagecdn/trunk/admin-functions.php
r2357161 r2360273 434 434 } 435 435 436 PageCDN_collect_repo_data(); 437 436 438 $options = PageCDN_options(); 437 439 … … 453 455 454 456 457 function PageCDN_collect_repo_data( ) 458 { 459 Global $PageCDN_options; 460 461 if( strlen( $PageCDN_options['pagecdn_api_key'] ) && strlen( $PageCDN_options['url'] ) ) 462 { 463 $repo = trim( parse_url( $PageCDN_options['url'] , PHP_URL_PATH ) , '/' ); 464 465 $apikey = $PageCDN_options['pagecdn_api_key']; 466 467 if( $response = PageCDN_get_API_response( '/private/repo/info' , array( 'apikey' => $apikey , 'repo' => $repo ) ) ) 468 { 469 if( !PageCDN_display_API_error( $response ) ) 470 { 471 $response = $response['response']; 472 473 $PageCDN_options['compression_level'] = $response['compression_level']; 474 $PageCDN_options['http2_server_push'] = $response['server_push'] && $response['server_push_trigger']; 475 $PageCDN_options['update_css_paths'] = $response['update_css_paths']; 476 $PageCDN_options['http_cache_ttl'] = strtotime( "+{$response['browser_cache_number']} {$response['browser_cache_period']}" , 0 ); 477 $PageCDN_options['cache_control'] = !!$PageCDN_options['http_cache_ttl']; 478 } 479 } 480 } 481 } 482 483 484 -
pagecdn/trunk/init-functions.php
r2319458 r2360273 64 64 function PageCDN_options( $option = null ) 65 65 { 66 Static $options = null; 67 68 if( $options === null ) 69 { 70 $options = wp_parse_args( get_option('pagecdn') , PageCDN_defaults( ) ); 71 66 Global $PageCDN_options; 67 68 //Static $options = null; 69 70 if( $PageCDN_options === null ) 71 { 72 $PageCDN_options = wp_parse_args( get_option('pagecdn') , PageCDN_defaults( ) ); 73 74 /* 72 75 if( is_admin( ) && strlen( $options['pagecdn_api_key'] ) && strlen( $options['url'] ) ) 73 76 { … … 90 93 } 91 94 } 95 */ 92 96 } 93 97 94 98 if( $option ) 95 99 { 96 if( isset( $ options[$option] ) )97 { 98 return $ options[$option];100 if( isset( $PageCDN_options[$option] ) ) 101 { 102 return $PageCDN_options[$option]; 99 103 } 100 104 … … 102 106 } 103 107 104 return $ options;108 return $PageCDN_options; 105 109 } 106 110 -
pagecdn/trunk/pagecdn.php
r2357161 r2360273 7 7 Author URI: https://pagecdn.com 8 8 License: GPLv2 or later 9 Version: 5.1 09 Version: 5.11 10 10 */ 11 11 … … 20 20 //define( 'PAGECDN_IMG_CACHE' , WP_CONTENT_DIR . '/cache/pagecdn/images.json' ); 21 21 //define( 'PAGECDN_WEBP_CACHE' , WP_CONTENT_DIR . '/cache/pagecdn/webp.json' ); 22 define( 'PAGECDN_VER' , '5.1 0');22 define( 'PAGECDN_VER' , '5.11' ); 23 23 24 24 $PageCDN_origin_scheme = strtolower( parse_url( home_url( ) , PHP_URL_SCHEME ) ); … … 67 67 $PageCDN_known_webp_URLs = get_option( 'pagecdn-webp-cache' , json_encode( array( ) ) ); 68 68 69 70 $PageCDN_options = null; 69 71 70 72
Note: See TracChangeset
for help on using the changeset viewer.