PluginProbe ʕ •ᴥ•ʔ
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin / 1.2.4
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin v1.2.4
0.9.6 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.6.0 1.6.2 1.7.0 1.7.1 1.8.0 1.8.1 1.9.0 2.0.0 2.0.1 2.1.1 2.2.1 2.3.1 2.4.0 2.5.0 2.5.1 2.6.0 2.7.0 2.8.0 2.9.0 3.0.1 3.0.2 3.0.3 3.1.0 3.10.0 3.11.0 3.11.1 3.2.0 3.2.1 3.3.0 3.4.0 3.5.0 3.5.1 3.5.2 3.6.1 3.7.0 3.8.0 3.8.2 3.9.0 4.0.1 4.1.0 4.1.1 4.2.0 4.3.0 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.8.0 trunk 0.10.0 0.10.1 0.11.1 0.11.2 0.3.1 0.3.2 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.5.2 0.6 0.7 0.8 0.8.2 0.8.3 0.8.4 0.8.5 0.8.6 0.8.7 0.9.0 0.9.1 0.9.2 0.9.3 0.9.4 0.9.5
wp-mail-smtp / wp-mail-smtp.php
wp-mail-smtp Last commit date
assets 8 years ago languages 8 years ago src 8 years ago vendor 8 years ago class-wpms-am-notification.php 8 years ago readme.txt 8 years ago wp-mail-smtp.php 8 years ago wp_mail_smtp.php 8 years ago
wp-mail-smtp.php
81 lines
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit; // Exit if accessed directly.
5 }
6
7 /**
8 * Autoloader. Inspired by PSR-4 examples:
9 *
10 * @link https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader-examples.md
11 *
12 * @since 1.0.0
13 *
14 * @param string $class The fully-qualified class name.
15 */
16 spl_autoload_register( function ( $class ) {
17
18 list( $plugin_space ) = explode( '\\', $class );
19 if ( $plugin_space !== 'WPMailSMTP' ) {
20 return;
21 }
22
23 $plugin_folder = 'wp-mail-smtp';
24
25 // Default directory for all code is plugin's /src/.
26 $base_dir = WP_PLUGIN_DIR . '/' . $plugin_folder . '/src/';
27
28 // Get the relative class name.
29 $relative_class = substr( $class, strlen( $plugin_space ) + 1 );
30
31 /**
32 * Normalize a filesystem path.
33 * Copy of the `wp_normalize_path()` from WordPress 3.9.
34 *
35 * @since 1.2.0
36 *
37 * @param string $path
38 *
39 * @return string
40 */
41 $normalize = function( $path ) {
42 $path = str_replace( '\\', '/', $path );
43 $path = preg_replace( '|(?<=.)/+|', '/', $path );
44 if ( ':' === substr( $path, 1, 1 ) ) {
45 $path = ucfirst( $path );
46 }
47 return $path;
48 };
49
50 // Prepare a path to a file.
51 $file = $normalize( $base_dir . $relative_class . '.php' );
52
53 // If the file exists, require it.
54 if ( is_readable( $file ) ) {
55 /** @noinspection PhpIncludeInspection */
56 require_once $file;
57 }
58 } );
59
60 /**
61 * Global function-holder. Works similar to a singleton's instance().
62 *
63 * @since 1.0.0
64 *
65 * @return WPMailSMTP\Core
66 */
67 function wp_mail_smtp() {
68 /**
69 * @var \WPMailSMTP\Core
70 */
71 static $core;
72
73 if ( ! isset( $core ) ) {
74 $core = new \WPMailSMTP\Core();
75 }
76
77 return $core;
78 }
79
80 wp_mail_smtp();
81