| @@ 410-418 (lines=9) @@ | ||
| 407 | <?php |
|
| 408 | if ( $this->settings_screen_do_remote_http ) { |
|
| 409 | $AO_banner = get_transient( 'autoptimize_banner' ); |
|
| 410 | if ( empty( $AO_banner ) ) { |
|
| 411 | $banner_resp = wp_remote_get( 'https://misc.optimizingmatters.com/autoptimize_news.html?ao_ver='.AUTOPTIMIZE_PLUGIN_VERSION ); |
|
| 412 | if ( ! is_wp_error( $banner_resp ) ) { |
|
| 413 | if ( '200' == wp_remote_retrieve_response_code( $banner_resp ) ) { |
|
| 414 | $AO_banner = wp_kses_post( wp_remote_retrieve_body( $banner_resp ) ); |
|
| 415 | set_transient('autoptimize_banner', $AO_banner, DAY_IN_SECONDS); |
|
| 416 | } |
|
| 417 | } |
|
| 418 | } |
|
| 419 | echo $AO_banner; |
|
| 420 | } |
|
| 421 | ?> |
|
| @@ 620-628 (lines=9) @@ | ||
| 617 | $_img_provider_stat_url = apply_filters( 'autoptimize_filter_extra_imgopt_stat_url', $_img_provider_stat_url ); |
|
| 618 | ||
| 619 | // only do the remote call if $_img_provider_stat_url is not empty to make sure no parse_url weirdness results in useless calls. |
|
| 620 | if ( ! empty( $_img_provider_stat_url ) ) { |
|
| 621 | $_img_stat_resp = wp_remote_get( $_img_provider_stat_url ); |
|
| 622 | if ( ! is_wp_error( $_img_stat_resp ) ) { |
|
| 623 | if ( '200' == wp_remote_retrieve_response_code( $_img_stat_resp ) ) { |
|
| 624 | $_img_provider_stat = json_decode( wp_remote_retrieve_body( $_img_stat_resp ), true ); |
|
| 625 | update_option( 'autoptimize_imgopt_provider_stat', $_img_provider_stat ); |
|
| 626 | } |
|
| 627 | } |
|
| 628 | } |
|
| 629 | } |
|
| 630 | } |
|
| 631 | ||
| @@ 311-321 (lines=11) @@ | ||
| 308 | public static function check_service_availability( $return_result = false ) |
|
| 309 | { |
|
| 310 | $service_availability_resp = wp_remote_get( 'https://misc.optimizingmatters.com/api/autoptimize_service_availablity.json?from=aomain&ver=' . AUTOPTIMIZE_PLUGIN_VERSION ); |
|
| 311 | if ( ! is_wp_error( $service_availability_resp ) ) { |
|
| 312 | if ( '200' == wp_remote_retrieve_response_code( $service_availability_resp ) ) { |
|
| 313 | $availabilities = json_decode( wp_remote_retrieve_body( $service_availability_resp ), true ); |
|
| 314 | if ( is_array( $availabilities ) ) { |
|
| 315 | update_option( 'autoptimize_service_availablity', $availabilities ); |
|
| 316 | if ( $return_result ) { |
|
| 317 | return $availabilities; |
|
| 318 | } |
|
| 319 | } |
|
| 320 | } |
|
| 321 | } |
|
| 322 | } |
|
| 323 | ||
| 324 | /** |
|