-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclear-cache.php
More file actions
24 lines (19 loc) · 798 Bytes
/
clear-cache.php
File metadata and controls
24 lines (19 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
/**
* Clear AI response cache or disable caching
*/
// Load WordPress
require_once '/var/www/html/wp-load.php';
// Get current settings
$settings = get_option('wp_content_flow_settings', array());
echo "Current cache setting: " . ($settings['cache_enabled'] ? 'ENABLED' : 'DISABLED') . "\n";
// Option 1: Clear all transients (cache)
global $wpdb;
$sql = "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_wp_content_flow_ai_%' OR option_name LIKE '_transient_timeout_wp_content_flow_ai_%'";
$deleted = $wpdb->query($sql);
echo "Cleared $deleted cache entries\n";
// Option 2: Disable cache temporarily
$settings['cache_enabled'] = false;
update_option('wp_content_flow_settings', $settings);
echo "Cache disabled\n";
echo "\nNow the plugin will make fresh API calls.\n";