'cache_manager', 'title' => 'Cache manager (admin bar)', 'desc' => 'Clear WordPress, page cache and builder caches from the admin bar', 'icon' => 'zap', 'risk' => 'safe', 'level' => 'beginner', 'audience' => 'everyone', 'priority' => 2, 'benefit' => 'Clear WordPress caches, transients, page cache plugins and builder CSS from one admin bar menu, which helps when content or styles do not update.', 'help' => 'Adds a Toolkit → Cache menu to the admin bar for administrators. "Clear All — Safe" clears the in-memory object cache, transients, WordPress core caches, detected page caches and builder caches. "Clear All — Aggressive" also flushes the whole object cache, rewrite rules and OPcache. Page cache plugins it can clear: WP Rocket, W3 Total Cache, WP Super Cache, LiteSpeed Cache, SG Optimizer, Hummingbird, Cache Enabler and WP Fastest Cache. Builder and asset caches: Elementor, GenerateBlocks and Autoptimize. Each is only called when it is installed.', 'before' => 'Visit each cache plugin and clear them one by one', 'after' => 'One menu clears every detected cache layer.', 'detect' => function () { require_once OVKIT_PATH . 'includes/class-ovkit-cache-manager.php'; $systems = OVKIT_Cache_Manager::instance()->detect_systems(); if ( empty( $systems ) ) { return array( 'detected' => true, 'message' => __( 'Core WordPress caches always clearable (object cache, transients, rewrite, OPcache)', 'ovanap-admin-toolkit' ), 'safe' => true, ); } return array( 'detected' => true, /* translators: %s: comma-separated list of detected cache systems */ 'message' => sprintf( __( 'Detected: %s', 'ovanap-admin-toolkit' ), implode( ', ', wp_list_pluck( $systems, 'label' ) ) ), 'safe' => true, ); }, 'callback' => function () { require_once OVKIT_PATH . 'includes/class-ovkit-cache-manager.php'; OVKIT_Cache_Manager::instance()->boot(); }, );