-
Notifications
You must be signed in to change notification settings - Fork 1
/
pageflash.php
100 lines (92 loc) · 3.51 KB
/
pageflash.php
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
/*
Plugin Name: PageFlash
Plugin URI: https://github.com/theaminuldev/pageflash
Author: theaminul
Author URI: theaminul.com
Version: 1.1.0
Stable tag: 1.1.0
Requires at least: 6.0
Tested up to: 6.5.5
Requires PHP: 7.4
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: pageflash
Description: PageFlash - Fast and Efficient Headless Browser WordPress Plugin. By using PageFlash, an active plugin, you'll experience a 50% increase in conversions and enjoy 4x faster page loading. ⚡️ Boost your website's speed, increase user engagement 💬, and supercharge your online presence 🚀. - NewEgg
Tags: headless-browser, pageflash, prefetches, quicklink, quickload, performance, speed, fast, prefetch, seo preconnect, optimization.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
define( 'PAGEFLASH_VERSION', '1.0.1' );
define( 'PAGEFLASH__FILE__', __FILE__ );
define( 'PAGEFLASH_PLUGIN_BASE', plugin_basename( PAGEFLASH__FILE__ ) );
define( 'PAGEFLASH_PATH', plugin_dir_path( PAGEFLASH__FILE__ ) );
define( 'PAGEFLASH_URL', plugins_url( '/', PAGEFLASH__FILE__ ) );
define( 'PAGEFLASH_ASSETS_PATH', PAGEFLASH_PATH . 'assets/' );
define( 'PAGEFLASH_ASSETS_URL', PAGEFLASH_URL . 'assets/' );
add_action( 'plugins_loaded', 'pageflash_load_plugin_textdomain' );
if ( ! version_compare( PHP_VERSION, '7.0', '>=' ) ) {
add_action( 'admin_notices', 'pageflash_fail_php_version' );
} elseif ( ! version_compare( get_bloginfo( 'version' ), '5.9', '>=' ) ) {
add_action( 'admin_notices', 'pageflash_fail_wp_version' );
} else {
require PAGEFLASH_PATH . 'includes/Plugin.php';
}
/**
* Load PageFlash textdomain.
*
* Load gettext translate for PageFlash text domain.
*
* @since PageFlash 1.0.0
*
* @return void
*/
function pageflash_load_plugin_textdomain() {
load_plugin_textdomain( 'pageflash' );
}
/**
* PageFlash admin notice for minimum PHP version.
*
* Warning when the site doesn't have the minimum required PHP version.
*
* @since PageFlash 1.0.0
*
* @return void
*/
function pageflash_fail_php_version() {
$message = sprintf(
/* translators: 1: `<h3>` opening tag, 2: `</h3>` closing tag, 3: PHP version. 4: Link opening tag, 5: Link closing tag. */
esc_html__( '%1$sPageFlash isn’t running because PHP is outdated.%2$s Update to PHP version %3$s and get back to using PageFlash! %4$sShow me how%5$s', 'pageflash' ),
'<h3>',
'</h3>',
'7.0',
'<a href="#" target="_blank">', // Replace with the actual link.
'</a>'
);
$html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
echo wp_kses_post( $html_message );
}
/**
* PageFlash admin notice for minimum WordPress version.
*
* Warning when the site doesn't have the minimum required WordPress version.
*
* @since PageFlash 1.0.0
*
* @return void
*/
function pageflash_fail_wp_version() {
$message = sprintf(
/* translators: 1: `<h3>` opening tag, 2: `</h3>` closing tag, 3: WP version. 4: Link opening tag, 5: Link closing tag. */
esc_html__( '%1$sPageFlash isn’t running because WordPress is outdated.%2$s Update to version %3$s and get back to using PageFlash! %4$sShow me how%5$s', 'pageflash' ),
'<h3>',
'</h3>',
'5.9',
'<a href="#" target="_blank">', // Replace with the actual link.
'</a>'
);
$html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
echo wp_kses_post( $html_message );
}
?>