|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Plugin Name: Email Log |
|
4
|
|
|
* Plugin URI: https://wpemaillog.com |
|
5
|
|
|
* Description: Logs every email sent through WordPress |
|
6
|
|
|
* Donate Link: http://sudarmuthu.com/if-you-wanna-thank-me |
|
7
|
|
|
* Author: Sudar |
|
8
|
|
|
* Version: 2.2.5 |
|
9
|
|
|
* Author URI: http://sudarmuthu.com/ |
|
10
|
|
|
* Text Domain: email-log |
|
11
|
|
|
* Domain Path: languages/ |
|
12
|
|
|
* === RELEASE NOTES === |
|
13
|
|
|
* Check readme file for full release notes. |
|
14
|
|
|
*/ |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Copyright 2009 Sudar Muthu (email : [email protected]) |
|
18
|
|
|
* This program is free software; you can redistribute it and/or modify |
|
19
|
|
|
* it under the terms of the GNU General Public License, version 2, as |
|
20
|
|
|
* published by the Free Software Foundation. |
|
21
|
|
|
* This program is distributed in the hope that it will be useful, |
|
22
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
23
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
24
|
|
|
* GNU General Public License for more details. |
|
25
|
|
|
* You should have received a copy of the GNU General Public License |
|
26
|
|
|
* along with this program; if not, write to the Free Software |
|
27
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
28
|
|
|
*/ |
|
29
|
|
|
defined( 'ABSPATH' ) || exit; // Exit if accessed directly. |
|
30
|
|
|
|
|
31
|
|
|
// Include the stub of the old `EmailLog` class, so that old add-ons don't generate a fatal error. |
|
32
|
|
|
include_once plugin_dir_path( __FILE__ ) . 'include/compatibility/EmailLog.php'; |
|
33
|
|
|
|
|
34
|
|
|
if ( version_compare( PHP_VERSION, '5.3.0', '<' ) ) { |
|
35
|
|
|
/** |
|
36
|
|
|
* Version 2.0 of the Email Log plugin dropped support for PHP 5.2. |
|
37
|
|
|
* If you are still struck with PHP 5.2 and can't update, then use v1.9.1 of the plugin. |
|
38
|
|
|
* But note that some add-ons may not work. |
|
39
|
|
|
* |
|
40
|
|
|
* @see http://sudarmuthu.com/blog/why-i-am-dropping-support-for-php-5-2-in-my-wordpress-plugins/ |
|
41
|
|
|
* @since 2.0 |
|
42
|
|
|
*/ |
|
43
|
|
|
function email_log_compatibility_notice() { |
|
44
|
|
|
?> |
|
45
|
|
|
<div class="error"> |
|
46
|
|
|
<p> |
|
47
|
|
|
<?php |
|
48
|
|
|
printf( |
|
49
|
|
|
__( 'Email Log requires at least PHP 5.3 to function properly. Please upgrade PHP or use <a href="%s">v1.9.1 of Email Log</a>.', 'email-log' ), // @codingStandardsIgnoreLine |
|
50
|
|
|
'https://downloads.wordpress.org/plugin/email-log.1.9.1.zip' |
|
51
|
|
|
); |
|
52
|
|
|
?> |
|
53
|
|
|
</p> |
|
54
|
|
|
</div> |
|
55
|
|
|
<?php |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
add_action( 'admin_notices', 'email_log_compatibility_notice' ); |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* Deactivate Email Log. |
|
62
|
|
|
* |
|
63
|
|
|
* @since 2.0 |
|
64
|
|
|
*/ |
|
65
|
|
|
function email_log_deactivate() { |
|
66
|
|
|
deactivate_plugins( plugin_basename( __FILE__ ) ); |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
add_action( 'admin_init', 'email_log_deactivate' ); |
|
70
|
|
|
|
|
71
|
|
|
return; |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
// PHP is at least 5.3, so we can safely include namespace code. |
|
75
|
|
|
require_once 'load-email-log.php'; |
|
76
|
|
|
load_email_log( __FILE__ ); |
|
77
|
|
|
|