Plugin Directory

Changeset 1276710


Ignore:
Timestamp:
10/31/2015 02:10:24 AM (10 years ago)
Author:
iterative
Message:

Adding notices on API failures.

Location:
iterative-headlines/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • iterative-headlines/trunk/headlines.php

    r1257579 r1276710  
    1515require_once dirname(__FILE__) . "/headlines_advice.php";
    1616require_once dirname(__FILE__) . "/headlines_api.php";
     17require_once dirname(__FILE__) . "/headlines_dashboard.php";
    1718require_once dirname(__FILE__) . "/headlines_pointer.php";
    1819require_once dirname(__FILE__) . "/headlines_options.php";
  • iterative-headlines/trunk/headlines_api.php

    r1257579 r1276710  
    2727    private static $request_age = 6400;
    2828    private static $variant_length = 8;
    29 
     29    public static $isOOS = false;
    3030    public static function getURL($page) {
    3131        return self::$api_endpoint . $page;
    3232    }
    3333
     34    public static function checkOOS() {
     35        if(self::$isOOS)
     36            return true;
     37        $result = self::makeRequest("oos", array("unique_id" => self::getGUID()));
     38
     39        return (self::$isOOS);
     40    }
    3441    public static function getEndpoint() { return self::$api_endpoint; }
    3542
     
    3744        $url_parameters = http_build_query($blob);
    3845        $url = self::getEndpoint() . "{$endpoint}?" . $url_parameters . "&v=" . self::$api_version . "&cangz=" . (function_exists("gzdecode") ? "yes" : "no");
    39        
     46        if(self::$isOOS)
     47            return;
     48
    4049        $request = wp_remote_get($url, array("timeout" => 20));
    4150        $response = json_decode(wp_remote_retrieve_body( $request ), true);
     
    5665            } else if($response['special'] == "DELIVER" && is_admin()) {
    5766                echo "<p>" . $response['error'] . "</p>";
     67            } else if($response['special'] == "OOS") {
     68                self::$isOOS = true;
    5869            }
    5970        }
  • iterative-headlines/trunk/readme.txt

    r1257579 r1276710  
    44Requires at least: 3.0.1
    55Tested up to: 4.3
    6 Stable tag: 1.5.2
     6Stable tag: 1.5.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8080* Support for PHP 5.2, 5.3.
    8181
    82 = 1.5.0 =
     82= 1.5 =
    8383* Synchronizing UI with pro version's UI.
    84 
    85 = 1.5.2 =
    8684* Fixing draft saving behavior.
    8785
     
    9896
    9997= 1.5.0 =
    100 Updating all material for the recent release of the pro version. New functionality on basic version. Support for the new API.
     98Updating all material for the recent release of the pro version. New functionality on basic version. Support for the new API. Updating API support to provide notices when things go wrong.
    10199
Note: See TracChangeset for help on using the changeset viewer.