From b81914ad54545d9e9bc58b35e0ce2fcd9007bde3 Mon Sep 17 00:00:00 2001 From: UVLabs Date: Sun, 6 Feb 2022 11:39:51 -0400 Subject: [PATCH] chore: syncing --- .husky/pre-commit | 1 + assets/admin/js/order-map.js | 1 + includes/Controllers/Emails_Controller.php | 4 ++-- includes/Notices/Notice.php | 6 +++++- includes/Traits/Upload_Folders.php | 2 +- lpac.php | 4 ++-- readme.txt | 8 ++++++-- 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 8ab6149..0fce77d 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,3 +2,4 @@ . "$(dirname "$0")/_/husky.sh" npm run format +composer run format \ No newline at end of file diff --git a/assets/admin/js/order-map.js b/assets/admin/js/order-map.js index 025d1fe..b98a2f3 100644 --- a/assets/admin/js/order-map.js +++ b/assets/admin/js/order-map.js @@ -1,4 +1,5 @@ function lpacSetupShopOrderMap() { + /** These values are coming from the base-map.js enqueued from our maps folder */ const map = window.lpac_map; const marker = window.lpac_marker; const infowindow = window.lpac_infowindow; diff --git a/includes/Controllers/Emails_Controller.php b/includes/Controllers/Emails_Controller.php index 663c950..168fddf 100644 --- a/includes/Controllers/Emails_Controller.php +++ b/includes/Controllers/Emails_Controller.php @@ -113,7 +113,7 @@ private function create_delivery_location_link_qrcode( $link, $order_id ) { /* * https://example.com/wp-content/uploads/lpac/qr-codes/order_id.jpg */ - $qr_code_link = $this->get_resource_url( $folder_name, $order_id, '.jpg' ); + $qr_code_link = $this->get_resource_url( $folder_name, $order_id ); $delivery_location_text = __( 'Delivery Location', 'map-location-picker-at-checkout-for-woocommerce' ); $delivery_location_text = apply_filters( 'lpac_email_map_location_link_button_text', $delivery_location_text ); @@ -166,7 +166,7 @@ private function create_delivery_location_static_map( $order_id, $map_link, $lat return; } - $image_src = $this->get_resource_url( $folder_name, $order_id, '.jpg' ); + $image_src = $this->get_resource_url( $folder_name, $order_id ); $width = ''; $height = ''; diff --git a/includes/Notices/Notice.php b/includes/Notices/Notice.php index 9c51085..c3c8fe7 100644 --- a/includes/Notices/Notice.php +++ b/includes/Notices/Notice.php @@ -64,8 +64,12 @@ protected function create_notice_markup( string $notice_id, array $content ) { $dismissed_notices = $this->get_dismissed_notices(); + if ( ! is_array( $dismissed_notices ) ) { + return; // Bail if received value type is unexpected. + } + # Bail if this notice has been dismissed - if ( in_array( $notice_id, $dismissed_notices ) ) { + if ( in_array( $notice_id, $dismissed_notices, true ) ) { return; } diff --git a/includes/Traits/Upload_Folders.php b/includes/Traits/Upload_Folders.php index 817a7f6..7758974 100644 --- a/includes/Traits/Upload_Folders.php +++ b/includes/Traits/Upload_Folders.php @@ -62,7 +62,7 @@ private function create_upload_folder( string $folder_name ) { * @param string $ext * @return string The upload URL */ - private function get_resource_url( string $folder_name, int $order_id, string $ext ) { + private function get_resource_url( string $folder_name, int $order_id, string $ext = '.jpg' ) { $upload_url = wp_upload_dir()['baseurl']; diff --git a/lpac.php b/lpac.php index 7abd337..cfe4df9 100644 --- a/lpac.php +++ b/lpac.php @@ -17,7 +17,7 @@ * Plugin Name: Location Picker At Checkout For WooCommerce * Plugin URI: https://lpacwp.com * Description: Allow customers to choose their shipping location using a map at checkout. - * Version: 1.4.3-lite + * Version: 1.4.4-lite * Author: Uriahs Victor * Author URI: https://uriahsvictor.com * License: GPL-2.0+ @@ -33,7 +33,7 @@ die; } if ( !defined( 'LPAC_VERSION' ) ) { - define( 'LPAC_VERSION', '1.4.3' ); + define( 'LPAC_VERSION', '1.4.4' ); } /** * The code that runs during plugin activation. diff --git a/readme.txt b/readme.txt index cbf8646..8169e48 100644 --- a/readme.txt +++ b/readme.txt @@ -4,8 +4,8 @@ Donate link: https://uriahsvictor.com Tags: woocommerce, location picker, checkout map, geolocation, google map, map, delivery map Requires at least: 5.5 Requires PHP: 7.0 -Tested up to: 5.8 -Stable tag: 1.4.3 +Tested up to: 5.9 +Stable tag: 1.4.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -164,6 +164,10 @@ The save location of QR codes have been changed. Links to QR codes in past order == Changelog == += 1.4.4 = +* [Fix] Error caused when dismissed notices returns a string. +* [Info] Tested on WP 5.9 + = 1.4.3 = * [New PRO] Option to change the type of results returned by the Places Autocomplete API (Geocode, Address, Establishment, Regions, Cities) * [Fix] Console error when Billing City field was not present on checkout page.