-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnocache-bfcache.php
More file actions
61 lines (53 loc) · 1.56 KB
/
nocache-bfcache.php
File metadata and controls
61 lines (53 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* Plugin Name: No-cache BFCache
* Plugin URI: https://github.com/westonruter/nocache-bfcache
* Description: Enables back/forward cache (bfcache) for instant history navigations even when "nocache" headers are sent, such as when a user is logged in. <strong>To see the effect, you must log out and log back in again, ensuring "Remember Me" is checked.</strong>
* Requires at least: 6.8
* Requires PHP: 7.2
* Version: 1.3.0
* Author: Weston Ruter
* Author URI: https://weston.ruter.net/
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* GitHub Plugin URI: https://github.com/westonruter/nocache-bfcache
* Primary Branch: main
*
* @package WestonRuter\NocacheBFCache
*/
namespace WestonRuter\NocacheBFCache;
if ( ! defined( 'ABSPATH' ) ) {
exit; // @codeCoverageIgnore
}
// Abort executing the plugin if the core patch has been applied. See <https://github.com/WordPress/wordpress-develop/pull/9131>.
if ( defined( 'BFCACHE_SESSION_TOKEN_COOKIE' ) || function_exists( 'wp_enqueue_bfcache_script_module' ) ) {
return;
}
/**
* Version.
*
* @since 1.0.0
* @access private
* @var string
*/
const VERSION = '1.3.0';
/**
* Plugin file.
*
* @since 1.1.0
* @access private
* @var string
*/
const PLUGIN_FILE = __FILE__;
/**
* Script and style registration.
*/
require_once __DIR__ . '/includes/script-loader.php';
/**
* User opt-in for BFCache.
*/
require_once __DIR__ . '/includes/bfcache-opt-in.php';
/**
* Invalidating pages from bfcache.
*/
require_once __DIR__ . '/includes/bfcache-invalidation.php';