PluginProbe ʕ •ᴥ•ʔ
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin / 3.3.0
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin v3.3.0
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 / src / Conflicts.php
wp-mail-smtp / src Last commit date
Admin 4 years ago Compatibility 4 years ago Helpers 4 years ago Providers 4 years ago Reports 4 years ago Tasks 4 years ago UsageTracking 4 years ago Conflicts.php 4 years ago Connect.php 4 years ago Core.php 4 years ago Debug.php 4 years ago Geo.php 4 years ago MailCatcher.php 4 years ago MailCatcherInterface.php 4 years ago MailCatcherV6.php 4 years ago Migration.php 4 years ago MigrationAbstract.php 4 years ago Options.php 4 years ago Processor.php 4 years ago SiteHealth.php 4 years ago Upgrade.php 4 years ago Uploads.php 4 years ago WP.php 4 years ago
Conflicts.php
516 lines
1 <?php
2
3 namespace WPMailSMTP;
4
5 /**
6 * Class Conflicts
7 *
8 * @since 1.5.0
9 */
10 class Conflicts {
11
12 /**
13 * List of plugins WP Mail SMTP may be conflicting with.
14 *
15 * @since 1.5.0
16 * @since 2.8.0 Updated the format of the plugins array.
17 *
18 * @var array List of plugins WP Mail SMTP may be conflicting with.
19 */
20 public static $plugins = [];
21
22 /**
23 * Conflict information.
24 *
25 * @var array
26 */
27 protected $conflict = [];
28
29 /**
30 * Constructor.
31 *
32 * @since 2.9.0
33 */
34 public function __construct() {
35
36 self::$plugins = [
37
38 /**
39 * Url: https://wordpress.org/plugins/easy-wp-smtp/
40 */
41 [
42 'name' => 'Easy WP SMTP',
43 'slug' => 'easy-wp-smtp/easy-wp-smtp.php',
44 'class' => 'EasyWPSMTP',
45 ],
46
47 /**
48 * Closed.
49 *
50 * Url: https://wordpress.org/plugins/postman-smtp/
51 */
52 [
53 'name' => 'Postman SMTP',
54 'slug' => 'postman-smtp/postman-smtp.php',
55 'function' => 'postman_start',
56 ],
57
58 /**
59 * Url: https://wordpress.org/plugins/post-smtp/
60 */
61 [
62 'name' => 'Post SMTP',
63 'slug' => 'post-smtp/postman-smtp.php',
64 'function' => 'post_smtp_start',
65 ],
66
67 /**
68 * Url: https://wordpress.org/plugins/wp-mail-bank/
69 */
70 [
71 'name' => 'Mail Bank',
72 'slug' => 'wp-mail-bank/wp-mail-bank.php',
73 'function' => 'mail_bank',
74 ],
75
76 /**
77 * Url: https://wordpress.org/plugins/smtp-mailer/
78 */
79 [
80 'name' => 'SMTP Mailer',
81 'slug' => 'smtp-mailer/main.php',
82 'class' => 'SMTP_MAILER',
83 ],
84
85 /**
86 * Url: https://wordpress.org/plugins/gmail-smtp/
87 */
88 [
89 'name' => 'Gmail SMTP',
90 'slug' => 'gmail-smtp/main.php',
91 'class' => 'GMAIL_SMTP',
92 ],
93
94 /**
95 * Url: https://wordpress.org/plugins/wp-email-smtp/
96 */
97 [
98 'name' => 'WP Email SMTP',
99 'class' => 'WP_Email_Smtp',
100 ],
101
102 /**
103 * Url: https://wordpress.org/plugins/smtp-mail/
104 */
105 [
106 'name' => 'SMTP Mail',
107 'slug' => 'smtp-mail/index.php',
108 'function' => 'smtpmail_include',
109 ],
110
111 /**
112 * Url: https://wordpress.org/plugins/bws-smtp/
113 */
114 [
115 'name' => 'SMTP by BestWebSoft',
116 'slug' => 'bws-smtp/bws-smtp.php',
117 'function' => 'bwssmtp_init',
118 ],
119
120 /**
121 * Url: https://wordpress.org/plugins/wp-sendgrid-smtp/
122 */
123 [
124 'name' => 'WP SendGrid SMTP',
125 'slug' => 'wp-sendgrid-smtp/wp-sendgrid-smtp.php',
126 'class' => 'WPSendGrid_SMTP',
127 ],
128
129 /**
130 * Url: https://wordpress.org/plugins/sar-friendly-smtp/
131 */
132 [
133 'name' => 'SAR Friendly SMTP',
134 'slug' => 'sar-friendly-smtp/sar-friendly-smtp.php',
135 'function' => 'sar_friendly_smtp',
136 ],
137
138 /**
139 * Url: https://wordpress.org/plugins/wp-gmail-smtp/
140 */
141 [
142 'name' => 'WP Gmail SMTP',
143 'slug' => 'wp-gmail-smtp/wp-gmail-smtp.php',
144 'class' => 'WPGmail_SMTP',
145 ],
146
147 /**
148 * Url: https://wordpress.org/plugins/cimy-swift-smtp/
149 */
150 [
151 'name' => 'Cimy Swift SMTP',
152 'slug' => 'cimy-swift-smtp/cimy_swift_smtp.php',
153 'function' => 'st_smtp_check_config',
154 ],
155
156 /**
157 * Closed.
158 *
159 * Url: https://wordpress.org/plugins/wp-easy-smtp/
160 */
161 [
162 'name' => 'WP Easy SMTP',
163 'slug' => 'wp-easy-smtp/wp-easy-smtp.php',
164 'class' => 'WP_Easy_SMTP',
165 ],
166
167 /**
168 * Url: https://wordpress.org/plugins/wp-mailgun-smtp/
169 */
170 [
171 'name' => 'WP Mailgun SMTP',
172 'slug' => 'wp-mailgun-smtp/wp-mailgun-smtp.php',
173 'class' => 'WPMailgun_SMTP',
174 ],
175
176 /**
177 * Url: https://wordpress.org/plugins/my-smtp-wp/
178 */
179 [
180 'name' => 'MY SMTP WP',
181 'slug' => 'my-smtp-wp/my-smtp-wp.php',
182 'function' => 'my_smtp_wp',
183 ],
184
185 /**
186 * Closed.
187 *
188 * Url: https://wordpress.org/plugins/wp-mail-booster/
189 */
190 [
191 'name' => 'WP Mail Booster',
192 'slug' => 'wp-mail-booster/wp-mail-booster.php',
193 'function' => 'mail_booster',
194 ],
195
196 /**
197 * Url: https://wordpress.org/plugins/sendgrid-email-delivery-simplified/
198 */
199 [
200 'name' => 'SendGrid',
201 'slug' => 'sendgrid-email-delivery-simplified/wpsendgrid.php',
202 'class' => 'Sendgrid_Settings',
203 ],
204
205 /**
206 * Url: https://wordpress.org/plugins/wp-mail-smtp-mailer/
207 */
208 [
209 'name' => 'WP Mail Smtp Mailer',
210 'slug' => 'wp-mail-smtp-mailer/wp-mail-smtp-mailer.php',
211 'function' => 'WPMS_php_mailer',
212 ],
213
214 /**
215 * Closed.
216 *
217 * Url: https://wordpress.org/plugins/wp-amazon-ses-smtp/
218 */
219 [
220 'name' => 'WP Amazon SES SMTP',
221 'slug' => 'wp-amazon-ses-smtp/wp-amazon-ses.php',
222 'class' => 'WPAmazonSES_SMTP',
223 ],
224
225 /**
226 * Url: https://wordpress.org/plugins/postmark-approved-wordpress-plugin/
227 */
228 [
229 'name' => 'Postmark (Official)',
230 'slug' => 'postmark-approved-wordpress-plugin/postmark.php',
231 'class' => 'Postmark_Mail',
232 ],
233
234 /**
235 * Url: https://wordpress.org/plugins/mailgun/
236 */
237 [
238 'name' => 'Mailgun',
239 'slug' => 'mailgun/mailgun.php',
240 'class' => 'Mailgun',
241 ],
242
243 /**
244 * Url: https://wordpress.org/plugins/sparkpost/
245 */
246 [
247 'name' => 'SparkPost',
248 'slug' => 'sparkpost/wordpress-sparkpost.php',
249 'class' => 'WPSparkPost\SparkPost',
250 ],
251
252 /**
253 * Url: https://wordpress.org/plugins/wp-yahoo-smtp/
254 */
255 [
256 'name' => 'WP Yahoo SMTP',
257 'slug' => 'wp-yahoo-smtp/wp-yahoo-smtp.php',
258 'class' => 'WPYahoo_SMTP',
259 ],
260
261 /**
262 * Url: https://wordpress.org/plugins/wp-ses/
263 */
264 [
265 'name' => 'WP Offload SES Lite',
266 'slug' => 'wp-ses/wp-ses.php',
267 'function' => 'wp_offload_ses_lite_init',
268 ],
269
270 /**
271 * Url: https://deliciousbrains.com/wp-offload-ses/
272 */
273 [
274 'name' => 'WP Offload SES',
275 'slug' => 'wp-offload-ses/wp-offload-ses.php',
276 ],
277
278 /**
279 * Url: https://wordpress.org/plugins/turbosmtp/
280 */
281 [
282 'name' => 'turboSMTP',
283 'slug' => 'turbosmtp/turbo-smtp-plugin.php',
284 'function' => 'TSPHPMailer',
285 ],
286
287 /**
288 * Url: https://wordpress.org/plugins/wp-smtp/
289 */
290 [
291 'name' => 'WP SMTP',
292 'slug' => 'wp-smtp/wp-smtp.php',
293 'class' => 'WP_SMTP',
294 ],
295
296 /**
297 * This plugin can be used along with our plugin if disable next option
298 * WooCommerce -> Settings -> Sendinblue -> Email Options -> Enable Sendinblue to send WooCommerce emails.
299 *
300 * Url: https://wordpress.org/plugins/woocommerce-sendinblue-newsletter-subscription
301 */
302 [
303 'name' => 'Sendinblue - WooCommerce Email Marketing',
304 'slug' => 'woocommerce-sendinblue-newsletter-subscription/woocommerce-sendinblue.php',
305 'class' => 'WC_Sendinblue_Integration',
306 'test' => 'test_wc_sendinblue_integration',
307 'message' => esc_html__( 'Or disable the Sendinblue email sending setting in WooCommerce > Settings > Sendinblue (tab) > Email Options (tab) > Enable Sendinblue to send WooCommerce emails.', 'wp-mail-smtp' ),
308 ],
309
310 /**
311 * Url: https://wordpress.org/plugins/disable-emails/
312 */
313 [
314 'name' => 'Disable Emails',
315 'slug' => 'disable-emails/disable-emails.php',
316 'class' => '\webaware\disable_emails\Plugin',
317 ],
318
319 /**
320 * Url: https://wordpress.org/plugins/fluent-smtp/
321 */
322 [
323 'name' => 'FluentSMTP',
324 'slug' => 'fluent-smtp/fluent-smtp.php',
325 'function' => 'fluentSmtpInit',
326 ],
327
328 /**
329 * This plugin can be used along with our plugin if enable next option
330 * Settings > Email template > Sender (tab) -> Do not change email sender by default.
331 *
332 * Url: https://wordpress.org/plugins/wp-html-mail/
333 */
334 [
335 'name' => 'WP HTML Mail - Email Template Designer',
336 'slug' => 'wp-html-mail/wp-html-mail.php',
337 'function' => 'Haet_Mail',
338 'test' => 'test_wp_html_mail_integration',
339 'message' => esc_html__( 'Or enable "Do not change email sender by default" setting in Settings > Email template > Sender (tab).', 'wp-mail-smtp' ),
340 ],
341 ];
342 }
343
344 /**
345 * Whether we have a conflict with predefined list of plugins.
346 *
347 * @since 1.5.0
348 *
349 * @return bool
350 */
351 public function is_detected() {
352
353 foreach ( self::$plugins as $plugin ) {
354 if ( $this->is_conflicting_plugin( $plugin ) ) {
355 $this->conflict = $plugin;
356 break;
357 }
358 }
359
360 return ! empty( $this->conflict );
361 }
362
363 /**
364 * Whether we have a conflict with plugin.
365 *
366 * @since 2.9.0
367 *
368 * @param array $plugin Plugin data.
369 *
370 * @return bool
371 */
372 protected function is_conflicting_plugin( $plugin ) {
373
374 $conflict = false;
375
376 if ( isset( $plugin['slug'] ) && WP::is_plugin_activated( $plugin['slug'] ) ) {
377 $conflict = true;
378 } elseif ( isset( $plugin['class'] ) && class_exists( $plugin['class'], false ) ) {
379 $conflict = true;
380 } elseif ( isset( $plugin['function'] ) && function_exists( $plugin['function'] ) ) {
381 $conflict = true;
382 }
383
384 if (
385 $conflict &&
386 isset( $plugin['test'] ) &&
387 is_callable( [ $this, $plugin['test'] ] )
388 ) {
389 $conflict = call_user_func( [ $this, $plugin['test'] ] );
390 }
391
392 /**
393 * Filters whether the plugin is conflicting.
394 *
395 * @since 2.9.0
396 *
397 * @param bool $conflict Whether the plugin is conflicting.
398 * @param array $plugin {
399 * Plugin data.
400 *
401 * @type string $name Plugin name.
402 * @type string $slug Plugin slug.
403 * }
404 */
405 return apply_filters( 'wp_mail_smtp_conflicts_is_conflicting_plugin', $conflict, $plugin );
406 }
407
408 /**
409 * Add a warning admin message to a user about the conflicting plugin.
410 *
411 * @since 1.5.0
412 */
413 public function notify() {
414
415 if ( empty( $this->conflict ) ) {
416 return;
417 }
418
419 WP::add_admin_notice( $this->get_conflict_message(), WP::ADMIN_NOTICE_WARNING );
420 }
421
422 /**
423 * Get the conflicting plugin name is any.
424 *
425 * @since 1.5.0
426 *
427 * @return null|string
428 */
429 public function get_conflict_name() {
430
431 $name = null;
432
433 if ( ! empty( $this->conflict['name'] ) ) {
434 $name = $this->conflict['name'];
435 }
436
437 return $name;
438 }
439
440 /**
441 * Get the conflicting plugin message.
442 *
443 * @since 2.9.0
444 *
445 * @return string
446 */
447 public function get_conflict_message() {
448
449 $message = sprintf( /* translators: %1$s - Plugin name causing conflict. */
450 esc_html__( 'Heads up! WP Mail SMTP has detected %1$s is activated. Please deactivate %1$s to prevent conflicts.', 'wp-mail-smtp' ),
451 $this->get_conflict_name()
452 );
453
454 if ( ! empty( $this->conflict['message'] ) ) {
455 $message .= ' ' . $this->conflict['message'];
456 }
457
458 return $message;
459 }
460
461 /**
462 * Check whether we have conflict with "WooCommerce Sendinblue Newsletter Subscription" plugin.
463 *
464 * @since 2.9.0
465 *
466 * @return bool Returns true if we have conflict otherwise false.
467 */
468 protected function test_wc_sendinblue_integration() {
469
470 // Check requirements for test.
471 if (
472 ! class_exists( 'WC_Sendinblue_Integration', false ) ||
473 ! property_exists( 'WC_Sendinblue_Integration', 'ws_smtp_enabled' )
474 ) {
475 return true;
476 }
477
478 // Display or hide conflict message after toggle "Enable Sendinblue to send WooCommerce emails" option.
479 // phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
480 if (
481 ! empty( $_POST ) &&
482 ( isset( $_GET['page'] ) && $_GET['page'] === 'wc-settings' ) &&
483 ( isset( $_GET['tab'] ) && $_GET['tab'] === 'sendinblue' ) &&
484 ( isset( $_GET['section'] ) && $_GET['section'] === 'email_options' )
485 ) {
486 return isset( $_POST['ws_smtp_enable'] );
487 }
488 // phpcs:enable
489
490 return \WC_Sendinblue_Integration::$ws_smtp_enabled === 'yes';
491 }
492
493 /**
494 * Check whether we have conflict with "WP HTML Mail - Email Template Designer" plugin.
495 *
496 * @since 3.3.0
497 *
498 * @return bool Returns true if we have conflict otherwise false.
499 */
500 protected function test_wp_html_mail_integration() {
501
502 // Check requirements for test.
503 if (
504 ! function_exists( 'Haet_Mail' ) ||
505 ! is_object( Haet_Mail() ) ||
506 ! method_exists( Haet_Mail(), 'get_options' )
507 ) {
508 return true;
509 }
510
511 $options = Haet_Mail()->get_options();
512
513 return ! isset( $options['disable_sender'] ) || ! $options['disable_sender'];
514 }
515 }
516