-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathimagekit.php
More file actions
55 lines (45 loc) · 1.59 KB
/
imagekit.php
File metadata and controls
55 lines (45 loc) · 1.59 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
<?php
/**
* Plugin Name: ImageKit
* Plugin URI: https://imagekit.io/docs/integration/wordpress
* Description: A WordPress plugin to automatically fetch your WordPress images via <a href="https://www.imagekit.io" target="_blank">ImageKit</a> for optimization and super fast delivery. <a href="https://imagekit.io/blog/how-to-optimize-images-on-wordpress-website-using-imagekit/" target="_blank">Learn more</a> from documentation.
* Author: ImageKit
* Author URI: https://imagekit.io
* Version: STABLETAG
* Text Domain: imagekit
* Domain Path: /languages
*
* @package ImageKitWordpress
*/
namespace ImageKitWordpress;
if ( ! defined( constant_name: 'ABSPATH' ) ) {
exit;
}
define( 'IK_PLUGIN_ENTRYPOINT', __FILE__ );
define( 'IK_PLUGIN_PATH', plugin_dir_path( IK_PLUGIN_ENTRYPOINT ) );
if ( ! defined( 'IK_EML_VERSION' ) ) {
define( 'IK_VERSION', 'latest' );
}
if ( ! defined( 'IK_DEBUG' ) ) {
define( 'IK_DEBUG', false );
}
if ( version_compare( phpversion(), '5.6', '>=' ) ) {
require_once __DIR__ . '/instance.php';
// register_activation_hook( IK_PLUGIN_ENTRYPOINT, array( Utils::class, 'install' ) );
} else {
add_action( 'admin_notices', __NAMESPACE__ . '\php_version_error' );
}
/**
* Admin notice for incompatible PHP version
*/
function php_version_error() {
printf( '<div class="error"><p>%s</p></div>', esc_html( php_version_text() ) );
}
/**
* String describing the minimum PHP version.
*
* @return string
*/
function php_version_text() {
return __( 'ImageKit plugin error: Your version of PHP is too old to run this plugin. You must be running PHP 5.6 or higher', 'imagekit' );
}