Changeset 3007319
- Timestamp:
- 12/08/2023 02:59:47 PM (2 years ago)
- Location:
- eshipper-commerce
- Files:
-
- 2 deleted
- 8 edited
- 27 copied
-
tags/2.16.5 (copied) (copied from eshipper-commerce/trunk)
-
tags/2.16.5/.editorconfig (deleted)
-
tags/2.16.5/.gitignore (deleted)
-
tags/2.16.5/README.md (copied) (copied from eshipper-commerce/trunk/README.md)
-
tags/2.16.5/assets (copied) (copied from eshipper-commerce/trunk/assets)
-
tags/2.16.5/assets/eShipper.js (copied) (copied from eshipper-commerce/trunk/assets/eShipper.js)
-
tags/2.16.5/composer.json (copied) (copied from eshipper-commerce/trunk/composer.json)
-
tags/2.16.5/composer.lock (copied) (copied from eshipper-commerce/trunk/composer.lock)
-
tags/2.16.5/docs (copied) (copied from eshipper-commerce/trunk/docs)
-
tags/2.16.5/framework (copied) (copied from eshipper-commerce/trunk/framework)
-
tags/2.16.5/framework/db.php (copied) (copied from eshipper-commerce/trunk/framework/db.php) (1 diff)
-
tags/2.16.5/framework/lib/admin-settings.js (copied) (copied from eshipper-commerce/trunk/framework/lib/admin-settings.js) (1 diff)
-
tags/2.16.5/framework/lib/plugin_health.css (copied) (copied from eshipper-commerce/trunk/framework/lib/plugin_health.css)
-
tags/2.16.5/framework/orderdetails.php (copied) (copied from eshipper-commerce/trunk/framework/orderdetails.php)
-
tags/2.16.5/framework/plugin.php (copied) (copied from eshipper-commerce/trunk/framework/plugin.php) (4 diffs)
-
tags/2.16.5/framework/shipments.php (copied) (copied from eshipper-commerce/trunk/framework/shipments.php)
-
tags/2.16.5/framework/shippingmethod.php (copied) (copied from eshipper-commerce/trunk/framework/shippingmethod.php) (1 diff)
-
tags/2.16.5/img (copied) (copied from eshipper-commerce/trunk/img)
-
tags/2.16.5/languages (copied) (copied from eshipper-commerce/trunk/languages)
-
tags/2.16.5/lib (copied) (copied from eshipper-commerce/trunk/lib)
-
tags/2.16.5/license.txt (copied) (copied from eshipper-commerce/trunk/license.txt)
-
tags/2.16.5/models (copied) (copied from eshipper-commerce/trunk/models)
-
tags/2.16.5/plugin (copied) (copied from eshipper-commerce/trunk/plugin)
-
tags/2.16.5/plugin/PluginHealthHelper.php (copied) (copied from eshipper-commerce/trunk/plugin/PluginHealthHelper.php) (1 diff)
-
tags/2.16.5/plugin/pluginLifeCycle.php (copied) (copied from eshipper-commerce/trunk/plugin/pluginLifeCycle.php) (7 diffs)
-
tags/2.16.5/readme.txt (copied) (copied from eshipper-commerce/trunk/readme.txt) (3 diffs)
-
tags/2.16.5/views (copied) (copied from eshipper-commerce/trunk/views)
-
tags/2.16.5/views/login_modal.php (copied) (copied from eshipper-commerce/trunk/views/login_modal.php)
-
tags/2.16.5/woocommerce-eshipper.php (copied) (copied from eshipper-commerce/trunk/woocommerce-eshipper.php) (2 diffs)
-
trunk/framework/db.php (modified) (1 diff)
-
trunk/framework/lib/admin-settings.js (modified) (1 diff)
-
trunk/framework/plugin.php (modified) (4 diffs)
-
trunk/framework/shippingmethod.php (modified) (1 diff)
-
trunk/plugin/PluginHealthHelper.php (modified) (1 diff)
-
trunk/plugin/pluginLifeCycle.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/woocommerce-eshipper.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
eshipper-commerce/tags/2.16.5/framework/db.php
r3006736 r3007319 14 14 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 15 15 $this->get_collate(); 16 update_option('eshipper_version', ESHIPPER_VERSION);17 16 } 18 17 -
eshipper-commerce/tags/2.16.5/framework/lib/admin-settings.js
r2984482 r3007319 452 452 console.log(response); 453 453 jQuery('#es-plugin-health-db-update-message').removeClass('es-d-none').html(response.msg); 454 jQuery('#es-plugin-health-db-update-manual').removeClass('es-d-none'); 454 455 } 455 456 }); -
eshipper-commerce/tags/2.16.5/framework/plugin.php
r3006736 r3007319 43 43 44 44 // Database integration 45 // add_action('init', [&$this, 'eshipper_db']);45 add_action('init', [&$this, 'eshipper_init']); 46 46 47 47 // Wire up product shipping options … … 238 238 public function eshipper_upgrades($upgraderObject, $options) 239 239 { 240 wc_get_logger()->debug('Plugin version updated to ' . ESHIPPER_VERSION . '. Now executing Post-Update tasks.', ['source' => 'eshipper']); 241 240 242 $eshipperPluginPathName = plugin_basename(ESHIPPER_PLUGIN_FILE); 241 243 242 $eshipperUpdated = false;243 244 if ($options['action'] == 'update' && 244 245 $options['type'] == 'plugin' && … … 246 247 in_array($eshipperPluginPathName, $options['plugins']) 247 248 ) { 248 $eshipperUpdated = true; 249 } 250 251 if (!$eshipperUpdated) { 249 // Set a transient to record that our plugin has just been updated 250 set_transient('wp_eshipper_updated', 1); 251 } else { 252 wc_get_logger()->error('Post-Update process interrupted.', ['source' => 'eshipper']); 253 252 254 return; 253 255 } 254 256 255 257 // Now we know that eshipper plugin was updated, so let's do things we're supposed to on updates 256 257 // Set a transient to record that our plugin has just been updated258 set_transient('wp_eshipper_updated', 1);259 258 260 259 // If the plugin is deactivated, activate it again 261 260 require_once(ABSPATH . 'wp-admin/includes/plugin.php'); 262 261 if (!is_plugin_active(plugin_basename(ESHIPPER_PLUGIN_FILE))) { 262 wc_get_logger()->debug('Re-activating plugin.', ['source' => 'eshipper']); 263 263 264 activate_plugin(ESHIPPER_PLUGIN_PATH); 265 266 wc_get_logger()->debug('Re-activated plugin successfully!', ['source' => 'eshipper']); 264 267 } 265 268 266 269 // Apply DB updates 270 wc_get_logger()->debug('Performing DB updates.', ['source' => 'eshipper']); 271 272 require_once(ESHIPPER_PLUGIN_PATH . '/plugin/pluginLifeCycle.php'); 267 273 pluginLifeCycle::updateDB(); 274 275 // Update the version number in options table 276 wc_get_logger()->debug('Updating eshipper version in options table.', ['source' => 'eshipper']); 268 277 update_option('eshipper_version', ESHIPPER_VERSION); 278 279 // DONE 280 wc_get_logger()->debug('Post-Update tasks completed!', ['source' => 'eshipper']); 269 281 } 270 282 … … 345 357 346 358 /** 359 * @deprecated 360 * @return void 361 */ 362 public function eshipper_init() 363 { 364 // Update the version in options table 365 $version = get_option('eshipper_version', '1.0'); 366 if (version_compare($version, ESHIPPER_VERSION, '<')) { 367 update_option('eshipper_version', ESHIPPER_VERSION); 368 } 369 } 370 371 372 /** 347 373 * Load Localisation 348 374 */ -
eshipper-commerce/tags/2.16.5/framework/shippingmethod.php
r3006736 r3007319 1117 1117 <button class='es-button es-button-primary' id="es-plugin-health-db-update">Update Database</button> 1118 1118 <p class="es-d-none" id="es-plugin-health-db-update-message"></p> 1119 <div class="es-d-none" id="es-plugin-health-db-update-manual"> 1120 <p>To resolve this error, follow the steps below - </p> 1121 <ol> 1122 <li> 1123 Copy the WordPress database table prefix from ‘wp-config.php’ file located at the root of the 1124 WordPress installation. 1125 <br><br> 1126 Look for this line and copy the value - <br> 1127 <code>$table_prefix = 'wp_';</code> 1128 <br><br> 1129 Default value is ‘wp_’ 1130 <br><br> 1131 </li> 1132 <li> 1133 Run the following MySQL query in the database after replacing ‘wp_’ in 1134 ‘wp_eshipper_plugin_health’ with the prefix obtained in Step 1.<br><br> 1135 <code> 1136 CREATE TABLE `wp_eshipper_plugin_health` ( `auth` tinyint(1) DEFAULT '0', `access_keys` tinyint(1) DEFAULT '0', `store_address` tinyint(1) DEFAULT '0', `webhooks` tinyint(1) DEFAULT '0', `carrier_services` tinyint(1) DEFAULT '0', `created_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `updated_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ); 1137 </code> 1138 <br><br> 1139 </li> 1140 <li> 1141 Come back to this page and hit refresh. The error should be gone and you will be able to see this page 1142 properly.<br> 1143 If the issue is still not resolved, please contact eShipper support and we'll be happy to help you 1144 out. 1145 </li> 1146 </ol> 1147 </div> 1119 1148 <?php } ?> 1120 1149 -
eshipper-commerce/tags/2.16.5/plugin/PluginHealthHelper.php
r3006736 r3007319 68 68 )"; 69 69 70 require_once(ABSPATH . "wp-admin/includes/upgrade.php"); 71 $queryResult = dbDelta($create_plugin_health_table); 72 73 // Check if table exists at this point before proceeding. 74 // Customers have been facing issue that the table was not created & it hinders other functions of the plugin 75 global $wpdb; 76 if ($wpdb->get_var("SHOW TABLES LIKE '$table'") !== $table) { 77 wc_get_logger()->error("Could not create table - $table \n Query Result - \n" . var_export($queryResult, true), ['source' => 'eshipper']); 70 $tableUpdate = pluginLifeCycle::updateTable($table, $create_plugin_health_table); 71 72 // Case - updated_time default null value was not working on strict SQL settings 73 // Ensure the new structure was applied for 'updated_time' with an explicit alter query 74 global $wpdb; 75 $update = $wpdb->query("ALTER TABLE $table MODIFY COLUMN updated_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP"); 76 77 if (!$update) { 78 wc_get_logger()->error("Health table update query did not run - $table", ['source' => 'eshipper']); 79 } 80 81 82 if (!$tableUpdate) { 78 83 return false; 79 84 } 80 81 wc_get_logger()->debug("Successfully created table - $table", ['source' => 'eshipper']);82 85 83 86 return self::initTable(); -
eshipper-commerce/tags/2.16.5/plugin/pluginLifeCycle.php
r3006736 r3007319 34 34 // All methods called here use dbDelta to create/update the tables 35 35 // and hence always contain the latest structure of the table 36 pluginLifeCycle::createEshipperAccessTokensTable();37 pluginLifeCycle::createEshipperCarrierServicesTable();38 pluginLifeCycle::createEshipperShippingAddressTable();36 self::createEshipperAccessTokensTable(); 37 self::createEshipperCarrierServicesTable(); 38 self::createEshipperShippingAddressTable(); 39 39 40 40 if (version_compare(phpversion(), '8.0', '>=')) { 41 41 PluginHealthHelper::createEshipperPluginHealthTable(); 42 42 } 43 } 44 45 public static function updateTable($table, $query) 46 { 47 wc_get_logger()->debug("Attempting to create table - $table", ['source' => 'eshipper']); 48 49 require_once(ABSPATH . "wp-admin/includes/upgrade.php"); 50 $queryResult = dbDelta($query); 51 52 wc_get_logger()->debug("Query Result - \n" . var_export($queryResult, true), ['source' => 'eshipper']); 53 54 // Check if table exists at this point before proceeding. 55 global $wpdb; 56 if ($wpdb->get_var("SHOW TABLES LIKE '$table'") !== $table) { 57 wc_get_logger()->error("Could not create table - $table", ['source' => 'eshipper']); 58 return false; 59 } 60 61 wc_get_logger()->debug("Successfully created table - $table", ['source' => 'eshipper']); 62 return true; 43 63 } 44 64 … … 171 191 $table = $wpdb->prefix . "eshipper_access_tokens"; 172 192 173 wc_get_logger()->debug("Attempting to create table - $table", ['source' => 'eshipper']);174 175 193 $access_tokens_query = " CREATE TABLE $table( 176 194 p_id int(10) NOT NULL AUTO_INCREMENT, … … 184 202 )"; 185 203 186 require_once(ABSPATH . "wp-admin/includes/upgrade.php"); 187 $queryResult = dbDelta($access_tokens_query); 188 189 if ($wpdb->get_var("SHOW TABLES LIKE '$table'") !== $table) { 190 wc_get_logger()->error("Could not create table - $table \n Query Result - \n" . var_export($queryResult, true), ['source' => 'eshipper']); 191 } 192 193 wc_get_logger()->debug("Successfully created table - $table", ['source' => 'eshipper']); 204 self::updateTable($table, $access_tokens_query); 194 205 } 195 206 … … 203 214 global $wpdb; 204 215 $table = $wpdb->prefix . "eshipper_carrier_service_master"; 205 206 wc_get_logger()->debug("Attempting to create table - $table", ['source' => 'eshipper']);207 216 208 217 $access_tokens_query = " CREATE TABLE $table( … … 218 227 )"; 219 228 220 require_once(ABSPATH . "wp-admin/includes/upgrade.php"); 221 $queryResult = dbDelta($access_tokens_query); 222 223 if ($wpdb->get_var("SHOW TABLES LIKE '$table'") !== $table) { 224 wc_get_logger()->error("Could not create table - $table \n Query Result - \n" . var_export($queryResult, true), ['source' => 'eshipper']); 225 } 226 227 wc_get_logger()->debug("Successfully created table - $table", ['source' => 'eshipper']); 229 self::updateTable($table, $access_tokens_query); 228 230 } 229 231 … … 492 494 $table = $wpdb->prefix . "eshipper_shipping_address"; 493 495 494 wc_get_logger()->debug("Attempting to create table - $table", ['source' => 'eshipper']);495 496 496 $create_shipping_address_query = " CREATE TABLE $table( 497 497 p_id int(10) NOT NULL AUTO_INCREMENT, … … 510 510 )"; 511 511 512 require_once(ABSPATH . "wp-admin/includes/upgrade.php"); 513 $queryResult = dbDelta($create_shipping_address_query); 514 515 if ($wpdb->get_var("SHOW TABLES LIKE '$table'") !== $table) { 516 wc_get_logger()->error("Could not create table - $table \n Query Result - \n" . var_export($queryResult, true), ['source' => 'eshipper']); 517 } 518 519 wc_get_logger()->debug("Successfully created table - $table", ['source' => 'eshipper']); 512 self::updateTable($table, $create_shipping_address_query); 520 513 } 521 514 -
eshipper-commerce/tags/2.16.5/readme.txt
r3006736 r3007319 5 5 Tested up to: 6.3.1 6 6 Requires PHP: 7.1 7 Stable tag: 2.16. 47 Stable tag: 2.16.5 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 54 54 55 55 == Changelog == 56 = 2.16.5 = 57 * Improved update process 58 56 59 = 2.16.4 = 57 60 * Bug fix for 'Update Database' error in Plugin Health page. … … 102 105 103 106 == Upgrade Notice == 107 = 2.16.5 = 108 Improved update process 109 104 110 = 2.16.4 = 105 111 Bug fix for 'Update Database' error in Plugin Health page. -
eshipper-commerce/tags/2.16.5/woocommerce-eshipper.php
r3006736 r3007319 4 4 Plugin URI: https://ww2.eshipper.com/ecommerce/ 5 5 Description: Extends WooCommerce with Shipping Rates from eShipper 6 Version: 2.16. 46 Version: 2.16.5 7 7 Author: eShipper 8 8 Author URI: https://ww2.eshipper.com/ … … 28 28 get_site_option('active_sitewide_plugins') 29 29 ))) { 30 define('ESHIPPER_VERSION', '2.16. 4');30 define('ESHIPPER_VERSION', '2.16.5'); 31 31 define('ESHIPPER_PLUGIN_PATH', dirname(__FILE__)); 32 32 define('ESHIPPER_PLUGIN_FILE', __FILE__); -
eshipper-commerce/trunk/framework/db.php
r3006736 r3007319 14 14 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 15 15 $this->get_collate(); 16 update_option('eshipper_version', ESHIPPER_VERSION);17 16 } 18 17 -
eshipper-commerce/trunk/framework/lib/admin-settings.js
r2984482 r3007319 452 452 console.log(response); 453 453 jQuery('#es-plugin-health-db-update-message').removeClass('es-d-none').html(response.msg); 454 jQuery('#es-plugin-health-db-update-manual').removeClass('es-d-none'); 454 455 } 455 456 }); -
eshipper-commerce/trunk/framework/plugin.php
r3006736 r3007319 43 43 44 44 // Database integration 45 // add_action('init', [&$this, 'eshipper_db']);45 add_action('init', [&$this, 'eshipper_init']); 46 46 47 47 // Wire up product shipping options … … 238 238 public function eshipper_upgrades($upgraderObject, $options) 239 239 { 240 wc_get_logger()->debug('Plugin version updated to ' . ESHIPPER_VERSION . '. Now executing Post-Update tasks.', ['source' => 'eshipper']); 241 240 242 $eshipperPluginPathName = plugin_basename(ESHIPPER_PLUGIN_FILE); 241 243 242 $eshipperUpdated = false;243 244 if ($options['action'] == 'update' && 244 245 $options['type'] == 'plugin' && … … 246 247 in_array($eshipperPluginPathName, $options['plugins']) 247 248 ) { 248 $eshipperUpdated = true; 249 } 250 251 if (!$eshipperUpdated) { 249 // Set a transient to record that our plugin has just been updated 250 set_transient('wp_eshipper_updated', 1); 251 } else { 252 wc_get_logger()->error('Post-Update process interrupted.', ['source' => 'eshipper']); 253 252 254 return; 253 255 } 254 256 255 257 // Now we know that eshipper plugin was updated, so let's do things we're supposed to on updates 256 257 // Set a transient to record that our plugin has just been updated258 set_transient('wp_eshipper_updated', 1);259 258 260 259 // If the plugin is deactivated, activate it again 261 260 require_once(ABSPATH . 'wp-admin/includes/plugin.php'); 262 261 if (!is_plugin_active(plugin_basename(ESHIPPER_PLUGIN_FILE))) { 262 wc_get_logger()->debug('Re-activating plugin.', ['source' => 'eshipper']); 263 263 264 activate_plugin(ESHIPPER_PLUGIN_PATH); 265 266 wc_get_logger()->debug('Re-activated plugin successfully!', ['source' => 'eshipper']); 264 267 } 265 268 266 269 // Apply DB updates 270 wc_get_logger()->debug('Performing DB updates.', ['source' => 'eshipper']); 271 272 require_once(ESHIPPER_PLUGIN_PATH . '/plugin/pluginLifeCycle.php'); 267 273 pluginLifeCycle::updateDB(); 274 275 // Update the version number in options table 276 wc_get_logger()->debug('Updating eshipper version in options table.', ['source' => 'eshipper']); 268 277 update_option('eshipper_version', ESHIPPER_VERSION); 278 279 // DONE 280 wc_get_logger()->debug('Post-Update tasks completed!', ['source' => 'eshipper']); 269 281 } 270 282 … … 345 357 346 358 /** 359 * @deprecated 360 * @return void 361 */ 362 public function eshipper_init() 363 { 364 // Update the version in options table 365 $version = get_option('eshipper_version', '1.0'); 366 if (version_compare($version, ESHIPPER_VERSION, '<')) { 367 update_option('eshipper_version', ESHIPPER_VERSION); 368 } 369 } 370 371 372 /** 347 373 * Load Localisation 348 374 */ -
eshipper-commerce/trunk/framework/shippingmethod.php
r3006736 r3007319 1117 1117 <button class='es-button es-button-primary' id="es-plugin-health-db-update">Update Database</button> 1118 1118 <p class="es-d-none" id="es-plugin-health-db-update-message"></p> 1119 <div class="es-d-none" id="es-plugin-health-db-update-manual"> 1120 <p>To resolve this error, follow the steps below - </p> 1121 <ol> 1122 <li> 1123 Copy the WordPress database table prefix from ‘wp-config.php’ file located at the root of the 1124 WordPress installation. 1125 <br><br> 1126 Look for this line and copy the value - <br> 1127 <code>$table_prefix = 'wp_';</code> 1128 <br><br> 1129 Default value is ‘wp_’ 1130 <br><br> 1131 </li> 1132 <li> 1133 Run the following MySQL query in the database after replacing ‘wp_’ in 1134 ‘wp_eshipper_plugin_health’ with the prefix obtained in Step 1.<br><br> 1135 <code> 1136 CREATE TABLE `wp_eshipper_plugin_health` ( `auth` tinyint(1) DEFAULT '0', `access_keys` tinyint(1) DEFAULT '0', `store_address` tinyint(1) DEFAULT '0', `webhooks` tinyint(1) DEFAULT '0', `carrier_services` tinyint(1) DEFAULT '0', `created_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `updated_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ); 1137 </code> 1138 <br><br> 1139 </li> 1140 <li> 1141 Come back to this page and hit refresh. The error should be gone and you will be able to see this page 1142 properly.<br> 1143 If the issue is still not resolved, please contact eShipper support and we'll be happy to help you 1144 out. 1145 </li> 1146 </ol> 1147 </div> 1119 1148 <?php } ?> 1120 1149 -
eshipper-commerce/trunk/plugin/PluginHealthHelper.php
r3006736 r3007319 68 68 )"; 69 69 70 require_once(ABSPATH . "wp-admin/includes/upgrade.php"); 71 $queryResult = dbDelta($create_plugin_health_table); 72 73 // Check if table exists at this point before proceeding. 74 // Customers have been facing issue that the table was not created & it hinders other functions of the plugin 75 global $wpdb; 76 if ($wpdb->get_var("SHOW TABLES LIKE '$table'") !== $table) { 77 wc_get_logger()->error("Could not create table - $table \n Query Result - \n" . var_export($queryResult, true), ['source' => 'eshipper']); 70 $tableUpdate = pluginLifeCycle::updateTable($table, $create_plugin_health_table); 71 72 // Case - updated_time default null value was not working on strict SQL settings 73 // Ensure the new structure was applied for 'updated_time' with an explicit alter query 74 global $wpdb; 75 $update = $wpdb->query("ALTER TABLE $table MODIFY COLUMN updated_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP"); 76 77 if (!$update) { 78 wc_get_logger()->error("Health table update query did not run - $table", ['source' => 'eshipper']); 79 } 80 81 82 if (!$tableUpdate) { 78 83 return false; 79 84 } 80 81 wc_get_logger()->debug("Successfully created table - $table", ['source' => 'eshipper']);82 85 83 86 return self::initTable(); -
eshipper-commerce/trunk/plugin/pluginLifeCycle.php
r3006736 r3007319 34 34 // All methods called here use dbDelta to create/update the tables 35 35 // and hence always contain the latest structure of the table 36 pluginLifeCycle::createEshipperAccessTokensTable();37 pluginLifeCycle::createEshipperCarrierServicesTable();38 pluginLifeCycle::createEshipperShippingAddressTable();36 self::createEshipperAccessTokensTable(); 37 self::createEshipperCarrierServicesTable(); 38 self::createEshipperShippingAddressTable(); 39 39 40 40 if (version_compare(phpversion(), '8.0', '>=')) { 41 41 PluginHealthHelper::createEshipperPluginHealthTable(); 42 42 } 43 } 44 45 public static function updateTable($table, $query) 46 { 47 wc_get_logger()->debug("Attempting to create table - $table", ['source' => 'eshipper']); 48 49 require_once(ABSPATH . "wp-admin/includes/upgrade.php"); 50 $queryResult = dbDelta($query); 51 52 wc_get_logger()->debug("Query Result - \n" . var_export($queryResult, true), ['source' => 'eshipper']); 53 54 // Check if table exists at this point before proceeding. 55 global $wpdb; 56 if ($wpdb->get_var("SHOW TABLES LIKE '$table'") !== $table) { 57 wc_get_logger()->error("Could not create table - $table", ['source' => 'eshipper']); 58 return false; 59 } 60 61 wc_get_logger()->debug("Successfully created table - $table", ['source' => 'eshipper']); 62 return true; 43 63 } 44 64 … … 171 191 $table = $wpdb->prefix . "eshipper_access_tokens"; 172 192 173 wc_get_logger()->debug("Attempting to create table - $table", ['source' => 'eshipper']);174 175 193 $access_tokens_query = " CREATE TABLE $table( 176 194 p_id int(10) NOT NULL AUTO_INCREMENT, … … 184 202 )"; 185 203 186 require_once(ABSPATH . "wp-admin/includes/upgrade.php"); 187 $queryResult = dbDelta($access_tokens_query); 188 189 if ($wpdb->get_var("SHOW TABLES LIKE '$table'") !== $table) { 190 wc_get_logger()->error("Could not create table - $table \n Query Result - \n" . var_export($queryResult, true), ['source' => 'eshipper']); 191 } 192 193 wc_get_logger()->debug("Successfully created table - $table", ['source' => 'eshipper']); 204 self::updateTable($table, $access_tokens_query); 194 205 } 195 206 … … 203 214 global $wpdb; 204 215 $table = $wpdb->prefix . "eshipper_carrier_service_master"; 205 206 wc_get_logger()->debug("Attempting to create table - $table", ['source' => 'eshipper']);207 216 208 217 $access_tokens_query = " CREATE TABLE $table( … … 218 227 )"; 219 228 220 require_once(ABSPATH . "wp-admin/includes/upgrade.php"); 221 $queryResult = dbDelta($access_tokens_query); 222 223 if ($wpdb->get_var("SHOW TABLES LIKE '$table'") !== $table) { 224 wc_get_logger()->error("Could not create table - $table \n Query Result - \n" . var_export($queryResult, true), ['source' => 'eshipper']); 225 } 226 227 wc_get_logger()->debug("Successfully created table - $table", ['source' => 'eshipper']); 229 self::updateTable($table, $access_tokens_query); 228 230 } 229 231 … … 492 494 $table = $wpdb->prefix . "eshipper_shipping_address"; 493 495 494 wc_get_logger()->debug("Attempting to create table - $table", ['source' => 'eshipper']);495 496 496 $create_shipping_address_query = " CREATE TABLE $table( 497 497 p_id int(10) NOT NULL AUTO_INCREMENT, … … 510 510 )"; 511 511 512 require_once(ABSPATH . "wp-admin/includes/upgrade.php"); 513 $queryResult = dbDelta($create_shipping_address_query); 514 515 if ($wpdb->get_var("SHOW TABLES LIKE '$table'") !== $table) { 516 wc_get_logger()->error("Could not create table - $table \n Query Result - \n" . var_export($queryResult, true), ['source' => 'eshipper']); 517 } 518 519 wc_get_logger()->debug("Successfully created table - $table", ['source' => 'eshipper']); 512 self::updateTable($table, $create_shipping_address_query); 520 513 } 521 514 -
eshipper-commerce/trunk/readme.txt
r3006736 r3007319 5 5 Tested up to: 6.3.1 6 6 Requires PHP: 7.1 7 Stable tag: 2.16. 47 Stable tag: 2.16.5 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 54 54 55 55 == Changelog == 56 = 2.16.5 = 57 * Improved update process 58 56 59 = 2.16.4 = 57 60 * Bug fix for 'Update Database' error in Plugin Health page. … … 102 105 103 106 == Upgrade Notice == 107 = 2.16.5 = 108 Improved update process 109 104 110 = 2.16.4 = 105 111 Bug fix for 'Update Database' error in Plugin Health page. -
eshipper-commerce/trunk/woocommerce-eshipper.php
r3006736 r3007319 4 4 Plugin URI: https://ww2.eshipper.com/ecommerce/ 5 5 Description: Extends WooCommerce with Shipping Rates from eShipper 6 Version: 2.16. 46 Version: 2.16.5 7 7 Author: eShipper 8 8 Author URI: https://ww2.eshipper.com/ … … 28 28 get_site_option('active_sitewide_plugins') 29 29 ))) { 30 define('ESHIPPER_VERSION', '2.16. 4');30 define('ESHIPPER_VERSION', '2.16.5'); 31 31 define('ESHIPPER_PLUGIN_PATH', dirname(__FILE__)); 32 32 define('ESHIPPER_PLUGIN_FILE', __FILE__);
Note: See TracChangeset
for help on using the changeset viewer.