Plugin Directory

Changeset 2334672


Ignore:
Timestamp:
07/03/2020 07:46:17 AM (6 years ago)
Author:
oskarn97
Message:

ssl check

Location:
appful/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • appful/trunk/appful.php

    r2314331 r2334672  
    44Plugin URI: https://appful.io/
    55Description: appful is one of the world's most remarkable & beautiful app service for Blogger and Online magazines. It is designed to create outstanding real native iOS and Android Apps based on the content of your Wordpress site or YouTube channel. appful is surprisingly simple to use and not a single line of code is required.
    6 Version: 1.0.119
     6Version: 1.0.120
    77Author: appful GmbH
    88Author URI: https://appful.io/
  • appful/trunk/singletons/api.php

    r2314329 r2334672  
    421421                    }
    422422
    423                     if (isset($_REQUEST["setServer"])) {
    424                         $this->save_option("appful_server_id", (int)$_REQUEST["setServer"]);
    425                     }
    426 
    427423                    if (isset($_REQUEST["setSession"])) {
    428424                        $this->save_option($this->wpml->filterVar("appful_session_id"), $_REQUEST["setSession"]);
     
    722718            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    723719            curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
     720            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    724721            if (isset($_REQUEST["debug_curl"])) {
    725722                curl_setopt($ch, CURLOPT_VERBOSE, true);
     
    768765            $url = "https://api.appful.io/v2/plugin/". $location;
    769766            if (!get_option("appful_ssl_available") && !get_option("appful_disable_ssl")) {
    770                 if (get_option("appful_last_ssl_check")+24*60*60 < time()) {
     767                if (get_option("appful_last_ssl_check")+60 < time()) {
    771768                    $fp = fsockopen("ssl://api.appful.io", 443, $ErrNo, $ErrString, 30);
    772769
     
    798795            if (!$response) $response = $this->get_contents($url, $params);
    799796
    800             if ((!$response || !$response && $serverOffline) && !isset($_REQUEST["useSSL"])) {
    801                 $serverCount = get_option("appful_server_count", 2);
    802                 for ($i = 1; $i <= $serverCount; $i++) {
    803                     if ($i != get_option("appful_server_id", 1)) {
    804                         $response = $this->get_contents(str_replace("s". get_option("appful_server_id", 1). ".", "s". $i . ".", $url), $params);
    805                         if ($response) {
    806                             $this->save_option("appful_server_id", $i);
    807                             break;
    808                         }
    809                     }
    810                 }
    811             }
    812 
    813797            if (!$response) {
    814798                delete_option("appful_ssl_available");
     
    822806                $this->save_option("appful_invalid_session", "1");
    823807            }
    824             if ($response["server_id"] > 0) {
    825                 $this->save_option("appful_server_id", $response["server_id"]);
    826             }
     808
    827809            return $response;
    828810        }
     
    11851167                if(isset($response["payload"]["overlay_banner"])) $this->save_option("appful_overlay_banner", $this->response->encode_json($response["payload"]["overlay_banner"]));
    11861168                else delete_option("appful_overlay_banner");
    1187                 $this->save_option("appful_server_count", $response["payload"]["server_count"] ? $response["payload"]["server_count"] : 2);
    11881169                if (isset($response["payload"]["push_default"])) $this->save_option("appful_push_default", $response["payload"]["push_default"] ? 1 : 0);
    11891170                if (isset($response["payload"]["cached_post_types"])) $this->save_option("appful_cached_post_types", $this->response->encode_json($response["payload"]["cached_post_types"]));
Note: See TracChangeset for help on using the changeset viewer.