Admin
6 months ago
Compatibility
6 months ago
Helpers
6 months ago
Providers
6 months ago
Queue
6 months ago
Reports
6 months ago
Tasks
6 months ago
UsageTracking
6 months ago
AbstractConnection.php
6 months ago
Conflicts.php
6 months ago
Connect.php
6 months ago
Connection.php
6 months ago
ConnectionInterface.php
6 months ago
ConnectionsManager.php
6 months ago
Core.php
6 months ago
DBRepair.php
6 months ago
Debug.php
6 months ago
Geo.php
6 months ago
MailCatcher.php
6 months ago
MailCatcherInterface.php
6 months ago
MailCatcherTrait.php
6 months ago
MailCatcherV6.php
6 months ago
Migration.php
6 months ago
MigrationAbstract.php
6 months ago
Migrations.php
6 months ago
OptimizedEmailSending.php
6 months ago
Options.php
6 months ago
Processor.php
6 months ago
SiteHealth.php
6 months ago
Upgrade.php
6 months ago
Uploads.php
6 months ago
WP.php
6 months ago
WPMailArgs.php
6 months ago
WPMailInitiator.php
6 months ago
Conflicts.php
631 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 | * All detected conflicting plugins. |
| 24 | * |
| 25 | * @since 1.5.0 |
| 26 | * @since 3.6.0 Changed from storing a single conflicting plugin info to storing multiple conflicting plugin items. |
| 27 | * |
| 28 | * @var array |
| 29 | */ |
| 30 | protected $conflict = []; |
| 31 | |
| 32 | /** |
| 33 | * Constructor. |
| 34 | * |
| 35 | * @since 2.9.0 |
| 36 | */ |
| 37 | public function __construct() { |
| 38 | |
| 39 | self::$plugins = [ |
| 40 | |
| 41 | /** |
| 42 | * Url: https://wordpress.org/plugins/easy-wp-smtp/ |
| 43 | */ |
| 44 | [ |
| 45 | 'name' => 'Easy WP SMTP', |
| 46 | 'slug' => 'easy-wp-smtp/easy-wp-smtp.php', |
| 47 | 'class' => 'EasyWPSMTP', |
| 48 | ], |
| 49 | |
| 50 | /** |
| 51 | * Closed. |
| 52 | * |
| 53 | * Url: https://wordpress.org/plugins/postman-smtp/ |
| 54 | */ |
| 55 | [ |
| 56 | 'name' => 'Postman SMTP', |
| 57 | 'slug' => 'postman-smtp/postman-smtp.php', |
| 58 | 'function' => 'postman_start', |
| 59 | ], |
| 60 | |
| 61 | /** |
| 62 | * Url: https://wordpress.org/plugins/post-smtp/ |
| 63 | */ |
| 64 | [ |
| 65 | 'name' => 'Post SMTP', |
| 66 | 'slug' => 'post-smtp/postman-smtp.php', |
| 67 | 'function' => 'post_smtp_start', |
| 68 | ], |
| 69 | |
| 70 | /** |
| 71 | * Url: https://wordpress.org/plugins/wp-mail-bank/ |
| 72 | */ |
| 73 | [ |
| 74 | 'name' => 'Mail Bank', |
| 75 | 'slug' => 'wp-mail-bank/wp-mail-bank.php', |
| 76 | 'function' => 'mail_bank', |
| 77 | ], |
| 78 | |
| 79 | /** |
| 80 | * Url: https://wordpress.org/plugins/smtp-mailer/ |
| 81 | */ |
| 82 | [ |
| 83 | 'name' => 'SMTP Mailer', |
| 84 | 'slug' => 'smtp-mailer/main.php', |
| 85 | 'class' => 'SMTP_MAILER', |
| 86 | ], |
| 87 | |
| 88 | /** |
| 89 | * Url: https://wordpress.org/plugins/gmail-smtp/ |
| 90 | */ |
| 91 | [ |
| 92 | 'name' => 'Gmail SMTP', |
| 93 | 'slug' => 'gmail-smtp/main.php', |
| 94 | 'class' => 'GMAIL_SMTP', |
| 95 | ], |
| 96 | |
| 97 | /** |
| 98 | * Url: https://wordpress.org/plugins/wp-email-smtp/ |
| 99 | */ |
| 100 | [ |
| 101 | 'name' => 'WP Email SMTP', |
| 102 | 'class' => 'WP_Email_Smtp', |
| 103 | ], |
| 104 | |
| 105 | /** |
| 106 | * Url: https://wordpress.org/plugins/smtp-mail/ |
| 107 | */ |
| 108 | [ |
| 109 | 'name' => 'SMTP Mail', |
| 110 | 'slug' => 'smtp-mail/index.php', |
| 111 | 'function' => 'smtpmail_include', |
| 112 | ], |
| 113 | |
| 114 | /** |
| 115 | * Url: https://wordpress.org/plugins/bws-smtp/ |
| 116 | */ |
| 117 | [ |
| 118 | 'name' => 'SMTP by BestWebSoft', |
| 119 | 'slug' => 'bws-smtp/bws-smtp.php', |
| 120 | 'function' => 'bwssmtp_init', |
| 121 | ], |
| 122 | |
| 123 | /** |
| 124 | * Url: https://wordpress.org/plugins/wp-sendgrid-smtp/ |
| 125 | */ |
| 126 | [ |
| 127 | 'name' => 'WP SendGrid SMTP', |
| 128 | 'slug' => 'wp-sendgrid-smtp/wp-sendgrid-smtp.php', |
| 129 | 'class' => 'WPSendGrid_SMTP', |
| 130 | ], |
| 131 | |
| 132 | /** |
| 133 | * Url: https://wordpress.org/plugins/sar-friendly-smtp/ |
| 134 | */ |
| 135 | [ |
| 136 | 'name' => 'SAR Friendly SMTP', |
| 137 | 'slug' => 'sar-friendly-smtp/sar-friendly-smtp.php', |
| 138 | 'function' => 'sar_friendly_smtp', |
| 139 | ], |
| 140 | |
| 141 | /** |
| 142 | * Url: https://wordpress.org/plugins/wp-gmail-smtp/ |
| 143 | */ |
| 144 | [ |
| 145 | 'name' => 'WP Gmail SMTP', |
| 146 | 'slug' => 'wp-gmail-smtp/wp-gmail-smtp.php', |
| 147 | 'class' => 'WPGmail_SMTP', |
| 148 | ], |
| 149 | |
| 150 | /** |
| 151 | * Url: https://wordpress.org/plugins/cimy-swift-smtp/ |
| 152 | */ |
| 153 | [ |
| 154 | 'name' => 'Cimy Swift SMTP', |
| 155 | 'slug' => 'cimy-swift-smtp/cimy_swift_smtp.php', |
| 156 | 'function' => 'st_smtp_check_config', |
| 157 | ], |
| 158 | |
| 159 | /** |
| 160 | * Closed. |
| 161 | * |
| 162 | * Url: https://wordpress.org/plugins/wp-easy-smtp/ |
| 163 | */ |
| 164 | [ |
| 165 | 'name' => 'WP Easy SMTP', |
| 166 | 'slug' => 'wp-easy-smtp/wp-easy-smtp.php', |
| 167 | 'class' => 'WP_Easy_SMTP', |
| 168 | ], |
| 169 | |
| 170 | /** |
| 171 | * Url: https://wordpress.org/plugins/wp-mailgun-smtp/ |
| 172 | */ |
| 173 | [ |
| 174 | 'name' => 'WP Mailgun SMTP', |
| 175 | 'slug' => 'wp-mailgun-smtp/wp-mailgun-smtp.php', |
| 176 | 'class' => 'WPMailgun_SMTP', |
| 177 | ], |
| 178 | |
| 179 | /** |
| 180 | * Url: https://wordpress.org/plugins/my-smtp-wp/ |
| 181 | */ |
| 182 | [ |
| 183 | 'name' => 'MY SMTP WP', |
| 184 | 'slug' => 'my-smtp-wp/my-smtp-wp.php', |
| 185 | 'function' => 'my_smtp_wp', |
| 186 | ], |
| 187 | |
| 188 | /** |
| 189 | * Closed. |
| 190 | * |
| 191 | * Url: https://wordpress.org/plugins/wp-mail-booster/ |
| 192 | */ |
| 193 | [ |
| 194 | 'name' => 'WP Mail Booster', |
| 195 | 'slug' => 'wp-mail-booster/wp-mail-booster.php', |
| 196 | 'function' => 'mail_booster', |
| 197 | ], |
| 198 | |
| 199 | /** |
| 200 | * Url: https://wordpress.org/plugins/sendgrid-email-delivery-simplified/ |
| 201 | */ |
| 202 | [ |
| 203 | 'name' => 'SendGrid', |
| 204 | 'slug' => 'sendgrid-email-delivery-simplified/wpsendgrid.php', |
| 205 | 'class' => 'Sendgrid_Settings', |
| 206 | ], |
| 207 | |
| 208 | /** |
| 209 | * Url: https://wordpress.org/plugins/wp-mail-smtp-mailer/ |
| 210 | */ |
| 211 | [ |
| 212 | 'name' => 'WP Mail Smtp Mailer', |
| 213 | 'slug' => 'wp-mail-smtp-mailer/wp-mail-smtp-mailer.php', |
| 214 | 'function' => 'WPMS_php_mailer', |
| 215 | ], |
| 216 | |
| 217 | /** |
| 218 | * Closed. |
| 219 | * |
| 220 | * Url: https://wordpress.org/plugins/wp-amazon-ses-smtp/ |
| 221 | */ |
| 222 | [ |
| 223 | 'name' => 'WP Amazon SES SMTP', |
| 224 | 'slug' => 'wp-amazon-ses-smtp/wp-amazon-ses.php', |
| 225 | 'class' => 'WPAmazonSES_SMTP', |
| 226 | ], |
| 227 | |
| 228 | /** |
| 229 | * Url: https://wordpress.org/plugins/postmark-approved-wordpress-plugin/ |
| 230 | */ |
| 231 | [ |
| 232 | 'name' => 'Postmark (Official)', |
| 233 | 'slug' => 'postmark-approved-wordpress-plugin/postmark.php', |
| 234 | 'class' => 'Postmark_Mail', |
| 235 | ], |
| 236 | |
| 237 | /** |
| 238 | * Url: https://wordpress.org/plugins/mailgun/ |
| 239 | */ |
| 240 | [ |
| 241 | 'name' => 'Mailgun', |
| 242 | 'slug' => 'mailgun/mailgun.php', |
| 243 | 'class' => 'Mailgun', |
| 244 | ], |
| 245 | |
| 246 | /** |
| 247 | * Url: https://wordpress.org/plugins/sparkpost/ |
| 248 | */ |
| 249 | [ |
| 250 | 'name' => 'SparkPost', |
| 251 | 'slug' => 'sparkpost/wordpress-sparkpost.php', |
| 252 | 'class' => 'WPSparkPost\SparkPost', |
| 253 | ], |
| 254 | |
| 255 | /** |
| 256 | * Url: https://wordpress.org/plugins/wp-yahoo-smtp/ |
| 257 | */ |
| 258 | [ |
| 259 | 'name' => 'WP Yahoo SMTP', |
| 260 | 'slug' => 'wp-yahoo-smtp/wp-yahoo-smtp.php', |
| 261 | 'class' => 'WPYahoo_SMTP', |
| 262 | ], |
| 263 | |
| 264 | /** |
| 265 | * Url: https://wordpress.org/plugins/wp-ses/ |
| 266 | */ |
| 267 | [ |
| 268 | 'name' => 'WP Offload SES Lite', |
| 269 | 'slug' => 'wp-ses/wp-ses.php', |
| 270 | 'function' => 'wp_offload_ses_lite_init', |
| 271 | ], |
| 272 | |
| 273 | /** |
| 274 | * Url: https://deliciousbrains.com/wp-offload-ses/ |
| 275 | */ |
| 276 | [ |
| 277 | 'name' => 'WP Offload SES', |
| 278 | 'slug' => 'wp-offload-ses/wp-offload-ses.php', |
| 279 | ], |
| 280 | |
| 281 | /** |
| 282 | * Url: https://wordpress.org/plugins/turbosmtp/ |
| 283 | */ |
| 284 | [ |
| 285 | 'name' => 'turboSMTP', |
| 286 | 'slug' => 'turbosmtp/turbo-smtp-plugin.php', |
| 287 | 'function' => 'TSPHPMailer', |
| 288 | ], |
| 289 | |
| 290 | /** |
| 291 | * Url: https://wordpress.org/plugins/wp-smtp/ |
| 292 | */ |
| 293 | [ |
| 294 | 'name' => 'Solid Mail', |
| 295 | 'slug' => 'wp-smtp/wp-smtp.php', |
| 296 | 'class' => 'WP_SMTP', |
| 297 | ], |
| 298 | |
| 299 | /** |
| 300 | * This plugin can be used along with our plugin if disable next option |
| 301 | * WooCommerce -> Settings -> Sendinblue -> Email Options -> Enable Sendinblue to send WooCommerce emails. |
| 302 | * |
| 303 | * Url: https://wordpress.org/plugins/woocommerce-sendinblue-newsletter-subscription |
| 304 | */ |
| 305 | [ |
| 306 | 'name' => 'Sendinblue - WooCommerce Email Marketing', |
| 307 | 'slug' => 'woocommerce-sendinblue-newsletter-subscription/woocommerce-sendinblue.php', |
| 308 | 'class' => 'WC_Sendinblue_Integration', |
| 309 | 'test' => 'test_wc_sendinblue_integration', |
| 310 | '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' ), |
| 311 | ], |
| 312 | |
| 313 | /** |
| 314 | * Url: https://wordpress.org/plugins/disable-emails/ |
| 315 | */ |
| 316 | [ |
| 317 | 'name' => 'Disable Emails', |
| 318 | 'slug' => 'disable-emails/disable-emails.php', |
| 319 | 'class' => '\webaware\disable_emails\Plugin', |
| 320 | ], |
| 321 | |
| 322 | /** |
| 323 | * Url: https://wordpress.org/plugins/fluent-smtp/ |
| 324 | */ |
| 325 | [ |
| 326 | 'name' => 'FluentSMTP', |
| 327 | 'slug' => 'fluent-smtp/fluent-smtp.php', |
| 328 | 'function' => 'fluentSmtpInit', |
| 329 | ], |
| 330 | |
| 331 | /** |
| 332 | * This plugin can be used along with our plugin if enable next option |
| 333 | * Settings > Email template > Sender (tab) -> Do not change email sender by default. |
| 334 | * |
| 335 | * Url: https://wordpress.org/plugins/wp-html-mail/ |
| 336 | */ |
| 337 | [ |
| 338 | 'name' => 'WP HTML Mail - Email Template Designer', |
| 339 | 'slug' => 'wp-html-mail/wp-html-mail.php', |
| 340 | 'function' => 'Haet_Mail', |
| 341 | 'test' => 'test_wp_html_mail_integration', |
| 342 | 'message' => esc_html__( 'Or enable "Do not change email sender by default" setting in Settings > Email template > Sender (tab).', 'wp-mail-smtp' ), |
| 343 | ], |
| 344 | |
| 345 | /** |
| 346 | * This plugin can be used along with our plugin if "SMTP" module is deactivated. |
| 347 | * |
| 348 | * Url: https://wordpress.org/plugins/branda-white-labeling/ |
| 349 | */ |
| 350 | [ |
| 351 | 'name' => 'Branda', |
| 352 | 'slug' => 'branda-white-labeling/ultimate-branding.php', |
| 353 | 'function' => 'set_ultimate_branding', |
| 354 | 'test' => 'test_branda_integration', |
| 355 | 'message' => esc_html__( 'Or deactivate "SMTP" module in Branda > Emails > SMTP.', 'wp-mail-smtp' ), |
| 356 | ], |
| 357 | |
| 358 | /** |
| 359 | * Url: https://wordpress.org/plugins/zoho-mail/ |
| 360 | */ |
| 361 | [ |
| 362 | 'name' => 'Zoho Mail for WordPress', |
| 363 | 'slug' => 'zoho-mail/zohoMail.php', |
| 364 | 'function' => 'zmail_send_mail_callback', |
| 365 | ], |
| 366 | |
| 367 | /** |
| 368 | * Url: https://elementor.com/products/site-mailer/ |
| 369 | */ |
| 370 | [ |
| 371 | 'name' => 'Site Mailer - SMTP Replacement, Email API Deliverability & Email Log', |
| 372 | 'slug' => 'site-mailer/site-mailer.php', |
| 373 | 'class' => 'SiteMailer', |
| 374 | ], |
| 375 | |
| 376 | /** |
| 377 | * Url: https://wordpress.org/plugins/suremails/ |
| 378 | */ |
| 379 | [ |
| 380 | 'name' => 'SureMail', |
| 381 | 'slug' => 'suremails/suremails.php', |
| 382 | 'class' => 'MailHandler', |
| 383 | ], |
| 384 | |
| 385 | /** |
| 386 | * Url: https://www.gravityforms.com/gravity-smtp/ |
| 387 | */ |
| 388 | [ |
| 389 | 'name' => 'Gravity SMTP', |
| 390 | 'slug' => 'gravitysmtp/gravitysmtp.php', |
| 391 | 'class' => 'Gravity_SMTP', |
| 392 | ], |
| 393 | |
| 394 | ]; |
| 395 | } |
| 396 | |
| 397 | /** |
| 398 | * Whether we have a conflict with predefined list of plugins. |
| 399 | * |
| 400 | * @since 1.5.0 |
| 401 | * |
| 402 | * @return bool |
| 403 | */ |
| 404 | public function is_detected() { |
| 405 | |
| 406 | foreach ( self::$plugins as $plugin ) { |
| 407 | if ( $this->is_conflicting_plugin( $plugin ) ) { |
| 408 | $this->conflict[] = $plugin; |
| 409 | } |
| 410 | } |
| 411 | |
| 412 | return ! empty( $this->conflict ); |
| 413 | } |
| 414 | |
| 415 | /** |
| 416 | * Whether we have a conflict with plugin. |
| 417 | * |
| 418 | * @since 2.9.0 |
| 419 | * |
| 420 | * @param array $plugin Plugin data. |
| 421 | * |
| 422 | * @return bool |
| 423 | */ |
| 424 | protected function is_conflicting_plugin( $plugin ) { |
| 425 | |
| 426 | $conflict = false; |
| 427 | |
| 428 | if ( isset( $plugin['slug'] ) && WP::is_plugin_activated( $plugin['slug'] ) ) { |
| 429 | $conflict = true; |
| 430 | } elseif ( isset( $plugin['class'] ) && class_exists( $plugin['class'], false ) ) { |
| 431 | $conflict = true; |
| 432 | } elseif ( isset( $plugin['function'] ) && function_exists( $plugin['function'] ) ) { |
| 433 | $conflict = true; |
| 434 | } |
| 435 | |
| 436 | if ( |
| 437 | $conflict && |
| 438 | isset( $plugin['test'] ) && |
| 439 | is_callable( [ $this, $plugin['test'] ] ) |
| 440 | ) { |
| 441 | $conflict = call_user_func( [ $this, $plugin['test'] ] ); |
| 442 | } |
| 443 | |
| 444 | /** |
| 445 | * Filters whether the plugin is conflicting. |
| 446 | * |
| 447 | * @since 2.9.0 |
| 448 | * |
| 449 | * @param bool $conflict Whether the plugin is conflicting. |
| 450 | * @param array $plugin { |
| 451 | * Plugin data. |
| 452 | * |
| 453 | * @type string $name Plugin name. |
| 454 | * @type string $slug Plugin slug. |
| 455 | * } |
| 456 | */ |
| 457 | return apply_filters( 'wp_mail_smtp_conflicts_is_conflicting_plugin', $conflict, $plugin ); |
| 458 | } |
| 459 | |
| 460 | /** |
| 461 | * Add a warning admin message to a user about the conflicting plugin. |
| 462 | * |
| 463 | * @since 1.5.0 |
| 464 | */ |
| 465 | public function notify() { |
| 466 | |
| 467 | if ( empty( $this->conflict ) ) { |
| 468 | return; |
| 469 | } |
| 470 | |
| 471 | foreach ( $this->conflict as $conflict_plugin ) { |
| 472 | WP::add_admin_notice( $this->get_conflict_message( $conflict_plugin ), WP::ADMIN_NOTICE_WARNING ); |
| 473 | } |
| 474 | } |
| 475 | |
| 476 | /** |
| 477 | * Get the conflicting plugin name is any. |
| 478 | * |
| 479 | * @since 1.5.0 |
| 480 | * @since 3.6.0 Added optional conflict_plugin parameter. |
| 481 | * |
| 482 | * @param array $conflict_plugin The conflicting plugin array. If provided then extract the name from the array. |
| 483 | * Else get the name from first conflicting plugin. |
| 484 | * |
| 485 | * @return null|string |
| 486 | */ |
| 487 | public function get_conflict_name( $conflict_plugin = [] ) { |
| 488 | |
| 489 | $name = null; |
| 490 | |
| 491 | if ( empty( $conflict_plugin ) && isset( $this->conflict[0] ) ) { |
| 492 | $conflict_plugin = $this->conflict[0]; |
| 493 | } |
| 494 | |
| 495 | if ( ! empty( $conflict_plugin['name'] ) ) { |
| 496 | $name = $conflict_plugin['name']; |
| 497 | } |
| 498 | |
| 499 | return $name; |
| 500 | } |
| 501 | |
| 502 | /** |
| 503 | * Get the conflicting plugin message. |
| 504 | * |
| 505 | * @since 2.9.0 |
| 506 | * @since 3.6.0 Added optional conflict_plugin parameter. |
| 507 | * |
| 508 | * @param array $conflict_plugin The conflicting plugin array. If provided then extract the message from the array. |
| 509 | * Else get the message from first conflicting plugin. |
| 510 | * |
| 511 | * @return string |
| 512 | */ |
| 513 | public function get_conflict_message( $conflict_plugin = [] ) { |
| 514 | |
| 515 | if ( empty( $conflict_plugin ) && isset( $this->conflict[0] ) ) { |
| 516 | $conflict_plugin = $this->conflict[0]; |
| 517 | } |
| 518 | |
| 519 | $message = sprintf( /* translators: %1$s - Plugin name causing conflict. */ |
| 520 | esc_html__( 'Heads up! WP Mail SMTP has detected %1$s is activated. Please deactivate %1$s to prevent conflicts.', 'wp-mail-smtp' ), |
| 521 | $this->get_conflict_name( $conflict_plugin ) |
| 522 | ); |
| 523 | |
| 524 | if ( ! empty( $conflict_plugin['message'] ) ) { |
| 525 | $message .= ' ' . $conflict_plugin['message']; |
| 526 | } |
| 527 | |
| 528 | return $message; |
| 529 | } |
| 530 | |
| 531 | /** |
| 532 | * Returns array containing (names) of all the conflicting plugins. |
| 533 | * |
| 534 | * @since 3.6.0 |
| 535 | * |
| 536 | * @return array |
| 537 | */ |
| 538 | public function get_all_conflict_names() { |
| 539 | |
| 540 | if ( empty( $this->conflict ) ) { |
| 541 | return []; |
| 542 | } |
| 543 | |
| 544 | $names_arr = []; |
| 545 | |
| 546 | foreach ( $this->conflict as $conflict_plugin ) { |
| 547 | $names_arr[] = $this->get_conflict_name( $conflict_plugin ); |
| 548 | } |
| 549 | |
| 550 | return $names_arr; |
| 551 | } |
| 552 | |
| 553 | /** |
| 554 | * Check whether we have conflict with "WooCommerce Sendinblue Newsletter Subscription" plugin. |
| 555 | * |
| 556 | * @since 2.9.0 |
| 557 | * @since 3.7.0 Added a version compatibility check. |
| 558 | * |
| 559 | * @return bool Returns true if we have conflict otherwise false. |
| 560 | */ |
| 561 | protected function test_wc_sendinblue_integration() { |
| 562 | |
| 563 | // Since version `3.0.0` "Sendinblue - WooCommerce Email Marketing" plugin no longer conflicts with WP Mail SMTP. |
| 564 | if ( defined( 'SENDINBLUE_WC_PLUGIN_VERSION' ) && version_compare( SENDINBLUE_WC_PLUGIN_VERSION, '3.0.0', '>=' ) ) { |
| 565 | return false; |
| 566 | } |
| 567 | |
| 568 | // Check requirements for test. |
| 569 | if ( |
| 570 | ! class_exists( 'WC_Sendinblue_Integration', false ) || |
| 571 | ! property_exists( 'WC_Sendinblue_Integration', 'ws_smtp_enabled' ) |
| 572 | ) { |
| 573 | return true; |
| 574 | } |
| 575 | |
| 576 | // Display or hide conflict message after toggle "Enable Sendinblue to send WooCommerce emails" option. |
| 577 | // phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing |
| 578 | if ( |
| 579 | ! empty( $_POST ) && |
| 580 | ( isset( $_GET['page'] ) && $_GET['page'] === 'wc-settings' ) && |
| 581 | ( isset( $_GET['tab'] ) && $_GET['tab'] === 'sendinblue' ) && |
| 582 | ( isset( $_GET['section'] ) && $_GET['section'] === 'email_options' ) |
| 583 | ) { |
| 584 | return isset( $_POST['ws_smtp_enable'] ); |
| 585 | } |
| 586 | // phpcs:enable |
| 587 | |
| 588 | return \WC_Sendinblue_Integration::$ws_smtp_enabled === 'yes'; |
| 589 | } |
| 590 | |
| 591 | /** |
| 592 | * Check whether we have conflict with "WP HTML Mail - Email Template Designer" plugin. |
| 593 | * |
| 594 | * @since 3.3.0 |
| 595 | * |
| 596 | * @return bool Returns true if we have conflict otherwise false. |
| 597 | */ |
| 598 | protected function test_wp_html_mail_integration() { |
| 599 | |
| 600 | // Check requirements for test. |
| 601 | if ( |
| 602 | ! function_exists( 'Haet_Mail' ) || |
| 603 | ! is_object( Haet_Mail() ) || |
| 604 | ! method_exists( Haet_Mail(), 'get_options' ) |
| 605 | ) { |
| 606 | return true; |
| 607 | } |
| 608 | |
| 609 | $options = Haet_Mail()->get_options(); |
| 610 | |
| 611 | return ! isset( $options['disable_sender'] ) || ! $options['disable_sender']; |
| 612 | } |
| 613 | |
| 614 | /** |
| 615 | * Check whether we have conflict with "Branda" plugin. |
| 616 | * |
| 617 | * @since 3.5.0 |
| 618 | * |
| 619 | * @return bool Returns true if we have conflict otherwise false. |
| 620 | */ |
| 621 | protected function test_branda_integration() { |
| 622 | |
| 623 | // Check requirements for test. |
| 624 | if ( ! function_exists( 'branda_is_active_module' ) ) { |
| 625 | return true; |
| 626 | } |
| 627 | |
| 628 | return branda_is_active_module( 'emails/smtp.php' ); |
| 629 | } |
| 630 | } |
| 631 |