-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththumbnify.php
More file actions
104 lines (88 loc) · 2.15 KB
/
Copy paththumbnify.php
File metadata and controls
104 lines (88 loc) · 2.15 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
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
101
102
103
104
<?php
/**
* Thumbnify
*
* @package iwpdev/thumbnify
* @author iwpdev
* @license GPL-2.0-or-later
* @wordpress-plugin
*
* Plugin Name: Thumbnify
* Plugin URI: https://i-wp-dev.com
* Description: Post Thumbnail Designer is a powerful WordPress plugin that automates the generation of post thumbnails
* while offering advanced customization options. With a sleek user interface, it allows you to effortlessly create
* eye-catching post thumbnails, complete with background images and customizable fonts. You have full control over
* where the title and quote are displayed on the thumbnail, allowing you to design visually appealing post previews
* that captivate your audience.
*
* Version: 1.0.0
* Requires at least: 6.0
* Requires PHP: 7.4
* Author: Alex Lavyhin
* Author URI: https://profiles.wordpress.org/alexlavigin/
* License: GPL2
*
* Text Domain: thumbnify
* Domain Path: /languages
*/
use Thumbnify\Main;
if ( ! defined( 'ABSPATH' ) ) {
// @codeCoverageIgnoreStart
exit;
// @codeCoverageIgnoreEnd
}
/**
* Plugin version.
*/
const TN_VERSION = '1.0.0';
/**
* Plugin path.
*/
const TN_PATH = __DIR__;
/**
* Plugin main file
*/
const TN_FILE = __FILE__;
/**
* Class autoload.
*/
require_once TN_PATH . '/vendor/autoload.php';
/**
* Min ver php.
*/
const TN_PHP_REQUIRED_VERSION = '7.4';
/**
* Plugin url.
*/
define( 'TN_URL', untrailingslashit( plugin_dir_url( TN_FILE ) ) );
/**
* Check php version.
*
* @return bool
* @noinspection ConstantCanBeUsedInspection
*/
function tn_is_php_version(): bool {
if ( version_compare( PHP_VERSION, TN_PHP_REQUIRED_VERSION, '<' ) ) {
return false;
}
return true;
}
if ( ! tn_is_php_version() ) {
add_action(
'admin_notices',
[
Thumbnify\Admin\Notification\Notification::class,
'php_version_nope',
]
);
if ( is_plugin_active( plugin_basename( TN_FILE ) ) ) {
deactivate_plugins( plugin_basename( TN_FILE ) );
// phpcs:disable WordPress.Security.NonceVerification.Recommended
if ( isset( $_GET['activate'] ) ) {
unset( $_GET['activate'] );
}
// phpcs:enable WordPress.Security.NonceVerification.Recommended
}
return;
}
new Main();