PluginProbe ʕ •ᴥ•ʔ
Clear Cache Everywhere / 1.1.1
Clear Cache Everywhere v1.1.1
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 8 months ago clear-cache-everywhere.php 8 months ago index.php 8 months ago readme.txt 8 months ago
clear-cache-everywhere.php
101 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.1.1
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', CCEVERYWHERE_VERSION ); // 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_IMG_PATH', CCEVERYWHERE_INCLUDES_DIR . 'img/' ); //: https://domain.com/wp-content/plugins/text-domain/includes/img/
72 define( 'CCEVERYWHERE_SETTINGS_PATH', admin_url( 'edit.php?post_type=cceverywhere-files&page=settings' ) ); //: https://domain.com/wp-admin/?page=text-domain
73
74 // Screen IDs
75 define( 'CCEVERYWHERE_SETTINGS_SCREEN_ID', 'tools_page_' . CCEVERYWHERE__TEXTDOMAIN );
76
77
78 /**
79 * Includes
80 */
81 require_once CCEVERYWHERE_INCLUDES_ABSPATH . 'common.php';
82 require_once CCEVERYWHERE_INCLUDES_ABSPATH . 'admin-bar.php';
83 require_once CCEVERYWHERE_INCLUDES_ABSPATH . 'clear-cache.php';
84 require_once CCEVERYWHERE_INCLUDES_ABSPATH . 'settings.php';
85
86
87 /**
88 * Helper function for developers
89 *
90 * Use this function to clear all caches from within your code,
91 * such as from a scheduled event or an admin action.
92 *
93 * @param bool $log_results Whether to log the results of cache clearing to the debug log. Default is false.
94 *
95 * @return array The results of the cache clearing process.
96 */
97 if ( !function_exists( 'cceverywhere_clear_all' ) ) {
98 function cceverywhere_clear_all( $log_results = false ) {
99 return (new \Apos37\ClearCache\Clear())->clear_all( true, $log_results );
100 } // End cceverywhere_clear_all()
101 }