diff --git a/includes/class-api-utility.php b/includes/class-api-utility.php index 03bfe093..b564e04b 100644 --- a/includes/class-api-utility.php +++ b/includes/class-api-utility.php @@ -196,7 +196,7 @@ public function parse_access_token_data( string $access_token ) { return []; } $connecting_account['account'] = $parsed_payload_data['sub']; - $connecting_account['site'] = get_site_url(); + $connecting_account['site'] = parse_url( get_site_url(), PHP_URL_HOST ); } return $connecting_account; diff --git a/includes/class-updates.php b/includes/class-updates.php index b5d6526f..9712033d 100644 --- a/includes/class-updates.php +++ b/includes/class-updates.php @@ -42,7 +42,7 @@ public function __construct( object $plugin ) { * * @since 1.0.0 */ - public function hooks() { + public function hooks(): void { if ( is_admin() ) { add_action( 'plugins_loaded', [ $this, 'check_for_update_needed' ] ); } @@ -54,12 +54,12 @@ public function hooks() { * * @since 1.0.0 */ - public function check_for_update_needed() { + public function check_for_update_needed(): void { $installed = get_option( 'ctct_plugin_version', '0.0.0' ); $current = esc_attr( $this->plugin->version ); - if ( ! version_compare( $current, $installed, '<' ) ) { + if ( ! version_compare( $current, $installed, '<' ) && $current !== $installed ) { update_option( 'ctct_plugin_version', $current, true ); @@ -88,7 +88,7 @@ public function check_for_update_needed() { * * @param string $update_id Update key to use for version. */ - public function add_notification( string $update_id ) { + public function add_notification( string $update_id ): void { $current_notifs = get_option( 'ctct_update_notifications', [] ); $compare_notifs = $current_notifs; @@ -111,4 +111,36 @@ public function add_notification( string $update_id ) { } } + /** + * Version 2.19.0 to 2.22.0. + * + * Force delete this option value due to changing how much gets hashed. + * + * @since 2.22.0 + */ + public function run_update_v2_19_0_to_v2_22_0(): void { + update_option( 'ctct_account_domain_hash', '' ); + } + + /** + * Version 2.20.0 to 2.22.0 + * + * Force delete this option value due to changing how much gets hashed. + * + * @since 2.22.0 + */ + public function run_update_v2_20_0_to_v2_22_0(): void { + update_option( 'ctct_account_domain_hash', '' ); + } + + /** + * Version 2.21.0 to 2.22.0 + * + * Force delete this option value due to changing how much gets hashed. + * + * @since 2.22.0 + */ + public function run_update_v2_21_0_to_v2_22_0(): void { + update_option( 'ctct_account_domain_hash', '' ); + } }