-
Notifications
You must be signed in to change notification settings - Fork 1
What if get_option( 'NF_Videomail_Version' ) is undefined? #42
Copy link
Copy link
Open
Description
@kjohnson I'm afraid your PR didn't resolve the problem. My customer re-enabled the LiteSpeed plugin and the error is still happening:
Uncaught ReferenceError: VideomailClient is not defined
The VideomailClient doesn't exist in the global scope. But it's being loaded, I can see in the network tab. Wondering if LiteSpeed plugin is messing with the global scope?
Furthermore, I've double-checked your code:
public function plugin_update_check() {
// Check if current version is newer.
if(version_compare( self::VERSION, get_option( 'NF_Videomail_Version' ), '>' )) {
// Purge LiteSpeed cache.
!class_exists('\LiteSpeed\Purge') || \LiteSpeed\Purge::purge_all();
// Finally, update the stored version for future checks.
update_option('NF_Videomail_Version', self::VERSION);
}
}I think we forgot something: when the user updates the plugin for the first time, then get_option( 'NF_Videomail_Version' ) is actually undefined and thus, version comparison is impossible. We need to add an extra check to purge cache when this option does not exist yet.
Thoughts?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels