PluginProbe
Force Refresh / trunk
Force Refresh vtrunk
3.2.0 3.1.2 3.1.1 3.1.0 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.2.0 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.10.0 2.10.1 2.10.2 2.11.0 2.11.1 2.12.0 2.12.1 All 53 releases
force-refresh / filter-force-refresh.php

filter-force-refresh.php in Force Refresh trunk, at filter-force-refresh.php

62 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The main init file for the Force Refresh plugin.
4 *
5 * @package ForceRefresh
6 */
7
8 namespace JordanLeven\Plugins\ForceRefresh;
9
10 // phpcs:disable Generic.Files.LineLength
11
12 /*
13 Plugin Name: Force Refresh
14 Plugin URI: https://github.com/jordanleven/force-refresh
15 Description: Force Refresh is a simple plugin that allows you to force a page refresh for users currently visiting your site.
16 Version: 3.2.0
17 Requires at least: 5.9
18 Requires PHP: 7.4
19 Author: Jordan Leven
20 Author URI: https://github.com/jordanleven
21 Contributors:
22 */
23
24 // phpcs:enable Generic.Files.LineLength
25
26 // The absolute path to the plugin's root directory.
27 define( 'WP_FORCE_REFRESH_PLUGIN_DIR', __DIR__ );
28 // Define the name of the action for the refresh. This is used with the nonce to create a unique
29 // action when admins request a refresh.
30 define( 'WP_FORCE_REFRESH_ACTION', 'wp_force_refresh' );
31 // The slug used for Force Refresh on the WordPress.org site.
32 define( 'WP_FORCE_REFRESH_REPOSITORY_SLUG', 'force-refresh' );
33 // Define the name of the capability used to invoke a refresh. This is used for developers who want
34 // to fine-tune control of what types of users and roles can request a refresh.
35 define( 'WP_FORCE_REFRESH_CAPABILITY', 'invoke_force_refresh' );
36 // Define the option for whether or not debug mode is active.
37 define( 'WP_FORCE_REFRESH_OPTION_DEBUG_ACTIVE_DATE', 'force_refresh_debug_active_date' );
38 // All the post types to exclude force refreshing from.
39 define( 'WP_FORCE_REFRESH_EXCLUDE_FROM_POST_TYPES', array( 'attachment' ) );
40 // The action used by browsers to get the current site and page versions. This is used to generate
41 // the nonce.
42 define( 'WP_ACTION_GET_VERSION', 'wp_get_version' );
43
44 /**
45 * Function used to retrieve the main file used in the plugin. This function is
46 * used frequently by functions that require the apex file used in a plugin.
47 *
48 * @return string The file path for this file
49 */
50 function get_main_plugin_file() {
51 return __FILE__;
52 }
53
54 // Include the plugin autoload file.
55 require_once __DIR__ . '/includes/autoload.php';
56 // Include the functions file.
57 require_once __DIR__ . '/includes/functions.php';
58 // Register all of our actions.
59 require_once __DIR__ . '/includes/actions/actions.php';
60 // Include the API call functions.
61 require_once __DIR__ . '/includes/api/api.php';
62