| 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 |
|