diff --git a/CHANGELOG.md b/CHANGELOG.md index 6229f5e6..65eded29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/). +## [5.6.4] + +### Fixed + +- Usage condition for Clearbit cron job. + ## [5.6.3] ### Fixed @@ -860,6 +866,7 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a - Initial production release. +[5.6.4]: https://github.com/infinum/eightshift-forms/compare/5.6.3...5.6.4 [5.6.3]: https://github.com/infinum/eightshift-forms/compare/5.6.2...5.6.3 [5.6.2]: https://github.com/infinum/eightshift-forms/compare/5.6.1...5.6.2 [5.6.1]: https://github.com/infinum/eightshift-forms/compare/5.6.0...5.6.1 diff --git a/eightshift-forms.php b/eightshift-forms.php index b4fd46f0..848c1ebc 100644 --- a/eightshift-forms.php +++ b/eightshift-forms.php @@ -6,7 +6,7 @@ * Description: Eightshift Forms is a complete form builder plugin that utilizes modern Block editor features with multiple third-party integrations, bringing your project to a new level. * Author: WordPress team @Infinum * Author URI: https://eightshift.com/ - * Version: 5.6.3 + * Version: 5.6.4 * Text Domain: eightshift-forms * * @package EightshiftForms diff --git a/src/CronJobs/ClearbitJob.php b/src/CronJobs/ClearbitJob.php index 91e82736..5e55502c 100644 --- a/src/CronJobs/ClearbitJob.php +++ b/src/CronJobs/ClearbitJob.php @@ -66,13 +66,6 @@ public function __construct( */ public function register(): void { - $use = \apply_filters(SettingsClearbit::FILTER_SETTINGS_GLOBAL_IS_VALID_NAME, false); - $useCron = UtilsSettingsHelper::isOptionCheckboxChecked(SettingsClearbit::SETTINGS_CLEARBIT_USE_JOBS_QUEUE_KEY, SettingsClearbit::SETTINGS_CLEARBIT_USE_JOBS_QUEUE_KEY); - - if (!$use || !$useCron) { - return; - } - \add_action('admin_init', [$this, 'checkIfJobIsSet']); \add_filter('cron_schedules', [$this, 'addJobToSchedule']); // phpcs:ignore WordPress.WP.CronInterval.CronSchedulesInterval \add_action(self::JOB_NAME, [$this, 'getJobCallback']); @@ -118,9 +111,11 @@ public function addJobToSchedule(array $schedules): array */ public function getJobCallback() { + $use = \apply_filters(SettingsClearbit::FILTER_SETTINGS_GLOBAL_IS_VALID_NAME, false); + $useCron = UtilsSettingsHelper::isOptionCheckboxChecked(SettingsClearbit::SETTINGS_CLEARBIT_USE_JOBS_QUEUE_KEY, SettingsClearbit::SETTINGS_CLEARBIT_USE_JOBS_QUEUE_KEY); $jobs = UtilsSettingsHelper::getOptionValueGroup(SettingsClearbit::SETTINGS_CLEARBIT_JOBS_KEY); - if (!$jobs) { + if (!$use || !$useCron || !$jobs) { return; } diff --git a/src/Integrations/Clearbit/SettingsClearbit.php b/src/Integrations/Clearbit/SettingsClearbit.php index 13921a0f..f710fc0b 100644 --- a/src/Integrations/Clearbit/SettingsClearbit.php +++ b/src/Integrations/Clearbit/SettingsClearbit.php @@ -110,7 +110,7 @@ public function register(): void { \add_filter(self::FILTER_SETTINGS_NAME, [$this, 'getSettingsData']); \add_filter(self::FILTER_SETTINGS_GLOBAL_NAME, [$this, 'getSettingsGlobalData']); - \add_filter(self::FILTER_SETTINGS_IS_VALID_NAME, [$this, 'isSettingsValid'], 10, 2); + \add_filter(self::FILTER_SETTINGS_IS_VALID_NAME, [$this, 'isSettingsValid']); \add_filter(self::FILTER_SETTINGS_GLOBAL_IS_VALID_NAME, [$this, 'isSettingsGlobalValid']); } @@ -118,13 +118,12 @@ public function register(): void * Determine if settings are valid. * * @param string $formId Form ID. - * @param string $type Integration type. * * @return boolean */ - public function isSettingsValid(string $formId, string $type): bool + public function isSettingsValid(string $formId): bool { - if (!$this->isSettingsGlobalValid($type)) { + if (!$this->isSettingsGlobalValid()) { return false; } @@ -140,17 +139,14 @@ public function isSettingsValid(string $formId, string $type): bool /** * Determine if settings global are valid. * - * @param string $type Integration type. - * * @return boolean */ - public function isSettingsGlobalValid(string $type = ''): bool + public function isSettingsGlobalValid(): bool { $isUsed = UtilsSettingsHelper::isOptionCheckboxChecked(self::SETTINGS_CLEARBIT_USE_KEY, self::SETTINGS_CLEARBIT_USE_KEY); $apiKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyClearbit(), self::SETTINGS_CLEARBIT_API_KEY_KEY)['value']; - $map = !empty($type) ? UtilsSettingsHelper::getOptionValueGroup(self::SETTINGS_CLEARBIT_MAP_HUBSPOT_KEYS_KEY . '-' . $type) : true; - if (!$isUsed || !$apiKey || !$map) { + if (!$isUsed || !$apiKey) { return false; } diff --git a/src/Integrations/Talentlyft/SettingsTalentlyft.php b/src/Integrations/Talentlyft/SettingsTalentlyft.php index 93922405..fa45f2e7 100644 --- a/src/Integrations/Talentlyft/SettingsTalentlyft.php +++ b/src/Integrations/Talentlyft/SettingsTalentlyft.php @@ -303,7 +303,7 @@ public function getSettingsGlobalData(): array 'stepsTitle' => \__('How to get the API key?', 'eightshift-forms'), 'stepsContent' => [ // translators: %s will be replaced with the link. - \sprintf(\__('Log in to your Talentlyft Account.', 'eightshift-forms'), 'https://app.talentlyft.io/'), + \sprintf(\__('Log in to your Talentlyft Account.', 'eightshift-forms'), 'https://app.talentlyft.com/'), // translators: %s will be replaced with the link. \sprintf(\__('Go to Integrations Settings.', 'eightshift-forms'), 'https://app.talentlyft.com/infinum/settings/integrations'), \__('Click on Settings under the TalentLyft card.', 'eightshift-forms'),