-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcbxwpemaillogger.php
More file actions
160 lines (127 loc) · 4.75 KB
/
Copy pathcbxwpemaillogger.php
File metadata and controls
160 lines (127 loc) · 4.75 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?php
/**
* The plugin bootstrap file
*
* This file is read by WordPress to generate the plugin information in the plugin
* admin area. This file also includes all of the dependencies used by the plugin,
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
*
* @link https://codeboxr.com
* @since 1.0.0
* @package ComfortSmtp
*
* @wordpress-plugin
* Plugin Name: Comfort Email SMTP, Logger & Email Api
* Plugin URI: https://codeboxr.com/product/cbx-email-logger-for-wordpress/
* Description: SMTP for WordPress with email logging, delivery tracking, failed email monitoring, and debugging tools.
* Version: 2.1.4
* Requires at least: 5.9
* Requires PHP: 7.4
* Author: Codeboxr
* Author URI: https://codeboxr.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: cbxwpemaillogger
* Domain Path: /languages
*/
use Comfort\Crm\Smtp\Helpers\ComfortSmtpHelpers;
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
defined( 'COMFORTSMTP_PLUGIN_NAME' ) or define( 'COMFORTSMTP_PLUGIN_NAME', 'cbxwpemaillogger' );
defined( 'COMFORTSMTP_PLUGIN_VERSION' ) or define( 'COMFORTSMTP_PLUGIN_VERSION', '2.1.4' );
defined( 'COMFORTSMTP_BASE_NAME' ) or define( 'COMFORTSMTP_BASE_NAME', plugin_basename( __FILE__ ) );
defined( 'COMFORTSMTP_ROOT_PATH' ) or define( 'COMFORTSMTP_ROOT_PATH', plugin_dir_path( __FILE__ ) );
defined( 'COMFORTSMTP_ROOT_URL' ) or define( 'COMFORTSMTP_ROOT_URL', plugin_dir_url( __FILE__ ) );
defined( 'COMFORTSMTP_WP_MIN_VERSION' ) or define( 'COMFORTSMTP_WP_MIN_VERSION', '5.9' );
defined( 'COMFORTSMTP_PHP_MIN_VERSION' ) or define( 'COMFORTSMTP_PHP_MIN_VERSION', '7.4' );
defined( 'COMFORTSMTP_PRO_VERSION' ) or define( 'COMFORTSMTP_PRO_VERSION', '1.0.10' );
defined( 'COMFORTSMTP_DEV_MODE' ) or define( 'COMFORTSMTP_DEV_MODE', false );
// Include the main Cbx class.
if ( ! class_exists( 'ComfortSmtp', false ) ) {
include_once COMFORTSMTP_ROOT_PATH . 'includes/ComfortSmtp.php';
}
/**
* Checking wp version
*
* @return bool
*/
function comfortsmtp_compatible_wp_version( $version = '' ) {
if($version == '') $version = COMFORTSMTP_WP_MIN_VERSION;
if ( version_compare( $GLOBALS['wp_version'], $version, '<' ) ) {
return false;
}
// Add sanity checks for other version requirements here
return true;
}//end function comfortsmtp_compatible_wp_version
/**
* Checking php version
*
* @return bool
*/
function comfortsmtp_compatible_php_version( $version = '' ) {
if($version == '') $version = COMFORTSMTP_PHP_MIN_VERSION;
if ( version_compare( PHP_VERSION, $version, '<' ) ) {
return false;
}
return true;
}//end function comfortsmtp_compatible_php_version
/**
* The code that runs during plugin activation.
*/
function comfortsmtp_activate() {
$wp_version = COMFORTSMTP_WP_MIN_VERSION;
$php_version = COMFORTSMTP_PHP_MIN_VERSION;
$activate_ok = true;
if ( ! comfortsmtp_compatible_wp_version( $wp_version ) ) {
$activate_ok = false;
deactivate_plugins( plugin_basename( __FILE__ ) );
/* Translators: WordPress Version */
wp_die( sprintf( esc_html__( 'Comfort form plugin requires WordPress %s or higher!', 'cbxwpemaillogger' ), esc_html($wp_version) ) );
}
if ( ! comfortsmtp_compatible_php_version( $php_version ) ) {
$activate_ok = false;
deactivate_plugins( plugin_basename( __FILE__ ) );
/* Translators: PHP Version */
wp_die( sprintf( esc_html__( 'Comfort form plugin requires PHP %s or higher!', 'cbxwpemaillogger' ), esc_html($php_version) ) );
}
if($activate_ok){
ComfortSmtpHelpers::load_orm();
ComfortSmtpHelpers::activate();
}
}//end function comfortsmtp_activate
register_activation_hook( __FILE__, 'comfortsmtp_activate' );
/**
* The code that runs during plugin deactivation.
*/
function comfortsmtp_deactivate() {
ComfortSmtpHelpers::deactivate();
}//end function comfortsmtp_deactivate
register_deactivation_hook( __FILE__, 'comfortsmtp_deactivate' );
/**
* Returns the main instance of WC.
*
* @since 1.0
*/
function comfortsmtp_core() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
global $comfortsmtp_core;
if ( ! isset( $comfortsmtp_core ) ) {
$comfortsmtp_core = comfortsmtp_run__core();
}
return $comfortsmtp_core;
}//end method comfortsmtp_core
/**
* Begins execution of the plugin.
*
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*
* @since 1.0.0
*/
function comfortsmtp_run__core() {
return ComfortSmtp::instance();
}//end function comfortsmtp_run__core
$GLOBALS['comfortsmtp_core'] = comfortsmtp_run__core();