From 9fb0c254dcbc7036ca30a133a2001e104f01f92a Mon Sep 17 00:00:00 2001 From: 4suredev <64234115+4suredev@users.noreply.github.com> Date: Mon, 26 May 2025 09:38:22 +0800 Subject: [PATCH 1/2] Update to fix minor bugs --- avada-dynamic-video-lightbox.php | 2 +- updater.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/avada-dynamic-video-lightbox.php b/avada-dynamic-video-lightbox.php index ecba980..3ef6328 100644 --- a/avada-dynamic-video-lightbox.php +++ b/avada-dynamic-video-lightbox.php @@ -3,7 +3,7 @@ * Plugin Name: 4sure - Avada Dynamic Video Lightbox * Plugin URI: https://4sure.com.au * Description: Insert a youtube or vimeo link that plays in a lightbox. Use [lightbox_video url=""]. Add a custom thumbnail using the 'img' parameter. - * Version: 1.0.9 + * Version: 1.0.10 * Author: 4sure * Author URI: https://4sure.com.au */ diff --git a/updater.php b/updater.php index c28c218..0b3a782 100644 --- a/updater.php +++ b/updater.php @@ -63,7 +63,7 @@ class Avada_dynamic_lightbox_updater { if( $transient->checked ) { // Did WordPress check for updates? $checked = $transient->checked; $this->get_repository_info(); // Get the repo info - if (isset($checked[$this->basename]) != null) { + if (!empty($checked[$this->basename])) { $out_of_date = version_compare( $this->github_response['tag_name'], $checked[$this->basename], 'gt' ); // Check if we're out of date } else { $out_of_date = false; From 73e9944354b0cc3a9146539aa53e285e3110158c Mon Sep 17 00:00:00 2001 From: 4suredev <64234115+4suredev@users.noreply.github.com> Date: Thu, 19 Jun 2025 09:30:51 +0800 Subject: [PATCH 2/2] Check response before comparing versions --- avada-dynamic-video-lightbox.php | 2 +- updater.php | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/avada-dynamic-video-lightbox.php b/avada-dynamic-video-lightbox.php index 3ef6328..d04945d 100644 --- a/avada-dynamic-video-lightbox.php +++ b/avada-dynamic-video-lightbox.php @@ -3,7 +3,7 @@ * Plugin Name: 4sure - Avada Dynamic Video Lightbox * Plugin URI: https://4sure.com.au * Description: Insert a youtube or vimeo link that plays in a lightbox. Use [lightbox_video url=""]. Add a custom thumbnail using the 'img' parameter. - * Version: 1.0.10 + * Version: 1.0.11 * Author: 4sure * Author URI: https://4sure.com.au */ diff --git a/updater.php b/updater.php index 0b3a782..2bc6e48 100644 --- a/updater.php +++ b/updater.php @@ -60,15 +60,14 @@ class Avada_dynamic_lightbox_updater { } public function modify_transient( $transient ) { if( property_exists( $transient, 'checked') ) { // Check if transient has a checked property - if( $transient->checked ) { // Did WordPress check for updates? - $checked = $transient->checked; + if( $checked = $transient->checked ) { // Did WordPress check for updates? $this->get_repository_info(); // Get the repo info - if (!empty($checked[$this->basename])) { - $out_of_date = version_compare( $this->github_response['tag_name'], $checked[$this->basename], 'gt' ); // Check if we're out of date + if( is_array($this->github_response) && !empty($this->github_response['tag_name']) && !empty($checked[$this->basename]) ) { // Check response + $out_of_date = version_compare( $this->github_response['tag_name'], $checked[$this->basename], 'gt' ); // Check if we're out of date } else { $out_of_date = false; } - if( $out_of_date != false ) { + if( $out_of_date ) { $new_files = $this->github_response['zipball_url']; // Get the ZIP $slug = current( explode('/', $this->basename ) ); // Create valid slug $plugin = array( // setup our plugin info