Changeset 3423676
- Timestamp:
- 12/19/2025 12:57:39 PM (3 months ago)
- Location:
- bigship-rest-api/trunk
- Files:
-
- 2 edited
-
Bigship-admin-rest-api.php (modified) (7 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bigship-rest-api/trunk/Bigship-admin-rest-api.php
r3423652 r3423676 157 157 } 158 158 159 // ✅ RESTORED ORIGINAL LOGIC160 159 if ($existing && !$force_regenerate) { 161 160 return new WP_REST_Response([ … … 169 168 } 170 169 171 // Regeneration: delete old key if exists172 170 if ($force_regenerate && $existing) { 173 171 // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching … … 177 175 ['%d'] 178 176 ); 179 // phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching177 // phpcs:enable 180 178 } 181 179 … … 195 193 ] 196 194 ); 197 // phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching195 // phpcs:enable 198 196 199 197 $key_id = $wpdb->insert_id; … … 229 227 ['%d'] 230 228 ); 231 // phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching229 // phpcs:enable 232 230 233 231 wp_cache_delete('bigship_wc_keys_' . $user_id); … … 235 233 delete_user_meta($user_id, 'bigship_consumer_secret'); 236 234 delete_user_meta($user_id, 'bigship_key_id'); 237 delete_user_meta($user_id, 'bigshiprestapi_api_token');235 // ✅ DO NOT delete bigshiprestapi_api_token here 238 236 239 237 return new WP_REST_Response([ … … 244 242 } 245 243 246 // Flush rewrites247 244 register_activation_hook(__FILE__, 'flush_rewrite_rules'); 248 245 register_deactivation_hook(__FILE__, 'flush_rewrite_rules'); -
bigship-rest-api/trunk/readme.txt
r3423652 r3423676 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 57 Stable tag: 1.0.6 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 27 27 28 28 == Changelog == 29 30 = 1.0.6 = 31 * Fixed issue where API authentication token was unintentionally invalidated during WooCommerce key revocation. 32 * Ensured user context is preserved when regenerating keys after revocation. 33 * No changes to existing API contracts or permissions. 29 34 30 35 = 1.0.5 =
Note: See TracChangeset
for help on using the changeset viewer.