Skip to content
Snippets Groups Projects
Commit 43c09d2e authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

V1.3.7debug1: Debug version for Blaine Rittmer: Downloading the update...

V1.3.7debug1: Debug version for Blaine Rittmer: Downloading the update information works, converting to JSON seems to fail, so we need to add debug statements in that area...
parent 4d23ff00
No related branches found
No related tags found
No related merge requests found
BASE=ordernumbers
PLATTFORM=woocommerce
VENDOR=opentools
VERSION=1.3.7debug
VERSION=1.3.7debug1
DIR = $(shell pwd)
SVNDIR=wordpress-plugin-svn
......
File added
File added
......@@ -902,8 +902,10 @@ class PluginInfo_2_1 {
* @return PluginInfo|null New instance of PluginInfo, or NULL on error.
*/
public static function fromJson($json, $triggerErrors = false){
$info = new self();
/** @var StdClass $apiResponse */
$apiResponse = json_decode($json);
$info->apiResponse = $apiResponse;
if ( empty($apiResponse) || !is_object($apiResponse) ){
if ( $triggerErrors ) {
trigger_error(
......@@ -911,7 +913,8 @@ class PluginInfo_2_1 {
E_USER_NOTICE
);
}
return null;
$info->fromJson_Error = "PluginInfo_2_1::fromJson: Unable to parse response into JSON object. JSON error: ".json_last_error_msg().", Original response: <pre>".$json."</pre>";
return $info;
}
//Very, very basic validation.
......@@ -923,10 +926,10 @@ class PluginInfo_2_1 {
E_USER_NOTICE
);
}
return null;
$info->fromJson_Error = "PluginInfo_2_1::fromJson: The plugin metadata file does not contain the required 'name' and 'version' keys.";
return $info;
}
$info = new self();
foreach(get_object_vars($apiResponse) as $key => $value){
$info->$key = $value;
}
......
......@@ -3,7 +3,7 @@
* Plugin Name: Woocommerce Advanced Ordernumbers
* Plugin URI: http://open-tools.net/woocommerce/advanced-ordernumbers-for-woocommerce.html
* Description: Lets the user freely configure the order numbers in WooCommerce.
* Version: 1.3.7debug
* Version: 1.3.7debug1
* Author: Open Tools
* Author URI: http://open-tools.net
* Text Domain: woocommerce-advanced-ordernumbers
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment