PluginProbe ʕ •ᴥ•ʔ
Clear Cache Everywhere / 1.2.0
Clear Cache Everywhere v1.2.0
trunk 1.1.0 1.1.1 1.2.0 1.2.1 1.2.1.1 1.2.2
clear-cache-everywhere / clear-cache-everywhere.php
clear-cache-everywhere Last commit date
inc 4 months ago clear-cache-everywhere.php 4 months ago index.php 4 months ago readme.txt 4 months ago
clear-cache-everywhere.php
100 lines
1 <?php
2 /**
3 * Plugin Name: Clear Cache Everywhere
4 * Plugin URI: https://pluginrx.com/plugin/clear-cache-everywhere/
5 * Description: Instantly clear all cache sources including WP cache, hosting cache, transients, sessions, and browser cache.
6 * Version: 1.2.0
7 * Requires at least: 5.9
8 * Tested up to: 6.8
9 * Requires PHP: 7.4
10 * Author: PluginRx
11 * Author URI: https://pluginrx.com/
12 * Discord URI: https://discord.gg/3HnzNEJVnR
13 * Text Domain: clear-cache-everywhere
14 * License: GPLv2 or later
15 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
16 * Created on: March 19, 2025
17 */
18
19
20 /**
21 * Define Namespace
22 */
23 namespace Apos37\ClearCache;
24
25
26 /**
27 * Exit if accessed directly.
28 */
29 if ( !defined( 'ABSPATH' ) ) exit;
30
31
32 /**
33 * Defines
34 */
35 $plugin_data = get_file_data( __FILE__, [
36 'name' => 'Plugin Name',
37 'version' => 'Version',
38 'plugin_uri' => 'Plugin URI',
39 'requires_php' => 'Requires PHP',
40 'textdomain' => 'Text Domain',
41 'author' => 'Author',
42 'author_uri' => 'Author URI',
43 'discord_uri' => 'Discord URI'
44 ] );
45
46 // Versions
47 define( 'CCEVERYWHERE_VERSION', $plugin_data[ 'version' ] );
48 define( 'CCEVERYWHERE_SCRIPT_VERSION', time() ); // REPLACE WITH time() DURING TESTING
49 define( 'CCEVERYWHERE_MIN_PHP_VERSION', $plugin_data[ 'requires_php' ] );
50
51 // Names
52 define( 'CCEVERYWHERE_NAME', $plugin_data[ 'name' ] );
53 define( 'CCEVERYWHERE_TEXTDOMAIN', $plugin_data[ 'textdomain' ] );
54 define( 'CCEVERYWHERE__TEXTDOMAIN', str_replace( '-', '_', CCEVERYWHERE_TEXTDOMAIN ) );
55 define( 'CCEVERYWHERE_AUTHOR', $plugin_data[ 'author' ] );
56 define( 'CCEVERYWHERE_AUTHOR_URI', $plugin_data[ 'author_uri' ] );
57 define( 'CCEVERYWHERE_PLUGIN_URI', $plugin_data[ 'plugin_uri' ] );
58 define( 'CCEVERYWHERE_GUIDE_URL', CCEVERYWHERE_AUTHOR_URI . 'guide/plugin/' . CCEVERYWHERE_TEXTDOMAIN . '/' );
59 define( 'CCEVERYWHERE_DOCS_URL', CCEVERYWHERE_AUTHOR_URI . 'docs/plugin/' . CCEVERYWHERE_TEXTDOMAIN . '/' );
60 define( 'CCEVERYWHERE_SUPPORT_URL', CCEVERYWHERE_AUTHOR_URI . 'support/plugin/' . CCEVERYWHERE_TEXTDOMAIN . '/' );
61 define( 'CCEVERYWHERE_DISCORD_URL', $plugin_data[ 'discord_uri' ] );
62
63 // Paths
64 define( 'CCEVERYWHERE_BASENAME', plugin_basename( __FILE__ ) ); //: text-domain/text-domain.php
65 define( 'CCEVERYWHERE_ABSPATH', plugin_dir_path( __FILE__ ) ); //: /home/.../public_html/wp-content/plugins/text-domain/
66 define( 'CCEVERYWHERE_DIR', plugins_url( '/' . CCEVERYWHERE_TEXTDOMAIN . '/' ) ); //: https://domain.com/wp-content/plugins/text-domain/
67 define( 'CCEVERYWHERE_INCLUDES_ABSPATH', CCEVERYWHERE_ABSPATH . 'inc/' ); //: /home/.../public_html/wp-content/plugins/text-domain/includes/
68 define( 'CCEVERYWHERE_INCLUDES_DIR', CCEVERYWHERE_DIR . 'inc/' ); //: https://domain.com/wp-content/plugins/text-domain/includes/
69 define( 'CCEVERYWHERE_JS_PATH', CCEVERYWHERE_INCLUDES_DIR . 'js/' ); //: https://domain.com/wp-content/plugins/text-domain/includes/js/
70 define( 'CCEVERYWHERE_CSS_PATH', CCEVERYWHERE_INCLUDES_DIR . 'css/' ); //: https://domain.com/wp-content/plugins/text-domain/includes/css/
71 define( 'CCEVERYWHERE_SETTINGS_PATH', admin_url( 'tools.php?page=clear_cache_everywhere' ) );
72
73 // Screen ID
74 define( 'CCEVERYWHERE_SETTINGS_SCREEN_ID', 'tools_page_' . CCEVERYWHERE__TEXTDOMAIN );
75
76
77 /**
78 * Includes
79 */
80 require_once CCEVERYWHERE_INCLUDES_ABSPATH . 'common.php';
81 require_once CCEVERYWHERE_INCLUDES_ABSPATH . 'admin-bar.php';
82 require_once CCEVERYWHERE_INCLUDES_ABSPATH . 'clear-cache.php';
83 require_once CCEVERYWHERE_INCLUDES_ABSPATH . 'settings.php';
84
85
86 /**
87 * Helper function for developers
88 *
89 * Use this function to clear all caches from within your code,
90 * such as from a scheduled event or an admin action.
91 *
92 * @param bool $log_results Whether to log the results of cache clearing to the debug log. Default is false.
93 *
94 * @return array The results of the cache clearing process.
95 */
96 if ( !function_exists( 'cceverywhere_clear_all' ) ) {
97 function cceverywhere_clear_all( $log_results = false ) {
98 return (new \Apos37\ClearCache\Clear())->clear_all( true, $log_results );
99 } // End cceverywhere_clear_all()
100 }