Skip to content

Commit

Permalink
fix: add prefix to transient name
Browse files Browse the repository at this point in the history
  • Loading branch information
ravinderk committed Aug 4, 2023
1 parent c2fd377 commit 620f8ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ public static function build_available_authorized_sites( $user_id = false, $cont
$last_changed = self::set_sites_last_changed_time();
}

$cache_key = "authorized_sites:$user_id:$context:$last_changed";
$cache_key = "dt_authorized_sites:$user_id:$context:$last_changed";
$authorized_sites = get_transient( $cache_key );

if ( $force || false === $authorized_sites ) {
Expand Down
10 changes: 10 additions & 0 deletions uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,13 @@
delete_option( 'dt_settings' );
delete_option( 'dt_sync_log' );
}

// Delete options.
$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'dt\_%';" );

Check warning on line 22 in uninstall.php

View workflow job for this annotation

GitHub Actions / phpcs

Usage of a direct database call is discouraged.

Check warning on line 22 in uninstall.php

View workflow job for this annotation

GitHub Actions / phpcs

Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete().

// Remove transients.
$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '_transients\_dt\_%';" );

Check warning on line 25 in uninstall.php

View workflow job for this annotation

GitHub Actions / phpcs

Usage of a direct database call is discouraged.

Check warning on line 25 in uninstall.php

View workflow job for this annotation

GitHub Actions / phpcs

Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete().

// Delete our data from the post and post meta tables.
$wpdb->query( "DELETE FROM {$wpdb->posts} WHERE post_type IN ( 'dt_subscription', 'dt_ext_connection' );" );

Check warning on line 28 in uninstall.php

View workflow job for this annotation

GitHub Actions / phpcs

Usage of a direct database call is discouraged.

Check warning on line 28 in uninstall.php

View workflow job for this annotation

GitHub Actions / phpcs

Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete().
$wpdb->query( "DELETE meta FROM {$wpdb->postmeta} meta LEFT JOIN {$wpdb->posts} posts ON posts.ID = meta.post_id WHERE posts.ID IS NULL;" );

Check warning on line 29 in uninstall.php

View workflow job for this annotation

GitHub Actions / phpcs

Usage of a direct database call is discouraged.

Check warning on line 29 in uninstall.php

View workflow job for this annotation

GitHub Actions / phpcs

Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete().

0 comments on commit 620f8ef

Please sign in to comment.