PluginProbe
Force Refresh / 2.10.0
Force Refresh v2.10.0
3.2.1 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 All 54 releases
force-refresh / filter-force-refresh.php

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

62 lines 2.2 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: 2.10.0
17 Requires at least: 5.2
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 // Define the name of the action for the refresh. This is used with the nonce to create a unique
27 // action when admins request a refresh.
28 define( 'WP_FORCE_REFRESH_ACTION', 'wp_force_refresh' );
29 // The slug used for Force Refresh on the WordPress.org site.
30 define( 'WP_FORCE_REFRESH_REPOSITORY_SLUG', 'force-refresh' );
31 // Define the name of the capability used to invoke a refresh. This is used for developers who want
32 // to fine-tune control of what types of users and roles can request a refresh.
33 define( 'WP_FORCE_REFRESH_CAPABILITY', 'invoke_force_refresh' );
34 // Define the option for whether or not debug mode is active.
35 define( 'WP_FORCE_REFRESH_OPTION_DEBUG_ACTIVE_DATE', 'force_refresh_debug_active_date' );
36 // All the post types to exclude force refreshing from.
37 define( 'WP_FORCE_REFRESH_EXCLUDE_FROM_POST_TYPES', array( 'attachment' ) );
38 // The action used by browsers to get the current site and page versions. This is used to generate
39 // the nonce.
40 define( 'WP_ACTION_GET_VERSION', 'wp_get_version' );
41
42 /**
43 * Function used to retrieve the main file used in the plugin. This function is
44 * used frequently by functions that require the apex file used in a plugin.
45 *
46 * @return string The file path for this file
47 */
48 function get_main_plugin_file() {
49 return __FILE__;
50 }
51
52 // Include the composer autoload file.
53 require_once __DIR__ . '/vendor/autoload.php';
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