Skip to content

Commit

Permalink
Added: migration script for self hosters using the (old) shared link …
Browse files Browse the repository at this point in the history
…option.
  • Loading branch information
Dan0sz committed Jan 31, 2024
1 parent f23e2e7 commit 95607fb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Admin/Upgrades.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ private function upgrade_to_200() {
$settings[ $option_name ] = 'on';
}

/**
* Migrate the shared link option for self hosters who use it.
*/
if ( ! empty( $settings[ 'self_hosted_domain' ] ) && ! empty( $settings[ 'shared_link' ] ) ) {
$settings[ 'self_hosted_shared_link' ] = $settings[ 'shared_link' ];
$settings[ 'shared_link' ] = '';
}

update_option( 'plausible_analytics_settings', $settings );

update_option( 'plausible_analytics_version', '2.0.0' );
Expand Down

0 comments on commit 95607fb

Please sign in to comment.