Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion includes/class-api-utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
40 changes: 36 additions & 4 deletions includes/class-updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ] );
}
Expand All @@ -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 );

Expand Down Expand Up @@ -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;
Expand All @@ -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', '' );
}
}