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

V1.2.8: Fix issue with UK_* variables when no address was entered yet

parent 2a63d25e
No related branches found
No related tags found
No related merge requests found
diff --git a/opentools-update-checker.php b/opentools-update-checker.php
index b01fa1d..49f45ad 100644
--- a/opentools-update-checker.php
+++ b/opentools-update-checker.php
@@ -23,6 +23,7 @@ class OpenToolsPluginUpdateChecker extends PluginUpdateChecker_2_1 {
public function __construct($metadataUrl, $pluginFile, $slug = '', $checkPeriod = 12, $optionName = '', $muPluginFile = '')
{
parent::__construct($metadataUrl, $pluginFile, $slug, $checkPeriod, $optionName, $muPluginFile);
+ $this->debugMode = TRUE;
$this->installOTHooks();
}
public function declareCredentials($credential_def) {
@@ -249,6 +250,9 @@ class OpenToolsPluginUpdateChecker extends PluginUpdateChecker_2_1 {
$success = ($status_code==200);
} else {
$message = __('Unable to access plugin download URL. Please check your credentials.');
+ if ($this->debugMode) {
+ $message .= "<pre>updateinfo: ".print_r($updateinfo,1)."</pre>";
+ }
}
return $success;
}
diff --git a/plugin-update-checker/plugin-update-checker.php b/plugin-update-checker/plugin-update-checker.php
index 8a5c92f..af74a8a 100644
--- a/plugin-update-checker/plugin-update-checker.php
+++ b/plugin-update-checker/plugin-update-checker.php
@@ -221,7 +221,7 @@ class PluginUpdateChecker_2_1 {
);
//Try to parse the response
- $pluginInfo = null;
+ $pluginInfo = new stdClass();
if ( !is_wp_error($result) && isset($result['response']['code']) && ($result['response']['code'] == 200) && !empty($result['body']) ){
$pluginInfo = PluginInfo_2_1::fromJson($result['body'], $this->debugMode);
$pluginInfo->filename = $this->pluginFile;
@@ -237,6 +237,7 @@ class PluginUpdateChecker_2_1 {
}
trigger_error($message, E_USER_WARNING);
}
+ $pluginInfo->response = $result;
$pluginInfo = apply_filters('puc_request_info_result-'.$this->slug, $pluginInfo, $result);
return $pluginInfo;
BASE=shipping-by-rules
PLATTFORM=woocommerce
VENDOR=opentools
VERSION=1.2.7
VERSION=1.2.8
DIR = $(shell pwd)
SVNDIR=wordpress-plugin-svn
......@@ -45,4 +45,4 @@ svn: $(SVNDIR)/trunk $(SVNDIR)/tags/$(VERSION)
svn-release: svn $(SVNDIR)/tags/$(VERSION)
rsync -avP $(PLUGINFILES) $(BASICPLUGINFILES) $(TRANSLATIONS) $(SVNDIR)/tags/$(VERSION)
\ No newline at end of file
......@@ -33,9 +33,9 @@ class RulesShippingFrameworkWooCommerceAdvanced extends RulesShippingFrameworkWo
$data = parent::getOrderAddress($cart, $method);
$address = $cart['destination'];
$zip = isset($address['postcode'])?trim($address['postcode']):'';
if (isset($zip) && $zip!='') {
$data = array_merge($data, $this->getAddressZIP($zip));
}
// Also call getAddressZIP if no zip code is given. All fields will
// be set to NULL, but at least they will exist!
$data = array_merge($data, $this->getAddressZIP($zip));
return $data;
}
......
......@@ -3,7 +3,7 @@ Contributors: opentools
Tags: WooCommerce, Shipment, Shipping
Requires at least: 4.0
Tested up to: 4.5
Stable tag: 1.2.6debug
Stable tag: 1.2.8
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl.html
......
......@@ -3,7 +3,7 @@ Contributors: opentools
Tags: WooCommerce, Shipment, Shipping, Rules shipping
Requires at least: 4.0
Tested up to: 4.7
Stable tag: 1.2.7
Stable tag: 1.2.8
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl.html
......@@ -69,6 +69,9 @@ Please see our support forum at http://open-tools.net/forum/. It might also be a
== Changelog ==
= 1.2.8 =
* Fix issues with UK_* variables when no address is entered yet
= 1.2.7 =
* Add debug messages to the update system (disabled by default)
......
File added
File added
......@@ -3,7 +3,7 @@
* Plugin Name: WooCommerce Advanced Shipping By Rules
* Plugin URI: http://open-tools.net/woocommerce/advanced-shipping-by-rules-for-woocommerce.html
* Description: Define Shipping cost by very general and flexible (text-based) rules. The advanced version also provides mathematical expressions and functions
* Version: 1.2.7
* Version: 1.2.8
* Author: Open Tools, Reinhold Kainhofer
* Author URI: http://open-tools.net
* Text Domain: woocommerce-advanced-shipping-by-rules
......@@ -75,7 +75,7 @@ class WooCommerce_Shipping_By_Rules_Advanced {
* @since 1.0.0
* @var string $version Plugin version number.
*/
public $version = '1.2.7';
public $version = '1.2.8';
/**
......
......@@ -3,7 +3,7 @@
* Plugin Name: WooCommerce Shipping By Rules
* Plugin URI: http://open-tools.net/woocommerce/advanced-shipping-by-rules-for-woocommerce.html
* Description: Define Shipping cost by very general and flexible (text-based) rules.
* Version: 1.2.7
* Version: 1.2.8
* Author: Open Tools, Reinhold Kainhofer
* Author URI: http://open-tools.net
* Text Domain: woocommerce-shipping-by-rules
......@@ -48,7 +48,7 @@ class WooCommerce_Shipping_By_Rules {
* @since 1.0.0
* @var string $version Plugin version number.
*/
public $version = '1.2.7';
public $version = '1.2.8';
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment