PluginProbe ʕ •ᴥ•ʔ
Check & Log Email – Easy Email Testing & Mail logging / 1.0.11
Check & Log Email – Easy Email Testing & Mail logging v1.0.11
1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 2.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.13.1 2.0.13.2 2.0.14 2.0.2 2.0.3 2.0.4 2.0.5 2.0.5.1 2.0.6 2.0.7 2.0.8 2.0.9 trunk 0.5.7 0.6.0 0.6.1 0.6.2 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.12.1 1.0.13 1.0.13.1 1.0.2 1.0.3
check-email / check-email.php
check-email Last commit date
assets 2 years ago include 2 years ago languages 2 years ago changelog.txt 2 years ago check-email.php 2 years ago readme.txt 2 years ago uninstall.php 2 years ago
check-email.php
120 lines
1 <?php
2 /*
3 * Plugin Name: Check & Log Email
4 * Description: Check & Log email allows you to test if your WordPress installation is sending emails correctly and logs every email.
5 * Author: checkemail
6 * Version: 1.0.11
7 * Author URI: https://check-email.tech/
8 * License: GPLv3 or later
9 * License URI: http://www.gnu.org/licenses/gpl-3.0.html
10 * Requires PHP: 5.6
11 * Text Domain: check-email
12 * Domain Path: /languages
13 *
14 * Copyright 2015-2020 Chris Taylor chris@stillbreathing.co.uk
15 * Copyright 2020 MachoThemes office@machothemes.com
16 * Copyright 2020 WPChill heyyy@wpchill.com
17 * Copyright 2023 WPOmnia contact@wpomnia.com
18 *
19 * NOTE:
20 * Chris Taylor transferred ownership rights on: 2020-06-19 07:52:03 GMT when ownership was handed over to MachoThemes
21 * The MachoThemes ownership period started on: 2020-06-19 07:52:03 GMT
22 * MachoThemes sold the plugin to WPOmnia on: 2023-10-15 15:52:03 GMT
23 *
24 * This program is free software; you can redistribute it and/or modify
25 * it under the terms of the GNU General Public License, version 3, as
26 * published by the Free Software Foundation.
27 *
28 * This program is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU General Public License for more details.
32 *
33 * You should have received a copy of the GNU General Public License
34 * along with this program; if not, write to the Free software
35 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
36 */
37 defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
38
39 if ( version_compare( PHP_VERSION, '5.6.0', '<' ) ) {
40 function check_email_compatibility_notice() {
41 ?>
42 <div class="error">
43 <p>
44 <?php
45 printf(
46 esc_html__( 'Check & Log Email requires at least PHP 5.6 to function properly. Please upgrade PHP.', 'check-email' )
47 );
48 ?>
49 </p>
50 </div>
51 <?php
52 }
53
54 add_action( 'admin_notices', 'check_email_compatibility_notice' );
55
56 /**
57 * Deactivate Email Log.
58 */
59 function check_email_deactivate() {
60 deactivate_plugins( plugin_basename( __FILE__ ) );
61 }
62
63 add_action( 'admin_init', 'check_email_deactivate' );
64
65 return;
66 }
67
68 /**
69 * Load Check Email Log.
70 */
71 function check_email_log( $plugin_file ) {
72 global $check_email;
73
74 $plugin_dir = plugin_dir_path( $plugin_file );
75
76 // setup autoloader.
77 require_once 'include/class-check-email-log-autoloader.php';
78
79 $loader = new \CheckEmail\Check_Email_Log_Autoloader();
80 $loader->add_namespace( 'CheckEmail', $plugin_dir . 'include' );
81
82 if ( file_exists( $plugin_dir . 'tests/' ) ) {
83 // if tests are present, then add them.
84 $loader->add_namespace( 'CheckEmail', $plugin_dir . 'tests/wp-tests' );
85 }
86
87 $loader->add_file( $plugin_dir . 'include/Util/helper.php' );
88
89 $loader->register();
90
91 $check_email = new \CheckEmail\Core\Check_Email_Log( $plugin_file, $loader, new \CheckEmail\Core\DB\Check_Email_Table_Manager() );
92
93 $check_email->add_loadie( new \CheckEmail\Core\Check_Email_Logger() );
94 $check_email->add_loadie( new \CheckEmail\Core\Check_Email_Review() );
95 $check_email->add_loadie( new \CheckEmail\Core\UI\Check_Email_UI_Loader() );
96
97 $check_email->add_loadie( new \CheckEmail\Core\Request\Check_Email_Nonce_Checker() );
98 $check_email->add_loadie( new \CheckEmail\Core\Request\Check_Email_Log_List_Action() );
99
100 $capability_giver = new \CheckEmail\Core\Check_Email_Admin_Capability_Giver();
101 $check_email->add_loadie( $capability_giver );
102 $capability_giver->add_cap_to_admin();
103
104 $check_email->add_loadie( new \CheckEmail\Core\Check_Email_From_Handler() );
105
106 // `register_activation_hook` can't be called from inside any hook.
107 register_activation_hook( $plugin_file, array( $check_email->table_manager, 'on_activate' ) );
108
109 // Ideally the plugin should be loaded in a later event like `init` or `wp_loaded`.
110 // But some plugins like EDD are sending emails in `init` event itself,
111 // which won't be logged if the plugin is loaded in `wp_loaded` or `init`.
112 add_action( 'plugins_loaded', array( $check_email, 'load' ), 101 );
113 }
114
115 function wpchill_check_email() {
116 global $check_email;
117 return $check_email;
118 }
119
120 check_email_log( __FILE__ );