various improvements to make release 1 complete

This commit is contained in:
Reindl David (IT-PTR-CEN2-SL10)
2026-03-27 13:59:28 +01:00
parent 9ea962131a
commit 6b9c3fefa1
37 changed files with 7695 additions and 1803 deletions
+14
View File
@@ -35,6 +35,15 @@ class Swiss_Football_Matchdata {
}
public function init() {
// Detect version updates and flush REST API routes cache if needed
$stored_version = get_option('swi_foot_plugin_version');
if ($stored_version !== SWI_FOOT_PLUGIN_VERSION) {
// Plugin was updated, clear REST endpoints cache
delete_transient('rest_endpoints_data');
wp_cache_delete('rest_endpoints', 'swi-foot/v1');
update_option('swi_foot_plugin_version', SWI_FOOT_PLUGIN_VERSION);
}
// Register post meta to store per-post context (season/team/match) for posts and pages
$meta_args = array(
'type' => 'object',
@@ -80,9 +89,14 @@ class Swiss_Football_Matchdata {
add_option('swi_foot_verein_id', '');
add_option('swi_foot_season_id', date('Y')); // Current year as default
add_option('swi_foot_match_cache_duration', 30);
add_option('swi_foot_plugin_version', SWI_FOOT_PLUGIN_VERSION);
// Flush rewrite rules
flush_rewrite_rules();
// Clear REST API route caches
delete_transient('rest_endpoints_data');
wp_cache_delete('rest_endpoints', 'swi-foot/v1');
}
public function deactivate() {