Changeset 3176363
- Timestamp:
- 10/27/2024 01:15:00 PM (18 months ago)
- Location:
- bosta-woocommerce
- Files:
-
- 15 added
- 2 edited
-
tags/3.0.12 (added)
-
tags/3.0.12/Css (added)
-
tags/3.0.12/Css/main.css (added)
-
tags/3.0.12/assets (added)
-
tags/3.0.12/assets/images (added)
-
tags/3.0.12/assets/images/bosta.svg (added)
-
tags/3.0.12/assets/images/refresh.png (added)
-
tags/3.0.12/assets/images/refreshIcon.png (added)
-
tags/3.0.12/bosta-woocommerce.php (added)
-
tags/3.0.12/components (added)
-
tags/3.0.12/components/pickups (added)
-
tags/3.0.12/components/pickups/pickups.css (added)
-
tags/3.0.12/components/pickups/pickups.php (added)
-
tags/3.0.12/readme.txt (added)
-
tags/3.0.12/uninstall.php (added)
-
trunk/bosta-woocommerce.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bosta-woocommerce/trunk/bosta-woocommerce.php
r3017345 r3176363 5 5 * Author: Bosta 6 6 * Author URI: https://www.bosta.co/ 7 * Version: 3.0.1 17 * Version: 3.0.12 8 8 * Requires at least: 5.0 9 9 * php version 7.0 10 * Tested up to: 6. 1.110 * Tested up to: 6.6.1 11 11 * WC requires at least: 2.6 12 * WC tested up to: 7.2.212 * WC tested up to: 9.3.3 13 13 * Text Domain: bosta-woocommerce 14 14 * Domain Path: /languages … … 24 24 25 25 const BOSTA_ENV_URL = 'https://app.bosta.co/api/v0'; 26 const PLUGIN_VERSION = '3.0.1 1';26 const PLUGIN_VERSION = '3.0.12'; 27 27 const bosta_cache_duration = 86400; 28 28 const bosta_country_id_duration = 604800; … … 30 30 add_action('admin_print_styles', 'bosta_stylesheet'); 31 31 32 function checkValidApiKey($bostaApiKey) { 33 if($bostaApiKey == null){ 34 return false; 35 } 36 37 $url = BOSTA_ENV_URL . '/businesses/' . esc_html($bostaApiKey). '/info'; 38 $business_result = wp_remote_get($url, array( 39 'timeout' => 30, 40 'method' => 'GET', 41 'headers' => array( 42 'Content-Type' => 'application/json', 43 'X-Requested-By' => 'WooCommerce', 44 'X-Plugin-Version' => PLUGIN_VERSION 45 ), 46 )); 47 48 $response_body = wp_remote_retrieve_body($business_result); 49 50 $response_code = wp_remote_retrieve_response_code($business_result); 51 52 if (is_wp_error($business_result) || $response_code!==200 || $response_body =='null' ) { 53 return false; 54 } 55 56 return true; 57 58 } 59 32 60 function bosta_get_api_key() { 33 if(isset(get_option('woocommerce_bosta_settings')['APIKey'])){ 34 return sanitize_text_field(get_option('woocommerce_bosta_settings')['APIKey']); 61 $apikey = get_option('woocommerce_bosta_settings')['APIKey']; 62 if(isset($apikey) ){ 63 return sanitize_text_field($apikey); 35 64 } 65 36 66 } 37 67 … … 1191 1221 ), 1192 1222 ); 1223 } 1224 public function process_admin_options() 1225 { 1226 $settings_saved = parent::process_admin_options(); 1227 1228 $apikey = $this->get_option('APIKey'); 1229 if (empty($apikey)) { 1230 WC_Admin_Settings::add_error(__('Error: API Key is required.', 'bosta')); 1231 $settings_saved = false; 1232 } elseif (!checkValidApiKey($apikey)) { 1233 WC_Admin_Settings::add_error(__('Error: API Key is invalid.', 'bosta')); 1234 $settings_saved = false; 1235 } 1236 1237 return $settings_saved; 1193 1238 } 1194 1239 } -
bosta-woocommerce/trunk/readme.txt
r3017345 r3176363 6 6 Requires at least: 5.0 7 7 Requires PHP: 7.0 8 Tested up to: 6. 1.19 Stable tag: 3.0.1 18 Tested up to: 6.6.1 9 Stable tag: 3.0.12 10 10 WC requires at least: 2.6 11 WC tested up to: 7.2.211 WC tested up to: 9.3.3 12 12 License: GPLv3 13 13 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 194 194 = 3.0.11 = 195 195 * Bug Fixes 196 197 = 3.0.12 = 198 * Upgrading Tested Up to Versions
Note: See TracChangeset
for help on using the changeset viewer.