From c01885f52eda58c7ca413dada931ad7ab44e3b4c Mon Sep 17 00:00:00 2001 From: Karim Date: Thu, 27 Jun 2024 12:17:38 +0200 Subject: [PATCH] Fixing the class name and small issues --- .gitignore | 1 + src/LicenseHandler.php | 15 +++++++-------- src/changelog.txt | 4 +++- 3 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..20cc52c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +phpcs.xml diff --git a/src/LicenseHandler.php b/src/LicenseHandler.php index f46c8f0..5184987 100644 --- a/src/LicenseHandler.php +++ b/src/LicenseHandler.php @@ -12,7 +12,7 @@ namespace GravityWP\LicenseHandler; use GFCommon; -use GravityWP\Updater; +use GravityWP\Updater\Plugin_Updater; defined( 'ABSPATH' ) || die(); @@ -172,7 +172,6 @@ class LicenseHandler { * @since 1.0 * * @param string $gwp_addon_class GravityWP GF Addon classname. - * @param string $license_hash Paddlepress license hash for this Addon. * @param string $plugin_file_path Path to main plugin file. * * @return void @@ -182,15 +181,15 @@ public function __construct( $gwp_addon_class, $plugin_file_path ) { if ( ! current_user_can( 'manage_options' ) && ! $doing_cron ) { return; } - $this->_addon_class = $gwp_addon_class; - $this->_addon_file_path = $plugin_file_path; - $this->_addon_slug = $gwp_addon_class::get_instance()->get_slug(); - $this->_addon_license = $gwp_addon_class::get_instance()->get_plugin_setting( $this->_addon_slug . '_license_key' ); + $this->_addon_class = $gwp_addon_class; + $this->_addon_file_path = $plugin_file_path; + $this->_addon_slug = $gwp_addon_class::get_instance()->get_slug(); + $this->_addon_license = $gwp_addon_class::get_instance()->get_plugin_setting( $this->_addon_slug . '_license_key' ); $this->initialize_paddlepress_client(); } /** - * Initialize or reinitialize the Paddlepress client . + * Initialize or reinitialize the Paddlepress client. * * @return bool */ @@ -202,7 +201,7 @@ public function initialize_paddlepress_client( $field_setting = null ) { $this->_license_handler = new Plugin_Updater( $this->_addon_file_path, array( - 'version' => $gwp_addon_class::get_instance()->version, // current version number. + 'version' => $this->_addon_class::get_instance()->get_version(), // current version number. 'license_key' => $license_key, // license key (used get_option above to retrieve from DB)..'error' 'license_url' => home_url(), // license domain. 'download_tag' => $this->_addon_slug, // download tag slug. diff --git a/src/changelog.txt b/src/changelog.txt index 3a5f611..542b9da 100644 --- a/src/changelog.txt +++ b/src/changelog.txt @@ -1,5 +1,7 @@ += 2.0.3 = +- Fixing the class name and small issues. -= 1.1.0 = += 2.0.0 = - Update license handler to support and work with Paddlepress Pro. = 1.0.21 =