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
|
<?php if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly }
/** * Plugin Name: Solid Mail * Description: Solid Mail can help us to send emails via SMTP instead of the PHP mail() function and email logger built-in. * Version: 2.1.4 * Author: SolidWP * Author URI: https://www.solidwp.com/ * Text Domain: wp-smtp * Domain Path: /lang * License: GPLv3 or Later * * Copyright 2012-2022 Yehuda Hassine [email protected] * Copyright 2022-2022 WPChill [email protected] * Copyright 2023 SolidWP [email protected] * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 3, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* * The plugin was originally created by BoLiQuan */
define( 'WPSMTP__FILE__', __FILE__ ); define( 'WPSMTP_PLUGIN_BASE', plugin_basename( WPSMTP__FILE__ ) ); define( 'WPSMTP_PATH', plugin_dir_path( WPSMTP__FILE__ ) ); define( 'WPSMTP_URL', plugins_url( '/', WPSMTP__FILE__ ) ); define( 'WPSMTP_ASSETS_PATH', WPSMTP_PATH . 'assets/' ); define( 'WPSMTP_ASSETS_URL', WPSMTP_URL . 'assets/' ); define( 'WPSMTP_VERSION', '2.1.4' );
require_once __DIR__ . '/vendor/autoload.php'; require_once __DIR__ . '/vendor/vendor-prefixed/autoload.php';
class WP_SMTP {
public function __construct() { $this->hooks(); }
public function hooks() { register_activation_hook( __FILE__, [ $this, 'wp_smtp_activate' ] );
add_filter( 'plugin_action_links', [ $this, 'wp_smtp_settings_link' ], 10, 2 ); add_action( 'init', [ $this, 'load_textdomain' ] ); add_action( 'wp_loaded', [ $this, 'load_admin_requirements' ], 16 );
// add the new code bootstrap. require_once __DIR__ . '/src/functions/boot.php'; $core = solid_mail_plugin(); add_action( 'plugins_loaded', static function () use ( $core ): void { $core->init(); } ); }
public function load_admin_requirements() { new WPSMTP\Admin(); new WPSMTP\Logger\Process(); }
public function wp_smtp_activate() { // @TODO: should we init solid 'solid_mail_settings' here? \WPSMTP\Logger\Table::install(); // @TODO: table should be deleted on uninstalling }
public function load_textdomain() { load_plugin_textdomain( 'wp-smtp', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' ); }
public function wp_smtp_settings_link( $action_links, $plugin_file ) { if ( $plugin_file === plugin_basename( __FILE__ ) ) {
$ws_settings_link = '<a href="admin.php?page=solidwp-mail-logs">' . __( 'Logs', 'LION' ) . '</a>'; array_unshift( $action_links, $ws_settings_link );
$ws_settings_link = '<a href="admin.php?page=solidwp-mail">' . __( 'Settings', 'LION' ) . '</a>'; array_unshift( $action_links, $ws_settings_link ); }
return $action_links; } }
new WP_SMTP();
|