prefix!==$prefix){return $result;} $ok=true; foreach(array('orderguard_hist_clients','orderguard_review_count','og_hist_clients','og_review_count') as $key){ try{delete_transient($key); // Clear persistent and Options API caches, including historical autoloaded entries. wp_cache_delete($key,'transient'); foreach(array('_transient_'.$key,'_transient_timeout_'.$key,'alloptions','notoptions') as $option){wp_cache_delete($option,'options');} $found=false;wp_cache_get($key,'transient',true,$found);if($found){$ok=false;} // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- OrderGuard's own tables or exact transactional reads/writes; no WordPress API covers these; must read current database state (locks, claims, delete checks); caching would be wrong $n=$wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->options} WHERE option_name IN (%s,%s)",'_transient_'.$key,'_transient_timeout_'.$key)); if($wpdb->last_error!==''||$n===null||(int)$n!==0){$ok=false;} foreach(array('_transient_'.$key,'_transient_timeout_'.$key,'alloptions','notoptions') as $option){$found=false;wp_cache_get($option,'options',true,$found);if($found){$ok=false;}} }catch(Throwable $e){$ok=false;} } if($ok){$result['flag_display_cache']='evicted';$result['requires_reconciliation']=($result['status']==='unknown');} }catch(Throwable $e){/* Preserve committed / unknown outcome; never retry database mutation here. */} return $result; } }