Version Description
- 2020-03-23 =
- Added: Add various Status tests and Info section on Tools > Site Health page.
- Added: Notify admin if there are unsaved changes in plugin admin area options.
- Fixed: Test email now has a proper bottom margin for better look.
- Changed: Update "About us" plugin page with relevant information.
- Changed: Save default WordPress FROM Email address when incorrect FROM Email address is saved by a user.
Download this release
Release Info
Developer | slaFFik |
Plugin | WP Mail SMTP by WPForms |
Version | 1.9.0 |
Comparing to | |
See all releases |
Code changes from version 1.8.1 to 1.9.0
- assets/css/smtp-about.min.css +1 -1
- assets/css/smtp-admin.min.css +1 -1
- assets/images/about/plugin-rp.png +0 -0
- assets/js/smtp-about.js +3 -3
- assets/js/smtp-about.min.js +1 -1
- assets/js/smtp-admin.js +282 -243
- assets/js/smtp-admin.min.js +1 -1
- assets/languages/wp-mail-smtp.pot +272 -198
- readme.txt +11 -4
- src/Admin/Area.php +4 -2
- src/Admin/Pages/About.php +21 -6
- src/Admin/Pages/TestTab.php +1115 -1130
- src/Core.php +738 -719
- src/Debug.php +122 -122
- src/Options.php +937 -933
- src/Processor.php +20 -0
- src/Providers/Gmail/Mailer.php +222 -209
- src/Providers/MailerAbstract.php +417 -417
- src/Providers/Mailgun/Options.php +161 -161
- src/Providers/OptionsAbstract.php +1 -1
- src/Providers/Pepipost/Options.php +29 -29
- src/Providers/PepipostAPI/Mailer.php +440 -440
- src/Providers/PepipostAPI/Options.php +1 -1
- src/Providers/Sendgrid/Mailer.php +409 -409
- src/SiteHealth.php +180 -0
- wp_mail_smtp.php +3 -3
assets/css/smtp-about.min.css
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
.wp-mail-smtp-page-about{padding:0 !important}.wp-mail-smtp-page-about *,.wp-mail-smtp-page-about *::before,.wp-mail-smtp-page-about *::after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins{padding:0 10px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container{margin-left:-20px;margin-right:-20px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-container{padding:0 10px;float:left;width:33.333333%}@media (max-width: 1249px){.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-container{width:50%}}@media (max-width: 781px){.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-container{width:100%;margin-bottom:20px}}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container h5{font-size:17px;font-weight:700}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item{background-color:#fff;border:1px solid #ddd;border-radius:3px;margin:0 0 40px 0}@media (max-width: 781px){.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item{margin:0 0}}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item img{border:1px solid #eee;float:left;max-width:75px;padding:10px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item img[src*="-mi"]{padding:13px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item h5{margin:0 0 10px 100px;font-size:16px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item p{margin:0 0 0 100px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .details{padding:20px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .actions{background-color:#f7f7f7;border-top:1px solid #ddd;padding:20px;position:relative}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .actions .msg{background-color:#f7f7f7;position:absolute;text-align:center;font-weight:600;top:0;left:0;height:100%;width:100%;z-index:99;padding:20px;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-ms-align-items:center;align-items:center;justify-content:center}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .actions .msg.success{color:#2a9b39}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .actions .msg.error{color:red}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .status{float:left;padding-top:8px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .status .status-inactive{color:red}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .status .status-download{color:#666}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .status .status-active{color:#2a9b39}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button{float:right}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button{background:none;cursor:pointer;width:140px;text-align:center;display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;-webkit-appearance:none;border-radius:3px;border:1px solid #cccccc;background:#f7f7f7;box-shadow:0 1px 0 #cccccc;font-weight:normal}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button:hover,.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button:focus,.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.loading{background:#fafafa;border-color:#999;color:#23282d}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button .fa{margin-right:8px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button .fa.fa-spinner{margin-right:0}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-primary{background:#0085ba;border-color:#0073aa #006799 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-shadow:0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-primary:hover,.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-primary:focus{background:#008ec2;border-color:#006799;color:#fff}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-primary .fa-spinner{color:#fff}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-secondary{color:#555;border-color:#cccccc;background:#f7f7f7;box-shadow:0 1px 0 #cccccc}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-secondary:hover,.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-secondary:focus{background:#fafafa;border-color:#999;color:#23282d}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.status-active .fa{color:#2a9b39}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.status-inactive .fa{color:red}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.status-download .fa{color:#999}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.loading .fa{color:#666}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.disabled{cursor:default}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section{margin:0 0 20px;padding:30px;background:#fff;border:1px solid #E5E6E6;line-height:2}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h1,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h2,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h3,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h4,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h5{margin-top:0;padding-top:0;line-height:1.6}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h2{font-size:24px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h3{font-size:18px;margin-bottom:30px;color:#23282C}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section ul,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section p{font-size:16px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section p{margin-bottom:20px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section p.bigger{font-size:18px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section p.smaller{font-size:14px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section p:last-child{margin-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section hr{margin:30px 0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section figure{margin:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section figure img{width:100%}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section figure figcaption{font-size:14px;color:#888888;margin-top:5px;text-align:center;line-height:initial}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .wp-mail-smtp-admin-column-40{padding-left:15px}@media (max-width: 781px){.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .wp-mail-smtp-admin-column-40{width:100%;padding-left:0;padding-top:20px}}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .wp-mail-smtp-admin-column-60{padding-right:15px}@media (max-width: 781px){.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .wp-mail-smtp-admin-column-60{width:100%;padding-right:0}}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section ul.list-plain{margin-top:0;margin-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section ul.list-plain li{margin-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section ul.list-features li .fa{color:#2a9b39;margin:0 8px 0 0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .fa-star{color:gold}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .no-margin{margin:0 !important}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .no-padding{padding:0 !important}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .centered{text-align:center !important}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero{padding:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-main,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-extra{padding:30px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-extra table{width:100%}@media (max-width: 781px){.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-extra .wp-mail-smtp-admin-column-50{float:none;width:100%}}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-main{background-color:#FAFAFA;border-bottom:1px solid #E5E6E6}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-main.no-border{border-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-main p{color:#666}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero h3.call-to-action{margin-bottom:-10px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero span.price-off{color:#6AB255}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-squashed{margin-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-squashed:not(:last-of-type){border-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post h2{margin-bottom:-10px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post h3{margin-bottom:15px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post p:last-of-type{margin-bottom:30px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-20{padding-right:20px;width:auto}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-20 img{width:270px}@media (max-width: 781px){.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-20{width:20%}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-20 img{width:auto;max-width:100%}}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-80{padding-left:20px;width:calc(100% - 20px - 270px)}@media (max-width: 781px){.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-80{width:80%}}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-about-section-post-link{padding:10px 15px;background-color:#DF7739;color:#fff;border-radius:3px;text-decoration:none;margin-top:15px;font-size:14px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-about-section-post-link:hover{background-color:#B85A1B}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-about-section-post-link .fa{color:#EDBA9E;vertical-align:middle;margin-left:8px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table{border-collapse:collapse}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table tr td{border-bottom:1px solid #E5E6E6;border-right:1px solid #E5E6E6;padding:30px;vertical-align:top}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table tr td:last-of-type{border-right:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table tr:last-child td{border-bottom:none}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table p{background-repeat:no-repeat;background-size:15px auto;background-position:0 6px;margin:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table p.features-full{padding-left:30px;background-image:url(../images/about/icon-full.svg)}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table p.features-none{padding-left:30px;background-image:url(../images/about/icon-none.svg)}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table p.features-partial{padding-left:30px;background-position:-3px 0;background-size:23px auto;background-image:url(../images/about/icon-partial.svg)}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table .wp-mail-smtp-admin-about-section-hero-main{padding:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table .wp-mail-smtp-admin-about-section-hero-main h3{padding:30px 30px 30px 60px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table .wp-mail-smtp-admin-about-section-hero-main .wp-mail-smtp-admin-column-33:first-child h3{padding:30px}
|
2 |
|
3 |
/*# sourceMappingURL=smtp-about.min.css.map */
|
1 |
+
.wp-mail-smtp-page-about{padding:0 !important}.wp-mail-smtp-page-about *,.wp-mail-smtp-page-about *::before,.wp-mail-smtp-page-about *::after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins{padding:0 10px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container{margin-left:-20px;margin-right:-20px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-container{padding:0 10px;float:left;width:33.333333%;margin-bottom:20px}@media (max-width: 1249px){.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-container{width:50%}}@media (max-width: 781px){.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-container{width:100%;margin-bottom:20px}}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container h5{font-size:17px;font-weight:700}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item{background-color:#fff;border:1px solid #ddd;border-radius:3px;margin:0}@media (max-width: 781px){.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item{margin:0 0}}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item img{border:1px solid #eee;float:left;max-width:75px;padding:10px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item img[src*="-mi"]{padding:13px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item h5{margin:0 0 10px 100px;font-size:16px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item p{margin:0 0 0 100px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .details{padding:20px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .actions{background-color:#f7f7f7;border-top:1px solid #ddd;padding:20px;position:relative}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .actions .msg{background-color:#f7f7f7;position:absolute;text-align:center;font-weight:600;top:0;left:0;height:100%;width:100%;z-index:99;padding:20px;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-ms-align-items:center;align-items:center;justify-content:center}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .actions .msg.success{color:#2a9b39}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .actions .msg.error{color:red}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .status{float:left;padding-top:8px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .status .status-inactive{color:red}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .status .status-download{color:#666}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .status .status-active{color:#2a9b39}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button{float:right}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button{background:none;cursor:pointer;width:140px;text-align:center;display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;-webkit-appearance:none;border-radius:3px;border:1px solid #cccccc;background:#f7f7f7;box-shadow:0 1px 0 #cccccc;font-weight:normal}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button:hover,.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button:focus,.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.loading{background:#fafafa;border-color:#999;color:#23282d}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button .fa{margin-right:8px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button .fa.fa-spinner{margin-right:0}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-primary{background:#0085ba;border-color:#0073aa #006799 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-shadow:0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-primary:hover,.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-primary:focus{background:#008ec2;border-color:#006799;color:#fff}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-primary .fa-spinner{color:#fff}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-secondary{color:#555;border-color:#cccccc;background:#f7f7f7;box-shadow:0 1px 0 #cccccc}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-secondary:hover,.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-secondary:focus{background:#fafafa;border-color:#999;color:#23282d}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.status-active .fa{color:#2a9b39}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.status-inactive .fa{color:red}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.status-download .fa{color:#999}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.loading .fa{color:#666}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.disabled{cursor:default}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section{margin:0 0 20px;padding:30px;background:#fff;border:1px solid #E5E6E6;line-height:2}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h1,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h2,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h3,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h4,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h5{margin-top:0;padding-top:0;line-height:1.6}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h2{font-size:24px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h3{font-size:18px;margin-bottom:30px;color:#23282C}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section ul,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section p{font-size:16px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section p{margin-bottom:20px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section p.bigger{font-size:18px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section p.smaller{font-size:14px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section p:last-child{margin-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section hr{margin:30px 0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section figure{margin:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section figure img{width:100%}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section figure figcaption{font-size:14px;color:#888888;margin-top:5px;text-align:center;line-height:initial}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .wp-mail-smtp-admin-column-40{padding-left:15px}@media (max-width: 781px){.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .wp-mail-smtp-admin-column-40{width:100%;padding-left:0;padding-top:20px}}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .wp-mail-smtp-admin-column-60{padding-right:15px}@media (max-width: 781px){.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .wp-mail-smtp-admin-column-60{width:100%;padding-right:0}}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section ul.list-plain{margin-top:0;margin-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section ul.list-plain li{margin-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section ul.list-features li .fa{color:#2a9b39;margin:0 8px 0 0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .fa-star{color:gold}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .no-margin{margin:0 !important}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .no-padding{padding:0 !important}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .centered{text-align:center !important}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero{padding:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-main,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-extra{padding:30px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-extra table{width:100%}@media (max-width: 781px){.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-extra .wp-mail-smtp-admin-column-50{float:none;width:100%}}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-main{background-color:#FAFAFA;border-bottom:1px solid #E5E6E6}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-main.no-border{border-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-main p{color:#666}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero h3.call-to-action{margin-bottom:-10px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero span.price-off{color:#6AB255}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-squashed{margin-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-squashed:not(:last-of-type){border-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post h2{margin-bottom:-10px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post h3{margin-bottom:15px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post p:last-of-type{margin-bottom:30px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-20{padding-right:20px;width:auto}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-20 img{width:270px}@media (max-width: 781px){.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-20{width:20%}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-20 img{width:auto;max-width:100%}}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-80{padding-left:20px;width:calc(100% - 20px - 270px)}@media (max-width: 781px){.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-80{width:80%}}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-about-section-post-link{padding:10px 15px;background-color:#DF7739;color:#fff;border-radius:3px;text-decoration:none;margin-top:15px;font-size:14px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-about-section-post-link:hover{background-color:#B85A1B}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-about-section-post-link .fa{color:#EDBA9E;vertical-align:middle;margin-left:8px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table{border-collapse:collapse}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table tr td{border-bottom:1px solid #E5E6E6;border-right:1px solid #E5E6E6;padding:30px;vertical-align:top}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table tr td:last-of-type{border-right:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table tr:last-child td{border-bottom:none}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table p{background-repeat:no-repeat;background-size:15px auto;background-position:0 6px;margin:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table p.features-full{padding-left:30px;background-image:url(../images/about/icon-full.svg)}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table p.features-none{padding-left:30px;background-image:url(../images/about/icon-none.svg)}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table p.features-partial{padding-left:30px;background-position:-3px 0;background-size:23px auto;background-image:url(../images/about/icon-partial.svg)}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table .wp-mail-smtp-admin-about-section-hero-main{padding:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table .wp-mail-smtp-admin-about-section-hero-main h3{padding:30px 30px 30px 60px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table .wp-mail-smtp-admin-about-section-hero-main .wp-mail-smtp-admin-column-33:first-child h3{padding:30px}
|
2 |
|
3 |
/*# sourceMappingURL=smtp-about.min.css.map */
|
assets/css/smtp-admin.min.css
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
#wpcontent{padding-left:0 !important;position:relative}@media (max-width: 600px){#wpcontent{padding-top:46px}}@media (max-width: 600px){#wpbody{padding-top:0}}body.toplevel_page_wp-mail-smtp div.jconfirm *,body.toplevel_page_wp-mail-smtp div.jconfirm *::before,body.toplevel_page_wp-mail-smtp div.jconfirm *::after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box-container div.jconfirm-box{border-radius:0;box-shadow:0 2px 6px rgba(0,0,0,0.2)}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box-container div.jconfirm-box div.jconfirm-closeIcon{color:rgba(0,0,0,0.4);top:8px;right:8px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box-container div.jconfirm-box div.jconfirm-closeIcon:hover{color:rgba(0,0,0,0.8)}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c{margin:0 0 26px 0 !important;padding:0 !important}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{margin:0 !important;color:#c4c4c4 !important;-webkit-transition:none !important;transition:none !important;-webkit-transform:none !important;-ms-transform:none !important;transform:none !important;font-size:45px !important}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c .jconfirm-icon-c i:empty{display:none}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c .jconfirm-icon-c svg{height:35px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c .jconfirm-title{display:block;color:#333}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c .jconfirm-icon-c+span.jconfirm-title{margin-top:20px !important}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content-pane{margin-bottom:0;display:block}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content-pane .jconfirm-content{overflow:inherit}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content{font-size:16px;color:#555;line-height:1.4}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content.lite-upgrade p{font-size:18px;padding:0 20px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content p{margin:0 0 16px;font-size:18px;line-height:1.5}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content p:last-of-type{margin:0}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content p.large{font-size:18px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content p.small{font-size:14px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content .already-purchased{font-size:12px;color:#ccc;text-decoration:none}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content .already-purchased:hover{text-decoration:underline}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-buttons .already-purchased{display:block;font-size:12px;color:#aaa;text-decoration:none;padding-top:20px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-buttons .already-purchased:hover{color:#999;text-decoration:underline}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .discount-note{text-align:center;margin:30px 0 0}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .discount-note p{background-color:#faffac;margin:0 -30px;padding:24px 60px 20px;font-size:15px;color:#4d4d4d;position:relative}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .discount-note p:after{content:'\f058';display:inline-block;font:normal normal normal 14px/1 FontAwesome;background-color:#fff;font-size:26px;border-radius:50%;padding:5px 6px;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;top:-20px;right:50%;margin-right:-18px;color:#3abc01}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .discount-note span{font-weight:700;color:#3abc01}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .discount-note a{color:#aaa;display:block;margin-top:12px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box input[type=text]{display:block;width:99%;border:1px solid #d6d6d6;padding:10px;box-shadow:none;margin:20px auto 0 auto}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button.btn-confirm{background-color:#FF982D;color:#fff;outline:none}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button.btn-confirm:hover{background-color:#f97f00;border-color:#f97f00}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button,body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button.btn-default{color:#666}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button.btn-block{display:block;text-align:center;width:100%;margin:0 0 10px 0 !important}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button.btn-normal-case{text-transform:none !important}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .error{display:none;color:red}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .wpforms-error{border:1px solid #ebccd1 !important}#wp-mail-smtp-header{border-top:3px solid #FF982D;padding:20px}#wp-mail-smtp-header img{display:block;margin:0;max-width:242px}@media (max-width: 782px){#wp-mail-smtp-header img{max-width:200px}}#wp-mail-smtp{margin:0}#wp-mail-smtp .wp-mail-smtp-hide{display:none}#wp-mail-smtp .wp-mail-smtp-page-title{background-color:#fff;font-size:14px;margin:0 0 20px 0;padding:0 20px}#wp-mail-smtp .wp-mail-smtp-page-title a.tab{border-bottom:2px solid #fff;box-shadow:none;color:#666;display:inline-block;margin-right:30px;padding:20px 0 18px 0;text-decoration:none}#wp-mail-smtp .wp-mail-smtp-page-title a.tab.active{border-bottom:2px solid #FF982D}#wp-mail-smtp .wp-mail-smtp-page-title a.tab:hover{border-color:#999}#wp-mail-smtp .wp-mail-smtp-page-title a.action{padding:5px;border:0;min-height:auto;color:#fff;margin:-10px 0 0 20px}#wp-mail-smtp .wp-mail-smtp-page-title .page-title{background-color:#fff;display:inline-block;font-size:23px;margin:0;padding:15px 20px 15px 0}#wp-mail-smtp .wp-mail-smtp-page-content{padding:0 20px}#wp-mail-smtp .wp-mail-smtp-page-content *,#wp-mail-smtp .wp-mail-smtp-page-content *::before,#wp-mail-smtp .wp-mail-smtp-page-content *::after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-clear:before{content:" ";display:table}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-clear:after{clear:both;content:" ";display:table}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row{border-bottom:1px solid #e4e4e4;padding:30px 0;font-size:14px;line-height:1.3}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row:first-of-type{padding-top:10px !important}@media (max-width: 781px){#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row{padding:20px 0}}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.inactive{display:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row .wp-mail-smtp-setting-mid-row-sep{background:#e4e4e4;height:1px;border:0;margin:15px 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.section-heading{padding:20px 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.section-heading.no-desc h2,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.section-heading.no-desc h4{margin:0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.section-heading .wp-mail-smtp-setting-field{margin:0;max-width:1005px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox input[type=checkbox]{float:left;margin:1px 0 0 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox input[type=checkbox]+label{margin:0 0 0 8px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox .desc{margin:0 0 0 30px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox input[type=checkbox]+label+.desc{margin:8px 0 0 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-text .wp-mail-smtp-setting-label,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-password .wp-mail-smtp-setting-label,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-number .wp-mail-smtp-setting-label,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-email .wp-mail-smtp-setting-label{padding-top:8px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-select .wp-mail-smtp-setting-label{padding-top:8px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-radio .wp-mail-smtp-setting-field input[type=radio]{margin:-3px 10px 0 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-radio .wp-mail-smtp-setting-field label{margin-right:30px;display:inline-block}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field label{vertical-align:middle;display:inline-block}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field label:hover .wp-mail-smtp-setting-toggle-switch{background-color:#999}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]{display:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:checked+.wp-mail-smtp-setting-toggle-switch{background-color:#46B450}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:checked+.wp-mail-smtp-setting-toggle-switch:before{-webkit-transform:translateX(19px);-ms-transform:translateX(19px);transform:translateX(19px)}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:disabled+.wp-mail-smtp-setting-toggle-switch{background-color:#69c471;cursor:default}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:checked+.wp-mail-smtp-setting-toggle-switch+.wp-mail-smtp-setting-toggle-checked-label{display:inline-block}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:checked+.wp-mail-smtp-setting-toggle-switch+.wp-mail-smtp-setting-toggle-checked-label+.wp-mail-smtp-setting-toggle-unchecked-label{display:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:disabled+.wp-mail-smtp-setting-toggle-switch+.wp-mail-smtp-setting-toggle-checked-label,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:disabled+.wp-mail-smtp-setting-toggle-switch+.wp-mail-smtp-setting-toggle-unchecked-label{color:#aaa}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field .wp-mail-smtp-setting-toggle-unchecked-label,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field .wp-mail-smtp-setting-toggle-checked-label{text-transform:uppercase;font-weight:400;color:#777;font-size:13px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field .wp-mail-smtp-setting-toggle-checked-label{display:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field .wp-mail-smtp-setting-toggle-switch{position:relative;cursor:pointer;background-color:#ccc;border-radius:15px;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out;vertical-align:middle;position:relative;display:inline-block;margin:0 5px 0 0;width:40px;height:20px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field .wp-mail-smtp-setting-toggle-switch:before{position:absolute;content:"";height:14px;width:14px;left:3px;top:3px;background-color:#fff;border-radius:50%;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer{padding-bottom:20px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer{display:inline-block;width:140px;margin-right:12px;margin-bottom:12px;position:relative}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer .wp-mail-smtp-mailer-image{background:#fff;text-align:center;border:2px solid #E5E5E5;border-radius:4px;cursor:pointer;height:76px;position:relative;margin-bottom:10px;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer .wp-mail-smtp-mailer-image.is-recommended{background-image:url(../images/recommended.svg);background-repeat:no-repeat;background-size:60%;background-position:top right -2px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer .wp-mail-smtp-mailer-image img{max-width:90%;max-height:40px;display:block;position:relative;top:50%;left:50%;transform:translate(-50%, -50%);opacity:0.6;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer.wp-mail-smtp-mailer-smtp .wp-mail-smtp-mailer-image img{max-height:30px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer.suggest-new a.wp-mail-smtp-mailer-image{min-width:140px;display:table-cell;color:#777777;text-decoration:underline;vertical-align:middle;bottom:10px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer.suggest-new .wp-mail-smtp-mailer-text{visibility:hidden}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer.active .wp-mail-smtp-mailer-image{border-color:#FF982D}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer.active .wp-mail-smtp-mailer-image img{opacity:1}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer:hover .wp-mail-smtp-mailer-image{border-color:#ccc}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer:hover .wp-mail-smtp-mailer-image img{opacity:1}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row h2,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row h4{color:#444;font-size:20px;font-weight:700;margin:0 0 6px 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row h2{margin-bottom:15px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row h3{color:#444;font-size:24px;font-weight:600;margin:0 0 20px 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p{margin:12px 0 0;font-size:14px;line-height:1.5em}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p:first-of-type{margin:8px 0 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.desc{font-style:italic;color:#777}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.buttonned{margin-top:30px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.inline-notice{margin:5px 0 15px;box-sizing:border-box;background:#fff;border-left:4px solid transparent;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1)}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.inline-notice.inline-error{border-color:#dc3232;margin-bottom:5px;padding:10px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.inline-notice.inline-edu-notice{border-color:#809EB0;line-height:1.5em;padding:10px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.inline-notice a.wp-mail-smtp-mailer-notice-dismiss{float:right;color:#999DA1;margin:0 0 10px 10px;text-decoration:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.inline-notice a.wp-mail-smtp-mailer-notice-dismiss:hover{color:#666a6e}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row ul{margin:8px 0 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row ul.list li{margin-left:20px;list-style-type:disc}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list th{padding:5px 5px 5px 0;text-align:left}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.email{padding-right:2em}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.status{width:100px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.actions a{border-bottom:1px solid;display:inline-block;margin-right:5px;text-decoration:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.actions a[class*=delete]{color:#a00}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.actions a[class*=delete]:hover,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.actions a[class*=delete]:active,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.actions a[class*=delete]:focus{color:#400}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password]{background-color:#fff;border:1px solid #ddd;border-radius:3px;box-shadow:none;color:#333;display:inline-block;vertical-align:middle;padding:7px 12px;margin:0 10px 0 0;width:400px;min-height:35px;line-height:1.3}@media (max-width: 959px){#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password]{width:300px}}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text][readonly],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email][readonly],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number][readonly],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password][readonly]{background-color:#f9f9f9}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text].small-text,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email].small-text,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number].small-text,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password].small-text{width:75px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text]:focus,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email]:focus,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number]:focus,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password]:focus{border-color:#bbb}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text]:disabled,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email]:disabled,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number]:disabled,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password]:disabled{opacity:0.6}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-label{display:block;float:left;width:205px;padding:0 20px 0 0}@media (max-width: 781px){#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-label{float:none;width:100%;padding-bottom:15px}}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-label label{display:block;font-weight:600;font-size:1.1em}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-field{display:block;margin:0 0 0 205px;max-width:800px}@media (max-width: 781px){#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-field{margin:0}}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-submit{margin:0;padding:25px 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-submit .help-text{margin-left:10px;vertical-align:middle}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-mailer-options .wp-mail-smtp-mailer-option .wp-mail-smtp-setting-row.section-heading{padding:20px 0 !important}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-mailer-options .wp-mail-smtp-mailer-option blockquote{background:#E5E5E5;border-radius:4px;color:#666;font-size:14px;margin:20px 0;padding:15px;width:1005px}#wp-mail-smtp .wp-mail-smtp-page-content.wp-mail-smtp-page-general p{margin:0}#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline{background:#fff;border-left:4px solid #fff;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);margin:5px 0 15px;padding:1px 12px}#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline.notice-success{border-left-color:#46b450}#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline.notice-warning{border-left-color:#ffb900}#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline.notice-error{border-left-color:#dc3232}#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline.notice-info{border-left-color:#00a0d2}#wp-mail-smtp .wp-mail-smtp-page-content .notice p,#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline p{margin:0.5em 0;padding:2px}#wp-mail-smtp .wp-mail-smtp-page-content pre{white-space:pre-line}#wp-mail-smtp .wp-mail-smtp-page-content.active{display:block}#wp-mail-smtp .wp-mail-smtp-page-content .connected-as{margin-left:30px}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug{background-color:#fff;padding:25px 20px 1px 25px}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug h2{color:#444;margin:1.4em 0 0.8em;font-size:16px;font-weight:700}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug p{font-size:14px;color:#555;margin-bottom:1.1em}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ul,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ol{font-size:14px;color:#555;margin:0 0 1.1em 1.8em}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ul li,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ol li{margin:0 0 8px 0;line-height:1.5}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ul li:last-of-type,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ol li:last-of-type{margin:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ul li ul,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ol li ul{list-style-type:disc}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug a{color:#FF982D}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug a:hover{color:#f97f00}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .dashicons-star-filled{color:#FF982D;width:16px;height:16px;font-size:16px;vertical-align:text-top}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .price-off{color:green;font-weight:bold}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log-toggle{text-decoration:none;color:#444}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log-toggle:hover{color:#FF982D}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log-toggle .dashicons{font-size:15px;height:15px;width:15px;padding-top:3px;border:0;outline:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log{border-left:3px solid #ffb900;padding:0 0 0 20px;margin:0 0 10px 0;font-size:12px;display:none}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log pre{margin:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log-note{display:none}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner{background-color:#fff;padding:25px 20px;border:1px solid #dadada;margin:10px 0 0 0;position:relative}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .wp-mail-smtp-pro-banner-dismiss{position:absolute;right:10px;top:10px}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .wp-mail-smtp-pro-banner-dismiss button{background:none;border:none;color:#a9a9a9;cursor:pointer;margin:0;padding:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner h2{color:#444;margin-top:0;font-size:16px;font-weight:700}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner p{font-size:14px;color:#555;margin-bottom:1.1em}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner p:last-of-type{margin:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits{margin:0 0 16px 0;overflow:auto;max-width:1000px}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits ul{margin:0;padding:0;width:50%;float:left}@media (max-width: 600px){#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits ul{width:100%;float:none}}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits ul li{margin:0;padding:0 0 2px 16px;color:#555;font-size:14px;position:relative}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits ul li:before{content:'+';position:absolute;top:-1px;left:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits ul li.arrow-right:before{content:'→'}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner a{color:#FF982D}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner a:hover,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner a:active,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner a:focus{color:#f97f00}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .stars{text-decoration:none}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .stars .dashicons{width:16px;height:16px;font-size:16px;vertical-align:text-top}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .price-off{color:green;font-weight:bold}#wp-mail-smtp .wp-mail-smtp-admin-columns>div[class*="-column-"]{float:left}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-20{width:20%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-33{width:33.33333%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-40{width:40%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-50{width:50%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-60{width:60%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-80{width:80%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-last{float:right !important}#wp-mail-smtp .wp-mail-smtp-admin-columns:after{content:"";display:table;clear:both}#wp-mail-smtp .wp-mail-smtp-page-upsell{display:flex;align-items:center;justify-content:center;height:auto;flex-direction:column}#wp-mail-smtp .wp-mail-smtp-page-upsell>*{width:800px}#wp-mail-smtp .wp-mail-smtp-page-upsell *,#wp-mail-smtp .wp-mail-smtp-page-upsell *::before,#wp-mail-smtp .wp-mail-smtp-page-upsell *::after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#wp-mail-smtp .wp-mail-smtp-page-upsell h2{font-size:24px;color:#444444;text-align:center}#wp-mail-smtp .wp-mail-smtp-page-upsell h3{font-size:16px;font-weight:normal;color:#72777C;line-height:1.5em;margin-top:0;margin-bottom:25px;text-align:center}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features{margin-bottom:40px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-items:stretch;align-content:flex-start}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature{display:flex;flex-direction:row;width:360px;align-items:flex-start;align-content:flex-start;margin-right:60px;margin-top:40px}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature:nth-of-type(1){margin-top:20px}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature:nth-of-type(2){margin-top:20px}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature:nth-of-type(even){margin-right:0}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature .wp-mail-smtp-page-upsell-feature-image{width:65px;text-align:center}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature .wp-mail-smtp-page-upsell-feature-image img{display:block;margin:5px auto 0}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature .wp-mail-smtp-page-upsell-feature-content{margin-left:20px}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature .wp-mail-smtp-page-upsell-feature-content h4{font-size:15px;margin:0 0 0.5em}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature .wp-mail-smtp-page-upsell-feature-content p{color:#72777C;margin:0}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-images{margin-bottom:20px;text-align:center}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-images img{width:380px;height:auto;margin-right:20px;border:5px solid #fff;border-radius:5px;box-shadow:0 0 10px 5px rgba(0,0,0,0.15)}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-images img:last-child{margin-right:0}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-button{text-align:center}.wp-mail-smtp-btn{border:0;border-radius:3px;cursor:pointer;display:inline-block;margin:0;text-decoration:none;text-align:center;vertical-align:middle;white-space:nowrap;text-shadow:none;box-shadow:none;outline:none}.wp-mail-smtp-btn .dashicons{font-size:16px;width:16px;height:16px}.wp-mail-smtp-btn:disabled{opacity:0.5;cursor:not-allowed}.wp-mail-smtp-btn.wp-mail-smtp-btn-md{font-size:13px;font-weight:600;padding:8px 12px;min-height:35px}.wp-mail-smtp-btn.wp-mail-smtp-btn-lg{font-size:16px;font-weight:600;padding:16px 28px}.wp-mail-smtp-btn.wp-mail-smtp-btn-orange{background-color:#FF982D;border-color:#FF982D;color:#fff}.wp-mail-smtp-btn.wp-mail-smtp-btn-orange:hover,.wp-mail-smtp-btn.wp-mail-smtp-btn-orange:active,.wp-mail-smtp-btn.wp-mail-smtp-btn-orange:focus{background-color:#f97f00;border-color:#f97f00}.wp-mail-smtp-btn.wp-mail-smtp-btn-red{background-color:#DC3232;border-color:#DC3232;color:#fff}.wp-mail-smtp-btn.wp-mail-smtp-btn-red:hover,.wp-mail-smtp-btn.wp-mail-smtp-btn-red:active,.wp-mail-smtp-btn.wp-mail-smtp-btn-red:focus{background-color:darkred;border-color:darkred}.wp-mail-smtp-btn.wp-mail-smtp-btn-grey{background-color:#f5f5f5;border:1px solid #ccc;color:#666}.wp-mail-smtp-btn.wp-mail-smtp-btn-grey:hover,.wp-mail-smtp-btn.wp-mail-smtp-btn-grey:active,.wp-mail-smtp-btn.wp-mail-smtp-btn-grey:focus{background-color:#d7d7d7;border-color:#ccc;color:#444}.wp-mail-smtp-btn.wp-mail-smtp-btn-light-grey{background-color:#f5f5f5;border:1px solid #ccc;color:#666}.wp-mail-smtp-btn.wp-mail-smtp-btn-light-grey:hover,.wp-mail-smtp-btn.wp-mail-smtp-btn-light-grey:active,.wp-mail-smtp-btn.wp-mail-smtp-btn-light-grey:focus{background-color:#eee;color:#444}.wp-mail-smtp-btn.wp-mail-smtp-btn-blueish{background-color:#738e9e;border:1px solid #738e9e;color:#fff}.wp-mail-smtp-btn.wp-mail-smtp-btn-blueish:hover,.wp-mail-smtp-btn.wp-mail-smtp-btn-blueish:active,.wp-mail-smtp-btn.wp-mail-smtp-btn-blueish:focus{background-color:#395360;border-color:#395360;color:#fff}
|
2 |
|
3 |
/*# sourceMappingURL=smtp-admin.min.css.map */
|
1 |
+
#wpcontent{padding-left:0 !important;position:relative}@media (max-width: 600px){#wpcontent{padding-top:46px}}@media (max-width: 600px){#wpbody{padding-top:0}}body.toplevel_page_wp-mail-smtp div.jconfirm *,body.toplevel_page_wp-mail-smtp div.jconfirm *::before,body.toplevel_page_wp-mail-smtp div.jconfirm *::after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box-container div.jconfirm-box{border-radius:0;box-shadow:0 2px 6px rgba(0,0,0,0.2)}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box-container div.jconfirm-box div.jconfirm-closeIcon{color:rgba(0,0,0,0.4);top:8px;right:8px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box-container div.jconfirm-box div.jconfirm-closeIcon:hover{color:rgba(0,0,0,0.8)}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c{margin:0 0 26px 0 !important;padding:0 !important}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{margin:0 !important;color:#c4c4c4 !important;-webkit-transition:none !important;transition:none !important;-webkit-transform:none !important;-ms-transform:none !important;transform:none !important;font-size:45px !important}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c .jconfirm-icon-c i:empty{display:none}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c .jconfirm-icon-c svg{height:35px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c .jconfirm-title{display:block;color:#333}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c .jconfirm-icon-c+span.jconfirm-title{margin-top:20px !important}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content-pane{margin-bottom:0;display:block}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content-pane .jconfirm-content{overflow:inherit}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content{font-size:16px;color:#555;line-height:1.4}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content.lite-upgrade p{font-size:18px;padding:0 20px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content p{margin:0 0 16px;font-size:18px;line-height:1.5}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content p:last-of-type{margin:0}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content p.large{font-size:18px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content p.small{font-size:14px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content .already-purchased{font-size:12px;color:#ccc;text-decoration:none}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content .already-purchased:hover{text-decoration:underline}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-buttons .already-purchased{display:block;font-size:12px;color:#aaa;text-decoration:none;padding-top:20px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-buttons .already-purchased:hover{color:#999;text-decoration:underline}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .discount-note{text-align:center;margin:30px 0 0}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .discount-note p{background-color:#faffac;margin:0 -30px;padding:24px 60px 20px;font-size:15px;color:#4d4d4d;position:relative}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .discount-note p:after{content:'\f058';display:inline-block;font:normal normal normal 14px/1 FontAwesome;background-color:#fff;font-size:26px;border-radius:50%;padding:5px 6px;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;top:-20px;right:50%;margin-right:-18px;color:#3abc01}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .discount-note span{font-weight:700;color:#3abc01}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .discount-note a{color:#aaa;display:block;margin-top:12px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box input[type=text]{display:block;width:99%;border:1px solid #d6d6d6;padding:10px;box-shadow:none;margin:20px auto 0 auto}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button.btn-confirm{background-color:#FF982D;color:#fff;outline:none}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button.btn-confirm:hover{background-color:#f97f00;border-color:#f97f00}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button,body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button.btn-default{color:#666}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button.btn-block{display:block;text-align:center;width:100%;margin:0 0 10px 0 !important}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button.btn-normal-case{text-transform:none !important}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .error{display:none;color:red}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .wpforms-error{border:1px solid #ebccd1 !important}#screen-meta-links,#screen-meta{display:none}#wp-mail-smtp-header-temp{position:absolute;margin:0;top:-1px;left:20px;right:20px;z-index:99}#wp-mail-smtp-header{border-top:3px solid #FF982D;padding:20px}#wp-mail-smtp-header img{display:block;margin:0;max-width:242px}@media (max-width: 782px){#wp-mail-smtp-header img{max-width:200px}}#wp-mail-smtp{margin:0}#wp-mail-smtp .wp-mail-smtp-hide{display:none}#wp-mail-smtp .wp-mail-smtp-page-title{background-color:#fff;font-size:14px;margin:0 0 20px 0;padding:0 20px}#wp-mail-smtp .wp-mail-smtp-page-title a.tab{border-bottom:2px solid #fff;box-shadow:none;color:#666;display:inline-block;margin-right:30px;padding:20px 0 18px 0;text-decoration:none}#wp-mail-smtp .wp-mail-smtp-page-title a.tab.active{border-bottom:2px solid #FF982D}#wp-mail-smtp .wp-mail-smtp-page-title a.tab:hover{border-color:#999}#wp-mail-smtp .wp-mail-smtp-page-title a.action{padding:5px;border:0;min-height:auto;color:#fff;margin:-10px 0 0 20px}#wp-mail-smtp .wp-mail-smtp-page-title .page-title{background-color:#fff;display:inline-block;font-size:23px;margin:0;padding:15px 20px 15px 0}#wp-mail-smtp .wp-mail-smtp-page-content{padding:0 20px}#wp-mail-smtp .wp-mail-smtp-page-content *,#wp-mail-smtp .wp-mail-smtp-page-content *::before,#wp-mail-smtp .wp-mail-smtp-page-content *::after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-clear:before{content:" ";display:table}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-clear:after{clear:both;content:" ";display:table}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row{border-bottom:1px solid #e4e4e4;padding:30px 0;font-size:14px;line-height:1.3}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row:first-of-type{padding-top:10px !important}@media (max-width: 781px){#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row{padding:20px 0}}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.inactive{display:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row .wp-mail-smtp-setting-mid-row-sep{background:#e4e4e4;height:1px;border:0;margin:15px 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.section-heading{padding:20px 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.section-heading.no-desc h2,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.section-heading.no-desc h4{margin:0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.section-heading .wp-mail-smtp-setting-field{margin:0;max-width:1005px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox input[type=checkbox]{float:left;margin:1px 0 0 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox input[type=checkbox]+label{margin:0 0 0 8px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox .desc{margin:0 0 0 30px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox input[type=checkbox]+label+.desc{margin:8px 0 0 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-text .wp-mail-smtp-setting-label,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-password .wp-mail-smtp-setting-label,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-number .wp-mail-smtp-setting-label,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-email .wp-mail-smtp-setting-label{padding-top:8px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-select .wp-mail-smtp-setting-label{padding-top:8px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-radio .wp-mail-smtp-setting-field input[type=radio]{margin:-3px 10px 0 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-radio .wp-mail-smtp-setting-field label{margin-right:30px;display:inline-block}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field label{vertical-align:middle;display:inline-block}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field label:hover .wp-mail-smtp-setting-toggle-switch{background-color:#999}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]{display:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:checked+.wp-mail-smtp-setting-toggle-switch{background-color:#46B450}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:checked+.wp-mail-smtp-setting-toggle-switch:before{-webkit-transform:translateX(19px);-ms-transform:translateX(19px);transform:translateX(19px)}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:disabled+.wp-mail-smtp-setting-toggle-switch{background-color:#69c471;cursor:default}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:checked+.wp-mail-smtp-setting-toggle-switch+.wp-mail-smtp-setting-toggle-checked-label{display:inline-block}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:checked+.wp-mail-smtp-setting-toggle-switch+.wp-mail-smtp-setting-toggle-checked-label+.wp-mail-smtp-setting-toggle-unchecked-label{display:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:disabled+.wp-mail-smtp-setting-toggle-switch+.wp-mail-smtp-setting-toggle-checked-label,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:disabled+.wp-mail-smtp-setting-toggle-switch+.wp-mail-smtp-setting-toggle-unchecked-label{color:#aaa}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field .wp-mail-smtp-setting-toggle-unchecked-label,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field .wp-mail-smtp-setting-toggle-checked-label{text-transform:uppercase;font-weight:400;color:#777;font-size:13px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field .wp-mail-smtp-setting-toggle-checked-label{display:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field .wp-mail-smtp-setting-toggle-switch{position:relative;cursor:pointer;background-color:#ccc;border-radius:15px;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out;vertical-align:middle;position:relative;display:inline-block;margin:0 5px 0 0;width:40px;height:20px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field .wp-mail-smtp-setting-toggle-switch:before{position:absolute;content:"";height:14px;width:14px;left:3px;top:3px;background-color:#fff;border-radius:50%;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer{padding-bottom:20px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer{display:inline-block;width:140px;margin-right:12px;margin-bottom:12px;position:relative}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer .wp-mail-smtp-mailer-image{background:#fff;text-align:center;border:2px solid #E5E5E5;border-radius:4px;cursor:pointer;height:76px;position:relative;margin-bottom:10px;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer .wp-mail-smtp-mailer-image.is-recommended{background-image:url(../images/recommended.svg);background-repeat:no-repeat;background-size:60%;background-position:top right -2px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer .wp-mail-smtp-mailer-image img{max-width:90%;max-height:40px;display:block;position:relative;top:50%;left:50%;transform:translate(-50%, -50%);opacity:0.6;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer.wp-mail-smtp-mailer-smtp .wp-mail-smtp-mailer-image img{max-height:30px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer.suggest-new a.wp-mail-smtp-mailer-image{min-width:140px;display:table-cell;color:#777777;text-decoration:underline;vertical-align:middle;bottom:10px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer.suggest-new .wp-mail-smtp-mailer-text{visibility:hidden}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer.active .wp-mail-smtp-mailer-image{border-color:#FF982D}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer.active .wp-mail-smtp-mailer-image img{opacity:1}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer:hover .wp-mail-smtp-mailer-image{border-color:#ccc}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer:hover .wp-mail-smtp-mailer-image img{opacity:1}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row h2,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row h4{color:#444;font-size:20px;font-weight:700;margin:0 0 6px 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row h2{margin-bottom:15px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row h3{color:#444;font-size:24px;font-weight:600;margin:0 0 20px 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p{margin:12px 0 0;font-size:14px;line-height:1.5em}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p:first-of-type{margin:8px 0 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.desc{font-style:italic;color:#777}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.buttonned{margin-top:30px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.inline-notice{margin:5px 0 15px;box-sizing:border-box;background:#fff;border-left:4px solid transparent;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1)}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.inline-notice.inline-error{border-color:#dc3232;margin-bottom:5px;padding:10px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.inline-notice.inline-edu-notice{border-color:#809EB0;line-height:1.5em;padding:10px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.inline-notice a.wp-mail-smtp-mailer-notice-dismiss{float:right;color:#999DA1;margin:0 0 10px 10px;text-decoration:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.inline-notice a.wp-mail-smtp-mailer-notice-dismiss:hover{color:#666a6e}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row ul{margin:8px 0 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row ul.list li{margin-left:20px;list-style-type:disc}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list th{padding:5px 5px 5px 0;text-align:left}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.email{padding-right:2em}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.status{width:100px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.actions a{border-bottom:1px solid;display:inline-block;margin-right:5px;text-decoration:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.actions a[class*=delete]{color:#a00}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.actions a[class*=delete]:hover,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.actions a[class*=delete]:active,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.actions a[class*=delete]:focus{color:#400}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password]{background-color:#fff;border:1px solid #ddd;border-radius:3px;box-shadow:none;color:#333;display:inline-block;vertical-align:middle;padding:7px 12px;margin:0 10px 0 0;width:400px;min-height:35px;line-height:1.3}@media (max-width: 959px){#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password]{width:300px}}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text][readonly],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email][readonly],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number][readonly],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password][readonly]{background-color:#f9f9f9}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text].small-text,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email].small-text,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number].small-text,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password].small-text{width:75px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text]:focus,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email]:focus,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number]:focus,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password]:focus{border-color:#bbb}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text]:disabled,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email]:disabled,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number]:disabled,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password]:disabled{opacity:0.6}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-label{display:block;float:left;width:205px;padding:0 20px 0 0}@media (max-width: 781px){#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-label{float:none;width:100%;padding-bottom:15px}}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-label label{display:block;font-weight:600;font-size:1.1em}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-field{display:block;margin:0 0 0 205px;max-width:800px}@media (max-width: 781px){#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-field{margin:0}}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-submit{margin:0;padding:25px 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-submit .help-text{margin-left:10px;vertical-align:middle}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-mailer-options .wp-mail-smtp-mailer-option .wp-mail-smtp-setting-row.section-heading{padding:20px 0 !important}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-mailer-options .wp-mail-smtp-mailer-option blockquote{background:#E5E5E5;border-radius:4px;color:#666;font-size:14px;margin:20px 0;padding:15px;width:1005px}#wp-mail-smtp .wp-mail-smtp-page-content.wp-mail-smtp-page-general p{margin:0}#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline{background:#fff;border-left:4px solid #fff;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);margin:5px 0 15px;padding:1px 12px}#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline.notice-success{border-left-color:#46b450}#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline.notice-warning{border-left-color:#ffb900}#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline.notice-error{border-left-color:#dc3232}#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline.notice-info{border-left-color:#00a0d2}#wp-mail-smtp .wp-mail-smtp-page-content .notice p,#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline p{margin:0.5em 0;padding:2px}#wp-mail-smtp .wp-mail-smtp-page-content pre{white-space:pre-line}#wp-mail-smtp .wp-mail-smtp-page-content.active{display:block}#wp-mail-smtp .wp-mail-smtp-page-content .connected-as{margin-left:30px}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug{background-color:#fff;padding:25px 20px 1px 25px}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug h2{color:#444;margin:1.4em 0 0.8em;font-size:16px;font-weight:700}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug p{font-size:14px;color:#555;margin-bottom:1.1em}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ul,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ol{font-size:14px;color:#555;margin:0 0 1.1em 1.8em}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ul li,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ol li{margin:0 0 8px 0;line-height:1.5}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ul li:last-of-type,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ol li:last-of-type{margin:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ul li ul,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ol li ul{list-style-type:disc}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug a{color:#FF982D}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug a:hover{color:#f97f00}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .dashicons-star-filled{color:#FF982D;width:16px;height:16px;font-size:16px;vertical-align:text-top}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .price-off{color:green;font-weight:bold}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log-toggle{text-decoration:none;color:#444}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log-toggle:hover{color:#FF982D}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log-toggle .dashicons{font-size:15px;height:15px;width:15px;padding-top:3px;border:0;outline:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log{border-left:3px solid #ffb900;padding:0 0 0 20px;margin:0 0 10px 0;font-size:12px;display:none}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log pre{margin:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log-note{display:none}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner{background-color:#fff;padding:25px 20px;border:1px solid #dadada;margin:10px 0 0 0;position:relative}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .wp-mail-smtp-pro-banner-dismiss{position:absolute;right:10px;top:10px}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .wp-mail-smtp-pro-banner-dismiss button{background:none;border:none;color:#a9a9a9;cursor:pointer;margin:0;padding:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner h2{color:#444;margin-top:0;font-size:16px;font-weight:700}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner p{font-size:14px;color:#555;margin-bottom:1.1em}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner p:last-of-type{margin:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits{margin:0 0 16px 0;overflow:auto;max-width:1000px}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits ul{margin:0;padding:0;width:50%;float:left}@media (max-width: 600px){#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits ul{width:100%;float:none}}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits ul li{margin:0;padding:0 0 2px 16px;color:#555;font-size:14px;position:relative}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits ul li:before{content:'+';position:absolute;top:-1px;left:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits ul li.arrow-right:before{content:'→'}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner a{color:#FF982D}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner a:hover,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner a:active,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner a:focus{color:#f97f00}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .stars{text-decoration:none}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .stars .dashicons{width:16px;height:16px;font-size:16px;vertical-align:text-top}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .price-off{color:green;font-weight:bold}#wp-mail-smtp .wp-mail-smtp-admin-columns>div[class*="-column-"]{float:left}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-20{width:20%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-33{width:33.33333%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-40{width:40%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-50{width:50%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-60{width:60%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-80{width:80%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-last{float:right !important}#wp-mail-smtp .wp-mail-smtp-admin-columns:after{content:"";display:table;clear:both}#wp-mail-smtp .wp-mail-smtp-page-upsell{display:flex;align-items:center;justify-content:center;height:auto;flex-direction:column}#wp-mail-smtp .wp-mail-smtp-page-upsell>*{width:800px}#wp-mail-smtp .wp-mail-smtp-page-upsell *,#wp-mail-smtp .wp-mail-smtp-page-upsell *::before,#wp-mail-smtp .wp-mail-smtp-page-upsell *::after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#wp-mail-smtp .wp-mail-smtp-page-upsell h2{font-size:24px;color:#444444;text-align:center}#wp-mail-smtp .wp-mail-smtp-page-upsell h3{font-size:16px;font-weight:normal;color:#72777C;line-height:1.5em;margin-top:0;margin-bottom:25px;text-align:center}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features{margin-bottom:40px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-items:stretch;align-content:flex-start}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature{display:flex;flex-direction:row;width:360px;align-items:flex-start;align-content:flex-start;margin-right:60px;margin-top:40px}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature:nth-of-type(1){margin-top:20px}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature:nth-of-type(2){margin-top:20px}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature:nth-of-type(even){margin-right:0}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature .wp-mail-smtp-page-upsell-feature-image{width:65px;text-align:center}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature .wp-mail-smtp-page-upsell-feature-image img{display:block;margin:5px auto 0}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature .wp-mail-smtp-page-upsell-feature-content{margin-left:20px}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature .wp-mail-smtp-page-upsell-feature-content h4{font-size:15px;margin:0 0 0.5em}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature .wp-mail-smtp-page-upsell-feature-content p{color:#72777C;margin:0}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-images{margin-bottom:20px;text-align:center}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-images img{width:380px;height:auto;margin-right:20px;border:5px solid #fff;border-radius:5px;box-shadow:0 0 10px 5px rgba(0,0,0,0.15)}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-images img:last-child{margin-right:0}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-button{text-align:center}.wp-mail-smtp-btn{border:0;border-radius:3px;cursor:pointer;display:inline-block;margin:0;text-decoration:none;text-align:center;vertical-align:middle;white-space:nowrap;text-shadow:none;box-shadow:none;outline:none}.wp-mail-smtp-btn .dashicons{font-size:16px;width:16px;height:16px}.wp-mail-smtp-btn:disabled{opacity:0.5;cursor:not-allowed}.wp-mail-smtp-btn.wp-mail-smtp-btn-md{font-size:13px;font-weight:600;padding:8px 12px;min-height:35px}.wp-mail-smtp-btn.wp-mail-smtp-btn-lg{font-size:16px;font-weight:600;padding:16px 28px}.wp-mail-smtp-btn.wp-mail-smtp-btn-orange{background-color:#FF982D;border-color:#FF982D;color:#fff}.wp-mail-smtp-btn.wp-mail-smtp-btn-orange:hover,.wp-mail-smtp-btn.wp-mail-smtp-btn-orange:active,.wp-mail-smtp-btn.wp-mail-smtp-btn-orange:focus{background-color:#f97f00;border-color:#f97f00}.wp-mail-smtp-btn.wp-mail-smtp-btn-red{background-color:#DC3232;border-color:#DC3232;color:#fff}.wp-mail-smtp-btn.wp-mail-smtp-btn-red:hover,.wp-mail-smtp-btn.wp-mail-smtp-btn-red:active,.wp-mail-smtp-btn.wp-mail-smtp-btn-red:focus{background-color:darkred;border-color:darkred}.wp-mail-smtp-btn.wp-mail-smtp-btn-grey{background-color:#f5f5f5;border:1px solid #ccc;color:#666}.wp-mail-smtp-btn.wp-mail-smtp-btn-grey:hover,.wp-mail-smtp-btn.wp-mail-smtp-btn-grey:active,.wp-mail-smtp-btn.wp-mail-smtp-btn-grey:focus{background-color:#d7d7d7;border-color:#ccc;color:#444}.wp-mail-smtp-btn.wp-mail-smtp-btn-light-grey{background-color:#f5f5f5;border:1px solid #ccc;color:#666}.wp-mail-smtp-btn.wp-mail-smtp-btn-light-grey:hover,.wp-mail-smtp-btn.wp-mail-smtp-btn-light-grey:active,.wp-mail-smtp-btn.wp-mail-smtp-btn-light-grey:focus{background-color:#eee;color:#444}.wp-mail-smtp-btn.wp-mail-smtp-btn-blueish{background-color:#738e9e;border:1px solid #738e9e;color:#fff}.wp-mail-smtp-btn.wp-mail-smtp-btn-blueish:hover,.wp-mail-smtp-btn.wp-mail-smtp-btn-blueish:active,.wp-mail-smtp-btn.wp-mail-smtp-btn-blueish:focus{background-color:#395360;border-color:#395360;color:#fff}
|
2 |
|
3 |
/*# sourceMappingURL=smtp-admin.min.css.map */
|
assets/images/about/plugin-rp.png
ADDED
Binary file
|
assets/js/smtp-about.js
CHANGED
@@ -88,7 +88,7 @@ WPMailSMTP.Admin.About = WPMailSMTP.Admin.About || (function ( document, window,
|
|
88 |
errorText,
|
89 |
successText;
|
90 |
|
91 |
-
$btn.
|
92 |
$btn.text( wp_mail_smtp_about.plugin_processing );
|
93 |
|
94 |
if ( $btn.hasClass( 'status-inactive' ) ) {
|
@@ -165,8 +165,8 @@ WPMailSMTP.Admin.About = WPMailSMTP.Admin.About || (function ( document, window,
|
|
165 |
$btn.html( wp_mail_smtp_about.plugin_download_btn );
|
166 |
}
|
167 |
|
168 |
-
if ( is_install_successful ) {
|
169 |
-
$btn.
|
170 |
}
|
171 |
$btn.removeClass( 'loading' );
|
172 |
|
88 |
errorText,
|
89 |
successText;
|
90 |
|
91 |
+
$btn.addClass( 'loading disabled' );
|
92 |
$btn.text( wp_mail_smtp_about.plugin_processing );
|
93 |
|
94 |
if ( $btn.hasClass( 'status-inactive' ) ) {
|
165 |
$btn.html( wp_mail_smtp_about.plugin_download_btn );
|
166 |
}
|
167 |
|
168 |
+
if ( ! is_install_successful ) {
|
169 |
+
$btn.removeClass( 'disabled' );
|
170 |
}
|
171 |
$btn.removeClass( 'loading' );
|
172 |
|
assets/js/smtp-about.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPMailSMTP=window.WPMailSMTP||{};WPMailSMTP.Admin=WPMailSMTP.Admin||{},WPMailSMTP.Admin.About=WPMailSMTP.Admin.About||function(a,t,p){"use strict";var i={init:function(){p(a).ready(i.ready)},ready:function(){i.pageHolder=p(".wp-mail-smtp-page-about"),i.bindActions(),p(".wp-mail-smtp-page").trigger("WPMailSMTP.Admin.About.ready")},bindActions:function(){jQuery(".wp-mail-smtp-admin-about-plugins .plugin-item .details").matchHeight(),p(a).on("click",".wp-mail-smtp-admin-about-plugins .plugin-item .action-button .button",function(a){a.preventDefault();var i=p(this);if(i.hasClass("disabled")||i.hasClass("loading"))return!1;var s,n,l,o,
|
1 |
+
var WPMailSMTP=window.WPMailSMTP||{};WPMailSMTP.Admin=WPMailSMTP.Admin||{},WPMailSMTP.Admin.About=WPMailSMTP.Admin.About||function(a,t,p){"use strict";var i={init:function(){p(a).ready(i.ready)},ready:function(){i.pageHolder=p(".wp-mail-smtp-page-about"),i.bindActions(),p(".wp-mail-smtp-page").trigger("WPMailSMTP.Admin.About.ready")},bindActions:function(){jQuery(".wp-mail-smtp-admin-about-plugins .plugin-item .details").matchHeight(),p(a).on("click",".wp-mail-smtp-admin-about-plugins .plugin-item .action-button .button",function(a){a.preventDefault();var i=p(this);if(i.hasClass("disabled")||i.hasClass("loading"))return!1;var s,n,l,e,o,u=i.closest(".plugin-item"),t=i.attr("data-plugin");if(i.addClass("loading disabled"),i.text(wp_mail_smtp_about.plugin_processing),i.hasClass("status-inactive"))s="about_plugin_activate",n="status-active button button-secondary disabled",l=wp_mail_smtp_about.plugin_active,e=wp_mail_smtp_about.plugin_activated,wp_mail_smtp_about.plugin_activate;else{if(!i.hasClass("status-download"))return;s="about_plugin_install",n="status-active button disabled",l=wp_mail_smtp_about.plugin_active,e=wp_mail_smtp_about.plugin_activated,wp_mail_smtp_about.plugin_activate}var d={action:"wp_mail_smtp_ajax",task:s,nonce:wp_mail_smtp_about.nonce,plugin:t};p.post(wp_mail_smtp_about.ajax_url,d,function(a){var t;a.success?(t=!0,"about_plugin_install"===s?(i.attr("data-plugin",a.data.basename),o=a.data.msg,a.data.is_activated||(n="button",l=wp_mail_smtp_about.plugin_inactive,e=wp_mail_smtp_about.plugin_activate)):o=a.data,u.find(".actions").append('<div class="msg success">'+o+"</div>"),u.find("span.status-label").removeClass("status-active status-inactive status-download").addClass(n).removeClass("button button-primary button-secondary disabled").text(l),i.removeClass("status-active status-inactive status-download").removeClass("button button-primary button-secondary disabled").addClass(n).html(e)):(t=!1,a.hasOwnProperty("data")&&a.data.hasOwnProperty(0)&&a.data[0].hasOwnProperty("code")&&"download_failed"===a.data[0].code?u.find(".actions").append('<div class="msg error">'+wp_mail_smtp_about.plugin_install_error+"</div>"):u.find(".actions").append('<div class="msg error">'+a.data+"</div>"),i.html(wp_mail_smtp_about.plugin_download_btn)),t||i.removeClass("disabled"),i.removeClass("loading"),setTimeout(function(){p(".plugin-item .msg").remove()},3e3)}).fail(function(a){console.log(a.responseText)})})}};return i}(document,window,jQuery),WPMailSMTP.Admin.About.init();
|
assets/js/smtp-admin.js
CHANGED
@@ -1,243 +1,282 @@
|
|
1 |
-
/* globals jQuery, wp_mail_smtp */
|
2 |
-
var WPMailSMTP = window.WPMailSMTP || {};
|
3 |
-
WPMailSMTP.Admin = WPMailSMTP.Admin || {};
|
4 |
-
|
5 |
-
/**
|
6 |
-
* WP Mail SMTP Admin area module.
|
7 |
-
*
|
8 |
-
* @since 1.6.0
|
9 |
-
*/
|
10 |
-
WPMailSMTP.Admin.Settings = WPMailSMTP.Admin.Settings || (function ( document, window, $ ) {
|
11 |
-
|
12 |
-
'use strict';
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Private functions and properties.
|
16 |
-
*
|
17 |
-
* @since 1.6.0
|
18 |
-
*
|
19 |
-
* @type {Object}
|
20 |
-
*/
|
21 |
-
var __private = {};
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Public functions and properties.
|
25 |
-
*
|
26 |
-
* @since 1.6.0
|
27 |
-
*
|
28 |
-
* @type {Object}
|
29 |
-
*/
|
30 |
-
var app = {
|
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 |
-
$( '.wp-mail-smtp-
|
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 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
$( '#wp-mail-smtp-setting-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* globals jQuery, wp_mail_smtp */
|
2 |
+
var WPMailSMTP = window.WPMailSMTP || {};
|
3 |
+
WPMailSMTP.Admin = WPMailSMTP.Admin || {};
|
4 |
+
|
5 |
+
/**
|
6 |
+
* WP Mail SMTP Admin area module.
|
7 |
+
*
|
8 |
+
* @since 1.6.0
|
9 |
+
*/
|
10 |
+
WPMailSMTP.Admin.Settings = WPMailSMTP.Admin.Settings || (function ( document, window, $ ) {
|
11 |
+
|
12 |
+
'use strict';
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Private functions and properties.
|
16 |
+
*
|
17 |
+
* @since 1.6.0
|
18 |
+
*
|
19 |
+
* @type {Object}
|
20 |
+
*/
|
21 |
+
var __private = {};
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Public functions and properties.
|
25 |
+
*
|
26 |
+
* @since 1.6.0
|
27 |
+
*
|
28 |
+
* @type {Object}
|
29 |
+
*/
|
30 |
+
var app = {
|
31 |
+
/**
|
32 |
+
* State attribute showing if one of the plugin settings
|
33 |
+
* changed and was not yet saved.
|
34 |
+
*
|
35 |
+
* @since {VERSION}
|
36 |
+
*
|
37 |
+
* @type {boolean}
|
38 |
+
*/
|
39 |
+
pluginSettingsChanged: false,
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Start the engine. DOM is not ready yet, use only to init something.
|
43 |
+
*
|
44 |
+
* @since 1.6.0
|
45 |
+
*/
|
46 |
+
init: function () {
|
47 |
+
|
48 |
+
// Do that when DOM is ready.
|
49 |
+
$( document ).ready( app.ready );
|
50 |
+
},
|
51 |
+
|
52 |
+
/**
|
53 |
+
* DOM is fully loaded.
|
54 |
+
*
|
55 |
+
* @since 1.6.0
|
56 |
+
*/
|
57 |
+
ready: function () {
|
58 |
+
|
59 |
+
app.pageHolder = $( '.wp-mail-smtp-tab-settings' );
|
60 |
+
|
61 |
+
// If there are screen options we have to move them.
|
62 |
+
$( '#screen-meta-links, #screen-meta' ).prependTo( '#wp-mail-smtp-header-temp' ).show();
|
63 |
+
|
64 |
+
app.bindActions();
|
65 |
+
},
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Process all generic actions/events, mostly custom that were fired by our API.
|
69 |
+
*
|
70 |
+
* @since 1.6.0
|
71 |
+
*/
|
72 |
+
bindActions: function () {
|
73 |
+
|
74 |
+
// Mailer selection.
|
75 |
+
$( '.wp-mail-smtp-mailer-image', app.pageHolder ).click( function () {
|
76 |
+
$( this ).parents( '.wp-mail-smtp-mailer' ).find( 'input' ).trigger( 'click' );
|
77 |
+
} );
|
78 |
+
|
79 |
+
$( '.wp-mail-smtp-mailer input', app.pageHolder ).click( function () {
|
80 |
+
var $input = $( this );
|
81 |
+
|
82 |
+
if ( $input.prop( 'disabled' ) ) {
|
83 |
+
// Educational Popup.
|
84 |
+
if ( $input.hasClass( 'educate' ) ) {
|
85 |
+
app.education.upgradeMailer( $input );
|
86 |
+
}
|
87 |
+
|
88 |
+
return false;
|
89 |
+
}
|
90 |
+
|
91 |
+
// Deselect the current mailer.
|
92 |
+
$( '.wp-mail-smtp-mailer', app.pageHolder ).removeClass( 'active' );
|
93 |
+
// Select the correct one.
|
94 |
+
$( this ).parents( '.wp-mail-smtp-mailer' ).addClass( 'active' );
|
95 |
+
|
96 |
+
// Hide all mailers options and display for a currently clicked one.
|
97 |
+
$( '.wp-mail-smtp-mailer-option', app.pageHolder ).addClass( 'hidden' ).removeClass( 'active' );
|
98 |
+
$( '.wp-mail-smtp-mailer-option-' + $( this ).val(), app.pageHolder ).addClass( 'active' ).removeClass( 'hidden' );
|
99 |
+
} );
|
100 |
+
|
101 |
+
app.mailers.smtp.bindActions();
|
102 |
+
|
103 |
+
// Dismiss Pro banner at the bottom of the page.
|
104 |
+
$( '#wp-mail-smtp-pro-banner-dismiss', app.pageHolder ).on( 'click', function () {
|
105 |
+
$.ajax( {
|
106 |
+
url: ajaxurl,
|
107 |
+
dataType: 'json',
|
108 |
+
type: 'POST',
|
109 |
+
data: {
|
110 |
+
action: 'wp_mail_smtp_ajax',
|
111 |
+
task: 'pro_banner_dismiss'
|
112 |
+
}
|
113 |
+
} )
|
114 |
+
.always( function () {
|
115 |
+
$( '#wp-mail-smtp-pro-banner', app.pageHolder ).fadeOut( 'fast' );
|
116 |
+
} );
|
117 |
+
} );
|
118 |
+
|
119 |
+
// Dismis educational notices for certain mailers.
|
120 |
+
$( '.js-wp-mail-smtp-mailer-notice-dismiss', app.pageHolder ).on( 'click', function ( e ) {
|
121 |
+
e.preventDefault();
|
122 |
+
|
123 |
+
var $btn = $( this ),
|
124 |
+
$notice = $btn.parents( '.inline-notice' );
|
125 |
+
|
126 |
+
if ( $btn.hasClass( 'disabled' ) ) {
|
127 |
+
return false;
|
128 |
+
}
|
129 |
+
|
130 |
+
$.ajax( {
|
131 |
+
url: ajaxurl,
|
132 |
+
dataType: 'json',
|
133 |
+
type: 'POST',
|
134 |
+
data: {
|
135 |
+
action: 'wp_mail_smtp_ajax',
|
136 |
+
task: 'notice_dismiss',
|
137 |
+
notice: $notice.data( 'notice' ),
|
138 |
+
mailer: $notice.data( 'mailer' )
|
139 |
+
},
|
140 |
+
beforeSend: function () {
|
141 |
+
$btn.addClass( 'disabled' );
|
142 |
+
}
|
143 |
+
} )
|
144 |
+
.always( function () {
|
145 |
+
$notice.fadeOut( 'fast', function () {
|
146 |
+
$btn.removeClass( 'disabled' );
|
147 |
+
} );
|
148 |
+
} );
|
149 |
+
} );
|
150 |
+
|
151 |
+
// Show/hide debug output.
|
152 |
+
$( '#wp-mail-smtp-debug .error-log-toggle' ).on( 'click', function ( e ) {
|
153 |
+
e.preventDefault();
|
154 |
+
|
155 |
+
$( '#wp-mail-smtp-debug .error-log-toggle' ).find( '.dashicons' ).toggleClass( 'dashicons-arrow-right-alt2 dashicons-arrow-down-alt2' );
|
156 |
+
$( '#wp-mail-smtp-debug .error-log' ).slideToggle();
|
157 |
+
$( '#wp-mail-smtp-debug .error-log-note' ).toggle();
|
158 |
+
} );
|
159 |
+
|
160 |
+
// Remove mailer connection.
|
161 |
+
$( '.js-wp-mail-smtp-provider-remove', app.pageHolder ).on( 'click', function () {
|
162 |
+
return confirm( wp_mail_smtp.text_provider_remove );
|
163 |
+
} );
|
164 |
+
|
165 |
+
// Copy input text to clipboard.
|
166 |
+
$( '.wp-mail-smtp-setting-copy', app.pageHolder ).click( function ( e ) {
|
167 |
+
e.preventDefault();
|
168 |
+
|
169 |
+
var target = $( '#' + $( this ).data( 'source_id' ) ).get( 0 );
|
170 |
+
|
171 |
+
target.select();
|
172 |
+
|
173 |
+
document.execCommand( 'Copy' );
|
174 |
+
} );
|
175 |
+
|
176 |
+
app.triggerExitNotice();
|
177 |
+
},
|
178 |
+
|
179 |
+
education: {
|
180 |
+
upgradeMailer: function ( $input ) {
|
181 |
+
|
182 |
+
$.alert( {
|
183 |
+
backgroundDismiss: true,
|
184 |
+
escapeKey: true,
|
185 |
+
animationBounce: 1,
|
186 |
+
theme: 'modern',
|
187 |
+
animateFromElement: false,
|
188 |
+
draggable: false,
|
189 |
+
closeIcon: true,
|
190 |
+
useBootstrap: false,
|
191 |
+
title: wp_mail_smtp.education.upgrade_title.replace( /%name%/g, $input.siblings( 'label' ).text().trim() ),
|
192 |
+
icon: '"></i>' + wp_mail_smtp.education.upgrade_icon_lock + '<i class="',
|
193 |
+
content: $( '.wp-mail-smtp-mailer-options .wp-mail-smtp-mailer-option-' + $input.val() + ' .wp-mail-smtp-setting-field' ).html(),
|
194 |
+
boxWidth: '550px',
|
195 |
+
onOpenBefore: function () {
|
196 |
+
this.$btnc.after( '<div class="discount-note">' + wp_mail_smtp.education.upgrade_bonus + wp_mail_smtp.education.upgrade_doc + '</div>' );
|
197 |
+
},
|
198 |
+
buttons: {
|
199 |
+
confirm: {
|
200 |
+
text: wp_mail_smtp.education.upgrade_button,
|
201 |
+
btnClass: 'btn-confirm',
|
202 |
+
keys: [ 'enter' ],
|
203 |
+
action: function () {
|
204 |
+
window.open( wp_mail_smtp.education.upgrade_url + '&utm_content=' + encodeURI( $input.val() ), '_blank' );
|
205 |
+
}
|
206 |
+
}
|
207 |
+
}
|
208 |
+
} );
|
209 |
+
}
|
210 |
+
},
|
211 |
+
|
212 |
+
/**
|
213 |
+
* Individual mailers specific js code.
|
214 |
+
*
|
215 |
+
* @since 1.6.0
|
216 |
+
*/
|
217 |
+
mailers: {
|
218 |
+
smtp: {
|
219 |
+
bindActions: function () {
|
220 |
+
|
221 |
+
// Hide SMTP-specific user/pass when Auth disabled.
|
222 |
+
$( '#wp-mail-smtp-setting-smtp-auth' ).change( function () {
|
223 |
+
$( '#wp-mail-smtp-setting-row-smtp-user, #wp-mail-smtp-setting-row-smtp-pass' ).toggleClass( 'inactive' );
|
224 |
+
} );
|
225 |
+
|
226 |
+
// Port default values based on encryption type.
|
227 |
+
$( '#wp-mail-smtp-setting-row-smtp-encryption input' ).change( function () {
|
228 |
+
|
229 |
+
var $input = $( this ),
|
230 |
+
$smtpPort = $( '#wp-mail-smtp-setting-smtp-port', app.pageHolder );
|
231 |
+
|
232 |
+
if ( 'tls' === $input.val() ) {
|
233 |
+
$smtpPort.val( '587' );
|
234 |
+
$( '#wp-mail-smtp-setting-row-smtp-autotls' ).addClass( 'inactive' );
|
235 |
+
}
|
236 |
+
else if ( 'ssl' === $input.val() ) {
|
237 |
+
$smtpPort.val( '465' );
|
238 |
+
$( '#wp-mail-smtp-setting-row-smtp-autotls' ).removeClass( 'inactive' );
|
239 |
+
}
|
240 |
+
else {
|
241 |
+
$smtpPort.val( '25' );
|
242 |
+
$( '#wp-mail-smtp-setting-row-smtp-autotls' ).removeClass( 'inactive' );
|
243 |
+
}
|
244 |
+
} );
|
245 |
+
}
|
246 |
+
}
|
247 |
+
},
|
248 |
+
|
249 |
+
/**
|
250 |
+
* Exit notice JS code when plugin settings are not saved.
|
251 |
+
*
|
252 |
+
* @since {VERSION}
|
253 |
+
*/
|
254 |
+
triggerExitNotice: function () {
|
255 |
+
|
256 |
+
var $settingPages = $( '.wp-mail-smtp-page-general:not( .wp-mail-smtp-tab-test )' );
|
257 |
+
|
258 |
+
// Display an exit notice, if settings are not saved.
|
259 |
+
$( window ).on( 'beforeunload', function () {
|
260 |
+
if ( app.pluginSettingsChanged ) {
|
261 |
+
return wp_mail_smtp.text_settings_not_saved;
|
262 |
+
}
|
263 |
+
} );
|
264 |
+
|
265 |
+
// Set settings changed attribute, if any input was changed.
|
266 |
+
$( ':input:not( #wp-mail-smtp-setting-license-key )', $settingPages ).on( 'change', function () {
|
267 |
+
app.pluginSettingsChanged = true;
|
268 |
+
} );
|
269 |
+
|
270 |
+
// Clear the settings changed attribute, if the settings are about to be saved.
|
271 |
+
$( 'form', $settingPages ).on( 'submit', function () {
|
272 |
+
app.pluginSettingsChanged = false;
|
273 |
+
} );
|
274 |
+
}
|
275 |
+
};
|
276 |
+
|
277 |
+
// Provide access to public functions/properties.
|
278 |
+
return app;
|
279 |
+
})( document, window, jQuery );
|
280 |
+
|
281 |
+
// Initialize.
|
282 |
+
WPMailSMTP.Admin.Settings.init();
|
assets/js/smtp-admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPMailSMTP=window.WPMailSMTP||{};WPMailSMTP.Admin=WPMailSMTP.Admin||{},WPMailSMTP.Admin.Settings=WPMailSMTP.Admin.Settings||function(
|
1 |
+
var WPMailSMTP=window.WPMailSMTP||{};WPMailSMTP.Admin=WPMailSMTP.Admin||{},WPMailSMTP.Admin.Settings=WPMailSMTP.Admin.Settings||function(i,e,a){"use strict";var n={pluginSettingsChanged:!1,init:function(){a(i).ready(n.ready)},ready:function(){n.pageHolder=a(".wp-mail-smtp-tab-settings"),a("#screen-meta-links, #screen-meta").prependTo("#wp-mail-smtp-header-temp").show(),n.bindActions()},bindActions:function(){a(".wp-mail-smtp-mailer-image",n.pageHolder).click(function(){a(this).parents(".wp-mail-smtp-mailer").find("input").trigger("click")}),a(".wp-mail-smtp-mailer input",n.pageHolder).click(function(){var t=a(this);if(t.prop("disabled"))return t.hasClass("educate")&&n.education.upgradeMailer(t),!1;a(".wp-mail-smtp-mailer",n.pageHolder).removeClass("active"),a(this).parents(".wp-mail-smtp-mailer").addClass("active"),a(".wp-mail-smtp-mailer-option",n.pageHolder).addClass("hidden").removeClass("active"),a(".wp-mail-smtp-mailer-option-"+a(this).val(),n.pageHolder).addClass("active").removeClass("hidden")}),n.mailers.smtp.bindActions(),a("#wp-mail-smtp-pro-banner-dismiss",n.pageHolder).on("click",function(){a.ajax({url:ajaxurl,dataType:"json",type:"POST",data:{action:"wp_mail_smtp_ajax",task:"pro_banner_dismiss"}}).always(function(){a("#wp-mail-smtp-pro-banner",n.pageHolder).fadeOut("fast")})}),a(".js-wp-mail-smtp-mailer-notice-dismiss",n.pageHolder).on("click",function(t){t.preventDefault();var i=a(this),e=i.parents(".inline-notice");if(i.hasClass("disabled"))return!1;a.ajax({url:ajaxurl,dataType:"json",type:"POST",data:{action:"wp_mail_smtp_ajax",task:"notice_dismiss",notice:e.data("notice"),mailer:e.data("mailer")},beforeSend:function(){i.addClass("disabled")}}).always(function(){e.fadeOut("fast",function(){i.removeClass("disabled")})})}),a("#wp-mail-smtp-debug .error-log-toggle").on("click",function(t){t.preventDefault(),a("#wp-mail-smtp-debug .error-log-toggle").find(".dashicons").toggleClass("dashicons-arrow-right-alt2 dashicons-arrow-down-alt2"),a("#wp-mail-smtp-debug .error-log").slideToggle(),a("#wp-mail-smtp-debug .error-log-note").toggle()}),a(".js-wp-mail-smtp-provider-remove",n.pageHolder).on("click",function(){return confirm(wp_mail_smtp.text_provider_remove)}),a(".wp-mail-smtp-setting-copy",n.pageHolder).click(function(t){t.preventDefault(),a("#"+a(this).data("source_id")).get(0).select(),i.execCommand("Copy")}),n.triggerExitNotice()},education:{upgradeMailer:function(t){a.alert({backgroundDismiss:!0,escapeKey:!0,animationBounce:1,theme:"modern",animateFromElement:!1,draggable:!1,closeIcon:!0,useBootstrap:!1,title:wp_mail_smtp.education.upgrade_title.replace(/%name%/g,t.siblings("label").text().trim()),icon:'"></i>'+wp_mail_smtp.education.upgrade_icon_lock+'<i class="',content:a(".wp-mail-smtp-mailer-options .wp-mail-smtp-mailer-option-"+t.val()+" .wp-mail-smtp-setting-field").html(),boxWidth:"550px",onOpenBefore:function(){this.$btnc.after('<div class="discount-note">'+wp_mail_smtp.education.upgrade_bonus+wp_mail_smtp.education.upgrade_doc+"</div>")},buttons:{confirm:{text:wp_mail_smtp.education.upgrade_button,btnClass:"btn-confirm",keys:["enter"],action:function(){e.open(wp_mail_smtp.education.upgrade_url+"&utm_content="+encodeURI(t.val()),"_blank")}}}})}},mailers:{smtp:{bindActions:function(){a("#wp-mail-smtp-setting-smtp-auth").change(function(){a("#wp-mail-smtp-setting-row-smtp-user, #wp-mail-smtp-setting-row-smtp-pass").toggleClass("inactive")}),a("#wp-mail-smtp-setting-row-smtp-encryption input").change(function(){var t=a(this),i=a("#wp-mail-smtp-setting-smtp-port",n.pageHolder);"tls"===t.val()?(i.val("587"),a("#wp-mail-smtp-setting-row-smtp-autotls").addClass("inactive")):("ssl"===t.val()?i.val("465"):i.val("25"),a("#wp-mail-smtp-setting-row-smtp-autotls").removeClass("inactive"))})}}},triggerExitNotice:function(){var t=a(".wp-mail-smtp-page-general:not( .wp-mail-smtp-tab-test )");a(e).on("beforeunload",function(){if(n.pluginSettingsChanged)return wp_mail_smtp.text_settings_not_saved}),a(":input:not( #wp-mail-smtp-setting-license-key )",t).on("change",function(){n.pluginSettingsChanged=!0}),a("form",t).on("submit",function(){n.pluginSettingsChanged=!1})}};return n}(document,window,jQuery),WPMailSMTP.Admin.Settings.init();
|
assets/languages/wp-mail-smtp.pot
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
-
"Project-Id-Version: WP Mail SMTP 1.
|
4 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-mail-smtp\n"
|
5 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
6 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
7 |
"MIME-Version: 1.0\n"
|
8 |
"Content-Type: text/plain; charset=UTF-8\n"
|
9 |
"Content-Transfer-Encoding: 8bit\n"
|
10 |
-
"POT-Creation-Date:
|
11 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
12 |
-
"X-Generator: WP-CLI 2.
|
13 |
"X-Domain: wp-mail-smtp\n"
|
14 |
|
15 |
#. Plugin Name of the plugin
|
@@ -60,21 +60,22 @@ msgstr ""
|
|
60 |
|
61 |
#: src/Admin/Area.php:197
|
62 |
#: src/Admin/Area.php:198
|
|
|
63 |
#: wp-mail-smtp-0.11.2.php:582
|
64 |
msgid "WP Mail SMTP"
|
65 |
msgstr ""
|
66 |
|
67 |
#: src/Admin/Area.php:208
|
68 |
#: src/Admin/Area.php:209
|
69 |
-
#: src/Admin/Area.php:
|
70 |
#: wp-mail-smtp-0.11.2.php:688
|
71 |
msgid "Settings"
|
72 |
msgstr ""
|
73 |
|
74 |
#: src/Admin/Area.php:216
|
75 |
#: src/Admin/Area.php:217
|
76 |
-
#: src/Admin/Area.php:
|
77 |
-
#: src/Admin/Pages/About.php:
|
78 |
#: src/Admin/Pages/Logs.php:40
|
79 |
#: src/Admin/Pages/LogsTab.php:31
|
80 |
msgid "Email Log"
|
@@ -90,69 +91,73 @@ msgstr ""
|
|
90 |
msgid "Are you sure you want to reset the current provider connection? You will need to immediately create a new one to be able to send emails."
|
91 |
msgstr ""
|
92 |
|
93 |
-
#: src/Admin/Area.php:
|
94 |
-
msgid "
|
95 |
msgstr ""
|
96 |
|
97 |
#: src/Admin/Area.php:271
|
|
|
|
|
|
|
|
|
98 |
msgid "Upgrade to Pro"
|
99 |
msgstr ""
|
100 |
|
101 |
-
#: src/Admin/Area.php:
|
102 |
msgid "<strong>Bonus:</strong> WP Mail SMTP users get <span>20% off</span> regular price,<br>applied at checkout."
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: src/Admin/Area.php:
|
106 |
msgid "Already purchased?"
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: src/Admin/Area.php:
|
110 |
-
#: src/Admin/Area.php:
|
111 |
-
#: src/Admin/Pages/About.php:
|
112 |
msgid "Activate"
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: src/Admin/Area.php:
|
116 |
-
#: src/Admin/Pages/About.php:
|
117 |
msgid "Activated"
|
118 |
msgstr ""
|
119 |
|
120 |
-
#: src/Admin/Area.php:
|
121 |
-
#: src/Admin/Pages/About.php:
|
122 |
msgid "Active"
|
123 |
msgstr ""
|
124 |
|
125 |
-
#: src/Admin/Area.php:
|
126 |
-
#: src/Admin/Pages/About.php:
|
127 |
msgid "Inactive"
|
128 |
msgstr ""
|
129 |
|
130 |
-
#: src/Admin/Area.php:
|
131 |
msgid "Processing..."
|
132 |
msgstr ""
|
133 |
|
134 |
-
#: src/Admin/Area.php:
|
135 |
msgid "Could not install a plugin. Please download from WordPress.org and install manually."
|
136 |
msgstr ""
|
137 |
|
138 |
-
#: src/Admin/Area.php:
|
139 |
msgid "Install and Activate"
|
140 |
msgstr ""
|
141 |
|
142 |
-
#: src/Admin/Area.php:
|
143 |
msgid "Download"
|
144 |
msgstr ""
|
145 |
|
146 |
#. translators: %1$s - WP.org link; %2$s - same WP.org link.
|
147 |
-
#: src/Admin/Area.php:
|
148 |
msgid "Please rate <strong>WP Mail SMTP</strong> <a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">★★★★★</a> on <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">WordPress.org</a> to help us spread the word. Thank you from the WP Mail SMTP team!"
|
149 |
msgstr ""
|
150 |
|
151 |
-
#: src/Admin/Area.php:
|
152 |
msgid "WP Mail SMTP Pro related message was successfully dismissed."
|
153 |
msgstr ""
|
154 |
|
155 |
-
#: src/Admin/Area.php:
|
156 |
msgid "Educational notice for this mailer was successfully dismissed."
|
157 |
msgstr ""
|
158 |
|
@@ -162,7 +167,7 @@ msgstr ""
|
|
162 |
|
163 |
#. translators: %s - plugin current license type.
|
164 |
#: src/Admin/Pages/About.php:98
|
165 |
-
#: src/Admin/Pages/About.php:
|
166 |
msgid "%s vs Pro"
|
167 |
msgstr ""
|
168 |
|
@@ -178,152 +183,165 @@ msgstr ""
|
|
178 |
msgid "Our goal is to make reliable email deliverability easy for WordPress."
|
179 |
msgstr ""
|
180 |
|
181 |
-
#. translators: %1$s -
|
182 |
#: src/Admin/Pages/About.php:184
|
183 |
-
msgid "WP Mail SMTP is brought to you by the same team that's behind the most user friendly WordPress forms, <a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">WPForms</a>, the largest WordPress resource site, <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">WPBeginner</a>, the most popular lead-generation software, <a href=\"%3$s\" target=\"_blank\" rel=\"noopener noreferrer\">OptinMonster</a>,
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: src/Admin/Pages/About.php:
|
187 |
msgid "Yup, we know a thing or two about building awesome products that customers love."
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: src/Admin/Pages/About.php:
|
191 |
msgid "The WPForms Team photo"
|
192 |
msgstr ""
|
193 |
|
194 |
-
#: src/Admin/Pages/About.php:
|
195 |
msgid "The WPForms Team"
|
196 |
msgstr ""
|
197 |
|
198 |
#. translators: %s - status HTML text.
|
199 |
-
#: src/Admin/Pages/About.php:
|
200 |
msgid "Status: %s"
|
201 |
msgstr ""
|
202 |
|
203 |
-
#: src/Admin/Pages/About.php:
|
204 |
msgid "Not Installed"
|
205 |
msgstr ""
|
206 |
|
207 |
-
#: src/Admin/Pages/About.php:
|
208 |
msgid "Install Plugin"
|
209 |
msgstr ""
|
210 |
|
211 |
-
#: src/Admin/Pages/About.php:
|
212 |
msgid "MonsterInsights"
|
213 |
msgstr ""
|
214 |
|
215 |
-
#: src/Admin/Pages/About.php:
|
216 |
-
#: src/Admin/Pages/About.php:
|
217 |
msgid "MonsterInsights makes it “effortless” to properly connect your WordPress site with Google Analytics, so you can start making data-driven decisions to grow your business."
|
218 |
msgstr ""
|
219 |
|
220 |
-
#: src/Admin/Pages/About.php:
|
221 |
msgid "MonsterInsights Pro"
|
222 |
msgstr ""
|
223 |
|
224 |
-
#: src/Admin/Pages/About.php:
|
225 |
msgid "OptinMonster"
|
226 |
msgstr ""
|
227 |
|
228 |
-
#: src/Admin/Pages/About.php:
|
229 |
msgid "Our high-converting optin forms like Exit-Intent® popups, Fullscreen Welcome Mats, and Scroll boxes help you dramatically boost conversions and get more email subscribers."
|
230 |
msgstr ""
|
231 |
|
232 |
-
#: src/Admin/Pages/About.php:
|
233 |
msgid "Contact Forms by WPForms"
|
234 |
msgstr ""
|
235 |
|
236 |
-
#: src/Admin/Pages/About.php:
|
237 |
-
#: src/Admin/Pages/About.php:
|
238 |
msgid "The best WordPress contact form plugin. Drag & Drop online form builder that helps you create beautiful contact forms with just a few clicks."
|
239 |
msgstr ""
|
240 |
|
241 |
-
#: src/Admin/Pages/About.php:
|
242 |
msgid "WPForms Pro"
|
243 |
msgstr ""
|
244 |
|
245 |
-
#: src/Admin/Pages/About.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
msgid "Could not activate the plugin. Please activate it from the Plugins page."
|
247 |
msgstr ""
|
248 |
|
249 |
-
#: src/Admin/Pages/About.php:
|
250 |
msgid "Plugin activated."
|
251 |
msgstr ""
|
252 |
|
253 |
-
#: src/Admin/Pages/About.php:
|
254 |
msgid "Could not install the plugin."
|
255 |
msgstr ""
|
256 |
|
257 |
-
#: src/Admin/Pages/About.php:
|
258 |
msgid "Plugin installed & activated."
|
259 |
msgstr ""
|
260 |
|
261 |
-
#: src/Admin/Pages/About.php:
|
262 |
msgid "Plugin installed."
|
263 |
msgstr ""
|
264 |
|
265 |
-
#: src/Admin/Pages/About.php:
|
266 |
msgid "Get the most out of WP Mail SMTP by upgrading to Pro and unlocking all of the powerful features."
|
267 |
msgstr ""
|
268 |
|
269 |
-
#: src/Admin/Pages/About.php:
|
270 |
msgid "Feature"
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: src/Admin/Pages/About.php:
|
274 |
msgid "Pro"
|
275 |
msgstr ""
|
276 |
|
277 |
-
#: src/Admin/Pages/About.php:
|
278 |
msgid "Get WP Mail SMTP Pro Today and Unlock all of these Powerful Features"
|
279 |
msgstr ""
|
280 |
|
281 |
-
#: src/Admin/Pages/About.php:
|
282 |
msgid "Bonus: WP Mail SMTP Lite users get <span class=\"price-off\">20% off regular price</span>, automatically applied at checkout."
|
283 |
msgstr ""
|
284 |
|
285 |
-
#: src/Admin/Pages/About.php:
|
286 |
#: src/Admin/Pages/ControlTab.php:27
|
287 |
msgid "Email Controls"
|
288 |
msgstr ""
|
289 |
|
290 |
-
#: src/Admin/Pages/About.php:
|
291 |
msgid "Additional Mailers"
|
292 |
msgstr ""
|
293 |
|
294 |
-
#: src/Admin/Pages/About.php:
|
295 |
msgid "Customer Support"
|
296 |
msgstr ""
|
297 |
|
298 |
-
#: src/Admin/Pages/About.php:
|
299 |
msgid "Emails are not logged"
|
300 |
msgstr ""
|
301 |
|
302 |
-
#: src/Admin/Pages/About.php:
|
303 |
msgid "Complete Email Log management inside WordPress"
|
304 |
msgstr ""
|
305 |
|
306 |
-
#: src/Admin/Pages/About.php:
|
307 |
msgid "No controls over whether default WordPress emails are sent"
|
308 |
msgstr ""
|
309 |
|
310 |
-
#: src/Admin/Pages/About.php:
|
311 |
msgid "Complete Email Controls management for most default WordPress emails"
|
312 |
msgstr ""
|
313 |
|
314 |
-
#: src/Admin/Pages/About.php:
|
315 |
msgid "Only default list of mailers"
|
316 |
msgstr ""
|
317 |
|
318 |
-
#: src/Admin/Pages/About.php:
|
319 |
msgid "Additional mailers: Microsoft Outlook (with Office365 support) and Amazon SES"
|
320 |
msgstr ""
|
321 |
|
322 |
-
#: src/Admin/Pages/About.php:
|
323 |
msgid "Limited Support"
|
324 |
msgstr ""
|
325 |
|
326 |
-
#: src/Admin/Pages/About.php:
|
327 |
msgid "Priority Support"
|
328 |
msgstr ""
|
329 |
|
@@ -710,449 +728,449 @@ msgstr ""
|
|
710 |
msgid "Send this email in HTML or in plain text format."
|
711 |
msgstr ""
|
712 |
|
713 |
-
#: src/Admin/Pages/TestTab.php:
|
714 |
msgid "You cannot send an email. Mailer is not properly configured. Please check your settings."
|
715 |
msgstr ""
|
716 |
|
717 |
-
#: src/Admin/Pages/TestTab.php:
|
718 |
msgid "Send Email"
|
719 |
msgstr ""
|
720 |
|
721 |
-
#: src/Admin/Pages/TestTab.php:
|
722 |
msgid "Test failed. Please use a valid email address and try to resend the test email."
|
723 |
msgstr ""
|
724 |
|
725 |
#. translators: %s - email address a test email will be sent to.
|
726 |
-
#: src/Admin/Pages/TestTab.php:
|
727 |
-
#: src/Admin/Pages/TestTab.php:
|
728 |
msgid "Test email to %s"
|
729 |
msgstr ""
|
730 |
|
731 |
-
#: src/Admin/Pages/TestTab.php:
|
732 |
msgid "Test plain text email was sent successfully!"
|
733 |
msgstr ""
|
734 |
|
735 |
#. translators: %s - "HTML" in bold.
|
736 |
-
#: src/Admin/Pages/TestTab.php:
|
737 |
msgid "Test %s email was sent successfully! Please check your inbox to make sure it is delivered."
|
738 |
msgstr ""
|
739 |
|
740 |
-
#: src/Admin/Pages/TestTab.php:
|
741 |
msgid "SSL certificate issue."
|
742 |
msgstr ""
|
743 |
|
744 |
-
#: src/Admin/Pages/TestTab.php:
|
745 |
msgid "This means your web server cannot reliably make secure connections (make requests to HTTPS sites)."
|
746 |
msgstr ""
|
747 |
|
748 |
-
#: src/Admin/Pages/TestTab.php:
|
749 |
-
#: src/Admin/Pages/TestTab.php:
|
750 |
msgid "Typically this error is returned when web server is not configured properly."
|
751 |
msgstr ""
|
752 |
|
753 |
-
#: src/Admin/Pages/TestTab.php:
|
754 |
msgid "Contact your web hosting provider and inform them your site has an issue with SSL certificates."
|
755 |
msgstr ""
|
756 |
|
757 |
-
#: src/Admin/Pages/TestTab.php:
|
758 |
-
#: src/Admin/Pages/TestTab.php:
|
759 |
msgid "The exact error you can provide them is in the Error log, available at the bottom of this page."
|
760 |
msgstr ""
|
761 |
|
762 |
-
#: src/Admin/Pages/TestTab.php:
|
763 |
-
#: src/Admin/Pages/TestTab.php:
|
764 |
msgid "Ask them to resolve the issue then try again."
|
765 |
msgstr ""
|
766 |
|
767 |
-
#: src/Admin/Pages/TestTab.php:
|
768 |
msgid "Could not connect to host."
|
769 |
msgstr ""
|
770 |
|
771 |
#. translators: %s - SMTP host address.
|
772 |
-
#: src/Admin/Pages/TestTab.php:
|
773 |
-
#: src/Admin/Pages/TestTab.php:
|
774 |
-
#: src/Admin/Pages/TestTab.php:
|
775 |
msgid "This means your web server was unable to connect to %s."
|
776 |
msgstr ""
|
777 |
|
778 |
-
#: src/Admin/Pages/TestTab.php:
|
779 |
-
#: src/Admin/Pages/TestTab.php:
|
780 |
-
#: src/Admin/Pages/TestTab.php:
|
781 |
msgid "This means your web server was unable to connect to the host server."
|
782 |
msgstr ""
|
783 |
|
784 |
-
#: src/Admin/Pages/TestTab.php:
|
785 |
msgid "Typically this error is returned your web server is blocking the connections or the SMTP host denying the request."
|
786 |
msgstr ""
|
787 |
|
788 |
#. translators: %s - SMTP host address.
|
789 |
-
#: src/Admin/Pages/TestTab.php:
|
790 |
msgid "Contact your web hosting provider and ask them to verify your server can connect to %s. Additionally, ask them if a firewall or security policy may be preventing the connection."
|
791 |
msgstr ""
|
792 |
|
793 |
-
#: src/Admin/Pages/TestTab.php:
|
794 |
msgid "If using \"Other SMTP\" Mailer, triple check your SMTP settings including host address, email, and password."
|
795 |
msgstr ""
|
796 |
|
797 |
-
#: src/Admin/Pages/TestTab.php:
|
798 |
msgid "If using \"Other SMTP\" Mailer, contact your SMTP host to confirm they are accepting outside connections with the settings you have configured (address, username, port, security, etc)."
|
799 |
msgstr ""
|
800 |
|
801 |
-
#: src/Admin/Pages/TestTab.php:
|
802 |
msgid "Could not connect to your host."
|
803 |
msgstr ""
|
804 |
|
805 |
-
#: src/Admin/Pages/TestTab.php:
|
806 |
msgid "Contact your web hosting provider and inform them you are having issues making outbound connections."
|
807 |
msgstr ""
|
808 |
|
809 |
-
#: src/Admin/Pages/TestTab.php:
|
810 |
msgid "Could not authenticate your SMTP account."
|
811 |
msgstr ""
|
812 |
|
813 |
-
#: src/Admin/Pages/TestTab.php:
|
814 |
msgid "This means we were able to connect to your SMTP host, but were not able to proceed using the email/password in the settings."
|
815 |
msgstr ""
|
816 |
|
817 |
-
#: src/Admin/Pages/TestTab.php:
|
818 |
msgid "Typically this error is returned when the email or password is not correct or is not what the SMTP host is expecting."
|
819 |
msgstr ""
|
820 |
|
821 |
-
#: src/Admin/Pages/TestTab.php:
|
822 |
msgid "Triple check your SMTP settings including host address, email, and password. If you have recently reset your password you will need to update the settings."
|
823 |
msgstr ""
|
824 |
|
825 |
-
#: src/Admin/Pages/TestTab.php:
|
826 |
-
#: src/Admin/Pages/TestTab.php:
|
827 |
msgid "Contact your SMTP host to confirm you are using the correct username and password."
|
828 |
msgstr ""
|
829 |
|
830 |
-
#: src/Admin/Pages/TestTab.php:
|
831 |
-
#: src/Admin/Pages/TestTab.php:
|
832 |
msgid "Verify with your SMTP host that your account has permissions to send emails using outside connections."
|
833 |
msgstr ""
|
834 |
|
835 |
-
#: src/Admin/Pages/TestTab.php:
|
836 |
msgid "Error due to unsolicited and/or bulk e-mail."
|
837 |
msgstr ""
|
838 |
|
839 |
-
#: src/Admin/Pages/TestTab.php:
|
840 |
msgid "This means the connection to your SMTP host was made successfully, but the host rejected the email."
|
841 |
msgstr ""
|
842 |
|
843 |
-
#: src/Admin/Pages/TestTab.php:
|
844 |
msgid "Typically this error is returned when you are sending too many e-mails or e-mails that have been identified as spam."
|
845 |
msgstr ""
|
846 |
|
847 |
-
#: src/Admin/Pages/TestTab.php:
|
848 |
msgid "Check the emails that are sending are sending individually. Example: email is not sending to 30 recipients. You can install any WordPress e-mail logging plugin to do that."
|
849 |
msgstr ""
|
850 |
|
851 |
-
#: src/Admin/Pages/TestTab.php:
|
852 |
msgid "Contact your SMTP host to ask about sending/rate limits."
|
853 |
msgstr ""
|
854 |
|
855 |
-
#: src/Admin/Pages/TestTab.php:
|
856 |
msgid "Verify with them your SMTP account is in good standing and your account has not been flagged."
|
857 |
msgstr ""
|
858 |
|
859 |
-
#: src/Admin/Pages/TestTab.php:
|
860 |
msgid "Unauthenticated senders are not allowed."
|
861 |
msgstr ""
|
862 |
|
863 |
-
#: src/Admin/Pages/TestTab.php:
|
864 |
msgid "This means the connection to your SMTP host was made successfully, but you should enable Authentication and provide correct Username and Password."
|
865 |
msgstr ""
|
866 |
|
867 |
-
#: src/Admin/Pages/TestTab.php:
|
868 |
msgid "Go to WP Mail SMTP plugin Settings page."
|
869 |
msgstr ""
|
870 |
|
871 |
-
#: src/Admin/Pages/TestTab.php:
|
872 |
msgid "Enable Authentication"
|
873 |
msgstr ""
|
874 |
|
875 |
-
#: src/Admin/Pages/TestTab.php:
|
876 |
msgid "Enter correct SMTP Username (usually this is an email address) and Password in the appropriate fields."
|
877 |
msgstr ""
|
878 |
|
879 |
-
#: src/Admin/Pages/TestTab.php:
|
880 |
msgid "Could not connect to the SMTP host."
|
881 |
msgstr ""
|
882 |
|
883 |
-
#: src/Admin/Pages/TestTab.php:
|
884 |
-
#: src/Admin/Pages/TestTab.php:
|
885 |
msgid "Typically this error is returned for one of the following reasons:"
|
886 |
msgstr ""
|
887 |
|
888 |
-
#: src/Admin/Pages/TestTab.php:
|
889 |
msgid "SMTP settings are incorrect (wrong port, security setting, incorrect host)."
|
890 |
msgstr ""
|
891 |
|
892 |
-
#: src/Admin/Pages/TestTab.php:
|
893 |
-
#: src/Admin/Pages/TestTab.php:
|
894 |
msgid "Your web server is blocking the connection."
|
895 |
msgstr ""
|
896 |
|
897 |
-
#: src/Admin/Pages/TestTab.php:
|
898 |
msgid "Your SMTP host is rejecting the connection."
|
899 |
msgstr ""
|
900 |
|
901 |
-
#: src/Admin/Pages/TestTab.php:
|
902 |
msgid "Triple check your SMTP settings including host address, email, and password, port, and security."
|
903 |
msgstr ""
|
904 |
|
905 |
#. translators: %1$s - SMTP host address, %2$s - SMTP port, %3$s - SMTP encryption.
|
906 |
-
#: src/Admin/Pages/TestTab.php:
|
907 |
msgid "Contact your web hosting provider and ask them to verify your server can connect to %1$s on port %2$s using %3$s encryption. Additionally, ask them if a firewall or security policy may be preventing the connection - many shared hosts block certain ports.<br><strong>Note: this is the most common cause of this issue.</strong>"
|
908 |
msgstr ""
|
909 |
|
910 |
-
#: src/Admin/Pages/TestTab.php:
|
911 |
msgid "no"
|
912 |
msgstr ""
|
913 |
|
|
|
914 |
#: src/Admin/Pages/TestTab.php:675
|
915 |
-
#: src/Admin/Pages/TestTab.php:
|
916 |
-
#: src/Admin/Pages/TestTab.php:706
|
917 |
msgid "Mailgun failed."
|
918 |
msgstr ""
|
919 |
|
920 |
-
#: src/Admin/Pages/TestTab.php:
|
921 |
msgid "It seems that you forgot to activate your Mailgun account."
|
922 |
msgstr ""
|
923 |
|
924 |
-
#: src/Admin/Pages/TestTab.php:
|
925 |
msgid "Check your inbox you used to create a Mailgun account. Click the activation link in an email from Mailgun."
|
926 |
msgstr ""
|
927 |
|
928 |
-
#: src/Admin/Pages/TestTab.php:
|
929 |
msgid "If you do not see activation email, go to your Mailgun control panel and resend the activation email."
|
930 |
msgstr ""
|
931 |
|
932 |
-
#: src/Admin/Pages/TestTab.php:
|
933 |
msgid "Typically this error is because there is an issue with your Mailgun settings, in many cases the API key."
|
934 |
msgstr ""
|
935 |
|
936 |
-
#: src/Admin/Pages/TestTab.php:
|
937 |
msgid "Verify your API key is correct."
|
938 |
msgstr ""
|
939 |
|
940 |
-
#: src/Admin/Pages/TestTab.php:
|
941 |
msgid "Go to your Mailgun account and view your API key."
|
942 |
msgstr ""
|
943 |
|
944 |
-
#: src/Admin/Pages/TestTab.php:
|
945 |
msgid "Note that the API key includes the \"key\" prefix, so make sure that it is in the WP Mail SMTP Mailgun API setting."
|
946 |
msgstr ""
|
947 |
|
948 |
-
#: src/Admin/Pages/TestTab.php:
|
949 |
msgid "Your Mailgun account does not have access to send emails."
|
950 |
msgstr ""
|
951 |
|
952 |
-
#: src/Admin/Pages/TestTab.php:
|
953 |
msgid "Typically this error is because you have not set up and/or complete domain name verification for your Mailgun account."
|
954 |
msgstr ""
|
955 |
|
956 |
#. translators: %s - Mailgun documentation URL.
|
957 |
-
#: src/Admin/Pages/TestTab.php:
|
958 |
msgid "Go to our how-to guide for setting up <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">Mailgun with WP Mail SMTP</a>."
|
959 |
msgstr ""
|
960 |
|
961 |
-
#: src/Admin/Pages/TestTab.php:
|
962 |
msgid "Complete the steps in section \"2. Verify Your Domain\"."
|
963 |
msgstr ""
|
964 |
|
965 |
-
#: src/Admin/Pages/TestTab.php:
|
966 |
-
#: src/Admin/Pages/TestTab.php:
|
967 |
-
#: src/Admin/Pages/TestTab.php:
|
968 |
-
#: src/Admin/Pages/TestTab.php:
|
969 |
-
#: src/Admin/Pages/TestTab.php:
|
970 |
-
#: src/Admin/Pages/TestTab.php:
|
971 |
-
#: src/Admin/Pages/TestTab.php:
|
972 |
msgid "Google API Error."
|
973 |
msgstr ""
|
974 |
|
975 |
-
#: src/Admin/Pages/TestTab.php:
|
976 |
msgid "You have not properly configured Gmail mailer."
|
977 |
msgstr ""
|
978 |
|
979 |
-
#: src/Admin/Pages/TestTab.php:
|
980 |
msgid "Make sure that you have clicked the \"Allow plugin to send emails using your Google account\" button under Gmail settings."
|
981 |
msgstr ""
|
982 |
|
983 |
-
#: src/Admin/Pages/TestTab.php:
|
984 |
msgid "Go to plugin Settings page and click the \"Allow plugin to send emails using your Google account\" button."
|
985 |
msgstr ""
|
986 |
|
987 |
-
#: src/Admin/Pages/TestTab.php:
|
988 |
msgid "After the click you should be redirected to a Gmail authorization screen, where you will be asked a permission to send emails on your behalf."
|
989 |
msgstr ""
|
990 |
|
991 |
-
#: src/Admin/Pages/TestTab.php:
|
992 |
msgid "Please click \"Agree\", if you see that button. If not - you will need to enable less secure apps first:"
|
993 |
msgstr ""
|
994 |
|
995 |
#. translators: %s - Google support article URL.
|
996 |
-
#: src/Admin/Pages/TestTab.php:
|
997 |
msgid "if you are using regular Gmail account, please <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">read this article</a> to proceed."
|
998 |
msgstr ""
|
999 |
|
1000 |
#. translators: %s - Google support article URL.
|
1001 |
-
#: src/Admin/Pages/TestTab.php:
|
1002 |
msgid "if you are using G Suite, please <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">read this article</a> to proceed."
|
1003 |
msgstr ""
|
1004 |
|
1005 |
-
#: src/Admin/Pages/TestTab.php:
|
1006 |
msgid "Typically this error is because address the email was sent to is invalid or was empty."
|
1007 |
msgstr ""
|
1008 |
|
1009 |
-
#: src/Admin/Pages/TestTab.php:
|
1010 |
msgid "Check the \"Send To\" email address used and confirm it is a valid email and was not empty."
|
1011 |
msgstr ""
|
1012 |
|
1013 |
#. translators: 1 - correct email address example. 2 - incorrect email address example.
|
1014 |
-
#: src/Admin/Pages/TestTab.php:
|
1015 |
msgid "It should be something like this: %1$s. These are incorrect values: %2$s."
|
1016 |
msgstr ""
|
1017 |
|
1018 |
-
#: src/Admin/Pages/TestTab.php:
|
1019 |
msgid "Make sure that the generated email has a TO header, useful when you are responsible for email creation."
|
1020 |
msgstr ""
|
1021 |
|
1022 |
-
#: src/Admin/Pages/TestTab.php:
|
1023 |
msgid "Unfortunately, this error can be due to many different reasons."
|
1024 |
msgstr ""
|
1025 |
|
1026 |
#. translators: %s - Blog article URL.
|
1027 |
-
#: src/Admin/Pages/TestTab.php:
|
1028 |
msgid "Please <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">read this article</a> to learn more about what can cause this error and how it can be resolved."
|
1029 |
msgstr ""
|
1030 |
|
1031 |
-
#: src/Admin/Pages/TestTab.php:
|
1032 |
msgid "Authentication code that Google returned to you has already been used on your previous auth attempt."
|
1033 |
msgstr ""
|
1034 |
|
1035 |
-
#: src/Admin/Pages/TestTab.php:
|
1036 |
msgid "Make sure that you are not trying to manually clean up the plugin options to retry the \"Allow...\" step."
|
1037 |
msgstr ""
|
1038 |
|
1039 |
-
#: src/Admin/Pages/TestTab.php:
|
1040 |
msgid "Reinstall the plugin with clean plugin data turned on on Misc page. This will remove all the plugin options and you will be safe to retry."
|
1041 |
msgstr ""
|
1042 |
|
1043 |
-
#: src/Admin/Pages/TestTab.php:
|
1044 |
msgid "Make sure there is no aggressive caching on site admin area pages or try to clean cache between attempts."
|
1045 |
msgstr ""
|
1046 |
|
1047 |
-
#: src/Admin/Pages/TestTab.php:
|
1048 |
msgid "There are various reasons for that, please review the steps below."
|
1049 |
msgstr ""
|
1050 |
|
1051 |
#. translators: %s - Google G Suite Admin area URL.
|
1052 |
-
#: src/Admin/Pages/TestTab.php:
|
1053 |
msgid "Make sure that your G Suite trial period has not expired. You can check the status <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>."
|
1054 |
msgstr ""
|
1055 |
|
1056 |
#. translators: %s - Google G Suite Admin area URL.
|
1057 |
-
#: src/Admin/Pages/TestTab.php:
|
1058 |
msgid "Make sure that Gmail app in your G Suite is actually enabled. You can check that in Apps list in <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">G Suite Admin</a> area."
|
1059 |
msgstr ""
|
1060 |
|
1061 |
#. translators: %s - Google Developers Console URL.
|
1062 |
-
#: src/Admin/Pages/TestTab.php:
|
1063 |
msgid "Make sure that you have Gmail API enabled, and you can do that <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>."
|
1064 |
msgstr ""
|
1065 |
|
1066 |
-
#: src/Admin/Pages/TestTab.php:
|
1067 |
-
#: src/Admin/Pages/TestTab.php:
|
1068 |
msgid "Make sure that the used Client ID/Secret correspond to a proper project that has Gmail API enabled."
|
1069 |
msgstr ""
|
1070 |
|
1071 |
#. translators: %s - WPForms.com tutorial URL.
|
1072 |
-
#: src/Admin/Pages/TestTab.php:
|
1073 |
msgid "Please follow our <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">Gmail tutorial</a> to be sure that all the correct project and data is applied."
|
1074 |
msgstr ""
|
1075 |
|
1076 |
-
#: src/Admin/Pages/TestTab.php:
|
1077 |
msgid "You may have added a new API to a project"
|
1078 |
msgstr ""
|
1079 |
|
1080 |
-
#: src/Admin/Pages/TestTab.php:
|
1081 |
msgid "Try to use a separate project for your emails, so the project has only 1 Gmail API in it enabled. You will need to remove the old project and create a new one from scratch."
|
1082 |
msgstr ""
|
1083 |
|
1084 |
-
#: src/Admin/Pages/TestTab.php:
|
1085 |
msgid "An issue was detected."
|
1086 |
msgstr ""
|
1087 |
|
1088 |
-
#: src/Admin/Pages/TestTab.php:
|
1089 |
msgid "This means your test email was unable to be sent."
|
1090 |
msgstr ""
|
1091 |
|
1092 |
-
#: src/Admin/Pages/TestTab.php:
|
1093 |
msgid "Plugin settings are incorrect (wrong SMTP settings, invalid Mailer configuration, etc)."
|
1094 |
msgstr ""
|
1095 |
|
1096 |
-
#: src/Admin/Pages/TestTab.php:
|
1097 |
msgid "Your host is rejecting the connection."
|
1098 |
msgstr ""
|
1099 |
|
1100 |
-
#: src/Admin/Pages/TestTab.php:
|
1101 |
msgid "Triple check the plugin settings, consider reconfiguring to make sure everything is correct (eg bad copy and paste)."
|
1102 |
msgstr ""
|
1103 |
|
1104 |
-
#: src/Admin/Pages/TestTab.php:
|
1105 |
msgid "Contact your web hosting provider and ask them to verify your server can make outside connections. Additionally, ask them if a firewall or security policy may be preventing the connection - many shared hosts block certain ports.<br><strong>Note: this is the most common cause of this issue.</strong>"
|
1106 |
msgstr ""
|
1107 |
|
1108 |
-
#: src/Admin/Pages/TestTab.php:
|
1109 |
msgid "Try using a different mailer."
|
1110 |
msgstr ""
|
1111 |
|
1112 |
-
#: src/Admin/Pages/TestTab.php:
|
1113 |
msgid "There was a problem while sending the test email."
|
1114 |
msgstr ""
|
1115 |
|
1116 |
-
#: src/Admin/Pages/TestTab.php:
|
1117 |
msgid "Recommended next steps:"
|
1118 |
msgstr ""
|
1119 |
|
1120 |
-
#: src/Admin/Pages/TestTab.php:
|
1121 |
msgid "Need support?"
|
1122 |
msgstr ""
|
1123 |
|
1124 |
#. translators: %s - WPMailSMTP.com account area link.
|
1125 |
-
#: src/Admin/Pages/TestTab.php:
|
1126 |
msgid "As a WP Mail SMTP Pro user you have access to WP Mail SMTP priority support. Please log in to your WPMailSMTP.com account and <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">submit a support ticket</a>."
|
1127 |
msgstr ""
|
1128 |
|
1129 |
-
#: src/Admin/Pages/TestTab.php:
|
1130 |
msgid "WP Mail SMTP is a free plugin, and the team behind WPForms maintains it to give back to the WordPress community."
|
1131 |
msgstr ""
|
1132 |
|
1133 |
#. translators: %s - WPMailSMTP.com URL.
|
1134 |
-
#: src/Admin/Pages/TestTab.php:
|
1135 |
msgid "To access our world class support, please <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">upgrade to WP Mail SMTP Pro</a>. Along with getting expert support, you will also get Notification controls, Email Logging, and integrations for Amazon SES, Office 365, and Outlook.com."
|
1136 |
msgstr ""
|
1137 |
|
1138 |
-
#: src/Admin/Pages/TestTab.php:
|
1139 |
msgid "Additionally, you can take advantage of our White Glove Setup. Sit back and relax while we handle everything for you! If you simply don't have time or maybe you feel a bit in over your head - we got you covered."
|
1140 |
msgstr ""
|
1141 |
|
1142 |
-
#: src/Admin/Pages/TestTab.php:
|
1143 |
msgid "As a valued WP Mail SMTP user, you will get <span class=\"price-off\">20% off regular pricing</span>, automatically applied at checkout!"
|
1144 |
msgstr ""
|
1145 |
|
1146 |
#. translators: %1$s - WP Mail SMTP support policy URL, %2$s - WP Mail SMTP support forum URL, %3$s - WPMailSMTP.com URL.
|
1147 |
-
#: src/Admin/Pages/TestTab.php:
|
1148 |
msgid "Alternatively, we also offer <a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">limited support</a> on the WordPress.org support forums. You can <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">create a support thread</a> there, but please understand that free support is not guaranteed and is limited to simple issues. If you have an urgent or complex issue, then please consider <a href=\"%3$s\" target=\"_blank\" rel=\"noopener noreferrer\">upgrading to WP Mail SMTP Pro</a> to access our priority support ticket system."
|
1149 |
msgstr ""
|
1150 |
|
1151 |
-
#: src/Admin/Pages/TestTab.php:
|
1152 |
msgid "Click here to view the full Error Log for debugging"
|
1153 |
msgstr ""
|
1154 |
|
1155 |
-
#: src/Admin/Pages/TestTab.php:
|
1156 |
msgid "Please copy only the content of the error debug message above, identified with an orange left border, into the support forum topic if you experience any issues."
|
1157 |
msgstr ""
|
1158 |
|
@@ -1172,38 +1190,42 @@ msgid "<strong>Note:</strong> WP Mail SMTP plugin is disabled on your site until
|
|
1172 |
msgstr ""
|
1173 |
|
1174 |
#. translators: %1$s - WP Mail SMTP plugin name; %2$s - WPForms.com URL to a related doc.
|
1175 |
-
#: src/Core.php:
|
1176 |
msgid "Your site is running an outdated version of PHP that is no longer supported and may cause issues with %1$s. <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">Read more</a> for additional information."
|
1177 |
msgstr ""
|
1178 |
|
1179 |
-
#: src/Core.php:
|
1180 |
-
msgid "<strong>Please Note:</strong> Support for PHP 5.3-5.5 will be discontinued in
|
1181 |
msgstr ""
|
1182 |
|
1183 |
#. translators: %s - plugin name and its version.
|
1184 |
-
#: src/Core.php:
|
1185 |
msgid "<strong>EMAILING DISABLED:</strong> The %s is currently blocking all emails from being sent."
|
1186 |
msgstr ""
|
1187 |
|
1188 |
#. translators: %1$s - constant name; %2$s - constant value.
|
1189 |
-
#: src/Core.php:
|
1190 |
msgid "To send emails, change the value of the %1$s constant to %2$s."
|
1191 |
msgstr ""
|
1192 |
|
1193 |
#. translators: %s - plugin Misc settings page URL.
|
1194 |
-
#: src/Core.php:
|
1195 |
msgid "To send emails, go to plugin <a href=\"%s\">Misc settings</a> and disable the \"Do Not Send\" option."
|
1196 |
msgstr ""
|
1197 |
|
1198 |
#. translators: %s - plugin name and its version.
|
1199 |
-
#: src/Core.php:
|
1200 |
msgid "<strong>EMAIL DELIVERY ERROR:</strong> the plugin %s logged this error during the last time it tried to send an email:"
|
1201 |
msgstr ""
|
1202 |
|
1203 |
-
#: src/Core.php:
|
1204 |
msgid "Consider running an email test after fixing it."
|
1205 |
msgstr ""
|
1206 |
|
|
|
|
|
|
|
|
|
1207 |
#: src/Providers/AmazonSES/Options.php:25
|
1208 |
msgid "Amazon SES"
|
1209 |
msgstr ""
|
@@ -1292,7 +1314,7 @@ msgstr ""
|
|
1292 |
|
1293 |
#. translators: %1$s - opening link tag; %2$s - closing link tag; %3$s - opening link tag; %4$s - closing link tag.
|
1294 |
#: src/Providers/Mailgun/Options.php:29
|
1295 |
-
msgid "%1$sMailgun%2$s is one of the leading transactional email services trusted by over
|
1296 |
msgstr ""
|
1297 |
|
1298 |
#: src/Providers/Mailgun/Options.php:57
|
@@ -1438,7 +1460,7 @@ msgstr ""
|
|
1438 |
|
1439 |
#. translators: %s - Provider name.
|
1440 |
#: src/Providers/OptionsAbstract.php:444
|
1441 |
-
msgid "%s requires a SSL certificate on a site to work and does not support
|
1442 |
msgstr ""
|
1443 |
|
1444 |
#: src/Providers/Outlook/Options.php:25
|
@@ -1542,6 +1564,58 @@ msgstr ""
|
|
1542 |
msgid "Use the SMTP details provided by your hosting provider or email service.<br><br>To see recommended settings for the popular services as well as troubleshooting tips, check out our <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">SMTP documentation</a>."
|
1543 |
msgstr ""
|
1544 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1545 |
#. translators: %1$s - date, \a\t - specially escaped "at", %2$s - time.
|
1546 |
#: src/WP.php:183
|
1547 |
msgid "%1$s \\a\\t %2$s"
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: WP Mail SMTP 1.9.0\n"
|
4 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-mail-smtp\n"
|
5 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
6 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
7 |
"MIME-Version: 1.0\n"
|
8 |
"Content-Type: text/plain; charset=UTF-8\n"
|
9 |
"Content-Transfer-Encoding: 8bit\n"
|
10 |
+
"POT-Creation-Date: 2020-03-23T16:26:08+02:00\n"
|
11 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
12 |
+
"X-Generator: WP-CLI 2.4.0\n"
|
13 |
"X-Domain: wp-mail-smtp\n"
|
14 |
|
15 |
#. Plugin Name of the plugin
|
60 |
|
61 |
#: src/Admin/Area.php:197
|
62 |
#: src/Admin/Area.php:198
|
63 |
+
#: src/SiteHealth.php:40
|
64 |
#: wp-mail-smtp-0.11.2.php:582
|
65 |
msgid "WP Mail SMTP"
|
66 |
msgstr ""
|
67 |
|
68 |
#: src/Admin/Area.php:208
|
69 |
#: src/Admin/Area.php:209
|
70 |
+
#: src/Admin/Area.php:795
|
71 |
#: wp-mail-smtp-0.11.2.php:688
|
72 |
msgid "Settings"
|
73 |
msgstr ""
|
74 |
|
75 |
#: src/Admin/Area.php:216
|
76 |
#: src/Admin/Area.php:217
|
77 |
+
#: src/Admin/Area.php:796
|
78 |
+
#: src/Admin/Pages/About.php:627
|
79 |
#: src/Admin/Pages/Logs.php:40
|
80 |
#: src/Admin/Pages/LogsTab.php:31
|
81 |
msgid "Email Log"
|
91 |
msgid "Are you sure you want to reset the current provider connection? You will need to immediately create a new one to be able to send emails."
|
92 |
msgstr ""
|
93 |
|
94 |
+
#: src/Admin/Area.php:268
|
95 |
+
msgid "Changes that you made to the settings are not saved!"
|
96 |
msgstr ""
|
97 |
|
98 |
#: src/Admin/Area.php:271
|
99 |
+
msgid "%name% is a PRO Feature"
|
100 |
+
msgstr ""
|
101 |
+
|
102 |
+
#: src/Admin/Area.php:272
|
103 |
msgid "Upgrade to Pro"
|
104 |
msgstr ""
|
105 |
|
106 |
+
#: src/Admin/Area.php:276
|
107 |
msgid "<strong>Bonus:</strong> WP Mail SMTP users get <span>20% off</span> regular price,<br>applied at checkout."
|
108 |
msgstr ""
|
109 |
|
110 |
+
#: src/Admin/Area.php:285
|
111 |
msgid "Already purchased?"
|
112 |
msgstr ""
|
113 |
|
114 |
+
#: src/Admin/Area.php:352
|
115 |
+
#: src/Admin/Area.php:359
|
116 |
+
#: src/Admin/Pages/About.php:308
|
117 |
msgid "Activate"
|
118 |
msgstr ""
|
119 |
|
120 |
+
#: src/Admin/Area.php:353
|
121 |
+
#: src/Admin/Pages/About.php:300
|
122 |
msgid "Activated"
|
123 |
msgstr ""
|
124 |
|
125 |
+
#: src/Admin/Area.php:354
|
126 |
+
#: src/Admin/Pages/About.php:297
|
127 |
msgid "Active"
|
128 |
msgstr ""
|
129 |
|
130 |
+
#: src/Admin/Area.php:355
|
131 |
+
#: src/Admin/Pages/About.php:305
|
132 |
msgid "Inactive"
|
133 |
msgstr ""
|
134 |
|
135 |
+
#: src/Admin/Area.php:356
|
136 |
msgid "Processing..."
|
137 |
msgstr ""
|
138 |
|
139 |
+
#: src/Admin/Area.php:357
|
140 |
msgid "Could not install a plugin. Please download from WordPress.org and install manually."
|
141 |
msgstr ""
|
142 |
|
143 |
+
#: src/Admin/Area.php:358
|
144 |
msgid "Install and Activate"
|
145 |
msgstr ""
|
146 |
|
147 |
+
#: src/Admin/Area.php:360
|
148 |
msgid "Download"
|
149 |
msgstr ""
|
150 |
|
151 |
#. translators: %1$s - WP.org link; %2$s - same WP.org link.
|
152 |
+
#: src/Admin/Area.php:420
|
153 |
msgid "Please rate <strong>WP Mail SMTP</strong> <a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">★★★★★</a> on <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">WordPress.org</a> to help us spread the word. Thank you from the WP Mail SMTP team!"
|
154 |
msgstr ""
|
155 |
|
156 |
+
#: src/Admin/Area.php:740
|
157 |
msgid "WP Mail SMTP Pro related message was successfully dismissed."
|
158 |
msgstr ""
|
159 |
|
160 |
+
#: src/Admin/Area.php:759
|
161 |
msgid "Educational notice for this mailer was successfully dismissed."
|
162 |
msgstr ""
|
163 |
|
167 |
|
168 |
#. translators: %s - plugin current license type.
|
169 |
#: src/Admin/Pages/About.php:98
|
170 |
+
#: src/Admin/Pages/About.php:526
|
171 |
msgid "%s vs Pro"
|
172 |
msgstr ""
|
173 |
|
183 |
msgid "Our goal is to make reliable email deliverability easy for WordPress."
|
184 |
msgstr ""
|
185 |
|
186 |
+
#. translators: %1$s - WPForms URL, %2$s - WPBeginner URL, %3$s - OptinMonster URL, %4$s - MonsterInsights URL, %5$s - RafflePress URL
|
187 |
#: src/Admin/Pages/About.php:184
|
188 |
+
msgid "WP Mail SMTP is brought to you by the same team that's behind the most user friendly WordPress forms, <a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">WPForms</a>, the largest WordPress resource site, <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">WPBeginner</a>, the most popular lead-generation software, <a href=\"%3$s\" target=\"_blank\" rel=\"noopener noreferrer\">OptinMonster</a>, the best WordPress analytics plugin, <a href=\"%4$s\" target=\"_blank\" rel=\"noopener noreferrer\">MonsterInsights</a>, and the most powerful WordPress contest plugin, <a href=\"%5$s\" target=\"_blank\" rel=\"noopener noreferrer\">RafflePress</a>."
|
189 |
msgstr ""
|
190 |
|
191 |
+
#: src/Admin/Pages/About.php:202
|
192 |
msgid "Yup, we know a thing or two about building awesome products that customers love."
|
193 |
msgstr ""
|
194 |
|
195 |
+
#: src/Admin/Pages/About.php:208
|
196 |
msgid "The WPForms Team photo"
|
197 |
msgstr ""
|
198 |
|
199 |
+
#: src/Admin/Pages/About.php:210
|
200 |
msgid "The WPForms Team"
|
201 |
msgstr ""
|
202 |
|
203 |
#. translators: %s - status HTML text.
|
204 |
+
#: src/Admin/Pages/About.php:250
|
205 |
msgid "Status: %s"
|
206 |
msgstr ""
|
207 |
|
208 |
+
#: src/Admin/Pages/About.php:316
|
209 |
msgid "Not Installed"
|
210 |
msgstr ""
|
211 |
|
212 |
+
#: src/Admin/Pages/About.php:319
|
213 |
msgid "Install Plugin"
|
214 |
msgstr ""
|
215 |
|
216 |
+
#: src/Admin/Pages/About.php:340
|
217 |
msgid "MonsterInsights"
|
218 |
msgstr ""
|
219 |
|
220 |
+
#: src/Admin/Pages/About.php:341
|
221 |
+
#: src/Admin/Pages/About.php:347
|
222 |
msgid "MonsterInsights makes it “effortless” to properly connect your WordPress site with Google Analytics, so you can start making data-driven decisions to grow your business."
|
223 |
msgstr ""
|
224 |
|
225 |
+
#: src/Admin/Pages/About.php:346
|
226 |
msgid "MonsterInsights Pro"
|
227 |
msgstr ""
|
228 |
|
229 |
+
#: src/Admin/Pages/About.php:354
|
230 |
msgid "OptinMonster"
|
231 |
msgstr ""
|
232 |
|
233 |
+
#: src/Admin/Pages/About.php:355
|
234 |
msgid "Our high-converting optin forms like Exit-Intent® popups, Fullscreen Welcome Mats, and Scroll boxes help you dramatically boost conversions and get more email subscribers."
|
235 |
msgstr ""
|
236 |
|
237 |
+
#: src/Admin/Pages/About.php:361
|
238 |
msgid "Contact Forms by WPForms"
|
239 |
msgstr ""
|
240 |
|
241 |
+
#: src/Admin/Pages/About.php:362
|
242 |
+
#: src/Admin/Pages/About.php:368
|
243 |
msgid "The best WordPress contact form plugin. Drag & Drop online form builder that helps you create beautiful contact forms with just a few clicks."
|
244 |
msgstr ""
|
245 |
|
246 |
+
#: src/Admin/Pages/About.php:367
|
247 |
msgid "WPForms Pro"
|
248 |
msgstr ""
|
249 |
|
250 |
+
#: src/Admin/Pages/About.php:375
|
251 |
+
msgid "RafflePress"
|
252 |
+
msgstr ""
|
253 |
+
|
254 |
+
#: src/Admin/Pages/About.php:376
|
255 |
+
#: src/Admin/Pages/About.php:382
|
256 |
+
msgid "Turn your visitors into brand ambassadors! Easily grow your email list, website traffic, and social media followers with powerful viral giveaways & contests."
|
257 |
+
msgstr ""
|
258 |
+
|
259 |
+
#: src/Admin/Pages/About.php:381
|
260 |
+
msgid "RafflePress Pro"
|
261 |
+
msgstr ""
|
262 |
+
|
263 |
+
#: src/Admin/Pages/About.php:401
|
264 |
msgid "Could not activate the plugin. Please activate it from the Plugins page."
|
265 |
msgstr ""
|
266 |
|
267 |
+
#: src/Admin/Pages/About.php:413
|
268 |
msgid "Plugin activated."
|
269 |
msgstr ""
|
270 |
|
271 |
+
#: src/Admin/Pages/About.php:430
|
272 |
msgid "Could not install the plugin."
|
273 |
msgstr ""
|
274 |
|
275 |
+
#: src/Admin/Pages/About.php:491
|
276 |
msgid "Plugin installed & activated."
|
277 |
msgstr ""
|
278 |
|
279 |
+
#: src/Admin/Pages/About.php:499
|
280 |
msgid "Plugin installed."
|
281 |
msgstr ""
|
282 |
|
283 |
+
#: src/Admin/Pages/About.php:534
|
284 |
msgid "Get the most out of WP Mail SMTP by upgrading to Pro and unlocking all of the powerful features."
|
285 |
msgstr ""
|
286 |
|
287 |
+
#: src/Admin/Pages/About.php:543
|
288 |
msgid "Feature"
|
289 |
msgstr ""
|
290 |
|
291 |
+
#: src/Admin/Pages/About.php:553
|
292 |
msgid "Pro"
|
293 |
msgstr ""
|
294 |
|
295 |
+
#: src/Admin/Pages/About.php:594
|
296 |
msgid "Get WP Mail SMTP Pro Today and Unlock all of these Powerful Features"
|
297 |
msgstr ""
|
298 |
|
299 |
+
#: src/Admin/Pages/About.php:601
|
300 |
msgid "Bonus: WP Mail SMTP Lite users get <span class=\"price-off\">20% off regular price</span>, automatically applied at checkout."
|
301 |
msgstr ""
|
302 |
|
303 |
+
#: src/Admin/Pages/About.php:628
|
304 |
#: src/Admin/Pages/ControlTab.php:27
|
305 |
msgid "Email Controls"
|
306 |
msgstr ""
|
307 |
|
308 |
+
#: src/Admin/Pages/About.php:629
|
309 |
msgid "Additional Mailers"
|
310 |
msgstr ""
|
311 |
|
312 |
+
#: src/Admin/Pages/About.php:630
|
313 |
msgid "Customer Support"
|
314 |
msgstr ""
|
315 |
|
316 |
+
#: src/Admin/Pages/About.php:651
|
317 |
msgid "Emails are not logged"
|
318 |
msgstr ""
|
319 |
|
320 |
+
#: src/Admin/Pages/About.php:657
|
321 |
msgid "Complete Email Log management inside WordPress"
|
322 |
msgstr ""
|
323 |
|
324 |
+
#: src/Admin/Pages/About.php:665
|
325 |
msgid "No controls over whether default WordPress emails are sent"
|
326 |
msgstr ""
|
327 |
|
328 |
+
#: src/Admin/Pages/About.php:671
|
329 |
msgid "Complete Email Controls management for most default WordPress emails"
|
330 |
msgstr ""
|
331 |
|
332 |
+
#: src/Admin/Pages/About.php:679
|
333 |
msgid "Only default list of mailers"
|
334 |
msgstr ""
|
335 |
|
336 |
+
#: src/Admin/Pages/About.php:685
|
337 |
msgid "Additional mailers: Microsoft Outlook (with Office365 support) and Amazon SES"
|
338 |
msgstr ""
|
339 |
|
340 |
+
#: src/Admin/Pages/About.php:693
|
341 |
msgid "Limited Support"
|
342 |
msgstr ""
|
343 |
|
344 |
+
#: src/Admin/Pages/About.php:699
|
345 |
msgid "Priority Support"
|
346 |
msgstr ""
|
347 |
|
728 |
msgid "Send this email in HTML or in plain text format."
|
729 |
msgstr ""
|
730 |
|
731 |
+
#: src/Admin/Pages/TestTab.php:110
|
732 |
msgid "You cannot send an email. Mailer is not properly configured. Please check your settings."
|
733 |
msgstr ""
|
734 |
|
735 |
+
#: src/Admin/Pages/TestTab.php:114
|
736 |
msgid "Send Email"
|
737 |
msgstr ""
|
738 |
|
739 |
+
#: src/Admin/Pages/TestTab.php:142
|
740 |
msgid "Test failed. Please use a valid email address and try to resend the test email."
|
741 |
msgstr ""
|
742 |
|
743 |
#. translators: %s - email address a test email will be sent to.
|
744 |
+
#: src/Admin/Pages/TestTab.php:154
|
745 |
+
#: src/Admin/Pages/TestTab.php:160
|
746 |
msgid "Test email to %s"
|
747 |
msgstr ""
|
748 |
|
749 |
+
#: src/Admin/Pages/TestTab.php:186
|
750 |
msgid "Test plain text email was sent successfully!"
|
751 |
msgstr ""
|
752 |
|
753 |
#. translators: %s - "HTML" in bold.
|
754 |
+
#: src/Admin/Pages/TestTab.php:190
|
755 |
msgid "Test %s email was sent successfully! Please check your inbox to make sure it is delivered."
|
756 |
msgstr ""
|
757 |
|
758 |
+
#: src/Admin/Pages/TestTab.php:498
|
759 |
msgid "SSL certificate issue."
|
760 |
msgstr ""
|
761 |
|
762 |
+
#: src/Admin/Pages/TestTab.php:499
|
763 |
msgid "This means your web server cannot reliably make secure connections (make requests to HTTPS sites)."
|
764 |
msgstr ""
|
765 |
|
766 |
+
#: src/Admin/Pages/TestTab.php:500
|
767 |
+
#: src/Admin/Pages/TestTab.php:551
|
768 |
msgid "Typically this error is returned when web server is not configured properly."
|
769 |
msgstr ""
|
770 |
|
771 |
+
#: src/Admin/Pages/TestTab.php:503
|
772 |
msgid "Contact your web hosting provider and inform them your site has an issue with SSL certificates."
|
773 |
msgstr ""
|
774 |
|
775 |
+
#: src/Admin/Pages/TestTab.php:504
|
776 |
+
#: src/Admin/Pages/TestTab.php:555
|
777 |
msgid "The exact error you can provide them is in the Error log, available at the bottom of this page."
|
778 |
msgstr ""
|
779 |
|
780 |
+
#: src/Admin/Pages/TestTab.php:505
|
781 |
+
#: src/Admin/Pages/TestTab.php:556
|
782 |
msgid "Ask them to resolve the issue then try again."
|
783 |
msgstr ""
|
784 |
|
785 |
+
#: src/Admin/Pages/TestTab.php:516
|
786 |
msgid "Could not connect to host."
|
787 |
msgstr ""
|
788 |
|
789 |
#. translators: %s - SMTP host address.
|
790 |
+
#: src/Admin/Pages/TestTab.php:520
|
791 |
+
#: src/Admin/Pages/TestTab.php:547
|
792 |
+
#: src/Admin/Pages/TestTab.php:620
|
793 |
msgid "This means your web server was unable to connect to %s."
|
794 |
msgstr ""
|
795 |
|
796 |
+
#: src/Admin/Pages/TestTab.php:523
|
797 |
+
#: src/Admin/Pages/TestTab.php:550
|
798 |
+
#: src/Admin/Pages/TestTab.php:623
|
799 |
msgid "This means your web server was unable to connect to the host server."
|
800 |
msgstr ""
|
801 |
|
802 |
+
#: src/Admin/Pages/TestTab.php:524
|
803 |
msgid "Typically this error is returned your web server is blocking the connections or the SMTP host denying the request."
|
804 |
msgstr ""
|
805 |
|
806 |
#. translators: %s - SMTP host address.
|
807 |
+
#: src/Admin/Pages/TestTab.php:529
|
808 |
msgid "Contact your web hosting provider and ask them to verify your server can connect to %s. Additionally, ask them if a firewall or security policy may be preventing the connection."
|
809 |
msgstr ""
|
810 |
|
811 |
+
#: src/Admin/Pages/TestTab.php:532
|
812 |
msgid "If using \"Other SMTP\" Mailer, triple check your SMTP settings including host address, email, and password."
|
813 |
msgstr ""
|
814 |
|
815 |
+
#: src/Admin/Pages/TestTab.php:533
|
816 |
msgid "If using \"Other SMTP\" Mailer, contact your SMTP host to confirm they are accepting outside connections with the settings you have configured (address, username, port, security, etc)."
|
817 |
msgstr ""
|
818 |
|
819 |
+
#: src/Admin/Pages/TestTab.php:543
|
820 |
msgid "Could not connect to your host."
|
821 |
msgstr ""
|
822 |
|
823 |
+
#: src/Admin/Pages/TestTab.php:554
|
824 |
msgid "Contact your web hosting provider and inform them you are having issues making outbound connections."
|
825 |
msgstr ""
|
826 |
|
827 |
+
#: src/Admin/Pages/TestTab.php:566
|
828 |
msgid "Could not authenticate your SMTP account."
|
829 |
msgstr ""
|
830 |
|
831 |
+
#: src/Admin/Pages/TestTab.php:567
|
832 |
msgid "This means we were able to connect to your SMTP host, but were not able to proceed using the email/password in the settings."
|
833 |
msgstr ""
|
834 |
|
835 |
+
#: src/Admin/Pages/TestTab.php:568
|
836 |
msgid "Typically this error is returned when the email or password is not correct or is not what the SMTP host is expecting."
|
837 |
msgstr ""
|
838 |
|
839 |
+
#: src/Admin/Pages/TestTab.php:571
|
840 |
msgid "Triple check your SMTP settings including host address, email, and password. If you have recently reset your password you will need to update the settings."
|
841 |
msgstr ""
|
842 |
|
843 |
+
#: src/Admin/Pages/TestTab.php:572
|
844 |
+
#: src/Admin/Pages/TestTab.php:649
|
845 |
msgid "Contact your SMTP host to confirm you are using the correct username and password."
|
846 |
msgstr ""
|
847 |
|
848 |
+
#: src/Admin/Pages/TestTab.php:573
|
849 |
+
#: src/Admin/Pages/TestTab.php:650
|
850 |
msgid "Verify with your SMTP host that your account has permissions to send emails using outside connections."
|
851 |
msgstr ""
|
852 |
|
853 |
+
#: src/Admin/Pages/TestTab.php:583
|
854 |
msgid "Error due to unsolicited and/or bulk e-mail."
|
855 |
msgstr ""
|
856 |
|
857 |
+
#: src/Admin/Pages/TestTab.php:584
|
858 |
msgid "This means the connection to your SMTP host was made successfully, but the host rejected the email."
|
859 |
msgstr ""
|
860 |
|
861 |
+
#: src/Admin/Pages/TestTab.php:585
|
862 |
msgid "Typically this error is returned when you are sending too many e-mails or e-mails that have been identified as spam."
|
863 |
msgstr ""
|
864 |
|
865 |
+
#: src/Admin/Pages/TestTab.php:588
|
866 |
msgid "Check the emails that are sending are sending individually. Example: email is not sending to 30 recipients. You can install any WordPress e-mail logging plugin to do that."
|
867 |
msgstr ""
|
868 |
|
869 |
+
#: src/Admin/Pages/TestTab.php:589
|
870 |
msgid "Contact your SMTP host to ask about sending/rate limits."
|
871 |
msgstr ""
|
872 |
|
873 |
+
#: src/Admin/Pages/TestTab.php:590
|
874 |
msgid "Verify with them your SMTP account is in good standing and your account has not been flagged."
|
875 |
msgstr ""
|
876 |
|
877 |
+
#: src/Admin/Pages/TestTab.php:600
|
878 |
msgid "Unauthenticated senders are not allowed."
|
879 |
msgstr ""
|
880 |
|
881 |
+
#: src/Admin/Pages/TestTab.php:601
|
882 |
msgid "This means the connection to your SMTP host was made successfully, but you should enable Authentication and provide correct Username and Password."
|
883 |
msgstr ""
|
884 |
|
885 |
+
#: src/Admin/Pages/TestTab.php:604
|
886 |
msgid "Go to WP Mail SMTP plugin Settings page."
|
887 |
msgstr ""
|
888 |
|
889 |
+
#: src/Admin/Pages/TestTab.php:605
|
890 |
msgid "Enable Authentication"
|
891 |
msgstr ""
|
892 |
|
893 |
+
#: src/Admin/Pages/TestTab.php:606
|
894 |
msgid "Enter correct SMTP Username (usually this is an email address) and Password in the appropriate fields."
|
895 |
msgstr ""
|
896 |
|
897 |
+
#: src/Admin/Pages/TestTab.php:616
|
898 |
msgid "Could not connect to the SMTP host."
|
899 |
msgstr ""
|
900 |
|
901 |
+
#: src/Admin/Pages/TestTab.php:624
|
902 |
+
#: src/Admin/Pages/TestTab.php:960
|
903 |
msgid "Typically this error is returned for one of the following reasons:"
|
904 |
msgstr ""
|
905 |
|
906 |
+
#: src/Admin/Pages/TestTab.php:625
|
907 |
msgid "SMTP settings are incorrect (wrong port, security setting, incorrect host)."
|
908 |
msgstr ""
|
909 |
|
910 |
+
#: src/Admin/Pages/TestTab.php:626
|
911 |
+
#: src/Admin/Pages/TestTab.php:962
|
912 |
msgid "Your web server is blocking the connection."
|
913 |
msgstr ""
|
914 |
|
915 |
+
#: src/Admin/Pages/TestTab.php:627
|
916 |
msgid "Your SMTP host is rejecting the connection."
|
917 |
msgstr ""
|
918 |
|
919 |
+
#: src/Admin/Pages/TestTab.php:630
|
920 |
msgid "Triple check your SMTP settings including host address, email, and password, port, and security."
|
921 |
msgstr ""
|
922 |
|
923 |
#. translators: %1$s - SMTP host address, %2$s - SMTP port, %3$s - SMTP encryption.
|
924 |
+
#: src/Admin/Pages/TestTab.php:634
|
925 |
msgid "Contact your web hosting provider and ask them to verify your server can connect to %1$s on port %2$s using %3$s encryption. Additionally, ask them if a firewall or security policy may be preventing the connection - many shared hosts block certain ports.<br><strong>Note: this is the most common cause of this issue.</strong>"
|
926 |
msgstr ""
|
927 |
|
928 |
+
#: src/Admin/Pages/TestTab.php:647
|
929 |
msgid "no"
|
930 |
msgstr ""
|
931 |
|
932 |
+
#: src/Admin/Pages/TestTab.php:660
|
933 |
#: src/Admin/Pages/TestTab.php:675
|
934 |
+
#: src/Admin/Pages/TestTab.php:691
|
|
|
935 |
msgid "Mailgun failed."
|
936 |
msgstr ""
|
937 |
|
938 |
+
#: src/Admin/Pages/TestTab.php:661
|
939 |
msgid "It seems that you forgot to activate your Mailgun account."
|
940 |
msgstr ""
|
941 |
|
942 |
+
#: src/Admin/Pages/TestTab.php:664
|
943 |
msgid "Check your inbox you used to create a Mailgun account. Click the activation link in an email from Mailgun."
|
944 |
msgstr ""
|
945 |
|
946 |
+
#: src/Admin/Pages/TestTab.php:665
|
947 |
msgid "If you do not see activation email, go to your Mailgun control panel and resend the activation email."
|
948 |
msgstr ""
|
949 |
|
950 |
+
#: src/Admin/Pages/TestTab.php:676
|
951 |
msgid "Typically this error is because there is an issue with your Mailgun settings, in many cases the API key."
|
952 |
msgstr ""
|
953 |
|
954 |
+
#: src/Admin/Pages/TestTab.php:679
|
955 |
msgid "Verify your API key is correct."
|
956 |
msgstr ""
|
957 |
|
958 |
+
#: src/Admin/Pages/TestTab.php:680
|
959 |
msgid "Go to your Mailgun account and view your API key."
|
960 |
msgstr ""
|
961 |
|
962 |
+
#: src/Admin/Pages/TestTab.php:681
|
963 |
msgid "Note that the API key includes the \"key\" prefix, so make sure that it is in the WP Mail SMTP Mailgun API setting."
|
964 |
msgstr ""
|
965 |
|
966 |
+
#: src/Admin/Pages/TestTab.php:692
|
967 |
msgid "Your Mailgun account does not have access to send emails."
|
968 |
msgstr ""
|
969 |
|
970 |
+
#: src/Admin/Pages/TestTab.php:693
|
971 |
msgid "Typically this error is because you have not set up and/or complete domain name verification for your Mailgun account."
|
972 |
msgstr ""
|
973 |
|
974 |
#. translators: %s - Mailgun documentation URL.
|
975 |
+
#: src/Admin/Pages/TestTab.php:699
|
976 |
msgid "Go to our how-to guide for setting up <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">Mailgun with WP Mail SMTP</a>."
|
977 |
msgstr ""
|
978 |
|
979 |
+
#: src/Admin/Pages/TestTab.php:710
|
980 |
msgid "Complete the steps in section \"2. Verify Your Domain\"."
|
981 |
msgstr ""
|
982 |
|
983 |
+
#: src/Admin/Pages/TestTab.php:720
|
984 |
+
#: src/Admin/Pages/TestTab.php:771
|
985 |
+
#: src/Admin/Pages/TestTab.php:792
|
986 |
+
#: src/Admin/Pages/TestTab.php:819
|
987 |
+
#: src/Admin/Pages/TestTab.php:835
|
988 |
+
#: src/Admin/Pages/TestTab.php:890
|
989 |
+
#: src/Admin/Pages/TestTab.php:917
|
990 |
msgid "Google API Error."
|
991 |
msgstr ""
|
992 |
|
993 |
+
#: src/Admin/Pages/TestTab.php:721
|
994 |
msgid "You have not properly configured Gmail mailer."
|
995 |
msgstr ""
|
996 |
|
997 |
+
#: src/Admin/Pages/TestTab.php:722
|
998 |
msgid "Make sure that you have clicked the \"Allow plugin to send emails using your Google account\" button under Gmail settings."
|
999 |
msgstr ""
|
1000 |
|
1001 |
+
#: src/Admin/Pages/TestTab.php:725
|
1002 |
msgid "Go to plugin Settings page and click the \"Allow plugin to send emails using your Google account\" button."
|
1003 |
msgstr ""
|
1004 |
|
1005 |
+
#: src/Admin/Pages/TestTab.php:726
|
1006 |
msgid "After the click you should be redirected to a Gmail authorization screen, where you will be asked a permission to send emails on your behalf."
|
1007 |
msgstr ""
|
1008 |
|
1009 |
+
#: src/Admin/Pages/TestTab.php:727
|
1010 |
msgid "Please click \"Agree\", if you see that button. If not - you will need to enable less secure apps first:"
|
1011 |
msgstr ""
|
1012 |
|
1013 |
#. translators: %s - Google support article URL.
|
1014 |
+
#: src/Admin/Pages/TestTab.php:733
|
1015 |
msgid "if you are using regular Gmail account, please <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">read this article</a> to proceed."
|
1016 |
msgstr ""
|
1017 |
|
1018 |
#. translators: %s - Google support article URL.
|
1019 |
+
#: src/Admin/Pages/TestTab.php:749
|
1020 |
msgid "if you are using G Suite, please <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">read this article</a> to proceed."
|
1021 |
msgstr ""
|
1022 |
|
1023 |
+
#: src/Admin/Pages/TestTab.php:772
|
1024 |
msgid "Typically this error is because address the email was sent to is invalid or was empty."
|
1025 |
msgstr ""
|
1026 |
|
1027 |
+
#: src/Admin/Pages/TestTab.php:775
|
1028 |
msgid "Check the \"Send To\" email address used and confirm it is a valid email and was not empty."
|
1029 |
msgstr ""
|
1030 |
|
1031 |
#. translators: 1 - correct email address example. 2 - incorrect email address example.
|
1032 |
+
#: src/Admin/Pages/TestTab.php:778
|
1033 |
msgid "It should be something like this: %1$s. These are incorrect values: %2$s."
|
1034 |
msgstr ""
|
1035 |
|
1036 |
+
#: src/Admin/Pages/TestTab.php:782
|
1037 |
msgid "Make sure that the generated email has a TO header, useful when you are responsible for email creation."
|
1038 |
msgstr ""
|
1039 |
|
1040 |
+
#: src/Admin/Pages/TestTab.php:793
|
1041 |
msgid "Unfortunately, this error can be due to many different reasons."
|
1042 |
msgstr ""
|
1043 |
|
1044 |
#. translators: %s - Blog article URL.
|
1045 |
+
#: src/Admin/Pages/TestTab.php:799
|
1046 |
msgid "Please <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">read this article</a> to learn more about what can cause this error and how it can be resolved."
|
1047 |
msgstr ""
|
1048 |
|
1049 |
+
#: src/Admin/Pages/TestTab.php:820
|
1050 |
msgid "Authentication code that Google returned to you has already been used on your previous auth attempt."
|
1051 |
msgstr ""
|
1052 |
|
1053 |
+
#: src/Admin/Pages/TestTab.php:823
|
1054 |
msgid "Make sure that you are not trying to manually clean up the plugin options to retry the \"Allow...\" step."
|
1055 |
msgstr ""
|
1056 |
|
1057 |
+
#: src/Admin/Pages/TestTab.php:824
|
1058 |
msgid "Reinstall the plugin with clean plugin data turned on on Misc page. This will remove all the plugin options and you will be safe to retry."
|
1059 |
msgstr ""
|
1060 |
|
1061 |
+
#: src/Admin/Pages/TestTab.php:825
|
1062 |
msgid "Make sure there is no aggressive caching on site admin area pages or try to clean cache between attempts."
|
1063 |
msgstr ""
|
1064 |
|
1065 |
+
#: src/Admin/Pages/TestTab.php:836
|
1066 |
msgid "There are various reasons for that, please review the steps below."
|
1067 |
msgstr ""
|
1068 |
|
1069 |
#. translators: %s - Google G Suite Admin area URL.
|
1070 |
+
#: src/Admin/Pages/TestTab.php:842
|
1071 |
msgid "Make sure that your G Suite trial period has not expired. You can check the status <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>."
|
1072 |
msgstr ""
|
1073 |
|
1074 |
#. translators: %s - Google G Suite Admin area URL.
|
1075 |
+
#: src/Admin/Pages/TestTab.php:856
|
1076 |
msgid "Make sure that Gmail app in your G Suite is actually enabled. You can check that in Apps list in <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">G Suite Admin</a> area."
|
1077 |
msgstr ""
|
1078 |
|
1079 |
#. translators: %s - Google Developers Console URL.
|
1080 |
+
#: src/Admin/Pages/TestTab.php:870
|
1081 |
msgid "Make sure that you have Gmail API enabled, and you can do that <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>."
|
1082 |
msgstr ""
|
1083 |
|
1084 |
+
#: src/Admin/Pages/TestTab.php:893
|
1085 |
+
#: src/Admin/Pages/TestTab.php:921
|
1086 |
msgid "Make sure that the used Client ID/Secret correspond to a proper project that has Gmail API enabled."
|
1087 |
msgstr ""
|
1088 |
|
1089 |
#. translators: %s - WPForms.com tutorial URL.
|
1090 |
+
#: src/Admin/Pages/TestTab.php:897
|
1091 |
msgid "Please follow our <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">Gmail tutorial</a> to be sure that all the correct project and data is applied."
|
1092 |
msgstr ""
|
1093 |
|
1094 |
+
#: src/Admin/Pages/TestTab.php:918
|
1095 |
msgid "You may have added a new API to a project"
|
1096 |
msgstr ""
|
1097 |
|
1098 |
+
#: src/Admin/Pages/TestTab.php:922
|
1099 |
msgid "Try to use a separate project for your emails, so the project has only 1 Gmail API in it enabled. You will need to remove the old project and create a new one from scratch."
|
1100 |
msgstr ""
|
1101 |
|
1102 |
+
#: src/Admin/Pages/TestTab.php:958
|
1103 |
msgid "An issue was detected."
|
1104 |
msgstr ""
|
1105 |
|
1106 |
+
#: src/Admin/Pages/TestTab.php:959
|
1107 |
msgid "This means your test email was unable to be sent."
|
1108 |
msgstr ""
|
1109 |
|
1110 |
+
#: src/Admin/Pages/TestTab.php:961
|
1111 |
msgid "Plugin settings are incorrect (wrong SMTP settings, invalid Mailer configuration, etc)."
|
1112 |
msgstr ""
|
1113 |
|
1114 |
+
#: src/Admin/Pages/TestTab.php:963
|
1115 |
msgid "Your host is rejecting the connection."
|
1116 |
msgstr ""
|
1117 |
|
1118 |
+
#: src/Admin/Pages/TestTab.php:966
|
1119 |
msgid "Triple check the plugin settings, consider reconfiguring to make sure everything is correct (eg bad copy and paste)."
|
1120 |
msgstr ""
|
1121 |
|
1122 |
+
#: src/Admin/Pages/TestTab.php:968
|
1123 |
msgid "Contact your web hosting provider and ask them to verify your server can make outside connections. Additionally, ask them if a firewall or security policy may be preventing the connection - many shared hosts block certain ports.<br><strong>Note: this is the most common cause of this issue.</strong>"
|
1124 |
msgstr ""
|
1125 |
|
1126 |
+
#: src/Admin/Pages/TestTab.php:974
|
1127 |
msgid "Try using a different mailer."
|
1128 |
msgstr ""
|
1129 |
|
1130 |
+
#: src/Admin/Pages/TestTab.php:993
|
1131 |
msgid "There was a problem while sending the test email."
|
1132 |
msgstr ""
|
1133 |
|
1134 |
+
#: src/Admin/Pages/TestTab.php:1003
|
1135 |
msgid "Recommended next steps:"
|
1136 |
msgstr ""
|
1137 |
|
1138 |
+
#: src/Admin/Pages/TestTab.php:1013
|
1139 |
msgid "Need support?"
|
1140 |
msgstr ""
|
1141 |
|
1142 |
#. translators: %s - WPMailSMTP.com account area link.
|
1143 |
+
#: src/Admin/Pages/TestTab.php:1021
|
1144 |
msgid "As a WP Mail SMTP Pro user you have access to WP Mail SMTP priority support. Please log in to your WPMailSMTP.com account and <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">submit a support ticket</a>."
|
1145 |
msgstr ""
|
1146 |
|
1147 |
+
#: src/Admin/Pages/TestTab.php:1038
|
1148 |
msgid "WP Mail SMTP is a free plugin, and the team behind WPForms maintains it to give back to the WordPress community."
|
1149 |
msgstr ""
|
1150 |
|
1151 |
#. translators: %s - WPMailSMTP.com URL.
|
1152 |
+
#: src/Admin/Pages/TestTab.php:1045
|
1153 |
msgid "To access our world class support, please <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">upgrade to WP Mail SMTP Pro</a>. Along with getting expert support, you will also get Notification controls, Email Logging, and integrations for Amazon SES, Office 365, and Outlook.com."
|
1154 |
msgstr ""
|
1155 |
|
1156 |
+
#: src/Admin/Pages/TestTab.php:1060
|
1157 |
msgid "Additionally, you can take advantage of our White Glove Setup. Sit back and relax while we handle everything for you! If you simply don't have time or maybe you feel a bit in over your head - we got you covered."
|
1158 |
msgstr ""
|
1159 |
|
1160 |
+
#: src/Admin/Pages/TestTab.php:1066
|
1161 |
msgid "As a valued WP Mail SMTP user, you will get <span class=\"price-off\">20% off regular pricing</span>, automatically applied at checkout!"
|
1162 |
msgstr ""
|
1163 |
|
1164 |
#. translators: %1$s - WP Mail SMTP support policy URL, %2$s - WP Mail SMTP support forum URL, %3$s - WPMailSMTP.com URL.
|
1165 |
+
#: src/Admin/Pages/TestTab.php:1080
|
1166 |
msgid "Alternatively, we also offer <a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">limited support</a> on the WordPress.org support forums. You can <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">create a support thread</a> there, but please understand that free support is not guaranteed and is limited to simple issues. If you have an urgent or complex issue, then please consider <a href=\"%3$s\" target=\"_blank\" rel=\"noopener noreferrer\">upgrading to WP Mail SMTP Pro</a> to access our priority support ticket system."
|
1167 |
msgstr ""
|
1168 |
|
1169 |
+
#: src/Admin/Pages/TestTab.php:1101
|
1170 |
msgid "Click here to view the full Error Log for debugging"
|
1171 |
msgstr ""
|
1172 |
|
1173 |
+
#: src/Admin/Pages/TestTab.php:1110
|
1174 |
msgid "Please copy only the content of the error debug message above, identified with an orange left border, into the support forum topic if you experience any issues."
|
1175 |
msgstr ""
|
1176 |
|
1190 |
msgstr ""
|
1191 |
|
1192 |
#. translators: %1$s - WP Mail SMTP plugin name; %2$s - WPForms.com URL to a related doc.
|
1193 |
+
#: src/Core.php:399
|
1194 |
msgid "Your site is running an outdated version of PHP that is no longer supported and may cause issues with %1$s. <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">Read more</a> for additional information."
|
1195 |
msgstr ""
|
1196 |
|
1197 |
+
#: src/Core.php:413
|
1198 |
+
msgid "<strong>Please Note:</strong> Support for PHP 5.3-5.5 will be discontinued in 2020. After this, if no further action is taken, WP Mail SMTP functionality will be disabled."
|
1199 |
msgstr ""
|
1200 |
|
1201 |
#. translators: %s - plugin name and its version.
|
1202 |
+
#: src/Core.php:447
|
1203 |
msgid "<strong>EMAILING DISABLED:</strong> The %s is currently blocking all emails from being sent."
|
1204 |
msgstr ""
|
1205 |
|
1206 |
#. translators: %1$s - constant name; %2$s - constant value.
|
1207 |
+
#: src/Core.php:458
|
1208 |
msgid "To send emails, change the value of the %1$s constant to %2$s."
|
1209 |
msgstr ""
|
1210 |
|
1211 |
#. translators: %s - plugin Misc settings page URL.
|
1212 |
+
#: src/Core.php:469
|
1213 |
msgid "To send emails, go to plugin <a href=\"%s\">Misc settings</a> and disable the \"Do Not Send\" option."
|
1214 |
msgstr ""
|
1215 |
|
1216 |
#. translators: %s - plugin name and its version.
|
1217 |
+
#: src/Core.php:501
|
1218 |
msgid "<strong>EMAIL DELIVERY ERROR:</strong> the plugin %s logged this error during the last time it tried to send an email:"
|
1219 |
msgstr ""
|
1220 |
|
1221 |
+
#: src/Core.php:531
|
1222 |
msgid "Consider running an email test after fixing it."
|
1223 |
msgstr ""
|
1224 |
|
1225 |
+
#: src/Pro/SiteHealth.php:58
|
1226 |
+
msgid "Is wpmailsmtp.com reachable?"
|
1227 |
+
msgstr ""
|
1228 |
+
|
1229 |
#: src/Providers/AmazonSES/Options.php:25
|
1230 |
msgid "Amazon SES"
|
1231 |
msgstr ""
|
1314 |
|
1315 |
#. translators: %1$s - opening link tag; %2$s - closing link tag; %3$s - opening link tag; %4$s - closing link tag.
|
1316 |
#: src/Providers/Mailgun/Options.php:29
|
1317 |
+
msgid "%1$sMailgun%2$s is one of the leading transactional email services trusted by over 150,000+ businesses.<br>They provide 5,000 free emails per month for 3 months, then $0.80 per 1000 emails.<br><br>Read our %3$sMailgun documentation%4$s to learn how to configure Mailgun and improve your email deliverability."
|
1318 |
msgstr ""
|
1319 |
|
1320 |
#: src/Providers/Mailgun/Options.php:57
|
1460 |
|
1461 |
#. translators: %s - Provider name.
|
1462 |
#: src/Providers/OptionsAbstract.php:444
|
1463 |
+
msgid "%s requires a SSL certificate on a site to work and does not support your current installation. Please contact your host and request a SSL certificate or install a free one, like Let's Encrypt."
|
1464 |
msgstr ""
|
1465 |
|
1466 |
#: src/Providers/Outlook/Options.php:25
|
1564 |
msgid "Use the SMTP details provided by your hosting provider or email service.<br><br>To see recommended settings for the popular services as well as troubleshooting tips, check out our <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">SMTP documentation</a>."
|
1565 |
msgstr ""
|
1566 |
|
1567 |
+
#: src/SiteHealth.php:67
|
1568 |
+
msgid "Is WP Mail SMTP mailer setup complete?"
|
1569 |
+
msgstr ""
|
1570 |
+
|
1571 |
+
#: src/SiteHealth.php:92
|
1572 |
+
msgid "Version"
|
1573 |
+
msgstr ""
|
1574 |
+
|
1575 |
+
#: src/SiteHealth.php:96
|
1576 |
+
msgid "License key type"
|
1577 |
+
msgstr ""
|
1578 |
+
|
1579 |
+
#: src/SiteHealth.php:100
|
1580 |
+
msgid "Debug"
|
1581 |
+
msgstr ""
|
1582 |
+
|
1583 |
+
#: src/SiteHealth.php:101
|
1584 |
+
msgid "No debug notices found."
|
1585 |
+
msgstr ""
|
1586 |
+
|
1587 |
+
#: src/SiteHealth.php:131
|
1588 |
+
msgid "Current mailer"
|
1589 |
+
msgstr ""
|
1590 |
+
|
1591 |
+
#: src/SiteHealth.php:136
|
1592 |
+
msgid "WP Mail SMTP mailer setup is complete"
|
1593 |
+
msgstr ""
|
1594 |
+
|
1595 |
+
#: src/SiteHealth.php:145
|
1596 |
+
msgid "The WP Mail SMTP plugin mailer setup is complete. You can send a test email, to make sure it's working properly."
|
1597 |
+
msgstr ""
|
1598 |
+
|
1599 |
+
#: src/SiteHealth.php:150
|
1600 |
+
msgid "Test email sending"
|
1601 |
+
msgstr ""
|
1602 |
+
|
1603 |
+
#: src/SiteHealth.php:158
|
1604 |
+
msgid "You currently have the default mailer selected, which means that you haven’t set up SMTP yet."
|
1605 |
+
msgstr ""
|
1606 |
+
|
1607 |
+
#: src/SiteHealth.php:163
|
1608 |
+
msgid "WP Mail SMTP mailer setup is incomplete"
|
1609 |
+
msgstr ""
|
1610 |
+
|
1611 |
+
#: src/SiteHealth.php:169
|
1612 |
+
msgid "The WP Mail SMTP plugin mailer setup is incomplete. Please click on the link below to access plugin settings and configure the mailer."
|
1613 |
+
msgstr ""
|
1614 |
+
|
1615 |
+
#: src/SiteHealth.php:174
|
1616 |
+
msgid "Configure mailer"
|
1617 |
+
msgstr ""
|
1618 |
+
|
1619 |
#. translators: %1$s - date, \a\t - specially escaped "at", %2$s - time.
|
1620 |
#: src/WP.php:183
|
1621 |
msgid "%1$s \\a\\t %2$s"
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== WP Mail SMTP by WPForms ===
|
2 |
Contributors: wpforms, jaredatch, smub, slaFFik
|
3 |
-
Tags: smtp, wp mail smtp, wordpress smtp, gmail smtp, sendgrid smtp, mailgun smtp, mail, mailer, phpmailer, wp_mail, email, mailgun, sengrid, gmail, wp smtp
|
4 |
Requires at least: 4.9
|
5 |
Tested up to: 5.3
|
6 |
-
Stable tag: 1.
|
7 |
Requires PHP: 5.3
|
8 |
|
9 |
The most popular WordPress SMTP and PHP Mailer plugin. Trusted by over 1 million sites.
|
@@ -62,7 +62,7 @@ Pepipost is a recommended transactional email service.
|
|
62 |
Every month they delivers over 8 billion emails from 20,000+ customers.
|
63 |
|
64 |
Their mission is to reliably send emails in the most efficient way and at the most disruptive pricing ever.
|
65 |
-
Pepipost provides users 30,000 emails the first 30 days
|
66 |
|
67 |
Read our <a href="https://wpmailsmtp.com/docs/how-to-set-up-the-pepipost-mailer-in-wp-mail-smtp/" rel="friend">Pepipost documentation</a> for more details.
|
68 |
|
@@ -78,7 +78,7 @@ Read our <a href="https://wpmailsmtp.com/docs/how-to-set-up-the-sendinblue-maile
|
|
78 |
|
79 |
= Mailgun SMTP =
|
80 |
|
81 |
-
Mailgun SMTP is a popular SMTP service provider that allows you to send large quantities of emails. They
|
82 |
|
83 |
WP Mail SMTP plugin offers a native integration with MailGun. All you have to do is connect your Mailgun account, and you will improve your email deliverability.
|
84 |
|
@@ -220,6 +220,13 @@ By all means please contact us to discuss features or options you'd like to see
|
|
220 |
|
221 |
== Changelog ==
|
222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
= 1.8.1 - 2019-12-13 =
|
224 |
* Fixed: Revert Guzzle version to 6.4.1 because Sendinblue and Gmail mailers may experience issues under certain circumstances while sending emails (not all sites are affected).
|
225 |
* Fixed: Make compatible the WordPress PhpMailer class inline attachments management with the Sendgrid API.
|
1 |
=== WP Mail SMTP by WPForms ===
|
2 |
Contributors: wpforms, jaredatch, smub, slaFFik
|
3 |
+
Tags: smtp, wp mail smtp, wordpress smtp, gmail smtp, sendgrid smtp, mailgun smtp, mail, mailer, phpmailer, wp_mail, email, mailgun, sengrid, gmail, pepipost, sendinblue, wp smtp
|
4 |
Requires at least: 4.9
|
5 |
Tested up to: 5.3
|
6 |
+
Stable tag: 1.9.0
|
7 |
Requires PHP: 5.3
|
8 |
|
9 |
The most popular WordPress SMTP and PHP Mailer plugin. Trusted by over 1 million sites.
|
62 |
Every month they delivers over 8 billion emails from 20,000+ customers.
|
63 |
|
64 |
Their mission is to reliably send emails in the most efficient way and at the most disruptive pricing ever.
|
65 |
+
Pepipost provides users 30,000 emails the first 30 days.
|
66 |
|
67 |
Read our <a href="https://wpmailsmtp.com/docs/how-to-set-up-the-pepipost-mailer-in-wp-mail-smtp/" rel="friend">Pepipost documentation</a> for more details.
|
68 |
|
78 |
|
79 |
= Mailgun SMTP =
|
80 |
|
81 |
+
Mailgun SMTP is a popular SMTP service provider that allows you to send large quantities of emails. They provide 5,000 free emails per month for 3 months.
|
82 |
|
83 |
WP Mail SMTP plugin offers a native integration with MailGun. All you have to do is connect your Mailgun account, and you will improve your email deliverability.
|
84 |
|
220 |
|
221 |
== Changelog ==
|
222 |
|
223 |
+
= 1.9.0 - 2020-03-23 =
|
224 |
+
* Added: Add various Status tests and Info section on Tools > Site Health page.
|
225 |
+
* Added: Notify admin if there are unsaved changes in plugin admin area options.
|
226 |
+
* Fixed: Test email now has a proper bottom margin for better look.
|
227 |
+
* Changed: Update "About us" plugin page with relevant information.
|
228 |
+
* Changed: Save default WordPress FROM Email address when incorrect FROM Email address is saved by a user.
|
229 |
+
|
230 |
= 1.8.1 - 2019-12-13 =
|
231 |
* Fixed: Revert Guzzle version to 6.4.1 because Sendinblue and Gmail mailers may experience issues under certain circumstances while sending emails (not all sites are affected).
|
232 |
* Fixed: Make compatible the WordPress PhpMailer class inline attachments management with the Sendgrid API.
|
src/Admin/Area.php
CHANGED
@@ -264,8 +264,9 @@ class Area {
|
|
264 |
'wp-mail-smtp-admin',
|
265 |
'wp_mail_smtp',
|
266 |
array(
|
267 |
-
'text_provider_remove'
|
268 |
-
'
|
|
|
269 |
'upgrade_icon_lock' => '<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="lock" class="svg-inline--fa fa-lock fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"></path></svg>',
|
270 |
'upgrade_title' => esc_html__( '%name% is a PRO Feature', 'wp-mail-smtp' ),
|
271 |
'upgrade_button' => esc_html__( 'Upgrade to Pro', 'wp-mail-smtp' ),
|
@@ -390,6 +391,7 @@ class Area {
|
|
390 |
}
|
391 |
?>
|
392 |
|
|
|
393 |
<div id="wp-mail-smtp-header">
|
394 |
<!--suppress HtmlUnknownTarget -->
|
395 |
<img class="wp-mail-smtp-header-logo" src="<?php echo esc_url( wp_mail_smtp()->assets_url ); ?>/images/logo.svg" alt="WP Mail SMTP"/>
|
264 |
'wp-mail-smtp-admin',
|
265 |
'wp_mail_smtp',
|
266 |
array(
|
267 |
+
'text_provider_remove' => esc_html__( 'Are you sure you want to reset the current provider connection? You will need to immediately create a new one to be able to send emails.', 'wp-mail-smtp' ),
|
268 |
+
'text_settings_not_saved' => esc_html__( 'Changes that you made to the settings are not saved!', 'wp-mail-smtp' ),
|
269 |
+
'education' => array(
|
270 |
'upgrade_icon_lock' => '<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="lock" class="svg-inline--fa fa-lock fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"></path></svg>',
|
271 |
'upgrade_title' => esc_html__( '%name% is a PRO Feature', 'wp-mail-smtp' ),
|
272 |
'upgrade_button' => esc_html__( 'Upgrade to Pro', 'wp-mail-smtp' ),
|
391 |
}
|
392 |
?>
|
393 |
|
394 |
+
<div id="wp-mail-smtp-header-temp"></div>
|
395 |
<div id="wp-mail-smtp-header">
|
396 |
<!--suppress HtmlUnknownTarget -->
|
397 |
<img class="wp-mail-smtp-header-logo" src="<?php echo esc_url( wp_mail_smtp()->assets_url ); ?>/images/logo.svg" alt="WP Mail SMTP"/>
|
src/Admin/Pages/About.php
CHANGED
@@ -180,8 +180,8 @@ class About extends PageAbstract {
|
|
180 |
<?php
|
181 |
printf(
|
182 |
wp_kses(
|
183 |
-
/* translators: %1$s -
|
184 |
-
__( 'WP Mail SMTP is brought to you by the same team that\'s behind the most user friendly WordPress forms, <a href="%1$s" target="_blank" rel="noopener noreferrer">WPForms</a>, the largest WordPress resource site, <a href="%2$s" target="_blank" rel="noopener noreferrer">WPBeginner</a>, the most popular lead-generation software, <a href="%3$s" target="_blank" rel="noopener noreferrer">OptinMonster</a>,
|
185 |
array(
|
186 |
'a' => array(
|
187 |
'href' => array(),
|
@@ -193,7 +193,8 @@ class About extends PageAbstract {
|
|
193 |
'https://wpforms.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp',
|
194 |
'https://www.wpbeginner.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp',
|
195 |
'https://optinmonster.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp',
|
196 |
-
'https://www.monsterinsights.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp'
|
|
|
197 |
);
|
198 |
?>
|
199 |
</p>
|
@@ -333,7 +334,7 @@ class About extends PageAbstract {
|
|
333 |
private function get_am_plugins() {
|
334 |
|
335 |
$data = array(
|
336 |
-
'mi'
|
337 |
'path' => 'google-analytics-for-wordpress/googleanalytics.php',
|
338 |
'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-mi.png',
|
339 |
'name' => \esc_html__( 'MonsterInsights', 'wp-mail-smtp' ),
|
@@ -347,14 +348,14 @@ class About extends PageAbstract {
|
|
347 |
'url' => 'https://www.monsterinsights.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
348 |
),
|
349 |
),
|
350 |
-
'om'
|
351 |
'path' => 'optinmonster/optin-monster-wp-api.php',
|
352 |
'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-om.png',
|
353 |
'name' => \esc_html__( 'OptinMonster', 'wp-mail-smtp' ),
|
354 |
'desc' => \esc_html__( 'Our high-converting optin forms like Exit-Intent® popups, Fullscreen Welcome Mats, and Scroll boxes help you dramatically boost conversions and get more email subscribers.', 'wp-mail-smtp' ),
|
355 |
'url' => 'https://downloads.wordpress.org/plugin/optinmonster.zip',
|
356 |
),
|
357 |
-
'wpforms'
|
358 |
'path' => 'wpforms-lite/wpforms.php',
|
359 |
'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-wpf.png',
|
360 |
'name' => \esc_html__( 'Contact Forms by WPForms', 'wp-mail-smtp' ),
|
@@ -368,6 +369,20 @@ class About extends PageAbstract {
|
|
368 |
'url' => 'https://wpforms.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
369 |
),
|
370 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
371 |
);
|
372 |
|
373 |
return $data;
|
180 |
<?php
|
181 |
printf(
|
182 |
wp_kses(
|
183 |
+
/* translators: %1$s - WPForms URL, %2$s - WPBeginner URL, %3$s - OptinMonster URL, %4$s - MonsterInsights URL, %5$s - RafflePress URL */
|
184 |
+
__( 'WP Mail SMTP is brought to you by the same team that\'s behind the most user friendly WordPress forms, <a href="%1$s" target="_blank" rel="noopener noreferrer">WPForms</a>, the largest WordPress resource site, <a href="%2$s" target="_blank" rel="noopener noreferrer">WPBeginner</a>, the most popular lead-generation software, <a href="%3$s" target="_blank" rel="noopener noreferrer">OptinMonster</a>, the best WordPress analytics plugin, <a href="%4$s" target="_blank" rel="noopener noreferrer">MonsterInsights</a>, and the most powerful WordPress contest plugin, <a href="%5$s" target="_blank" rel="noopener noreferrer">RafflePress</a>.', 'wp-mail-smtp' ),
|
185 |
array(
|
186 |
'a' => array(
|
187 |
'href' => array(),
|
193 |
'https://wpforms.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp',
|
194 |
'https://www.wpbeginner.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp',
|
195 |
'https://optinmonster.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp',
|
196 |
+
'https://www.monsterinsights.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp',
|
197 |
+
'https://rafflepress.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp'
|
198 |
);
|
199 |
?>
|
200 |
</p>
|
334 |
private function get_am_plugins() {
|
335 |
|
336 |
$data = array(
|
337 |
+
'mi' => array(
|
338 |
'path' => 'google-analytics-for-wordpress/googleanalytics.php',
|
339 |
'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-mi.png',
|
340 |
'name' => \esc_html__( 'MonsterInsights', 'wp-mail-smtp' ),
|
348 |
'url' => 'https://www.monsterinsights.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
349 |
),
|
350 |
),
|
351 |
+
'om' => array(
|
352 |
'path' => 'optinmonster/optin-monster-wp-api.php',
|
353 |
'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-om.png',
|
354 |
'name' => \esc_html__( 'OptinMonster', 'wp-mail-smtp' ),
|
355 |
'desc' => \esc_html__( 'Our high-converting optin forms like Exit-Intent® popups, Fullscreen Welcome Mats, and Scroll boxes help you dramatically boost conversions and get more email subscribers.', 'wp-mail-smtp' ),
|
356 |
'url' => 'https://downloads.wordpress.org/plugin/optinmonster.zip',
|
357 |
),
|
358 |
+
'wpforms' => array(
|
359 |
'path' => 'wpforms-lite/wpforms.php',
|
360 |
'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-wpf.png',
|
361 |
'name' => \esc_html__( 'Contact Forms by WPForms', 'wp-mail-smtp' ),
|
369 |
'url' => 'https://wpforms.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
370 |
),
|
371 |
),
|
372 |
+
'rafflepress' => array(
|
373 |
+
'path' => 'rafflepress/rafflepress.php',
|
374 |
+
'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-rp.png',
|
375 |
+
'name' => \esc_html__( 'RafflePress', 'wp-mail-smtp' ),
|
376 |
+
'desc' => \esc_html__( 'Turn your visitors into brand ambassadors! Easily grow your email list, website traffic, and social media followers with powerful viral giveaways & contests.', 'wp-mail-smtp' ),
|
377 |
+
'url' => 'https://downloads.wordpress.org/plugin/rafflepress.zip',
|
378 |
+
'pro' => array(
|
379 |
+
'path' => 'rafflepress-pro/rafflepress-pro.php',
|
380 |
+
'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-rp.png',
|
381 |
+
'name' => \esc_html__( 'RafflePress Pro', 'wp-mail-smtp' ),
|
382 |
+
'desc' => \esc_html__( 'Turn your visitors into brand ambassadors! Easily grow your email list, website traffic, and social media followers with powerful viral giveaways & contests.', 'wp-mail-smtp' ),
|
383 |
+
'url' => 'https://rafflepress.com/pricing/',
|
384 |
+
),
|
385 |
+
),
|
386 |
);
|
387 |
|
388 |
return $data;
|
src/Admin/Pages/TestTab.php
CHANGED
@@ -1,1130 +1,1115 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPMailSMTP\Admin\Pages;
|
4 |
-
|
5 |
-
use WPMailSMTP\Conflicts;
|
6 |
-
use WPMailSMTP\Debug;
|
7 |
-
use WPMailSMTP\MailCatcher;
|
8 |
-
use WPMailSMTP\Options;
|
9 |
-
use WPMailSMTP\WP;
|
10 |
-
use WPMailSMTP\Admin\PageAbstract;
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Class TestTab is part of Area, displays email testing page of the plugin.
|
14 |
-
*
|
15 |
-
* @since 1.0.0
|
16 |
-
*/
|
17 |
-
class TestTab extends PageAbstract {
|
18 |
-
|
19 |
-
/**
|
20 |
-
* @var string Slug of a tab.
|
21 |
-
*/
|
22 |
-
protected $slug = 'test';
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Mailer debug error data.
|
26 |
-
*
|
27 |
-
* @since 1.3.0
|
28 |
-
*
|
29 |
-
* @var array
|
30 |
-
*/
|
31 |
-
private $debug = array();
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @inheritdoc
|
35 |
-
*/
|
36 |
-
public function get_label() {
|
37 |
-
return esc_html__( 'Email Test', 'wp-mail-smtp' );
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* @inheritdoc
|
42 |
-
*/
|
43 |
-
public function get_title() {
|
44 |
-
return $this->get_label();
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* @inheritdoc
|
49 |
-
*/
|
50 |
-
public function display() {
|
51 |
-
?>
|
52 |
-
|
53 |
-
<form method="POST" action="">
|
54 |
-
<?php $this->wp_nonce_field(); ?>
|
55 |
-
|
56 |
-
<!-- Test Email Section Title -->
|
57 |
-
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-content wp-mail-smtp-clear section-heading no-desc" id="wp-mail-smtp-setting-row-email-heading">
|
58 |
-
<div class="wp-mail-smtp-setting-field">
|
59 |
-
<h2><?php esc_html_e( 'Send a Test Email', 'wp-mail-smtp' ); ?></h2>
|
60 |
-
</div>
|
61 |
-
</div>
|
62 |
-
|
63 |
-
<!-- Test Email -->
|
64 |
-
<div id="wp-mail-smtp-setting-row-test_email" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-email wp-mail-smtp-clear">
|
65 |
-
<div class="wp-mail-smtp-setting-label">
|
66 |
-
<label for="wp-mail-smtp-setting-test_email"><?php esc_html_e( 'Send To', 'wp-mail-smtp' ); ?></label>
|
67 |
-
</div>
|
68 |
-
<div class="wp-mail-smtp-setting-field">
|
69 |
-
<input name="wp-mail-smtp[test][email]" value="<?php echo esc_attr( wp_get_current_user()->user_email ); ?>"
|
70 |
-
type="email" id="wp-mail-smtp-setting-test_email" spellcheck="false" required>
|
71 |
-
<p class="desc">
|
72 |
-
<?php esc_html_e( 'Enter email address where test email will be sent.', 'wp-mail-smtp' ); ?>
|
73 |
-
</p>
|
74 |
-
</div>
|
75 |
-
</div>
|
76 |
-
|
77 |
-
<!-- HTML/Plain -->
|
78 |
-
<div id="wp-mail-smtp-setting-row-test_email_html" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-checkbox-toggle wp-mail-smtp-clear">
|
79 |
-
<div class="wp-mail-smtp-setting-label">
|
80 |
-
<label for="wp-mail-smtp-setting-test_email_html"><?php esc_html_e( 'HTML', 'wp-mail-smtp' ); ?></label>
|
81 |
-
</div>
|
82 |
-
<div class="wp-mail-smtp-setting-field">
|
83 |
-
<label for="wp-mail-smtp-setting-test_email_html">
|
84 |
-
<input type="checkbox" id="wp-mail-smtp-setting-test_email_html" name="wp-mail-smtp[test][html]" value="yes" checked />
|
85 |
-
<span class="wp-mail-smtp-setting-toggle-switch"></span>
|
86 |
-
<span class="wp-mail-smtp-setting-toggle-checked-label"><?php esc_html_e( 'On', 'wp-mail-smtp' ); ?></span>
|
87 |
-
<span class="wp-mail-smtp-setting-toggle-unchecked-label"><?php esc_html_e( 'Off', 'wp-mail-smtp' ); ?></span>
|
88 |
-
</label>
|
89 |
-
<p class="desc">
|
90 |
-
<?php esc_html_e( 'Send this email in HTML or in plain text format.', 'wp-mail-smtp' ); ?>
|
91 |
-
</p>
|
92 |
-
</div>
|
93 |
-
</div>
|
94 |
-
|
95 |
-
<p class="wp-mail-smtp-submit">
|
96 |
-
<?php
|
97 |
-
$btn = 'wp-mail-smtp-btn-orange';
|
98 |
-
$disabled = '';
|
99 |
-
$help_text = '';
|
100 |
-
|
101 |
-
if (
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
if ( empty( $data['test']['
|
132 |
-
$
|
133 |
-
}
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
}
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
*
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
</p>
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
*
|
396 |
-
*
|
397 |
-
* @
|
398 |
-
*
|
399 |
-
* @return string
|
400 |
-
*/
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
$
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
$
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
);
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
'
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
'
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
esc_html__( '
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
esc_html__( '
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
esc_html__( '
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
esc_html__( '
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
esc_html__( '
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
esc_html__( '
|
605 |
-
esc_html__( '
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
'
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
esc_html__( '
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
esc_html__( '
|
665 |
-
esc_html__( '
|
666 |
-
),
|
667 |
-
),
|
668 |
-
// [mailgun] -
|
669 |
-
array(
|
670 |
-
'mailer' => 'mailgun',
|
671 |
-
'errors' => array(
|
672 |
-
array( '
|
673 |
-
),
|
674 |
-
'description' => array(
|
675 |
-
'<strong>' . esc_html__( 'Mailgun failed.', 'wp-mail-smtp' ) . '</strong>',
|
676 |
-
esc_html__( '
|
677 |
-
),
|
678 |
-
'steps' => array(
|
679 |
-
esc_html__( '
|
680 |
-
esc_html__( '
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
'
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
esc_html__( '
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
esc_html__( '
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
. '
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
'
|
753 |
-
'
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
. '
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
),
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
'
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
esc_html__( '
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
'
|
861 |
-
'
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
'
|
875 |
-
'
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
),
|
923 |
-
),
|
924 |
-
),
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
}
|
949 |
-
|
950 |
-
$match
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
esc_html__( '
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
<strong><?php esc_html_e( 'Click here to view the full Error Log for debugging', 'wp-mail-smtp' ); ?></strong>
|
1117 |
-
</a>
|
1118 |
-
</p>
|
1119 |
-
|
1120 |
-
<div class="error-log">
|
1121 |
-
<?php echo $this->debug['error_log']; ?>
|
1122 |
-
</div>
|
1123 |
-
|
1124 |
-
<p class="error-log-note">
|
1125 |
-
<em><?php esc_html_e( 'Please copy only the content of the error debug message above, identified with an orange left border, into the support forum topic if you experience any issues.', 'wp-mail-smtp' ); ?></em>
|
1126 |
-
</p>
|
1127 |
-
</div>
|
1128 |
-
<?php
|
1129 |
-
}
|
1130 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPMailSMTP\Admin\Pages;
|
4 |
+
|
5 |
+
use WPMailSMTP\Conflicts;
|
6 |
+
use WPMailSMTP\Debug;
|
7 |
+
use WPMailSMTP\MailCatcher;
|
8 |
+
use WPMailSMTP\Options;
|
9 |
+
use WPMailSMTP\WP;
|
10 |
+
use WPMailSMTP\Admin\PageAbstract;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Class TestTab is part of Area, displays email testing page of the plugin.
|
14 |
+
*
|
15 |
+
* @since 1.0.0
|
16 |
+
*/
|
17 |
+
class TestTab extends PageAbstract {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* @var string Slug of a tab.
|
21 |
+
*/
|
22 |
+
protected $slug = 'test';
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Mailer debug error data.
|
26 |
+
*
|
27 |
+
* @since 1.3.0
|
28 |
+
*
|
29 |
+
* @var array
|
30 |
+
*/
|
31 |
+
private $debug = array();
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @inheritdoc
|
35 |
+
*/
|
36 |
+
public function get_label() {
|
37 |
+
return esc_html__( 'Email Test', 'wp-mail-smtp' );
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @inheritdoc
|
42 |
+
*/
|
43 |
+
public function get_title() {
|
44 |
+
return $this->get_label();
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* @inheritdoc
|
49 |
+
*/
|
50 |
+
public function display() {
|
51 |
+
?>
|
52 |
+
|
53 |
+
<form method="POST" action="">
|
54 |
+
<?php $this->wp_nonce_field(); ?>
|
55 |
+
|
56 |
+
<!-- Test Email Section Title -->
|
57 |
+
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-content wp-mail-smtp-clear section-heading no-desc" id="wp-mail-smtp-setting-row-email-heading">
|
58 |
+
<div class="wp-mail-smtp-setting-field">
|
59 |
+
<h2><?php esc_html_e( 'Send a Test Email', 'wp-mail-smtp' ); ?></h2>
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
|
63 |
+
<!-- Test Email -->
|
64 |
+
<div id="wp-mail-smtp-setting-row-test_email" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-email wp-mail-smtp-clear">
|
65 |
+
<div class="wp-mail-smtp-setting-label">
|
66 |
+
<label for="wp-mail-smtp-setting-test_email"><?php esc_html_e( 'Send To', 'wp-mail-smtp' ); ?></label>
|
67 |
+
</div>
|
68 |
+
<div class="wp-mail-smtp-setting-field">
|
69 |
+
<input name="wp-mail-smtp[test][email]" value="<?php echo esc_attr( wp_get_current_user()->user_email ); ?>"
|
70 |
+
type="email" id="wp-mail-smtp-setting-test_email" spellcheck="false" required>
|
71 |
+
<p class="desc">
|
72 |
+
<?php esc_html_e( 'Enter email address where test email will be sent.', 'wp-mail-smtp' ); ?>
|
73 |
+
</p>
|
74 |
+
</div>
|
75 |
+
</div>
|
76 |
+
|
77 |
+
<!-- HTML/Plain -->
|
78 |
+
<div id="wp-mail-smtp-setting-row-test_email_html" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-checkbox-toggle wp-mail-smtp-clear">
|
79 |
+
<div class="wp-mail-smtp-setting-label">
|
80 |
+
<label for="wp-mail-smtp-setting-test_email_html"><?php esc_html_e( 'HTML', 'wp-mail-smtp' ); ?></label>
|
81 |
+
</div>
|
82 |
+
<div class="wp-mail-smtp-setting-field">
|
83 |
+
<label for="wp-mail-smtp-setting-test_email_html">
|
84 |
+
<input type="checkbox" id="wp-mail-smtp-setting-test_email_html" name="wp-mail-smtp[test][html]" value="yes" checked />
|
85 |
+
<span class="wp-mail-smtp-setting-toggle-switch"></span>
|
86 |
+
<span class="wp-mail-smtp-setting-toggle-checked-label"><?php esc_html_e( 'On', 'wp-mail-smtp' ); ?></span>
|
87 |
+
<span class="wp-mail-smtp-setting-toggle-unchecked-label"><?php esc_html_e( 'Off', 'wp-mail-smtp' ); ?></span>
|
88 |
+
</label>
|
89 |
+
<p class="desc">
|
90 |
+
<?php esc_html_e( 'Send this email in HTML or in plain text format.', 'wp-mail-smtp' ); ?>
|
91 |
+
</p>
|
92 |
+
</div>
|
93 |
+
</div>
|
94 |
+
|
95 |
+
<p class="wp-mail-smtp-submit">
|
96 |
+
<?php
|
97 |
+
$btn = 'wp-mail-smtp-btn-orange';
|
98 |
+
$disabled = '';
|
99 |
+
$help_text = '';
|
100 |
+
|
101 |
+
if (
|
102 |
+
! wp_mail_smtp()->get_providers()->get_mailer(
|
103 |
+
Options::init()->get( 'mail', 'mailer' ),
|
104 |
+
wp_mail_smtp()->get_processor()->get_phpmailer()
|
105 |
+
)->is_mailer_complete()
|
106 |
+
) {
|
107 |
+
$btn = 'wp-mail-smtp-btn-red';
|
108 |
+
$disabled = 'disabled';
|
109 |
+
|
110 |
+
$help_text = '<span class="help-text"><strong>' . esc_html__( 'You cannot send an email. Mailer is not properly configured. Please check your settings.', 'wp-mail-smtp' ) . '</strong></span>';
|
111 |
+
}
|
112 |
+
?>
|
113 |
+
<button type="submit" class="wp-mail-smtp-btn wp-mail-smtp-btn-md <?php echo esc_attr( $btn ); ?>" <?php echo esc_attr( $disabled ); ?>>
|
114 |
+
<?php esc_html_e( 'Send Email', 'wp-mail-smtp' ); ?>
|
115 |
+
</button>
|
116 |
+
<?php echo $help_text; ?>
|
117 |
+
</p>
|
118 |
+
</form>
|
119 |
+
|
120 |
+
<?php
|
121 |
+
$this->display_debug_details();
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* @inheritdoc
|
126 |
+
*/
|
127 |
+
public function process_post( $data ) {
|
128 |
+
|
129 |
+
$this->check_admin_referer();
|
130 |
+
|
131 |
+
if ( ! empty( $data['test']['email'] ) ) {
|
132 |
+
$data['test']['email'] = filter_var( $data['test']['email'], FILTER_VALIDATE_EMAIL );
|
133 |
+
}
|
134 |
+
|
135 |
+
$is_html = true;
|
136 |
+
if ( empty( $data['test']['html'] ) ) {
|
137 |
+
$is_html = false;
|
138 |
+
}
|
139 |
+
|
140 |
+
if ( empty( $data['test']['email'] ) ) {
|
141 |
+
WP::add_admin_notice(
|
142 |
+
esc_html__( 'Test failed. Please use a valid email address and try to resend the test email.', 'wp-mail-smtp' ),
|
143 |
+
WP::ADMIN_NOTICE_WARNING
|
144 |
+
);
|
145 |
+
return;
|
146 |
+
}
|
147 |
+
|
148 |
+
$phpmailer = wp_mail_smtp()->get_processor()->get_phpmailer();
|
149 |
+
|
150 |
+
// Set SMTPDebug level, default is 3 (commands + data + connection status).
|
151 |
+
$phpmailer->SMTPDebug = apply_filters( 'wp_mail_smtp_admin_test_email_smtp_debug', 3 );
|
152 |
+
|
153 |
+
/* translators: %s - email address a test email will be sent to. */
|
154 |
+
$subject = 'WP Mail SMTP: ' . sprintf( esc_html__( 'Test email to %s', 'wp-mail-smtp' ), $data['test']['email'] );
|
155 |
+
|
156 |
+
if ( $is_html ) {
|
157 |
+
add_filter( 'wp_mail_content_type', array( __CLASS__, 'set_test_html_content_type' ) );
|
158 |
+
|
159 |
+
/* translators: %s - email address a test email will be sent to. */
|
160 |
+
$subject = 'WP Mail SMTP: HTML ' . sprintf( esc_html__( 'Test email to %s', 'wp-mail-smtp' ), $data['test']['email'] );
|
161 |
+
}
|
162 |
+
|
163 |
+
// Start output buffering to grab smtp debugging output.
|
164 |
+
ob_start();
|
165 |
+
|
166 |
+
// Send the test mail.
|
167 |
+
$result = wp_mail(
|
168 |
+
$data['test']['email'],
|
169 |
+
$subject,
|
170 |
+
$this->get_email_message( $is_html ),
|
171 |
+
array(
|
172 |
+
'X-Mailer-Type:WPMailSMTP/Admin/Test',
|
173 |
+
)
|
174 |
+
);
|
175 |
+
|
176 |
+
$smtp_debug = ob_get_clean();
|
177 |
+
|
178 |
+
if ( $is_html ) {
|
179 |
+
remove_filter( 'wp_mail_content_type', array( __NAMESPACE__, 'set_test_html_content_type' ) );
|
180 |
+
}
|
181 |
+
|
182 |
+
/*
|
183 |
+
* Notify a user about the results.
|
184 |
+
*/
|
185 |
+
if ( $result ) {
|
186 |
+
$result_message = esc_html__( 'Test plain text email was sent successfully!', 'wp-mail-smtp' );
|
187 |
+
if ( $is_html ) {
|
188 |
+
$result_message = sprintf(
|
189 |
+
/* translators: %s - "HTML" in bold. */
|
190 |
+
esc_html__( 'Test %s email was sent successfully! Please check your inbox to make sure it is delivered.', 'wp-mail-smtp' ),
|
191 |
+
'<strong>HTML</strong>'
|
192 |
+
);
|
193 |
+
}
|
194 |
+
WP::add_admin_notice(
|
195 |
+
$result_message,
|
196 |
+
WP::ADMIN_NOTICE_SUCCESS
|
197 |
+
);
|
198 |
+
} else {
|
199 |
+
// Grab the smtp debugging output.
|
200 |
+
$this->debug['smtp_debug'] = $smtp_debug;
|
201 |
+
$this->debug['smtp_error'] = wp_strip_all_tags( $phpmailer->ErrorInfo );
|
202 |
+
$this->debug['error_log'] = $this->get_debug_messages( $phpmailer, $smtp_debug );
|
203 |
+
}
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* Get the email message that should be sent.
|
208 |
+
*
|
209 |
+
* @since 1.4.0
|
210 |
+
*
|
211 |
+
* @param bool $is_html Whether to send an HTML email or plain text.
|
212 |
+
*
|
213 |
+
* @return string
|
214 |
+
*/
|
215 |
+
private function get_email_message( $is_html = true ) {
|
216 |
+
|
217 |
+
// Default plain text version of the email.
|
218 |
+
$message = $this->get_email_message_text();
|
219 |
+
|
220 |
+
if ( $is_html ) {
|
221 |
+
$message = $this->get_email_message_html();
|
222 |
+
}
|
223 |
+
|
224 |
+
return $message;
|
225 |
+
}
|
226 |
+
|
227 |
+
/**
|
228 |
+
* Get the HTML prepared message for test email.
|
229 |
+
*
|
230 |
+
* @since 1.4.0
|
231 |
+
*
|
232 |
+
* @return string
|
233 |
+
*/
|
234 |
+
private function get_email_message_html() {
|
235 |
+
|
236 |
+
ob_start();
|
237 |
+
?>
|
238 |
+
<!doctype html>
|
239 |
+
<html lang="en">
|
240 |
+
<head>
|
241 |
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
242 |
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
243 |
+
<meta name="viewport" content="width=device-width">
|
244 |
+
<title>WP Mail SMTP Test Email</title>
|
245 |
+
<style type="text/css">@media only screen and (max-width: 599px) {table.body .container {width: 95% !important;}.header {padding: 15px 15px 12px 15px !important;}.header img {width: 200px !important;height: auto !important;}.content, .aside {padding: 30px 40px 20px 40px !important;}}</style>
|
246 |
+
</head>
|
247 |
+
<body style="height: 100% !important; width: 100% !important; min-width: 100%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-font-smoothing: antialiased !important; -moz-osx-font-smoothing: grayscale !important; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; margin: 0; Margin: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; background-color: #f1f1f1; text-align: center;">
|
248 |
+
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" class="body" style="border-collapse: collapse; border-spacing: 0; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; height: 100% !important; width: 100% !important; min-width: 100%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-font-smoothing: antialiased !important; -moz-osx-font-smoothing: grayscale !important; background-color: #f1f1f1; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; margin: 0; Margin: 0; text-align: left; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%;">
|
249 |
+
<tr style="padding: 0; vertical-align: top; text-align: left;">
|
250 |
+
<td align="center" valign="top" class="body-inner wp-mail-smtp" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; margin: 0; Margin: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; text-align: center;">
|
251 |
+
<!-- Container -->
|
252 |
+
<table border="0" cellpadding="0" cellspacing="0" class="container" style="border-collapse: collapse; border-spacing: 0; padding: 0; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; width: 600px; margin: 0 auto 30px auto; Margin: 0 auto 30px auto; text-align: inherit;">
|
253 |
+
<!-- Header -->
|
254 |
+
<tr style="padding: 0; vertical-align: top; text-align: left;">
|
255 |
+
<td align="center" valign="middle" class="header" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; text-align: center; padding: 30px 30px 22px 30px;">
|
256 |
+
<img src="<?php echo esc_url( wp_mail_smtp()->plugin_url . '/assets/images/email/wp-mail-smtp.png' ); ?>" width="250" alt="WP Mail SMTP Logo" style="outline: none; text-decoration: none; max-width: 100%; clear: both; -ms-interpolation-mode: bicubic; display: inline-block !important; width: 250px;">
|
257 |
+
</td>
|
258 |
+
</tr>
|
259 |
+
<!-- Content -->
|
260 |
+
<tr style="padding: 0; vertical-align: top; text-align: left;">
|
261 |
+
<td align="left" valign="top" class="content" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; text-align: left; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; background-color: #ffffff; padding: 60px 75px 45px 75px; border-right: 1px solid #ddd; border-bottom: 1px solid #ddd; border-left: 1px solid #ddd; border-top: 3px solid #809eb0;">
|
262 |
+
<div class="success" style="text-align: center;">
|
263 |
+
<p class="check" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; margin: 0 auto 16px auto; Margin: 0 auto 16px auto; text-align: center;">
|
264 |
+
<img src="<?php echo esc_url( wp_mail_smtp()->plugin_url . '/assets/images/email/icon-check.png' ); ?>" width="70" alt="Success" style="outline: none; text-decoration: none; max-width: 100%; clear: both; -ms-interpolation-mode: bicubic; display: block; margin: 0 auto 0 auto; Margin: 0 auto 0 auto; width: 50px;">
|
265 |
+
</p>
|
266 |
+
<p class="text-extra-large text-center congrats" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; mso-line-height-rule: exactly; line-height: 140%; font-size: 20px; text-align: center; margin: 0 0 20px 0; Margin: 0 0 20px 0;">
|
267 |
+
Congrats, test email was sent successfully!
|
268 |
+
</p>
|
269 |
+
<p class="text-large" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; text-align: left; mso-line-height-rule: exactly; line-height: 140%; margin: 0 0 15px 0; Margin: 0 0 15px 0; font-size: 16px;">
|
270 |
+
Thank you for trying out WP Mail SMTP. We're on a mission to make sure that your emails actually get delivered.
|
271 |
+
</p>
|
272 |
+
<?php if ( ! wp_mail_smtp()->is_pro() ) : ?>
|
273 |
+
<p class="text-large" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; text-align: left; mso-line-height-rule: exactly; line-height: 140%; margin: 0 0 15px 0; Margin: 0 0 15px 0; font-size: 16px;">
|
274 |
+
If you find this free plugin useful, please consider giving WP Mail SMTP Pro a try!
|
275 |
+
</p>
|
276 |
+
<?php endif; ?>
|
277 |
+
<p class="signature" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; text-align: left; margin: 20px 0 0 0; Margin: 20px 0 0 0;">
|
278 |
+
<img src="<?php echo esc_url( wp_mail_smtp()->plugin_url . '/assets/images/email/signature.png' ); ?>" width="180" alt="Signature" style="outline: none; text-decoration: none; max-width: 100%; clear: both; -ms-interpolation-mode: bicubic; width: 180px; display: block; margin: 0 0 0 0; Margin: 0 0 0 0;">
|
279 |
+
</p>
|
280 |
+
<p style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; text-align: left; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; margin: 0 0 15px 0; Margin: 0 0 15px 0;">
|
281 |
+
Jared Atchison<br>Lead Developer, WP Mail SMTP
|
282 |
+
</p>
|
283 |
+
</div>
|
284 |
+
</td>
|
285 |
+
</tr>
|
286 |
+
<!-- Aside -->
|
287 |
+
<?php if ( ! wp_mail_smtp()->is_pro() ) : ?>
|
288 |
+
<tr style="padding: 0; vertical-align: top; text-align: left;">
|
289 |
+
<td align="left" valign="top" class="aside upsell-mi" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; background-color: #f8f8f8; border-top: 1px solid #dddddd; border-right: 1px solid #dddddd; border-bottom: 1px solid #dddddd; border-left: 1px solid #dddddd; text-align: center !important; padding: 30px 75px 25px 75px;">
|
290 |
+
<h6 style="padding: 0; color: #444444; word-wrap: normal; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: bold; mso-line-height-rule: exactly; line-height: 130%; font-size: 18px; text-align: center; margin: 0 0 15px 0; Margin: 0 0 15px 0;">
|
291 |
+
Unlock More Features with WP Mail SMTP Pro
|
292 |
+
</h6>
|
293 |
+
<p class="text-large" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; mso-line-height-rule: exactly; line-height: 140%; margin: 0 0 15px 0; Margin: 0 0 15px 0; font-size: 16px; text-align: center;">
|
294 |
+
Email Logs and Notification Controls<br>
|
295 |
+
Amazon SES / Outlook.com / Office 365 integrations<br>
|
296 |
+
Access to our world class support team
|
297 |
+
</p>
|
298 |
+
<p class="text-large last" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; mso-line-height-rule: exactly; line-height: 140%; font-size: 13px; text-align: center; margin: 0 0 0 0; Margin: 0 0 0 0;">
|
299 |
+
WP Mail SMTP users get <span style="font-weight:700;color:#218900;">20% off</span>, automatically applied at checkout
|
300 |
+
</p>
|
301 |
+
<center style="width: 100%;">
|
302 |
+
<table class="button large expanded orange" style="border-collapse: collapse; border-spacing: 0; padding: 0; vertical-align: top; text-align: left; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #e27730; width: 100% !important;">
|
303 |
+
<tr style="padding: 0; vertical-align: top; text-align: left;">
|
304 |
+
<td class="button-inner" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; text-align: left; font-size: 14px; mso-line-height-rule: exactly; line-height: 100%; padding: 20px 0 20px 0;">
|
305 |
+
<table style="border-collapse: collapse; border-spacing: 0; padding: 0; vertical-align: top; text-align: left; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; width: 100% !important;">
|
306 |
+
<tr style="padding: 0; vertical-align: top; text-align: left;">
|
307 |
+
<td style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; margin: 0; Margin: 0; font-size: 14px; text-align: center; color: #ffffff; background: #e27730; border: 1px solid #c45e1b; border-bottom: 3px solid #c45e1b; mso-line-height-rule: exactly; line-height: 100%;">
|
308 |
+
<a href="<?php echo esc_url( wp_mail_smtp()->get_upgrade_link( 'email-test' ) ); ?>" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; margin: 0; Margin: 0; font-family: Helvetica, Arial, sans-serif; font-weight: bold; color: #ffffff; text-decoration: none; display: inline-block; border: 0 solid #c45e1b; mso-line-height-rule: exactly; line-height: 100%; padding: 14px 20px 12px 20px; font-size: 20px; text-align: center; width: 100%; padding-left: 0; padding-right: 0;">
|
309 |
+
Upgrade to WP Mail SMTP Pro Today
|
310 |
+
</a>
|
311 |
+
</td>
|
312 |
+
</tr>
|
313 |
+
</table>
|
314 |
+
</td>
|
315 |
+
</tr>
|
316 |
+
</table>
|
317 |
+
</center>
|
318 |
+
</td>
|
319 |
+
</tr>
|
320 |
+
<?php endif; ?>
|
321 |
+
</table>
|
322 |
+
</td>
|
323 |
+
</tr>
|
324 |
+
</table>
|
325 |
+
</body>
|
326 |
+
</html>
|
327 |
+
|
328 |
+
<?php
|
329 |
+
$message = ob_get_clean();
|
330 |
+
|
331 |
+
return $message;
|
332 |
+
}
|
333 |
+
|
334 |
+
/**
|
335 |
+
* Get the plain text prepared message for test email.
|
336 |
+
*
|
337 |
+
* @since 1.4.0
|
338 |
+
* @since 1.5.0 Display an upsell to WP Mail SMTP Pro if free version installed.
|
339 |
+
*
|
340 |
+
* @return string
|
341 |
+
*/
|
342 |
+
private function get_email_message_text() {
|
343 |
+
|
344 |
+
// phpcs:disable
|
345 |
+
if ( wp_mail_smtp()->is_pro() ) {
|
346 |
+
// WP Mail SMTP Pro & WPForms paid installed.
|
347 |
+
$message =
|
348 |
+
'Congrats, test email was sent successfully!
|
349 |
+
|
350 |
+
Thank you for trying out WP Mail SMTP. We are on a mission to make sure your emails actually get delivered.
|
351 |
+
|
352 |
+
- Jared Atchison
|
353 |
+
Lead Developer, WP Mail SMTP';
|
354 |
+
} else {
|
355 |
+
// Free WP Mail SMTP is installed.
|
356 |
+
$message =
|
357 |
+
'Congrats, test email was sent successfully!
|
358 |
+
|
359 |
+
Thank you for trying out WP Mail SMTP. We are on a mission to make sure your emails actually get delivered.
|
360 |
+
|
361 |
+
If you find this free plugin useful, please consider giving WP Mail SMTP Pro a try!
|
362 |
+
|
363 |
+
https://wpmailsmtp.com/lite-upgrade/
|
364 |
+
|
365 |
+
Unlock More Features with WP Mail SMTP Pro:
|
366 |
+
|
367 |
+
+ Email Logs and Notification Controls
|
368 |
+
+ Amazon SES / Outlook.com / Office 365 integrations
|
369 |
+
+ Access to our world class support team
|
370 |
+
|
371 |
+
- Jared Atchison
|
372 |
+
Lead Developer, WP Mail SMTP';
|
373 |
+
}
|
374 |
+
// phpcs:enable
|
375 |
+
|
376 |
+
return $message;
|
377 |
+
}
|
378 |
+
|
379 |
+
/**
|
380 |
+
* Set the HTML content type for a test email.
|
381 |
+
*
|
382 |
+
* @since 1.4.0
|
383 |
+
*
|
384 |
+
* @return string
|
385 |
+
*/
|
386 |
+
public static function set_test_html_content_type() {
|
387 |
+
|
388 |
+
return 'text/html';
|
389 |
+
}
|
390 |
+
|
391 |
+
/**
|
392 |
+
* Prepare debug information, that will help users to identify the error.
|
393 |
+
*
|
394 |
+
* @since 1.0.0
|
395 |
+
*
|
396 |
+
* @param MailCatcher $phpmailer
|
397 |
+
* @param string $smtp_debug
|
398 |
+
*
|
399 |
+
* @return string
|
400 |
+
*/
|
401 |
+
protected function get_debug_messages( $phpmailer, $smtp_debug ) {
|
402 |
+
|
403 |
+
$options = new Options();
|
404 |
+
$conflicts = new Conflicts();
|
405 |
+
|
406 |
+
$this->debug['mailer'] = $options->get( 'mail', 'mailer' );
|
407 |
+
|
408 |
+
/*
|
409 |
+
* Versions Debug.
|
410 |
+
*/
|
411 |
+
|
412 |
+
$versions_text = '<strong>Versions:</strong><br>';
|
413 |
+
|
414 |
+
$versions_text .= '<strong>WordPress:</strong> ' . get_bloginfo( 'version' ) . '<br>';
|
415 |
+
$versions_text .= '<strong>WordPress MS:</strong> ' . ( is_multisite() ? 'Yes' : 'No' ) . '<br>';
|
416 |
+
$versions_text .= '<strong>PHP:</strong> ' . PHP_VERSION . '<br>';
|
417 |
+
$versions_text .= '<strong>WP Mail SMTP:</strong> ' . WPMS_PLUGIN_VER . '<br>';
|
418 |
+
|
419 |
+
/*
|
420 |
+
* Mailer Debug.
|
421 |
+
*/
|
422 |
+
|
423 |
+
$mailer_text = '<strong>Params:</strong><br>';
|
424 |
+
|
425 |
+
$mailer_text .= '<strong>Mailer:</strong> ' . $this->debug['mailer'] . '<br>';
|
426 |
+
$mailer_text .= '<strong>Constants:</strong> ' . ( $options->is_const_enabled() ? 'Yes' : 'No' ) . '<br>';
|
427 |
+
if ( $conflicts->is_detected() ) {
|
428 |
+
$mailer_text .= '<strong>Conflicts:</strong> ' . esc_html( $conflicts->get_conflict_name() ) . '<br>';
|
429 |
+
}
|
430 |
+
|
431 |
+
// Display different debug info based on the mailer.
|
432 |
+
$mailer = wp_mail_smtp()->get_providers()->get_mailer( $this->debug['mailer'], $phpmailer );
|
433 |
+
|
434 |
+
if ( $mailer ) {
|
435 |
+
$mailer_text .= $mailer->get_debug_info();
|
436 |
+
}
|
437 |
+
|
438 |
+
/*
|
439 |
+
* General Debug.
|
440 |
+
*/
|
441 |
+
|
442 |
+
$debug_text = implode( '<br>', Debug::get() );
|
443 |
+
Debug::clear();
|
444 |
+
if ( ! empty( $debug_text ) ) {
|
445 |
+
$debug_text = '<br><strong>Debug:</strong><br>' . $debug_text . '<br>';
|
446 |
+
}
|
447 |
+
|
448 |
+
/*
|
449 |
+
* SMTP Debug.
|
450 |
+
*/
|
451 |
+
|
452 |
+
$smtp_text = '';
|
453 |
+
if ( $options->is_mailer_smtp() ) {
|
454 |
+
$smtp_text = '<strong>SMTP Debug:</strong><br>';
|
455 |
+
if ( ! empty( $smtp_debug ) ) {
|
456 |
+
$smtp_text .= '<pre>' . $smtp_debug . '</pre>';
|
457 |
+
} else {
|
458 |
+
$smtp_text .= '[empty]';
|
459 |
+
}
|
460 |
+
}
|
461 |
+
|
462 |
+
$errors = apply_filters(
|
463 |
+
'wp_mail_smtp_admin_test_get_debug_messages',
|
464 |
+
array(
|
465 |
+
$versions_text,
|
466 |
+
$mailer_text,
|
467 |
+
$debug_text,
|
468 |
+
$smtp_text,
|
469 |
+
)
|
470 |
+
);
|
471 |
+
|
472 |
+
return '<pre>' . implode( '<br>', array_filter( $errors ) ) . '</pre>';
|
473 |
+
}
|
474 |
+
|
475 |
+
/**
|
476 |
+
* Returns debug information for detection, processing, and display.
|
477 |
+
*
|
478 |
+
* @since 1.3.0
|
479 |
+
*
|
480 |
+
* @return array
|
481 |
+
*/
|
482 |
+
protected function get_debug_details() {
|
483 |
+
|
484 |
+
$options = new Options();
|
485 |
+
$smtp_host = $options->get( 'smtp', 'host' );
|
486 |
+
$smtp_port = $options->get( 'smtp', 'port' );
|
487 |
+
$smtp_encryption = $options->get( 'smtp', 'encryption' );
|
488 |
+
|
489 |
+
$details = array(
|
490 |
+
// [any] - cURL error 60/77.
|
491 |
+
array(
|
492 |
+
'mailer' => 'any',
|
493 |
+
'errors' => array(
|
494 |
+
array( 'cURL error 60' ),
|
495 |
+
array( 'cURL error 77' ),
|
496 |
+
),
|
497 |
+
'description' => array(
|
498 |
+
'<strong>' . esc_html__( 'SSL certificate issue.', 'wp-mail-smtp' ) . '</strong>',
|
499 |
+
esc_html__( 'This means your web server cannot reliably make secure connections (make requests to HTTPS sites).', 'wp-mail-smtp' ),
|
500 |
+
esc_html__( 'Typically this error is returned when web server is not configured properly.', 'wp-mail-smtp' ),
|
501 |
+
),
|
502 |
+
'steps' => array(
|
503 |
+
esc_html__( 'Contact your web hosting provider and inform them your site has an issue with SSL certificates.', 'wp-mail-smtp' ),
|
504 |
+
esc_html__( 'The exact error you can provide them is in the Error log, available at the bottom of this page.', 'wp-mail-smtp' ),
|
505 |
+
esc_html__( 'Ask them to resolve the issue then try again.', 'wp-mail-smtp' ),
|
506 |
+
),
|
507 |
+
),
|
508 |
+
// [any] - cURL error 6/7.
|
509 |
+
array(
|
510 |
+
'mailer' => 'any',
|
511 |
+
'errors' => array(
|
512 |
+
array( 'cURL error 6' ),
|
513 |
+
array( 'cURL error 7' ),
|
514 |
+
),
|
515 |
+
'description' => array(
|
516 |
+
'<strong>' . esc_html__( 'Could not connect to host.', 'wp-mail-smtp' ) . '</strong>',
|
517 |
+
! empty( $smtp_host )
|
518 |
+
? sprintf(
|
519 |
+
/* translators: %s - SMTP host address. */
|
520 |
+
esc_html__( 'This means your web server was unable to connect to %s.', 'wp-mail-smtp' ),
|
521 |
+
$smtp_host
|
522 |
+
)
|
523 |
+
: esc_html__( 'This means your web server was unable to connect to the host server.', 'wp-mail-smtp' ),
|
524 |
+
esc_html__( 'Typically this error is returned your web server is blocking the connections or the SMTP host denying the request.', 'wp-mail-smtp' ),
|
525 |
+
),
|
526 |
+
'steps' => array(
|
527 |
+
sprintf(
|
528 |
+
/* translators: %s - SMTP host address. */
|
529 |
+
esc_html__( 'Contact your web hosting provider and ask them to verify your server can connect to %s. Additionally, ask them if a firewall or security policy may be preventing the connection.', 'wp-mail-smtp' ),
|
530 |
+
$smtp_host
|
531 |
+
),
|
532 |
+
esc_html__( 'If using "Other SMTP" Mailer, triple check your SMTP settings including host address, email, and password.', 'wp-mail-smtp' ),
|
533 |
+
esc_html__( 'If using "Other SMTP" Mailer, contact your SMTP host to confirm they are accepting outside connections with the settings you have configured (address, username, port, security, etc).', 'wp-mail-smtp' ),
|
534 |
+
),
|
535 |
+
),
|
536 |
+
// [any] - cURL error XX (other).
|
537 |
+
array(
|
538 |
+
'mailer' => 'any',
|
539 |
+
'errors' => array(
|
540 |
+
array( 'cURL error' ),
|
541 |
+
),
|
542 |
+
'description' => array(
|
543 |
+
'<strong>' . esc_html__( 'Could not connect to your host.', 'wp-mail-smtp' ) . '</strong>',
|
544 |
+
! empty( $smtp_host )
|
545 |
+
? sprintf(
|
546 |
+
/* translators: %s - SMTP host address. */
|
547 |
+
esc_html__( 'This means your web server was unable to connect to %s.', 'wp-mail-smtp' ),
|
548 |
+
$smtp_host
|
549 |
+
)
|
550 |
+
: esc_html__( 'This means your web server was unable to connect to the host server.', 'wp-mail-smtp' ),
|
551 |
+
esc_html__( 'Typically this error is returned when web server is not configured properly.', 'wp-mail-smtp' ),
|
552 |
+
),
|
553 |
+
'steps' => array(
|
554 |
+
esc_html__( 'Contact your web hosting provider and inform them you are having issues making outbound connections.', 'wp-mail-smtp' ),
|
555 |
+
esc_html__( 'The exact error you can provide them is in the Error log, available at the bottom of this page.', 'wp-mail-smtp' ),
|
556 |
+
esc_html__( 'Ask them to resolve the issue then try again.', 'wp-mail-smtp' ),
|
557 |
+
),
|
558 |
+
),
|
559 |
+
// [smtp] - SMTP Error: Count not authenticate.
|
560 |
+
array(
|
561 |
+
'mailer' => 'smtp',
|
562 |
+
'errors' => array(
|
563 |
+
array( 'SMTP Error: Could not authenticate.' ),
|
564 |
+
),
|
565 |
+
'description' => array(
|
566 |
+
'<strong>' . esc_html__( 'Could not authenticate your SMTP account.', 'wp-mail-smtp' ) . '</strong>',
|
567 |
+
esc_html__( 'This means we were able to connect to your SMTP host, but were not able to proceed using the email/password in the settings.', 'wp-mail-smtp' ),
|
568 |
+
esc_html__( 'Typically this error is returned when the email or password is not correct or is not what the SMTP host is expecting.', 'wp-mail-smtp' ),
|
569 |
+
),
|
570 |
+
'steps' => array(
|
571 |
+
esc_html__( 'Triple check your SMTP settings including host address, email, and password. If you have recently reset your password you will need to update the settings.', 'wp-mail-smtp' ),
|
572 |
+
esc_html__( 'Contact your SMTP host to confirm you are using the correct username and password.', 'wp-mail-smtp' ),
|
573 |
+
esc_html__( 'Verify with your SMTP host that your account has permissions to send emails using outside connections.', 'wp-mail-smtp' ),
|
574 |
+
),
|
575 |
+
),
|
576 |
+
// [smtp] - Sending bulk email, hitting rate limit.
|
577 |
+
array(
|
578 |
+
'mailer' => 'smtp',
|
579 |
+
'errors' => array(
|
580 |
+
array( 'We do not authorize the use of this system to transport unsolicited' ),
|
581 |
+
),
|
582 |
+
'description' => array(
|
583 |
+
'<strong>' . esc_html__( 'Error due to unsolicited and/or bulk e-mail.', 'wp-mail-smtp' ) . '</strong>',
|
584 |
+
esc_html__( 'This means the connection to your SMTP host was made successfully, but the host rejected the email.', 'wp-mail-smtp' ),
|
585 |
+
esc_html__( 'Typically this error is returned when you are sending too many e-mails or e-mails that have been identified as spam.', 'wp-mail-smtp' ),
|
586 |
+
),
|
587 |
+
'steps' => array(
|
588 |
+
esc_html__( 'Check the emails that are sending are sending individually. Example: email is not sending to 30 recipients. You can install any WordPress e-mail logging plugin to do that.', 'wp-mail-smtp' ),
|
589 |
+
esc_html__( 'Contact your SMTP host to ask about sending/rate limits.', 'wp-mail-smtp' ),
|
590 |
+
esc_html__( 'Verify with them your SMTP account is in good standing and your account has not been flagged.', 'wp-mail-smtp' ),
|
591 |
+
),
|
592 |
+
),
|
593 |
+
// [smtp] - Unauthenticated senders not allowed.
|
594 |
+
array(
|
595 |
+
'mailer' => 'smtp',
|
596 |
+
'errors' => array(
|
597 |
+
array( 'Unauthenticated senders not allowed' ),
|
598 |
+
),
|
599 |
+
'description' => array(
|
600 |
+
'<strong>' . esc_html__( 'Unauthenticated senders are not allowed.', 'wp-mail-smtp' ) . '</strong>',
|
601 |
+
esc_html__( 'This means the connection to your SMTP host was made successfully, but you should enable Authentication and provide correct Username and Password.', 'wp-mail-smtp' ),
|
602 |
+
),
|
603 |
+
'steps' => array(
|
604 |
+
esc_html__( 'Go to WP Mail SMTP plugin Settings page.', 'wp-mail-smtp' ),
|
605 |
+
esc_html__( 'Enable Authentication', 'wp-mail-smtp' ),
|
606 |
+
esc_html__( 'Enter correct SMTP Username (usually this is an email address) and Password in the appropriate fields.', 'wp-mail-smtp' ),
|
607 |
+
),
|
608 |
+
),
|
609 |
+
// [smtp] - SMTP connect() failed.
|
610 |
+
array(
|
611 |
+
'mailer' => 'smtp',
|
612 |
+
'errors' => array(
|
613 |
+
array( 'SMTP connect() failed' ),
|
614 |
+
),
|
615 |
+
'description' => array(
|
616 |
+
'<strong>' . esc_html__( 'Could not connect to the SMTP host.', 'wp-mail-smtp' ) . '</strong>',
|
617 |
+
! empty( $smtp_host )
|
618 |
+
? sprintf(
|
619 |
+
/* translators: %s - SMTP host address. */
|
620 |
+
esc_html__( 'This means your web server was unable to connect to %s.', 'wp-mail-smtp' ),
|
621 |
+
$smtp_host
|
622 |
+
)
|
623 |
+
: esc_html__( 'This means your web server was unable to connect to the host server.', 'wp-mail-smtp' ),
|
624 |
+
esc_html__( 'Typically this error is returned for one of the following reasons:', 'wp-mail-smtp' ),
|
625 |
+
'-' . esc_html__( 'SMTP settings are incorrect (wrong port, security setting, incorrect host).', 'wp-mail-smtp' ) . '<br>' .
|
626 |
+
'-' . esc_html__( 'Your web server is blocking the connection.', 'wp-mail-smtp' ) . '<br>' .
|
627 |
+
'-' . esc_html__( 'Your SMTP host is rejecting the connection.', 'wp-mail-smtp' ),
|
628 |
+
),
|
629 |
+
'steps' => array(
|
630 |
+
esc_html__( 'Triple check your SMTP settings including host address, email, and password, port, and security.', 'wp-mail-smtp' ),
|
631 |
+
sprintf(
|
632 |
+
wp_kses(
|
633 |
+
/* translators: %1$s - SMTP host address, %2$s - SMTP port, %3$s - SMTP encryption. */
|
634 |
+
__( 'Contact your web hosting provider and ask them to verify your server can connect to %1$s on port %2$s using %3$s encryption. Additionally, ask them if a firewall or security policy may be preventing the connection - many shared hosts block certain ports.<br><strong>Note: this is the most common cause of this issue.</strong>', 'wp-mail-smtp' ),
|
635 |
+
array(
|
636 |
+
'a' => array(
|
637 |
+
'href' => array(),
|
638 |
+
'rel' => array(),
|
639 |
+
'target' => array(),
|
640 |
+
),
|
641 |
+
'strong' => array(),
|
642 |
+
'br' => array(),
|
643 |
+
)
|
644 |
+
),
|
645 |
+
$smtp_host,
|
646 |
+
$smtp_port,
|
647 |
+
'none' === $smtp_encryption ? esc_html__( 'no', 'wp-mail-smtp' ) : $smtp_encryption
|
648 |
+
),
|
649 |
+
esc_html__( 'Contact your SMTP host to confirm you are using the correct username and password.', 'wp-mail-smtp' ),
|
650 |
+
esc_html__( 'Verify with your SMTP host that your account has permissions to send emails using outside connections.', 'wp-mail-smtp' ),
|
651 |
+
),
|
652 |
+
),
|
653 |
+
// [mailgun] - Please activate your Mailgun account.
|
654 |
+
array(
|
655 |
+
'mailer' => 'mailgun',
|
656 |
+
'errors' => array(
|
657 |
+
array( 'Please activate your Mailgun account' ),
|
658 |
+
),
|
659 |
+
'description' => array(
|
660 |
+
'<strong>' . esc_html__( 'Mailgun failed.', 'wp-mail-smtp' ) . '</strong>',
|
661 |
+
esc_html__( 'It seems that you forgot to activate your Mailgun account.', 'wp-mail-smtp' ),
|
662 |
+
),
|
663 |
+
'steps' => array(
|
664 |
+
esc_html__( 'Check your inbox you used to create a Mailgun account. Click the activation link in an email from Mailgun.', 'wp-mail-smtp' ),
|
665 |
+
esc_html__( 'If you do not see activation email, go to your Mailgun control panel and resend the activation email.', 'wp-mail-smtp' ),
|
666 |
+
),
|
667 |
+
),
|
668 |
+
// [mailgun] - Forbidden.
|
669 |
+
array(
|
670 |
+
'mailer' => 'mailgun',
|
671 |
+
'errors' => array(
|
672 |
+
array( 'Forbidden' ),
|
673 |
+
),
|
674 |
+
'description' => array(
|
675 |
+
'<strong>' . esc_html__( 'Mailgun failed.', 'wp-mail-smtp' ) . '</strong>',
|
676 |
+
esc_html__( 'Typically this error is because there is an issue with your Mailgun settings, in many cases the API key.', 'wp-mail-smtp' ),
|
677 |
+
),
|
678 |
+
'steps' => array(
|
679 |
+
esc_html__( 'Verify your API key is correct.', 'wp-mail-smtp' ),
|
680 |
+
esc_html__( 'Go to your Mailgun account and view your API key.', 'wp-mail-smtp' ),
|
681 |
+
esc_html__( 'Note that the API key includes the "key" prefix, so make sure that it is in the WP Mail SMTP Mailgun API setting.', 'wp-mail-smtp' ),
|
682 |
+
),
|
683 |
+
),
|
684 |
+
// [mailgun] - Free accounts are for test purposes only.
|
685 |
+
array(
|
686 |
+
'mailer' => 'mailgun',
|
687 |
+
'errors' => array(
|
688 |
+
array( 'Free accounts are for test purposes only' ),
|
689 |
+
),
|
690 |
+
'description' => array(
|
691 |
+
'<strong>' . esc_html__( 'Mailgun failed.', 'wp-mail-smtp' ) . '</strong>',
|
692 |
+
esc_html__( 'Your Mailgun account does not have access to send emails.', 'wp-mail-smtp' ),
|
693 |
+
esc_html__( 'Typically this error is because you have not set up and/or complete domain name verification for your Mailgun account.', 'wp-mail-smtp' ),
|
694 |
+
),
|
695 |
+
'steps' => array(
|
696 |
+
sprintf(
|
697 |
+
wp_kses(
|
698 |
+
/* translators: %s - Mailgun documentation URL. */
|
699 |
+
__( 'Go to our how-to guide for setting up <a href="%s" target="_blank" rel="noopener noreferrer">Mailgun with WP Mail SMTP</a>.', 'wp-mail-smtp' ),
|
700 |
+
array(
|
701 |
+
'a' => array(
|
702 |
+
'href' => array(),
|
703 |
+
'rel' => array(),
|
704 |
+
'target' => array(),
|
705 |
+
),
|
706 |
+
)
|
707 |
+
),
|
708 |
+
'https://wpforms.com/how-to-send-wordpress-emails-with-mailgun/'
|
709 |
+
),
|
710 |
+
esc_html__( 'Complete the steps in section "2. Verify Your Domain".', 'wp-mail-smtp' ),
|
711 |
+
),
|
712 |
+
),
|
713 |
+
// [gmail] - 401: Login Required.
|
714 |
+
array(
|
715 |
+
'mailer' => 'gmail',
|
716 |
+
'errors' => array(
|
717 |
+
array( '401', 'Login Required' ),
|
718 |
+
),
|
719 |
+
'description' => array(
|
720 |
+
'<strong>' . esc_html__( 'Google API Error.', 'wp-mail-smtp' ) . '</strong>',
|
721 |
+
esc_html__( 'You have not properly configured Gmail mailer.', 'wp-mail-smtp' ),
|
722 |
+
esc_html__( 'Make sure that you have clicked the "Allow plugin to send emails using your Google account" button under Gmail settings.', 'wp-mail-smtp' ),
|
723 |
+
),
|
724 |
+
'steps' => array(
|
725 |
+
esc_html__( 'Go to plugin Settings page and click the "Allow plugin to send emails using your Google account" button.', 'wp-mail-smtp' ),
|
726 |
+
esc_html__( 'After the click you should be redirected to a Gmail authorization screen, where you will be asked a permission to send emails on your behalf.', 'wp-mail-smtp' ),
|
727 |
+
esc_html__( 'Please click "Agree", if you see that button. If not - you will need to enable less secure apps first:', 'wp-mail-smtp' )
|
728 |
+
. '<ul>'
|
729 |
+
. '<li>' .
|
730 |
+
sprintf(
|
731 |
+
wp_kses(
|
732 |
+
/* translators: %s - Google support article URL. */
|
733 |
+
__( 'if you are using regular Gmail account, please <a href="%s" target="_blank" rel="noopener noreferrer">read this article</a> to proceed.', 'wp-mail-smtp' ),
|
734 |
+
array(
|
735 |
+
'a' => array(
|
736 |
+
'href' => array(),
|
737 |
+
'target' => array(),
|
738 |
+
'rel' => array(),
|
739 |
+
),
|
740 |
+
)
|
741 |
+
),
|
742 |
+
'https://support.google.com/accounts/answer/6010255?hl=en'
|
743 |
+
)
|
744 |
+
. '</li>'
|
745 |
+
. '<li>' .
|
746 |
+
sprintf(
|
747 |
+
wp_kses(
|
748 |
+
/* translators: %s - Google support article URL. */
|
749 |
+
__( 'if you are using G Suite, please <a href="%s" target="_blank" rel="noopener noreferrer">read this article</a> to proceed.', 'wp-mail-smtp' ),
|
750 |
+
array(
|
751 |
+
'a' => array(
|
752 |
+
'href' => array(),
|
753 |
+
'target' => array(),
|
754 |
+
'rel' => array(),
|
755 |
+
),
|
756 |
+
)
|
757 |
+
),
|
758 |
+
'https://support.google.com/cloudidentity/answer/6260879?hl=en'
|
759 |
+
)
|
760 |
+
. '</li>'
|
761 |
+
. '</ul>',
|
762 |
+
),
|
763 |
+
),
|
764 |
+
// [gmail] - 400: Recipient address required.
|
765 |
+
array(
|
766 |
+
'mailer' => 'gmail',
|
767 |
+
'errors' => array(
|
768 |
+
array( '400', 'Recipient address required' ),
|
769 |
+
),
|
770 |
+
'description' => array(
|
771 |
+
'<strong>' . esc_html__( 'Google API Error.', 'wp-mail-smtp' ) . '</strong>',
|
772 |
+
esc_html__( 'Typically this error is because address the email was sent to is invalid or was empty.', 'wp-mail-smtp' ),
|
773 |
+
),
|
774 |
+
'steps' => array(
|
775 |
+
esc_html__( 'Check the "Send To" email address used and confirm it is a valid email and was not empty.', 'wp-mail-smtp' ),
|
776 |
+
sprintf(
|
777 |
+
/* translators: 1 - correct email address example. 2 - incorrect email address example. */
|
778 |
+
esc_html__( 'It should be something like this: %1$s. These are incorrect values: %2$s.', 'wp-mail-smtp' ),
|
779 |
+
'<code>info@example.com</code>',
|
780 |
+
'<code>info@localhost</code>, <code>info@192.168.1.1</code>'
|
781 |
+
),
|
782 |
+
esc_html__( 'Make sure that the generated email has a TO header, useful when you are responsible for email creation.', 'wp-mail-smtp' ),
|
783 |
+
),
|
784 |
+
),
|
785 |
+
// [gmail] - Token has been expired or revoked.
|
786 |
+
array(
|
787 |
+
'mailer' => 'gmail',
|
788 |
+
'errors' => array(
|
789 |
+
array( 'invalid_grant', 'Token has been expired or revoked' ),
|
790 |
+
),
|
791 |
+
'description' => array(
|
792 |
+
'<strong>' . esc_html__( 'Google API Error.', 'wp-mail-smtp' ) . '</strong>',
|
793 |
+
esc_html__( 'Unfortunately, this error can be due to many different reasons.', 'wp-mail-smtp' ),
|
794 |
+
),
|
795 |
+
'steps' => array(
|
796 |
+
sprintf(
|
797 |
+
wp_kses(
|
798 |
+
/* translators: %s - Blog article URL. */
|
799 |
+
__( 'Please <a href="%s" target="_blank" rel="noopener noreferrer">read this article</a> to learn more about what can cause this error and how it can be resolved.', 'wp-mail-smtp' ),
|
800 |
+
array(
|
801 |
+
'a' => array(
|
802 |
+
'href' => array(),
|
803 |
+
'target' => array(),
|
804 |
+
'rel' => array(),
|
805 |
+
),
|
806 |
+
)
|
807 |
+
),
|
808 |
+
'https://blog.timekit.io/google-oauth-invalid-grant-nightmare-and-how-to-fix-it-9f4efaf1da35'
|
809 |
+
),
|
810 |
+
),
|
811 |
+
),
|
812 |
+
// [gmail] - Code was already redeemed.
|
813 |
+
array(
|
814 |
+
'mailer' => 'gmail',
|
815 |
+
'errors' => array(
|
816 |
+
array( 'invalid_grant', 'Code was already redeemed' ),
|
817 |
+
),
|
818 |
+
'description' => array(
|
819 |
+
'<strong>' . esc_html__( 'Google API Error.', 'wp-mail-smtp' ) . '</strong>',
|
820 |
+
esc_html__( 'Authentication code that Google returned to you has already been used on your previous auth attempt.', 'wp-mail-smtp' ),
|
821 |
+
),
|
822 |
+
'steps' => array(
|
823 |
+
esc_html__( 'Make sure that you are not trying to manually clean up the plugin options to retry the "Allow..." step.', 'wp-mail-smtp' ),
|
824 |
+
esc_html__( 'Reinstall the plugin with clean plugin data turned on on Misc page. This will remove all the plugin options and you will be safe to retry.', 'wp-mail-smtp' ),
|
825 |
+
esc_html__( 'Make sure there is no aggressive caching on site admin area pages or try to clean cache between attempts.', 'wp-mail-smtp' ),
|
826 |
+
),
|
827 |
+
),
|
828 |
+
// [gmail] - 400: Mail service not enabled.
|
829 |
+
array(
|
830 |
+
'mailer' => 'gmail',
|
831 |
+
'errors' => array(
|
832 |
+
array( '400', 'Mail service not enabled' ),
|
833 |
+
),
|
834 |
+
'description' => array(
|
835 |
+
'<strong>' . esc_html__( 'Google API Error.', 'wp-mail-smtp' ) . '</strong>',
|
836 |
+
esc_html__( 'There are various reasons for that, please review the steps below.', 'wp-mail-smtp' ),
|
837 |
+
),
|
838 |
+
'steps' => array(
|
839 |
+
sprintf(
|
840 |
+
wp_kses(
|
841 |
+
/* translators: %s - Google G Suite Admin area URL. */
|
842 |
+
__( 'Make sure that your G Suite trial period has not expired. You can check the status <a href="%s" target="_blank" rel="noopener noreferrer">here</a>.', 'wp-mail-smtp' ),
|
843 |
+
array(
|
844 |
+
'a' => array(
|
845 |
+
'href' => array(),
|
846 |
+
'rel' => array(),
|
847 |
+
'target' => array(),
|
848 |
+
),
|
849 |
+
)
|
850 |
+
),
|
851 |
+
'https://admin.google.com'
|
852 |
+
),
|
853 |
+
sprintf(
|
854 |
+
wp_kses(
|
855 |
+
/* translators: %s - Google G Suite Admin area URL. */
|
856 |
+
__( 'Make sure that Gmail app in your G Suite is actually enabled. You can check that in Apps list in <a href="%s" target="_blank" rel="noopener noreferrer">G Suite Admin</a> area.', 'wp-mail-smtp' ),
|
857 |
+
array(
|
858 |
+
'a' => array(
|
859 |
+
'href' => array(),
|
860 |
+
'rel' => array(),
|
861 |
+
'target' => array(),
|
862 |
+
),
|
863 |
+
)
|
864 |
+
),
|
865 |
+
'https://admin.google.com'
|
866 |
+
),
|
867 |
+
sprintf(
|
868 |
+
wp_kses(
|
869 |
+
/* translators: %s - Google Developers Console URL. */
|
870 |
+
__( 'Make sure that you have Gmail API enabled, and you can do that <a href="%s" target="_blank" rel="noopener noreferrer">here</a>.', 'wp-mail-smtp' ),
|
871 |
+
array(
|
872 |
+
'a' => array(
|
873 |
+
'href' => array(),
|
874 |
+
'rel' => array(),
|
875 |
+
'target' => array(),
|
876 |
+
),
|
877 |
+
)
|
878 |
+
),
|
879 |
+
'https://console.developers.google.com/'
|
880 |
+
),
|
881 |
+
),
|
882 |
+
),
|
883 |
+
// [gmail] - 403: Project X is not found and cannot be used for API calls.
|
884 |
+
array(
|
885 |
+
'mailer' => 'gmail',
|
886 |
+
'errors' => array(
|
887 |
+
array( '403', 'is not found and cannot be used for API calls' ),
|
888 |
+
),
|
889 |
+
'description' => array(
|
890 |
+
'<strong>' . esc_html__( 'Google API Error.', 'wp-mail-smtp' ) . '</strong>',
|
891 |
+
),
|
892 |
+
'steps' => array(
|
893 |
+
esc_html__( 'Make sure that the used Client ID/Secret correspond to a proper project that has Gmail API enabled.', 'wp-mail-smtp' ),
|
894 |
+
sprintf(
|
895 |
+
wp_kses(
|
896 |
+
/* translators: %s - WPForms.com tutorial URL. */
|
897 |
+
esc_html__( 'Please follow our <a href="%s" target="_blank" rel="noopener noreferrer">Gmail tutorial</a> to be sure that all the correct project and data is applied.', 'wp-mail-smtp' ),
|
898 |
+
array(
|
899 |
+
'a' => array(
|
900 |
+
'href' => array(),
|
901 |
+
'rel' => array(),
|
902 |
+
'target' => array(),
|
903 |
+
),
|
904 |
+
)
|
905 |
+
),
|
906 |
+
'https://wpforms.com/how-to-securely-send-wordpress-emails-using-gmail-smtp/'
|
907 |
+
),
|
908 |
+
),
|
909 |
+
),
|
910 |
+
// [gmail] - The OAuth client was disabled.
|
911 |
+
array(
|
912 |
+
'mailer' => 'gmail',
|
913 |
+
'errors' => array(
|
914 |
+
array( 'disabled_client', 'The OAuth client was disabled' ),
|
915 |
+
),
|
916 |
+
'description' => array(
|
917 |
+
'<strong>' . esc_html__( 'Google API Error.', 'wp-mail-smtp' ) . '</strong>',
|
918 |
+
esc_html__( 'You may have added a new API to a project', 'wp-mail-smtp' ),
|
919 |
+
),
|
920 |
+
'steps' => array(
|
921 |
+
esc_html__( 'Make sure that the used Client ID/Secret correspond to a proper project that has Gmail API enabled.', 'wp-mail-smtp' ),
|
922 |
+
esc_html__( 'Try to use a separate project for your emails, so the project has only 1 Gmail API in it enabled. You will need to remove the old project and create a new one from scratch.', 'wp-mail-smtp' ),
|
923 |
+
),
|
924 |
+
),
|
925 |
+
);
|
926 |
+
|
927 |
+
// Error detection logic.
|
928 |
+
foreach ( $details as $data ) {
|
929 |
+
|
930 |
+
// Check for appropriate mailer.
|
931 |
+
if ( 'any' !== $data['mailer'] && $this->debug['mailer'] !== $data['mailer'] ) {
|
932 |
+
continue;
|
933 |
+
}
|
934 |
+
|
935 |
+
$match = false;
|
936 |
+
|
937 |
+
// Attempt to detect errors.
|
938 |
+
foreach ( $data['errors'] as $error_group ) {
|
939 |
+
foreach ( $error_group as $error_code => $error_message ) {
|
940 |
+
$match = ( false !== strpos( $this->debug['error_log'], $error_message ) || false !== strpos( $this->debug['error_log'], $error_message ) );
|
941 |
+
if ( ! $match ) {
|
942 |
+
break;
|
943 |
+
}
|
944 |
+
}
|
945 |
+
if ( $match ) {
|
946 |
+
break;
|
947 |
+
}
|
948 |
+
}
|
949 |
+
|
950 |
+
if ( $match ) {
|
951 |
+
return $data;
|
952 |
+
}
|
953 |
+
}
|
954 |
+
|
955 |
+
// Return defaults.
|
956 |
+
return array(
|
957 |
+
'description' => array(
|
958 |
+
'<strong>' . esc_html__( 'An issue was detected.', 'wp-mail-smtp' ) . '</strong>',
|
959 |
+
esc_html__( 'This means your test email was unable to be sent.', 'wp-mail-smtp' ),
|
960 |
+
esc_html__( 'Typically this error is returned for one of the following reasons:', 'wp-mail-smtp' ),
|
961 |
+
'- ' . esc_html__( 'Plugin settings are incorrect (wrong SMTP settings, invalid Mailer configuration, etc).', 'wp-mail-smtp' ) . '<br>' .
|
962 |
+
'- ' . esc_html__( 'Your web server is blocking the connection.', 'wp-mail-smtp' ) . '<br>' .
|
963 |
+
'- ' . esc_html__( 'Your host is rejecting the connection.', 'wp-mail-smtp' ),
|
964 |
+
),
|
965 |
+
'steps' => array(
|
966 |
+
esc_html__( 'Triple check the plugin settings, consider reconfiguring to make sure everything is correct (eg bad copy and paste).', 'wp-mail-smtp' ),
|
967 |
+
wp_kses(
|
968 |
+
__( 'Contact your web hosting provider and ask them to verify your server can make outside connections. Additionally, ask them if a firewall or security policy may be preventing the connection - many shared hosts block certain ports.<br><strong>Note: this is the most common cause of this issue.</strong>', 'wp-mail-smtp' ),
|
969 |
+
array(
|
970 |
+
'strong' => array(),
|
971 |
+
'br' => array(),
|
972 |
+
)
|
973 |
+
),
|
974 |
+
esc_html__( 'Try using a different mailer.', 'wp-mail-smtp' ),
|
975 |
+
),
|
976 |
+
);
|
977 |
+
}
|
978 |
+
|
979 |
+
/**
|
980 |
+
* Displays all the various error and debug details.
|
981 |
+
*
|
982 |
+
* @since 1.3.0
|
983 |
+
*/
|
984 |
+
protected function display_debug_details() {
|
985 |
+
|
986 |
+
if ( empty( $this->debug ) ) {
|
987 |
+
return;
|
988 |
+
}
|
989 |
+
|
990 |
+
$debug = $this->get_debug_details();
|
991 |
+
?>
|
992 |
+
<div id="message" class="notice-error notice-inline">
|
993 |
+
<p><strong><?php esc_html_e( 'There was a problem while sending the test email.', 'wp-mail-smtp' ); ?></strong></p>
|
994 |
+
</div>
|
995 |
+
|
996 |
+
<div id="wp-mail-smtp-debug">
|
997 |
+
<?php
|
998 |
+
foreach ( $debug['description'] as $description ) {
|
999 |
+
echo '<p>' . $description . '</p>';
|
1000 |
+
}
|
1001 |
+
?>
|
1002 |
+
|
1003 |
+
<h2><?php esc_html_e( 'Recommended next steps:', 'wp-mail-smtp' ); ?></h2>
|
1004 |
+
|
1005 |
+
<ol>
|
1006 |
+
<?php
|
1007 |
+
foreach ( $debug['steps'] as $step ) {
|
1008 |
+
echo '<li>' . $step . '</li>';
|
1009 |
+
}
|
1010 |
+
?>
|
1011 |
+
</ol>
|
1012 |
+
|
1013 |
+
<h2><?php esc_html_e( 'Need support?', 'wp-mail-smtp' ); ?></h2>
|
1014 |
+
|
1015 |
+
<?php if ( wp_mail_smtp()->is_pro() ) : ?>
|
1016 |
+
|
1017 |
+
<p>
|
1018 |
+
<?php
|
1019 |
+
printf(
|
1020 |
+
wp_kses( /* translators: %s - WPMailSMTP.com account area link. */
|
1021 |
+
__( 'As a WP Mail SMTP Pro user you have access to WP Mail SMTP priority support. Please log in to your WPMailSMTP.com account and <a href="%s" target="_blank" rel="noopener noreferrer">submit a support ticket</a>.', 'wp-mail-smtp' ),
|
1022 |
+
array(
|
1023 |
+
'a' => array(
|
1024 |
+
'href' => array(),
|
1025 |
+
'rel' => array(),
|
1026 |
+
'target' => array(),
|
1027 |
+
),
|
1028 |
+
)
|
1029 |
+
),
|
1030 |
+
'https://wpmailsmtp.com/account/support/'
|
1031 |
+
);
|
1032 |
+
?>
|
1033 |
+
</p>
|
1034 |
+
|
1035 |
+
<?php else : ?>
|
1036 |
+
|
1037 |
+
<p>
|
1038 |
+
<?php esc_html_e( 'WP Mail SMTP is a free plugin, and the team behind WPForms maintains it to give back to the WordPress community.', 'wp-mail-smtp' ); ?>
|
1039 |
+
</p>
|
1040 |
+
|
1041 |
+
<p>
|
1042 |
+
<?php
|
1043 |
+
printf(
|
1044 |
+
wp_kses( /* translators: %s - WPMailSMTP.com URL. */
|
1045 |
+
__( 'To access our world class support, please <a href="%s" target="_blank" rel="noopener noreferrer">upgrade to WP Mail SMTP Pro</a>. Along with getting expert support, you will also get Notification controls, Email Logging, and integrations for Amazon SES, Office 365, and Outlook.com.', 'wp-mail-smtp' ),
|
1046 |
+
array(
|
1047 |
+
'a' => array(
|
1048 |
+
'href' => array(),
|
1049 |
+
'target' => array(),
|
1050 |
+
'rel' => array(),
|
1051 |
+
),
|
1052 |
+
)
|
1053 |
+
),
|
1054 |
+
esc_url( wp_mail_smtp()->get_upgrade_link( 'email-test-fail' ) )
|
1055 |
+
)
|
1056 |
+
?>
|
1057 |
+
</p>
|
1058 |
+
|
1059 |
+
<p>
|
1060 |
+
<?php esc_html_e( 'Additionally, you can take advantage of our White Glove Setup. Sit back and relax while we handle everything for you! If you simply don\'t have time or maybe you feel a bit in over your head - we got you covered.', 'wp-mail-smtp' ); ?>
|
1061 |
+
</p>
|
1062 |
+
|
1063 |
+
<p>
|
1064 |
+
<?php
|
1065 |
+
echo wp_kses(
|
1066 |
+
__( 'As a valued WP Mail SMTP user, you will get <span class="price-off">20% off regular pricing</span>, automatically applied at checkout!', 'wp-mail-smtp' ),
|
1067 |
+
array(
|
1068 |
+
'span' => array(
|
1069 |
+
'class' => array(),
|
1070 |
+
),
|
1071 |
+
)
|
1072 |
+
);
|
1073 |
+
?>
|
1074 |
+
</p>
|
1075 |
+
|
1076 |
+
<p>
|
1077 |
+
<?php
|
1078 |
+
printf(
|
1079 |
+
wp_kses( /* translators: %1$s - WP Mail SMTP support policy URL, %2$s - WP Mail SMTP support forum URL, %3$s - WPMailSMTP.com URL. */
|
1080 |
+
__( 'Alternatively, we also offer <a href="%1$s" target="_blank" rel="noopener noreferrer">limited support</a> on the WordPress.org support forums. You can <a href="%2$s" target="_blank" rel="noopener noreferrer">create a support thread</a> there, but please understand that free support is not guaranteed and is limited to simple issues. If you have an urgent or complex issue, then please consider <a href="%3$s" target="_blank" rel="noopener noreferrer">upgrading to WP Mail SMTP Pro</a> to access our priority support ticket system.', 'wp-mail-smtp' ),
|
1081 |
+
array(
|
1082 |
+
'a' => array(
|
1083 |
+
'href' => array(),
|
1084 |
+
'rel' => array(),
|
1085 |
+
'target' => array(),
|
1086 |
+
),
|
1087 |
+
)
|
1088 |
+
),
|
1089 |
+
'https://wordpress.org/support/topic/wp-mail-smtp-support-policy/',
|
1090 |
+
'https://wordpress.org/support/plugin/wp-mail-smtp/',
|
1091 |
+
esc_url( wp_mail_smtp()->get_upgrade_link( 'email-test-fail' ) )
|
1092 |
+
);
|
1093 |
+
?>
|
1094 |
+
</p>
|
1095 |
+
|
1096 |
+
<?php endif; ?>
|
1097 |
+
|
1098 |
+
<p>
|
1099 |
+
<a href="#" class="error-log-toggle">
|
1100 |
+
<span class="dashicons dashicons-arrow-right-alt2"></span>
|
1101 |
+
<strong><?php esc_html_e( 'Click here to view the full Error Log for debugging', 'wp-mail-smtp' ); ?></strong>
|
1102 |
+
</a>
|
1103 |
+
</p>
|
1104 |
+
|
1105 |
+
<div class="error-log">
|
1106 |
+
<?php echo $this->debug['error_log']; ?>
|
1107 |
+
</div>
|
1108 |
+
|
1109 |
+
<p class="error-log-note">
|
1110 |
+
<em><?php esc_html_e( 'Please copy only the content of the error debug message above, identified with an orange left border, into the support forum topic if you experience any issues.', 'wp-mail-smtp' ); ?></em>
|
1111 |
+
</p>
|
1112 |
+
</div>
|
1113 |
+
<?php
|
1114 |
+
}
|
1115 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/Core.php
CHANGED
@@ -1,719 +1,738 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPMailSMTP;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Class Core to handle all plugin initialization.
|
7 |
-
*
|
8 |
-
* @since 1.0.0
|
9 |
-
*/
|
10 |
-
class Core {
|
11 |
-
|
12 |
-
/**
|
13 |
-
* URL to plugin directory.
|
14 |
-
*
|
15 |
-
* @since 1.0.0
|
16 |
-
*
|
17 |
-
* @var string Without trailing slash.
|
18 |
-
*/
|
19 |
-
public $plugin_url;
|
20 |
-
|
21 |
-
/**
|
22 |
-
* URL to Lite plugin assets directory.
|
23 |
-
*
|
24 |
-
* @since 1.5.0
|
25 |
-
*
|
26 |
-
* @var string Without trailing slash.
|
27 |
-
*/
|
28 |
-
public $assets_url;
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Path to plugin directory.
|
32 |
-
*
|
33 |
-
* @since 1.0.0
|
34 |
-
*
|
35 |
-
* @var string Without trailing slash.
|
36 |
-
*/
|
37 |
-
public $plugin_path;
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Shortcut to get access to Pro functionality using wp_mail_smtp()->pro->example().
|
41 |
-
*
|
42 |
-
* @since 1.5.0
|
43 |
-
*
|
44 |
-
* @var \WPMailSMTP\Pro\Pro
|
45 |
-
*/
|
46 |
-
public $pro;
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Core constructor.
|
50 |
-
*
|
51 |
-
* @since 1.0.0
|
52 |
-
*/
|
53 |
-
public function __construct() {
|
54 |
-
|
55 |
-
$this->plugin_url = rtrim( plugin_dir_url( __DIR__ ), '/\\' );
|
56 |
-
$this->assets_url = $this->plugin_url . '/assets';
|
57 |
-
$this->plugin_path = rtrim( plugin_dir_path( __DIR__ ), '/\\' );
|
58 |
-
|
59 |
-
if ( $this->is_not_loadable() ) {
|
60 |
-
$this->do_not_load();
|
61 |
-
|
62 |
-
return;
|
63 |
-
}
|
64 |
-
|
65 |
-
// Finally, load all the plugin.
|
66 |
-
$this->hooks();
|
67 |
-
$this->init_early();
|
68 |
-
}
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Currently used for Pro version only.
|
72 |
-
*
|
73 |
-
* @since 1.5.0
|
74 |
-
*
|
75 |
-
* @return bool
|
76 |
-
*/
|
77 |
-
protected function is_not_loadable() {
|
78 |
-
|
79 |
-
// Check the Pro.
|
80 |
-
if (
|
81 |
-
is_readable( $this->plugin_path . '/src/Pro/Pro.php' ) &&
|
82 |
-
! $this->is_pro_allowed()
|
83 |
-
) {
|
84 |
-
// So there is a Pro version, but its PHP version check failed.
|
85 |
-
return true;
|
86 |
-
}
|
87 |
-
|
88 |
-
return false;
|
89 |
-
}
|
90 |
-
|
91 |
-
/**
|
92 |
-
* What to do if plugin is not loaded.
|
93 |
-
*
|
94 |
-
* @since 1.5.0
|
95 |
-
*/
|
96 |
-
protected function do_not_load() {
|
97 |
-
|
98 |
-
add_action( 'admin_notices', function () {
|
99 |
-
|
100 |
-
?>
|
101 |
-
<div class="notice notice-error">
|
102 |
-
<p>
|
103 |
-
<?php
|
104 |
-
printf(
|
105 |
-
wp_kses( /* translators: %1$s - WPBeginner URL for recommended WordPress hosting. */
|
106 |
-
__( 'Your site is running an <strong>insecure version</strong> of PHP that is no longer supported. Please contact your web hosting provider to update your PHP version or switch to a <a href="%1$s" target="_blank" rel="noopener noreferrer">recommended WordPress hosting company</a>.', 'wp-mail-smtp' ),
|
107 |
-
array(
|
108 |
-
'a' => array(
|
109 |
-
'href' => array(),
|
110 |
-
'target' => array(),
|
111 |
-
'rel' => array(),
|
112 |
-
),
|
113 |
-
'strong' => array(),
|
114 |
-
)
|
115 |
-
),
|
116 |
-
'https://www.wpbeginner.com/wordpress-hosting/'
|
117 |
-
);
|
118 |
-
?>
|
119 |
-
<br><br>
|
120 |
-
<?php
|
121 |
-
printf(
|
122 |
-
wp_kses( /* translators: %s - WPForms.com docs URL with more details. */
|
123 |
-
__( '<strong>Note:</strong> WP Mail SMTP plugin is disabled on your site until you fix the issue. <a href="%s" target="_blank" rel="noopener noreferrer">Read more for additional information.</a>', 'wp-mail-smtp' ),
|
124 |
-
array(
|
125 |
-
'a' => array(
|
126 |
-
'href' => array(),
|
127 |
-
'target' => array(),
|
128 |
-
'rel' => array(),
|
129 |
-
),
|
130 |
-
'strong' => array(),
|
131 |
-
)
|
132 |
-
),
|
133 |
-
'https://wpforms.com/docs/supported-php-version/'
|
134 |
-
);
|
135 |
-
?>
|
136 |
-
</p>
|
137 |
-
</div>
|
138 |
-
|
139 |
-
<?php
|
140 |
-
|
141 |
-
// In case this is on plugin activation.
|
142 |
-
if ( isset( $_GET['activate'] ) ) { //phpcs:ignore
|
143 |
-
unset( $_GET['activate'] ); //phpcs:ignore
|
144 |
-
}
|
145 |
-
} );
|
146 |
-
}
|
147 |
-
|
148 |
-
/**
|
149 |
-
* Assign all hooks to proper places.
|
150 |
-
*
|
151 |
-
* @since 1.0.0
|
152 |
-
*/
|
153 |
-
public function hooks() {
|
154 |
-
|
155 |
-
// Activation hook.
|
156 |
-
add_action( 'activate_plugin', array( $this, 'activate' ), 10, 2 );
|
157 |
-
|
158 |
-
// Redefine PHPMailer.
|
159 |
-
add_action( 'plugins_loaded', array( $this, 'get_processor' ) );
|
160 |
-
add_action( 'plugins_loaded', array( $this, 'replace_phpmailer' ) );
|
161 |
-
|
162 |
-
// Various notifications.
|
163 |
-
add_action( 'admin_init', array( $this, 'init_notifications' ) );
|
164 |
-
|
165 |
-
add_action( 'init', array( $this, 'init' ) );
|
166 |
-
|
167 |
-
add_action( 'plugins_loaded', array( $this, 'get_pro' ) );
|
168 |
-
}
|
169 |
-
|
170 |
-
/**
|
171 |
-
* Initial plugin actions.
|
172 |
-
*
|
173 |
-
* @since 1.0.0
|
174 |
-
*/
|
175 |
-
public function init() {
|
176 |
-
|
177 |
-
// Load translations just in case.
|
178 |
-
load_plugin_textdomain( 'wp-mail-smtp', false, plugin_basename( wp_mail_smtp()->plugin_path ) . '/assets/languages' );
|
179 |
-
|
180 |
-
/*
|
181 |
-
* Constantly check in admin area, that we don't need to upgrade DB.
|
182 |
-
* Do not wait for the `admin_init` hook, because some actions are already done
|
183 |
-
* on `plugins_loaded`, so migration has to be done before.
|
184 |
-
* We should not fire this in AJAX requests.
|
185 |
-
*/
|
186 |
-
if ( WP::in_wp_admin() ) {
|
187 |
-
$this->get_migration();
|
188 |
-
$this->get_upgrade();
|
189 |
-
$this->detect_conflicts();
|
190 |
-
}
|
191 |
-
|
192 |
-
// In admin area, regardless of AJAX or not AJAX request.
|
193 |
-
if ( is_admin() ) {
|
194 |
-
$this->get_admin();
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
add_action( 'admin_notices', array(
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
*
|
207 |
-
*
|
208 |
-
* @since 1.
|
209 |
-
*
|
210 |
-
*
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
*
|
230 |
-
*
|
231 |
-
*
|
232 |
-
*
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
*
|
250 |
-
* -
|
251 |
-
* - before
|
252 |
-
*
|
253 |
-
*
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
*
|
274 |
-
*
|
275 |
-
*
|
276 |
-
*
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
*
|
292 |
-
*
|
293 |
-
*
|
294 |
-
*
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
*
|
310 |
-
*
|
311 |
-
*
|
312 |
-
*
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
*
|
328 |
-
*
|
329 |
-
*
|
330 |
-
*
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
*
|
346 |
-
*
|
347 |
-
*
|
348 |
-
*
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
*
|
364 |
-
*
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
'
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
*
|
569 |
-
*
|
570 |
-
* @since 1.0.
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
*
|
588 |
-
*
|
589 |
-
* @
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
*
|
602 |
-
*
|
603 |
-
* @
|
604 |
-
* @
|
605 |
-
*
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
*
|
621 |
-
*
|
622 |
-
* @
|
623 |
-
*
|
624 |
-
*
|
625 |
-
*/
|
626 |
-
public function
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
*
|
652 |
-
*
|
653 |
-
*
|
654 |
-
*
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
*
|
670 |
-
*
|
671 |
-
* @since 1.5.
|
672 |
-
*
|
673 |
-
* @
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
$
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPMailSMTP;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Class Core to handle all plugin initialization.
|
7 |
+
*
|
8 |
+
* @since 1.0.0
|
9 |
+
*/
|
10 |
+
class Core {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* URL to plugin directory.
|
14 |
+
*
|
15 |
+
* @since 1.0.0
|
16 |
+
*
|
17 |
+
* @var string Without trailing slash.
|
18 |
+
*/
|
19 |
+
public $plugin_url;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* URL to Lite plugin assets directory.
|
23 |
+
*
|
24 |
+
* @since 1.5.0
|
25 |
+
*
|
26 |
+
* @var string Without trailing slash.
|
27 |
+
*/
|
28 |
+
public $assets_url;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Path to plugin directory.
|
32 |
+
*
|
33 |
+
* @since 1.0.0
|
34 |
+
*
|
35 |
+
* @var string Without trailing slash.
|
36 |
+
*/
|
37 |
+
public $plugin_path;
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Shortcut to get access to Pro functionality using wp_mail_smtp()->pro->example().
|
41 |
+
*
|
42 |
+
* @since 1.5.0
|
43 |
+
*
|
44 |
+
* @var \WPMailSMTP\Pro\Pro
|
45 |
+
*/
|
46 |
+
public $pro;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Core constructor.
|
50 |
+
*
|
51 |
+
* @since 1.0.0
|
52 |
+
*/
|
53 |
+
public function __construct() {
|
54 |
+
|
55 |
+
$this->plugin_url = rtrim( plugin_dir_url( __DIR__ ), '/\\' );
|
56 |
+
$this->assets_url = $this->plugin_url . '/assets';
|
57 |
+
$this->plugin_path = rtrim( plugin_dir_path( __DIR__ ), '/\\' );
|
58 |
+
|
59 |
+
if ( $this->is_not_loadable() ) {
|
60 |
+
$this->do_not_load();
|
61 |
+
|
62 |
+
return;
|
63 |
+
}
|
64 |
+
|
65 |
+
// Finally, load all the plugin.
|
66 |
+
$this->hooks();
|
67 |
+
$this->init_early();
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Currently used for Pro version only.
|
72 |
+
*
|
73 |
+
* @since 1.5.0
|
74 |
+
*
|
75 |
+
* @return bool
|
76 |
+
*/
|
77 |
+
protected function is_not_loadable() {
|
78 |
+
|
79 |
+
// Check the Pro.
|
80 |
+
if (
|
81 |
+
is_readable( $this->plugin_path . '/src/Pro/Pro.php' ) &&
|
82 |
+
! $this->is_pro_allowed()
|
83 |
+
) {
|
84 |
+
// So there is a Pro version, but its PHP version check failed.
|
85 |
+
return true;
|
86 |
+
}
|
87 |
+
|
88 |
+
return false;
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* What to do if plugin is not loaded.
|
93 |
+
*
|
94 |
+
* @since 1.5.0
|
95 |
+
*/
|
96 |
+
protected function do_not_load() {
|
97 |
+
|
98 |
+
add_action( 'admin_notices', function () {
|
99 |
+
|
100 |
+
?>
|
101 |
+
<div class="notice notice-error">
|
102 |
+
<p>
|
103 |
+
<?php
|
104 |
+
printf(
|
105 |
+
wp_kses( /* translators: %1$s - WPBeginner URL for recommended WordPress hosting. */
|
106 |
+
__( 'Your site is running an <strong>insecure version</strong> of PHP that is no longer supported. Please contact your web hosting provider to update your PHP version or switch to a <a href="%1$s" target="_blank" rel="noopener noreferrer">recommended WordPress hosting company</a>.', 'wp-mail-smtp' ),
|
107 |
+
array(
|
108 |
+
'a' => array(
|
109 |
+
'href' => array(),
|
110 |
+
'target' => array(),
|
111 |
+
'rel' => array(),
|
112 |
+
),
|
113 |
+
'strong' => array(),
|
114 |
+
)
|
115 |
+
),
|
116 |
+
'https://www.wpbeginner.com/wordpress-hosting/'
|
117 |
+
);
|
118 |
+
?>
|
119 |
+
<br><br>
|
120 |
+
<?php
|
121 |
+
printf(
|
122 |
+
wp_kses( /* translators: %s - WPForms.com docs URL with more details. */
|
123 |
+
__( '<strong>Note:</strong> WP Mail SMTP plugin is disabled on your site until you fix the issue. <a href="%s" target="_blank" rel="noopener noreferrer">Read more for additional information.</a>', 'wp-mail-smtp' ),
|
124 |
+
array(
|
125 |
+
'a' => array(
|
126 |
+
'href' => array(),
|
127 |
+
'target' => array(),
|
128 |
+
'rel' => array(),
|
129 |
+
),
|
130 |
+
'strong' => array(),
|
131 |
+
)
|
132 |
+
),
|
133 |
+
'https://wpforms.com/docs/supported-php-version/'
|
134 |
+
);
|
135 |
+
?>
|
136 |
+
</p>
|
137 |
+
</div>
|
138 |
+
|
139 |
+
<?php
|
140 |
+
|
141 |
+
// In case this is on plugin activation.
|
142 |
+
if ( isset( $_GET['activate'] ) ) { //phpcs:ignore
|
143 |
+
unset( $_GET['activate'] ); //phpcs:ignore
|
144 |
+
}
|
145 |
+
} );
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Assign all hooks to proper places.
|
150 |
+
*
|
151 |
+
* @since 1.0.0
|
152 |
+
*/
|
153 |
+
public function hooks() {
|
154 |
+
|
155 |
+
// Activation hook.
|
156 |
+
add_action( 'activate_plugin', array( $this, 'activate' ), 10, 2 );
|
157 |
+
|
158 |
+
// Redefine PHPMailer.
|
159 |
+
add_action( 'plugins_loaded', array( $this, 'get_processor' ) );
|
160 |
+
add_action( 'plugins_loaded', array( $this, 'replace_phpmailer' ) );
|
161 |
+
|
162 |
+
// Various notifications.
|
163 |
+
add_action( 'admin_init', array( $this, 'init_notifications' ) );
|
164 |
+
|
165 |
+
add_action( 'init', array( $this, 'init' ) );
|
166 |
+
|
167 |
+
add_action( 'plugins_loaded', array( $this, 'get_pro' ) );
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Initial plugin actions.
|
172 |
+
*
|
173 |
+
* @since 1.0.0
|
174 |
+
*/
|
175 |
+
public function init() {
|
176 |
+
|
177 |
+
// Load translations just in case.
|
178 |
+
load_plugin_textdomain( 'wp-mail-smtp', false, plugin_basename( wp_mail_smtp()->plugin_path ) . '/assets/languages' );
|
179 |
+
|
180 |
+
/*
|
181 |
+
* Constantly check in admin area, that we don't need to upgrade DB.
|
182 |
+
* Do not wait for the `admin_init` hook, because some actions are already done
|
183 |
+
* on `plugins_loaded`, so migration has to be done before.
|
184 |
+
* We should not fire this in AJAX requests.
|
185 |
+
*/
|
186 |
+
if ( WP::in_wp_admin() ) {
|
187 |
+
$this->get_migration();
|
188 |
+
$this->get_upgrade();
|
189 |
+
$this->detect_conflicts();
|
190 |
+
}
|
191 |
+
|
192 |
+
// In admin area, regardless of AJAX or not AJAX request.
|
193 |
+
if ( is_admin() ) {
|
194 |
+
$this->get_admin();
|
195 |
+
$this->get_site_health()->init();
|
196 |
+
}
|
197 |
+
|
198 |
+
// Plugin admin area notices. Display to "admins" only.
|
199 |
+
if ( current_user_can( 'manage_options' ) ) {
|
200 |
+
add_action( 'admin_notices', array( '\WPMailSMTP\WP', 'display_admin_notices' ) );
|
201 |
+
add_action( 'admin_notices', array( $this, 'display_general_notices' ) );
|
202 |
+
}
|
203 |
+
}
|
204 |
+
|
205 |
+
/**
|
206 |
+
* Whether the Pro part of the plugin is allowed to be loaded.
|
207 |
+
*
|
208 |
+
* @since 1.5.0
|
209 |
+
* @since 1.6.0 Added a filter.
|
210 |
+
*
|
211 |
+
* @return bool
|
212 |
+
*/
|
213 |
+
protected function is_pro_allowed() {
|
214 |
+
|
215 |
+
$is_allowed = true;
|
216 |
+
|
217 |
+
if ( ! is_readable( $this->plugin_path . '/src/Pro/Pro.php' ) ) {
|
218 |
+
$is_allowed = false;
|
219 |
+
}
|
220 |
+
|
221 |
+
if ( version_compare( phpversion(), '5.6', '<' ) ) {
|
222 |
+
$is_allowed = false;
|
223 |
+
}
|
224 |
+
|
225 |
+
return apply_filters( 'wp_mail_smtp_core_is_pro_allowed', $is_allowed );
|
226 |
+
}
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Get/Load the Pro code of the plugin if it exists.
|
230 |
+
*
|
231 |
+
* @since 1.6.2
|
232 |
+
*
|
233 |
+
* @return \WPMailSMTP\Pro\Pro
|
234 |
+
*/
|
235 |
+
public function get_pro() {
|
236 |
+
|
237 |
+
if ( ! $this->is_pro_allowed() ) {
|
238 |
+
return $this->pro;
|
239 |
+
}
|
240 |
+
|
241 |
+
if ( ! $this->is_pro() ) {
|
242 |
+
$this->pro = new \WPMailSMTP\Pro\Pro();
|
243 |
+
}
|
244 |
+
|
245 |
+
return $this->pro;
|
246 |
+
}
|
247 |
+
|
248 |
+
/**
|
249 |
+
* This method allows to overwrite certain core WP functions, because it's fired:
|
250 |
+
* - after `muplugins_loaded` hook,
|
251 |
+
* - before WordPress own `wp-includes/pluggable.php` file include,
|
252 |
+
* - before `plugin_loaded` and `plugins_loaded` hooks.
|
253 |
+
*
|
254 |
+
* @since 1.5.0
|
255 |
+
*/
|
256 |
+
protected function init_early() {
|
257 |
+
|
258 |
+
$pro_files = $this->is_pro_allowed() ? \WPMailSMTP\Pro\Pro::PLUGGABLE_FILES : array();
|
259 |
+
|
260 |
+
$files = (array) apply_filters( 'wp_mail_smtp_core_init_early_include_files', $pro_files );
|
261 |
+
|
262 |
+
foreach ( $files as $file ) {
|
263 |
+
$path = $this->plugin_path . '/' . $file;
|
264 |
+
|
265 |
+
if ( is_readable( $path ) ) {
|
266 |
+
/** @noinspection PhpIncludeInspection */
|
267 |
+
include_once $path;
|
268 |
+
}
|
269 |
+
}
|
270 |
+
}
|
271 |
+
|
272 |
+
/**
|
273 |
+
* Load the plugin core processor.
|
274 |
+
*
|
275 |
+
* @since 1.0.0
|
276 |
+
*
|
277 |
+
* @return Processor
|
278 |
+
*/
|
279 |
+
public function get_processor() {
|
280 |
+
|
281 |
+
static $processor;
|
282 |
+
|
283 |
+
if ( ! isset( $processor ) ) {
|
284 |
+
$processor = apply_filters( 'wp_mail_smtp_core_get_processor', new Processor() );
|
285 |
+
}
|
286 |
+
|
287 |
+
return $processor;
|
288 |
+
}
|
289 |
+
|
290 |
+
/**
|
291 |
+
* Load the plugin admin area.
|
292 |
+
*
|
293 |
+
* @since 1.0.0
|
294 |
+
*
|
295 |
+
* @return Admin\Area
|
296 |
+
*/
|
297 |
+
public function get_admin() {
|
298 |
+
|
299 |
+
static $admin;
|
300 |
+
|
301 |
+
if ( ! isset( $admin ) ) {
|
302 |
+
$admin = apply_filters( 'wp_mail_smtp_core_get_admin', new Admin\Area() );
|
303 |
+
}
|
304 |
+
|
305 |
+
return $admin;
|
306 |
+
}
|
307 |
+
|
308 |
+
/**
|
309 |
+
* Load the plugin providers loader.
|
310 |
+
*
|
311 |
+
* @since 1.0.0
|
312 |
+
*
|
313 |
+
* @return Providers\Loader
|
314 |
+
*/
|
315 |
+
public function get_providers() {
|
316 |
+
|
317 |
+
static $providers;
|
318 |
+
|
319 |
+
if ( ! isset( $providers ) ) {
|
320 |
+
$providers = apply_filters( 'wp_mail_smtp_core_get_providers', new Providers\Loader() );
|
321 |
+
}
|
322 |
+
|
323 |
+
return $providers;
|
324 |
+
}
|
325 |
+
|
326 |
+
/**
|
327 |
+
* Load the plugin option migrator.
|
328 |
+
*
|
329 |
+
* @since 1.0.0
|
330 |
+
*
|
331 |
+
* @return Migration
|
332 |
+
*/
|
333 |
+
public function get_migration() {
|
334 |
+
|
335 |
+
static $migration;
|
336 |
+
|
337 |
+
if ( ! isset( $migration ) ) {
|
338 |
+
$migration = apply_filters( 'wp_mail_smtp_core_get_migration', new Migration() );
|
339 |
+
}
|
340 |
+
|
341 |
+
return $migration;
|
342 |
+
}
|
343 |
+
|
344 |
+
/**
|
345 |
+
* Load the plugin upgrader.
|
346 |
+
*
|
347 |
+
* @since 1.1.0
|
348 |
+
*
|
349 |
+
* @return Upgrade
|
350 |
+
*/
|
351 |
+
public function get_upgrade() {
|
352 |
+
|
353 |
+
static $upgrade;
|
354 |
+
|
355 |
+
if ( ! isset( $upgrade ) ) {
|
356 |
+
$upgrade = apply_filters( 'wp_mail_smtp_core_get_upgrade', new Upgrade() );
|
357 |
+
}
|
358 |
+
|
359 |
+
return $upgrade;
|
360 |
+
}
|
361 |
+
|
362 |
+
/**
|
363 |
+
* Get the plugin's WP Site Health object.
|
364 |
+
*
|
365 |
+
* @since {VERSION}
|
366 |
+
*
|
367 |
+
* @return SiteHealth
|
368 |
+
*/
|
369 |
+
public function get_site_health() {
|
370 |
+
|
371 |
+
static $site_health;
|
372 |
+
|
373 |
+
if ( ! isset( $site_health ) ) {
|
374 |
+
$site_health = apply_filters( 'wp_mail_smtp_core_get_site_health', new SiteHealth() );
|
375 |
+
}
|
376 |
+
|
377 |
+
return $site_health;
|
378 |
+
}
|
379 |
+
|
380 |
+
/**
|
381 |
+
* Display various notifications to a user
|
382 |
+
*
|
383 |
+
* @since 1.0.0
|
384 |
+
*/
|
385 |
+
public function init_notifications() {
|
386 |
+
|
387 |
+
// Old PHP version notification.
|
388 |
+
if (
|
389 |
+
version_compare( phpversion(), '5.6', '<' ) &&
|
390 |
+
is_super_admin() &&
|
391 |
+
(
|
392 |
+
isset( $GLOBALS['pagenow'] ) &&
|
393 |
+
$GLOBALS['pagenow'] === 'index.php'
|
394 |
+
)
|
395 |
+
) {
|
396 |
+
WP::add_admin_notice(
|
397 |
+
sprintf(
|
398 |
+
wp_kses( /* translators: %1$s - WP Mail SMTP plugin name; %2$s - WPForms.com URL to a related doc. */
|
399 |
+
__( 'Your site is running an outdated version of PHP that is no longer supported and may cause issues with %1$s. <a href="%2$s" target="_blank" rel="noopener noreferrer">Read more</a> for additional information.', 'wp-mail-smtp' ),
|
400 |
+
array(
|
401 |
+
'a' => array(
|
402 |
+
'href' => array(),
|
403 |
+
'target' => array(),
|
404 |
+
'rel' => array(),
|
405 |
+
),
|
406 |
+
)
|
407 |
+
),
|
408 |
+
'<strong>WP Mail SMTP</strong>',
|
409 |
+
'https://wpforms.com/docs/supported-php-version/'
|
410 |
+
) .
|
411 |
+
'<br><br><em>' .
|
412 |
+
wp_kses(
|
413 |
+
__( '<strong>Please Note:</strong> Support for PHP 5.3-5.5 will be discontinued in 2020. After this, if no further action is taken, WP Mail SMTP functionality will be disabled.', 'wp-mail-smtp' ),
|
414 |
+
array(
|
415 |
+
'strong' => array(),
|
416 |
+
'em' => array(),
|
417 |
+
)
|
418 |
+
) .
|
419 |
+
'</em>',
|
420 |
+
WP::ADMIN_NOTICE_ERROR,
|
421 |
+
false
|
422 |
+
);
|
423 |
+
}
|
424 |
+
|
425 |
+
// Awesome Motive Notifications.
|
426 |
+
if ( Options::init()->get( 'general', 'am_notifications_hidden' ) ) {
|
427 |
+
return;
|
428 |
+
}
|
429 |
+
}
|
430 |
+
|
431 |
+
/**
|
432 |
+
* Display all debug mail-delivery related notices.
|
433 |
+
*
|
434 |
+
* @since 1.3.0
|
435 |
+
* @since 1.6.0 Added a filter that allows to hide debug errors.
|
436 |
+
*/
|
437 |
+
public static function display_general_notices() {
|
438 |
+
|
439 |
+
if ( wp_mail_smtp()->is_blocked() ) {
|
440 |
+
?>
|
441 |
+
|
442 |
+
<div class="notice <?php echo esc_attr( WP::ADMIN_NOTICE_ERROR ); ?>">
|
443 |
+
<p>
|
444 |
+
<?php
|
445 |
+
$notices[] = sprintf(
|
446 |
+
wp_kses( /* translators: %s - plugin name and its version. */
|
447 |
+
__( '<strong>EMAILING DISABLED:</strong> The %s is currently blocking all emails from being sent.', 'wp-mail-smtp' ),
|
448 |
+
array(
|
449 |
+
'strong' => true,
|
450 |
+
)
|
451 |
+
),
|
452 |
+
esc_html( 'WP Mail SMTP v' . WPMS_PLUGIN_VER )
|
453 |
+
);
|
454 |
+
|
455 |
+
if ( Options::init()->is_const_defined( 'general', 'do_not_send' ) ) {
|
456 |
+
$notices[] = sprintf(
|
457 |
+
wp_kses( /* translators: %1$s - constant name; %2$s - constant value. */
|
458 |
+
__( 'To send emails, change the value of the %1$s constant to %2$s.', 'wp-mail-smtp' ),
|
459 |
+
array(
|
460 |
+
'code' => true,
|
461 |
+
)
|
462 |
+
),
|
463 |
+
'<code>WPMS_DO_NOT_SEND</code>',
|
464 |
+
'<code>false</code>'
|
465 |
+
);
|
466 |
+
} else {
|
467 |
+
$notices[] = sprintf(
|
468 |
+
wp_kses( /* translators: %s - plugin Misc settings page URL. */
|
469 |
+
__( 'To send emails, go to plugin <a href="%s">Misc settings</a> and disable the "Do Not Send" option.', 'wp-mail-smtp' ),
|
470 |
+
array(
|
471 |
+
'a' => array(
|
472 |
+
'href' => true,
|
473 |
+
),
|
474 |
+
)
|
475 |
+
),
|
476 |
+
esc_url( add_query_arg( 'tab', 'misc', wp_mail_smtp()->get_admin()->get_admin_page_url() ) )
|
477 |
+
);
|
478 |
+
}
|
479 |
+
|
480 |
+
echo implode( ' ', $notices );
|
481 |
+
?>
|
482 |
+
</p>
|
483 |
+
</div>
|
484 |
+
|
485 |
+
<?php
|
486 |
+
return;
|
487 |
+
}
|
488 |
+
|
489 |
+
if ( wp_mail_smtp()->get_admin()->is_error_delivery_notice_enabled() ) {
|
490 |
+
|
491 |
+
$notice = Debug::get_last();
|
492 |
+
|
493 |
+
if ( ! empty( $notice ) ) {
|
494 |
+
?>
|
495 |
+
|
496 |
+
<div class="notice <?php echo esc_attr( WP::ADMIN_NOTICE_ERROR ); ?>">
|
497 |
+
<p>
|
498 |
+
<?php
|
499 |
+
printf(
|
500 |
+
wp_kses( /* translators: %s - plugin name and its version. */
|
501 |
+
__( '<strong>EMAIL DELIVERY ERROR:</strong> the plugin %s logged this error during the last time it tried to send an email:', 'wp-mail-smtp' ),
|
502 |
+
array(
|
503 |
+
'strong' => array(),
|
504 |
+
)
|
505 |
+
),
|
506 |
+
esc_html( 'WP Mail SMTP v' . WPMS_PLUGIN_VER )
|
507 |
+
);
|
508 |
+
?>
|
509 |
+
</p>
|
510 |
+
|
511 |
+
<blockquote>
|
512 |
+
<pre><?php echo $notice; ?></pre>
|
513 |
+
</blockquote>
|
514 |
+
|
515 |
+
<p>
|
516 |
+
<?php
|
517 |
+
if ( ! wp_mail_smtp()->get_admin()->is_admin_page() ) {
|
518 |
+
printf(
|
519 |
+
wp_kses( /* translators: %s - plugin admin page URL. */
|
520 |
+
__( 'Please review your WP Mail SMTP settings in <a href="%s">plugin admin area</a>.' ) . ' ',
|
521 |
+
array(
|
522 |
+
'a' => array(
|
523 |
+
'href' => array(),
|
524 |
+
),
|
525 |
+
)
|
526 |
+
),
|
527 |
+
esc_url( wp_mail_smtp()->get_admin()->get_admin_page_url() )
|
528 |
+
);
|
529 |
+
}
|
530 |
+
|
531 |
+
esc_html_e( 'Consider running an email test after fixing it.', 'wp-mail-smtp' );
|
532 |
+
?>
|
533 |
+
</p>
|
534 |
+
</div>
|
535 |
+
|
536 |
+
<?php
|
537 |
+
}
|
538 |
+
}
|
539 |
+
}
|
540 |
+
|
541 |
+
/**
|
542 |
+
* Check whether we are working with a new plugin install.
|
543 |
+
*
|
544 |
+
* @since 1.3.0
|
545 |
+
*
|
546 |
+
* @return bool
|
547 |
+
*/
|
548 |
+
protected function is_new_install() {
|
549 |
+
|
550 |
+
/*
|
551 |
+
* No previously installed 0.*.
|
552 |
+
* 'wp_mail_smtp_initial_version' option appeared in 1.3.0. So we make sure it exists.
|
553 |
+
* No previous plugin upgrades.
|
554 |
+
*/
|
555 |
+
if (
|
556 |
+
! get_option( 'mailer', false ) &&
|
557 |
+
get_option( 'wp_mail_smtp_initial_version', false ) &&
|
558 |
+
version_compare( WPMS_PLUGIN_VER, get_option( 'wp_mail_smtp_initial_version' ), '=' )
|
559 |
+
) {
|
560 |
+
return true;
|
561 |
+
}
|
562 |
+
|
563 |
+
return false;
|
564 |
+
}
|
565 |
+
|
566 |
+
/**
|
567 |
+
* Detect if there are plugins activated that will cause a conflict.
|
568 |
+
*
|
569 |
+
* @since 1.3.0
|
570 |
+
* @since 1.5.0 Moved the logic to Conflicts class.
|
571 |
+
*/
|
572 |
+
public function detect_conflicts() {
|
573 |
+
|
574 |
+
// Display only for those who can actually deactivate plugins.
|
575 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
576 |
+
return;
|
577 |
+
}
|
578 |
+
|
579 |
+
$conflicts = new Conflicts();
|
580 |
+
|
581 |
+
if ( $conflicts->is_detected() ) {
|
582 |
+
$conflicts->notify();
|
583 |
+
}
|
584 |
+
}
|
585 |
+
|
586 |
+
/**
|
587 |
+
* Init the \PHPMailer replacement.
|
588 |
+
*
|
589 |
+
* @since 1.0.0
|
590 |
+
*
|
591 |
+
* @return \WPMailSMTP\MailCatcher
|
592 |
+
*/
|
593 |
+
public function replace_phpmailer() {
|
594 |
+
|
595 |
+
global $phpmailer;
|
596 |
+
|
597 |
+
return $this->replace_w_fake_phpmailer( $phpmailer );
|
598 |
+
}
|
599 |
+
|
600 |
+
/**
|
601 |
+
* Overwrite default PhpMailer with our MailCatcher.
|
602 |
+
*
|
603 |
+
* @since 1.0.0
|
604 |
+
* @since 1.5.0 Throw external PhpMailer exceptions, inherits default WP behavior.
|
605 |
+
*
|
606 |
+
* @param null $obj PhpMailer object to override with own implementation.
|
607 |
+
*
|
608 |
+
* @return \WPMailSMTP\MailCatcher
|
609 |
+
*/
|
610 |
+
protected function replace_w_fake_phpmailer( &$obj = null ) {
|
611 |
+
|
612 |
+
$obj = new MailCatcher( true );
|
613 |
+
|
614 |
+
return $obj;
|
615 |
+
}
|
616 |
+
|
617 |
+
/**
|
618 |
+
* What to do on plugin activation.
|
619 |
+
*
|
620 |
+
* @since 1.0.0
|
621 |
+
*
|
622 |
+
* @param string $plugin Path to the plugin file relative to the plugins directory.
|
623 |
+
* @param bool $network_wide Whether to enable the plugin for all sites in the network
|
624 |
+
* or just the current site. Multisite only. Default is false.
|
625 |
+
*/
|
626 |
+
public function activate( $plugin, $network_wide ) {
|
627 |
+
|
628 |
+
// Store the plugin version when initial install occurred.
|
629 |
+
add_option( 'wp_mail_smtp_initial_version', WPMS_PLUGIN_VER, '', false );
|
630 |
+
|
631 |
+
// Store the plugin version activated to reference with upgrades.
|
632 |
+
update_option( 'wp_mail_smtp_version', WPMS_PLUGIN_VER, false );
|
633 |
+
|
634 |
+
// Save default options, only once.
|
635 |
+
Options::init()->set( Options::get_defaults(), true );
|
636 |
+
}
|
637 |
+
|
638 |
+
/**
|
639 |
+
* Whether this is a Pro version of a plugin.
|
640 |
+
*
|
641 |
+
* @since 1.5.0
|
642 |
+
*
|
643 |
+
* @return bool
|
644 |
+
*/
|
645 |
+
public function is_pro() {
|
646 |
+
|
647 |
+
return apply_filters( 'wp_mail_smtp_core_is_pro', ! empty( $this->pro ) );
|
648 |
+
}
|
649 |
+
|
650 |
+
/**
|
651 |
+
* Get the current license type.
|
652 |
+
*
|
653 |
+
* @since 1.5.0
|
654 |
+
*
|
655 |
+
* @return string Default value: lite.
|
656 |
+
*/
|
657 |
+
public function get_license_type() {
|
658 |
+
|
659 |
+
$type = Options::init()->get( 'license', 'type' );
|
660 |
+
|
661 |
+
if ( empty( $type ) ) {
|
662 |
+
$type = 'lite';
|
663 |
+
}
|
664 |
+
|
665 |
+
return strtolower( $type );
|
666 |
+
}
|
667 |
+
|
668 |
+
/**
|
669 |
+
* Get the current license key.
|
670 |
+
*
|
671 |
+
* @since 1.5.0
|
672 |
+
*
|
673 |
+
* @return string
|
674 |
+
*/
|
675 |
+
public function get_license_key() {
|
676 |
+
|
677 |
+
$key = Options::init()->get( 'license', 'key' );
|
678 |
+
|
679 |
+
if ( empty( $key ) ) {
|
680 |
+
$key = '';
|
681 |
+
}
|
682 |
+
|
683 |
+
return $key;
|
684 |
+
}
|
685 |
+
|
686 |
+
/**
|
687 |
+
* Upgrade link used within the various admin pages.
|
688 |
+
*
|
689 |
+
* @since 1.5.0
|
690 |
+
* @since 1.5.1 Support all UTM params.
|
691 |
+
*
|
692 |
+
* @param array|string $utm Array of UTM params, or if string provided - utm_content URL parameter.
|
693 |
+
*
|
694 |
+
* @return string
|
695 |
+
*/
|
696 |
+
public function get_upgrade_link( $utm ) {
|
697 |
+
|
698 |
+
// Defaults.
|
699 |
+
$source = 'WordPress';
|
700 |
+
$medium = 'plugin-settings';
|
701 |
+
$campaign = 'liteplugin';
|
702 |
+
$content = 'general';
|
703 |
+
|
704 |
+
if ( is_array( $utm ) ) {
|
705 |
+
if ( isset( $utm['source'] ) ) {
|
706 |
+
$source = $utm['source'];
|
707 |
+
}
|
708 |
+
if ( isset( $utm['medium'] ) ) {
|
709 |
+
$medium = $utm['medium'];
|
710 |
+
}
|
711 |
+
if ( isset( $utm['campaign'] ) ) {
|
712 |
+
$campaign = $utm['campaign'];
|
713 |
+
}
|
714 |
+
if ( isset( $utm['content'] ) ) {
|
715 |
+
$content = $utm['content'];
|
716 |
+
}
|
717 |
+
} elseif ( is_string( $utm ) ) {
|
718 |
+
$content = $utm;
|
719 |
+
}
|
720 |
+
|
721 |
+
return apply_filters(
|
722 |
+
'wp_mail_smtp_core_get_upgrade_link',
|
723 |
+
'https://wpmailsmtp.com/lite-upgrade/?utm_source=' . esc_attr( $source ) . '&utm_medium=' . esc_attr( $medium ) . '&utm_campaign=' . esc_attr( $campaign ) . '&utm_content=' . esc_attr( $content )
|
724 |
+
);
|
725 |
+
}
|
726 |
+
|
727 |
+
/**
|
728 |
+
* Whether the emailing functionality is blocked, with either an option or a constatnt.
|
729 |
+
*
|
730 |
+
* @since 1.7.0
|
731 |
+
*
|
732 |
+
* @return bool
|
733 |
+
*/
|
734 |
+
public function is_blocked() {
|
735 |
+
|
736 |
+
return (bool) Options::init()->get( 'general', 'do_not_send' );
|
737 |
+
}
|
738 |
+
}
|
src/Debug.php
CHANGED
@@ -1,122 +1,122 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPMailSMTP;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Class Debug that will save all errors or warnings generated by APIs or SMTP
|
7 |
-
* and display in area for administrators.
|
8 |
-
*
|
9 |
-
* Usage example:
|
10 |
-
* Debug::set( 'Some warning: %s', array( '%s' => $e->getMessage() );
|
11 |
-
* $debug = Debug::get(); // array
|
12 |
-
* $debug = Debug::get_last(); // string
|
13 |
-
*
|
14 |
-
* @since 1.2.0
|
15 |
-
*/
|
16 |
-
class Debug {
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Key for options table where all messages will be saved to.
|
20 |
-
*/
|
21 |
-
const OPTION_KEY = 'wp_mail_smtp_debug';
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Save unique debug message to a debug log.
|
25 |
-
* Adds one more to a list, at the end.
|
26 |
-
*
|
27 |
-
* @since 1.2.0
|
28 |
-
*
|
29 |
-
* @param mixed $message
|
30 |
-
*/
|
31 |
-
public static function set( $message ) {
|
32 |
-
|
33 |
-
if ( empty( $message ) ) {
|
34 |
-
return;
|
35 |
-
}
|
36 |
-
|
37 |
-
if ( ! is_string( $message ) ) {
|
38 |
-
$message = wp_json_encode( $message );
|
39 |
-
} else {
|
40 |
-
$message = wp_strip_all_tags( $message, false );
|
41 |
-
}
|
42 |
-
|
43 |
-
$all = self::get();
|
44 |
-
|
45 |
-
array_push( $all, $message );
|
46 |
-
|
47 |
-
update_option( self::OPTION_KEY, array_unique( $all ), false );
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Remove all messages for a debug log.
|
52 |
-
*
|
53 |
-
* @since 1.2.0
|
54 |
-
*/
|
55 |
-
public static function clear() {
|
56 |
-
update_option( self::OPTION_KEY, array(), false );
|
57 |
-
}
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Retrieve all messages from a debug log.
|
61 |
-
*
|
62 |
-
* @since 1.2.0
|
63 |
-
*
|
64 |
-
* @return array
|
65 |
-
*/
|
66 |
-
public static function get() {
|
67 |
-
|
68 |
-
$all = get_option( self::OPTION_KEY, array() );
|
69 |
-
|
70 |
-
if ( ! is_array( $all ) ) {
|
71 |
-
$all = (array) $all;
|
72 |
-
}
|
73 |
-
|
74 |
-
return $all;
|
75 |
-
}
|
76 |
-
|
77 |
-
/**
|
78 |
-
* Get the last message that was saved to a debug log.
|
79 |
-
*
|
80 |
-
* @since 1.2.0
|
81 |
-
*
|
82 |
-
* @return string
|
83 |
-
*/
|
84 |
-
public static function get_last() {
|
85 |
-
|
86 |
-
$all = self::get();
|
87 |
-
|
88 |
-
if ( ! empty( $all ) && is_array( $all ) ) {
|
89 |
-
return (string)
|
90 |
-
}
|
91 |
-
|
92 |
-
return '';
|
93 |
-
}
|
94 |
-
|
95 |
-
/**
|
96 |
-
* Get the proper variable content output to debug.
|
97 |
-
*
|
98 |
-
* @since 1.2.0
|
99 |
-
*
|
100 |
-
* @param mixed $var
|
101 |
-
*
|
102 |
-
* @return string
|
103 |
-
*/
|
104 |
-
public static function pvar( $var = '' ) {
|
105 |
-
|
106 |
-
ob_start();
|
107 |
-
|
108 |
-
echo '<code>';
|
109 |
-
|
110 |
-
if ( is_bool( $var ) || empty( $var ) ) {
|
111 |
-
var_dump( $var );
|
112 |
-
} else {
|
113 |
-
print_r( $var );
|
114 |
-
}
|
115 |
-
|
116 |
-
echo '</code>';
|
117 |
-
|
118 |
-
$output = ob_get_clean();
|
119 |
-
|
120 |
-
return str_replace( array( "\r\n", "\r", "\n" ), '', $output );
|
121 |
-
}
|
122 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPMailSMTP;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Class Debug that will save all errors or warnings generated by APIs or SMTP
|
7 |
+
* and display in area for administrators.
|
8 |
+
*
|
9 |
+
* Usage example:
|
10 |
+
* Debug::set( 'Some warning: %s', array( '%s' => $e->getMessage() );
|
11 |
+
* $debug = Debug::get(); // array
|
12 |
+
* $debug = Debug::get_last(); // string
|
13 |
+
*
|
14 |
+
* @since 1.2.0
|
15 |
+
*/
|
16 |
+
class Debug {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Key for options table where all messages will be saved to.
|
20 |
+
*/
|
21 |
+
const OPTION_KEY = 'wp_mail_smtp_debug';
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Save unique debug message to a debug log.
|
25 |
+
* Adds one more to a list, at the end.
|
26 |
+
*
|
27 |
+
* @since 1.2.0
|
28 |
+
*
|
29 |
+
* @param mixed $message
|
30 |
+
*/
|
31 |
+
public static function set( $message ) {
|
32 |
+
|
33 |
+
if ( empty( $message ) ) {
|
34 |
+
return;
|
35 |
+
}
|
36 |
+
|
37 |
+
if ( ! is_string( $message ) ) {
|
38 |
+
$message = wp_json_encode( $message );
|
39 |
+
} else {
|
40 |
+
$message = wp_strip_all_tags( $message, false );
|
41 |
+
}
|
42 |
+
|
43 |
+
$all = self::get();
|
44 |
+
|
45 |
+
array_push( $all, $message );
|
46 |
+
|
47 |
+
update_option( self::OPTION_KEY, array_unique( $all ), false );
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Remove all messages for a debug log.
|
52 |
+
*
|
53 |
+
* @since 1.2.0
|
54 |
+
*/
|
55 |
+
public static function clear() {
|
56 |
+
update_option( self::OPTION_KEY, array(), false );
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Retrieve all messages from a debug log.
|
61 |
+
*
|
62 |
+
* @since 1.2.0
|
63 |
+
*
|
64 |
+
* @return array
|
65 |
+
*/
|
66 |
+
public static function get() {
|
67 |
+
|
68 |
+
$all = get_option( self::OPTION_KEY, array() );
|
69 |
+
|
70 |
+
if ( ! is_array( $all ) ) {
|
71 |
+
$all = (array) $all;
|
72 |
+
}
|
73 |
+
|
74 |
+
return $all;
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Get the last message that was saved to a debug log.
|
79 |
+
*
|
80 |
+
* @since 1.2.0
|
81 |
+
*
|
82 |
+
* @return string
|
83 |
+
*/
|
84 |
+
public static function get_last() {
|
85 |
+
|
86 |
+
$all = self::get();
|
87 |
+
|
88 |
+
if ( ! empty( $all ) && is_array( $all ) ) {
|
89 |
+
return (string) end( $all );
|
90 |
+
}
|
91 |
+
|
92 |
+
return '';
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Get the proper variable content output to debug.
|
97 |
+
*
|
98 |
+
* @since 1.2.0
|
99 |
+
*
|
100 |
+
* @param mixed $var
|
101 |
+
*
|
102 |
+
* @return string
|
103 |
+
*/
|
104 |
+
public static function pvar( $var = '' ) {
|
105 |
+
|
106 |
+
ob_start();
|
107 |
+
|
108 |
+
echo '<code>';
|
109 |
+
|
110 |
+
if ( is_bool( $var ) || empty( $var ) ) {
|
111 |
+
var_dump( $var );
|
112 |
+
} else {
|
113 |
+
print_r( $var );
|
114 |
+
}
|
115 |
+
|
116 |
+
echo '</code>';
|
117 |
+
|
118 |
+
$output = ob_get_clean();
|
119 |
+
|
120 |
+
return str_replace( array( "\r\n", "\r", "\n" ), '', $output );
|
121 |
+
}
|
122 |
+
}
|
src/Options.php
CHANGED
@@ -1,933 +1,937 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPMailSMTP;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Class Options to handle all options management.
|
7 |
-
* WordPress does all the heavy work for caching get_option() data,
|
8 |
-
* so we don't have to do that. But we want to minimize cyclomatic complexity
|
9 |
-
* of calling a bunch of WP functions, thus we will cache them in a class as well.
|
10 |
-
*
|
11 |
-
* @since 1.0.0
|
12 |
-
*/
|
13 |
-
class Options {
|
14 |
-
|
15 |
-
/**
|
16 |
-
* All the options keys.
|
17 |
-
*
|
18 |
-
* @since 1.3.0
|
19 |
-
* @since 1.4.0 Added Mailgun:region.
|
20 |
-
* @since 1.5.0 Added Outlook/AmazonSES.
|
21 |
-
* @since 1.8.0 Added Pepipost API.
|
22 |
-
*
|
23 |
-
* @since
|
24 |
-
*
|
25 |
-
* @var array Map of all the default options of the plugin.
|
26 |
-
*/
|
27 |
-
private static $map = array(
|
28 |
-
'mail' => array(
|
29 |
-
'from_name',
|
30 |
-
'from_email',
|
31 |
-
'mailer',
|
32 |
-
'return_path',
|
33 |
-
'from_name_force',
|
34 |
-
'from_email_force',
|
35 |
-
),
|
36 |
-
'smtp' => array(
|
37 |
-
'host',
|
38 |
-
'port',
|
39 |
-
'encryption',
|
40 |
-
'autotls',
|
41 |
-
'auth',
|
42 |
-
'user',
|
43 |
-
'pass',
|
44 |
-
),
|
45 |
-
'gmail' => array(
|
46 |
-
'client_id',
|
47 |
-
'client_secret',
|
48 |
-
),
|
49 |
-
'outlook' => array(
|
50 |
-
'client_id',
|
51 |
-
'client_secret',
|
52 |
-
),
|
53 |
-
'amazonses' => array(
|
54 |
-
'client_id',
|
55 |
-
'client_secret',
|
56 |
-
'region',
|
57 |
-
'emails_pending',
|
58 |
-
),
|
59 |
-
'mailgun' => array(
|
60 |
-
'api_key',
|
61 |
-
'domain',
|
62 |
-
'region',
|
63 |
-
),
|
64 |
-
'sendgrid' => array(
|
65 |
-
'api_key',
|
66 |
-
),
|
67 |
-
'sendinblue' => array(
|
68 |
-
'api_key',
|
69 |
-
),
|
70 |
-
'pepipostapi' => array(
|
71 |
-
'api_key',
|
72 |
-
),
|
73 |
-
'pepipost' => array(
|
74 |
-
'host',
|
75 |
-
'port',
|
76 |
-
'encryption',
|
77 |
-
'auth',
|
78 |
-
'user',
|
79 |
-
'pass',
|
80 |
-
),
|
81 |
-
'license' => array(
|
82 |
-
'key',
|
83 |
-
),
|
84 |
-
);
|
85 |
-
|
86 |
-
/**
|
87 |
-
* That's where plugin options are saved in wp_options table.
|
88 |
-
*
|
89 |
-
* @var string
|
90 |
-
*/
|
91 |
-
const META_KEY = 'wp_mail_smtp';
|
92 |
-
|
93 |
-
/**
|
94 |
-
* All the plugin options.
|
95 |
-
*
|
96 |
-
* @var array
|
97 |
-
*/
|
98 |
-
private $_options = array();
|
99 |
-
|
100 |
-
/**
|
101 |
-
* Init the Options class.
|
102 |
-
* TODO: add a flag to process without retrieving const values.
|
103 |
-
*
|
104 |
-
* @since 1.0.0
|
105 |
-
*/
|
106 |
-
public function __construct() {
|
107 |
-
$this->populate_options();
|
108 |
-
}
|
109 |
-
|
110 |
-
/**
|
111 |
-
* Initialize all the options, used for chaining.
|
112 |
-
*
|
113 |
-
* One-liner:
|
114 |
-
* Options::init()->get('smtp', 'host');
|
115 |
-
* Options::init()->is_pepipost_active();
|
116 |
-
*
|
117 |
-
* Or multiple-usage:
|
118 |
-
* $options = new Options();
|
119 |
-
* $options->get('smtp', 'host');
|
120 |
-
*
|
121 |
-
* @since 1.0.0
|
122 |
-
*
|
123 |
-
* @return Options
|
124 |
-
*/
|
125 |
-
public static function init() {
|
126 |
-
|
127 |
-
static $instance;
|
128 |
-
|
129 |
-
if ( ! $instance ) {
|
130 |
-
$instance = new self();
|
131 |
-
}
|
132 |
-
|
133 |
-
return $instance;
|
134 |
-
}
|
135 |
-
|
136 |
-
/**
|
137 |
-
* Default options that are saved on plugin activation.
|
138 |
-
*
|
139 |
-
* @since 1.3.0
|
140 |
-
*
|
141 |
-
* @return array
|
142 |
-
*/
|
143 |
-
public static function get_defaults() {
|
144 |
-
|
145 |
-
return array(
|
146 |
-
'mail' => array(
|
147 |
-
'from_email' => get_option( 'admin_email' ),
|
148 |
-
'from_name' => get_bloginfo( 'name' ),
|
149 |
-
'mailer' => 'mail',
|
150 |
-
'return_path' => false,
|
151 |
-
'from_email_force' => false,
|
152 |
-
'from_name_force' => false,
|
153 |
-
),
|
154 |
-
'smtp' => array(
|
155 |
-
'autotls' => true,
|
156 |
-
'auth' => true,
|
157 |
-
),
|
158 |
-
);
|
159 |
-
}
|
160 |
-
|
161 |
-
/**
|
162 |
-
* Retrieve all options of the plugin.
|
163 |
-
*
|
164 |
-
* @since 1.0.0
|
165 |
-
*/
|
166 |
-
protected function populate_options() {
|
167 |
-
$this->_options = get_option( self::META_KEY, array() );
|
168 |
-
}
|
169 |
-
|
170 |
-
/**
|
171 |
-
* Get all the options.
|
172 |
-
*
|
173 |
-
* Options::init()->get_all();
|
174 |
-
*
|
175 |
-
* @since 1.0.0
|
176 |
-
*
|
177 |
-
* @return array
|
178 |
-
*/
|
179 |
-
public function get_all() {
|
180 |
-
|
181 |
-
$options = $this->_options;
|
182 |
-
|
183 |
-
foreach ( $options as $group => $g_value ) {
|
184 |
-
foreach ( $g_value as $key => $value ) {
|
185 |
-
$options[ $group ][ $key ] = $this->get( $group, $key );
|
186 |
-
}
|
187 |
-
}
|
188 |
-
|
189 |
-
return apply_filters( 'wp_mail_smtp_options_get_all', $options );
|
190 |
-
}
|
191 |
-
|
192 |
-
/**
|
193 |
-
* Get all the options for a group.
|
194 |
-
*
|
195 |
-
* Options::init()->get_group('smtp') - will return the array of options for the group, including defaults and constants.
|
196 |
-
*
|
197 |
-
* @since 1.0.0
|
198 |
-
* @since 1.5.0 Process values through the get() method which is aware of constants.
|
199 |
-
*
|
200 |
-
* @param string $group
|
201 |
-
*
|
202 |
-
* @return array
|
203 |
-
*/
|
204 |
-
public function get_group( $group ) {
|
205 |
-
|
206 |
-
// Just to feel safe.
|
207 |
-
$group = sanitize_key( $group );
|
208 |
-
|
209 |
-
/*
|
210 |
-
* Get the values saved in DB.
|
211 |
-
* If plugin is configured with constants right from the start - this will not have all the values.
|
212 |
-
*/
|
213 |
-
$options = isset( $this->_options[ $group ] ) ? $this->_options[ $group ] : array();
|
214 |
-
|
215 |
-
// We need to process certain constants-aware options through actual constants.
|
216 |
-
if ( isset( self::$map[ $group ] ) ) {
|
217 |
-
foreach ( self::$map[ $group ] as $key ) {
|
218 |
-
$options[ $key ] = $this->get( $group, $key );
|
219 |
-
}
|
220 |
-
}
|
221 |
-
|
222 |
-
return apply_filters( 'wp_mail_smtp_options_get_group', $options, $group );
|
223 |
-
}
|
224 |
-
|
225 |
-
/**
|
226 |
-
* Get options by a group and a key.
|
227 |
-
*
|
228 |
-
* Options::init()->get( 'smtp', 'host' ) - will return only SMTP 'host' option.
|
229 |
-
*
|
230 |
-
* @since 1.0.0
|
231 |
-
*
|
232 |
-
* @param string $group
|
233 |
-
* @param string $key
|
234 |
-
*
|
235 |
-
* @return mixed|null Null if value doesn't exist anywhere: in constants, in DB, in a map. So it's completely custom or a typo.
|
236 |
-
*/
|
237 |
-
public function get( $group, $key ) {
|
238 |
-
|
239 |
-
// Just to feel safe.
|
240 |
-
$group = sanitize_key( $group );
|
241 |
-
$key = sanitize_key( $key );
|
242 |
-
$value = null;
|
243 |
-
|
244 |
-
// Get the const value if we have one.
|
245 |
-
$value = $this->get_const_value( $group, $key, $value );
|
246 |
-
|
247 |
-
// We don't have a const value.
|
248 |
-
if ( $value === null ) {
|
249 |
-
// Ordinary database or default values.
|
250 |
-
if ( isset( $this->_options[ $group ] ) ) {
|
251 |
-
// Get the options key of a group.
|
252 |
-
if ( isset( $this->_options[ $group ][ $key ] ) ) {
|
253 |
-
$value = $this->_options[ $group ][ $key ];
|
254 |
-
} else {
|
255 |
-
$value = $this->postprocess_key_defaults( $group, $key );
|
256 |
-
}
|
257 |
-
} else {
|
258 |
-
/*
|
259 |
-
* Fallback to default if it doesn't exist in a map.
|
260 |
-
* Allow to retrieve only values from a map.
|
261 |
-
*/
|
262 |
-
if (
|
263 |
-
isset( self::$map[ $group ] ) &&
|
264 |
-
in_array( $key, self::$map[ $group ], true )
|
265 |
-
) {
|
266 |
-
$value = $this->postprocess_key_defaults( $group, $key );
|
267 |
-
}
|
268 |
-
}
|
269 |
-
}
|
270 |
-
|
271 |
-
// Strip slashes only from values saved in DB. Constants should be processed as is.
|
272 |
-
if ( is_string( $value ) && ! $this->is_const_defined( $group, $key ) ) {
|
273 |
-
$value = stripslashes( $value );
|
274 |
-
}
|
275 |
-
|
276 |
-
return apply_filters( 'wp_mail_smtp_options_get', $value, $group, $key );
|
277 |
-
}
|
278 |
-
|
279 |
-
/**
|
280 |
-
* Some options may be non-empty by default,
|
281 |
-
* so we need to postprocess them to convert.
|
282 |
-
*
|
283 |
-
* @since 1.0.0
|
284 |
-
* @since 1.4.0 Added Mailgun:region.
|
285 |
-
* @since 1.5.0 Added Outlook/AmazonSES, license key support.
|
286 |
-
*
|
287 |
-
* @param string $group
|
288 |
-
* @param string $key
|
289 |
-
*
|
290 |
-
* @return mixed
|
291 |
-
*/
|
292 |
-
protected function postprocess_key_defaults( $group, $key ) {
|
293 |
-
|
294 |
-
$value = '';
|
295 |
-
|
296 |
-
switch ( $key ) {
|
297 |
-
case 'from_email_force':
|
298 |
-
case 'from_name_force':
|
299 |
-
case 'return_path':
|
300 |
-
$value = $group === 'mail' ? false : true;
|
301 |
-
break;
|
302 |
-
|
303 |
-
case 'mailer':
|
304 |
-
$value = 'mail';
|
305 |
-
break;
|
306 |
-
|
307 |
-
case 'encryption':
|
308 |
-
$value = in_array( $group, array( 'smtp', 'pepipost' ), true ) ? 'none' : $value;
|
309 |
-
break;
|
310 |
-
|
311 |
-
case 'region':
|
312 |
-
$value = $group === 'mailgun' ? 'US' : $value;
|
313 |
-
break;
|
314 |
-
|
315 |
-
case 'emails_pending':
|
316 |
-
$value = array();
|
317 |
-
break;
|
318 |
-
|
319 |
-
case 'auth':
|
320 |
-
case 'autotls':
|
321 |
-
$value = in_array( $group, array( 'smtp', 'pepipost' ), true ) ? false : true;
|
322 |
-
break;
|
323 |
-
|
324 |
-
case 'pass':
|
325 |
-
$value = $this->get_const_value( $group, $key, $value );
|
326 |
-
break;
|
327 |
-
|
328 |
-
case 'type':
|
329 |
-
$value = $group === 'license' ? 'lite' : '';
|
330 |
-
break;
|
331 |
-
}
|
332 |
-
|
333 |
-
return apply_filters( 'wp_mail_smtp_options_postprocess_key_defaults', $value, $group, $key );
|
334 |
-
}
|
335 |
-
|
336 |
-
/**
|
337 |
-
* Process the options values through the constants check.
|
338 |
-
* If we have defined associated constant - use it instead of a DB value.
|
339 |
-
* Backward compatibility is hard.
|
340 |
-
* General section of options won't have constants, so we are omitting those checks and just return default value.
|
341 |
-
*
|
342 |
-
* @since 1.0.0
|
343 |
-
* @since 1.4.0 Added WPMS_MAILGUN_REGION.
|
344 |
-
* @since 1.5.0 Added Outlook/AmazonSES, license key support.
|
345 |
-
* @since 1.6.0 Added Sendinblue.
|
346 |
-
* @since 1.7.0 Added Do Not Send.
|
347 |
-
* @since 1.8.0 Added Pepipost API.
|
348 |
-
*
|
349 |
-
* @param string $group
|
350 |
-
* @param string $key
|
351 |
-
* @param mixed $value
|
352 |
-
*
|
353 |
-
* @return mixed
|
354 |
-
*/
|
355 |
-
protected function get_const_value( $group, $key, $value ) {
|
356 |
-
|
357 |
-
if ( ! $this->is_const_enabled() ) {
|
358 |
-
return $value;
|
359 |
-
}
|
360 |
-
|
361 |
-
$return = null;
|
362 |
-
|
363 |
-
switch ( $group ) {
|
364 |
-
case 'mail':
|
365 |
-
switch ( $key ) {
|
366 |
-
case 'from_name':
|
367 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
368 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_MAIL_FROM_NAME : $value;
|
369 |
-
break;
|
370 |
-
case 'from_email':
|
371 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
372 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_MAIL_FROM : $value;
|
373 |
-
break;
|
374 |
-
case 'mailer':
|
375 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
376 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_MAILER : $value;
|
377 |
-
break;
|
378 |
-
case 'return_path':
|
379 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
380 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_SET_RETURN_PATH : $value;
|
381 |
-
break;
|
382 |
-
case 'from_name_force':
|
383 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
384 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_MAIL_FROM_NAME_FORCE : $value;
|
385 |
-
break;
|
386 |
-
case 'from_email_force':
|
387 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
388 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_MAIL_FROM_FORCE : $value;
|
389 |
-
break;
|
390 |
-
}
|
391 |
-
|
392 |
-
break;
|
393 |
-
|
394 |
-
case 'smtp':
|
395 |
-
switch ( $key ) {
|
396 |
-
case 'host':
|
397 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
398 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_HOST : $value;
|
399 |
-
break;
|
400 |
-
case 'port':
|
401 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
402 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_PORT : $value;
|
403 |
-
break;
|
404 |
-
case 'encryption':
|
405 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
406 |
-
$return = $this->is_const_defined( $group, $key ) ? ( WPMS_SSL === '' ? 'none' : WPMS_SSL ) : $value;
|
407 |
-
break;
|
408 |
-
case 'auth':
|
409 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
410 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_AUTH : $value;
|
411 |
-
break;
|
412 |
-
case 'autotls':
|
413 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
414 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_AUTOTLS : $value;
|
415 |
-
break;
|
416 |
-
case 'user':
|
417 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
418 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_USER : $value;
|
419 |
-
break;
|
420 |
-
case 'pass':
|
421 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
422 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_PASS : $value;
|
423 |
-
break;
|
424 |
-
}
|
425 |
-
|
426 |
-
break;
|
427 |
-
|
428 |
-
case 'gmail':
|
429 |
-
switch ( $key ) {
|
430 |
-
case 'client_id':
|
431 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
432 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_GMAIL_CLIENT_ID : $value;
|
433 |
-
break;
|
434 |
-
case 'client_secret':
|
435 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
436 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_GMAIL_CLIENT_SECRET : $value;
|
437 |
-
break;
|
438 |
-
}
|
439 |
-
|
440 |
-
break;
|
441 |
-
|
442 |
-
case 'outlook':
|
443 |
-
switch ( $key ) {
|
444 |
-
case 'client_id':
|
445 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
446 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_OUTLOOK_CLIENT_ID : $value;
|
447 |
-
break;
|
448 |
-
case 'client_secret':
|
449 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
450 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_OUTLOOK_CLIENT_SECRET : $value;
|
451 |
-
break;
|
452 |
-
}
|
453 |
-
|
454 |
-
break;
|
455 |
-
|
456 |
-
case 'amazonses':
|
457 |
-
switch ( $key ) {
|
458 |
-
case 'client_id':
|
459 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
460 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_AMAZONSES_CLIENT_ID : $value;
|
461 |
-
break;
|
462 |
-
case 'client_secret':
|
463 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
464 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_AMAZONSES_CLIENT_SECRET : $value;
|
465 |
-
break;
|
466 |
-
case 'region':
|
467 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
468 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_AMAZONSES_REGION : $value;
|
469 |
-
break;
|
470 |
-
}
|
471 |
-
|
472 |
-
break;
|
473 |
-
|
474 |
-
case 'mailgun':
|
475 |
-
switch ( $key ) {
|
476 |
-
case 'api_key':
|
477 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
478 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_MAILGUN_API_KEY : $value;
|
479 |
-
break;
|
480 |
-
case 'domain':
|
481 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
482 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_MAILGUN_DOMAIN : $value;
|
483 |
-
break;
|
484 |
-
case 'region':
|
485 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
486 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_MAILGUN_REGION : $value;
|
487 |
-
break;
|
488 |
-
}
|
489 |
-
|
490 |
-
break;
|
491 |
-
|
492 |
-
case 'sendgrid':
|
493 |
-
switch ( $key ) {
|
494 |
-
case 'api_key':
|
495 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
496 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_SENDGRID_API_KEY : $value;
|
497 |
-
break;
|
498 |
-
}
|
499 |
-
|
500 |
-
break;
|
501 |
-
|
502 |
-
case 'sendinblue':
|
503 |
-
switch ( $key ) {
|
504 |
-
case 'api_key':
|
505 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
506 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_SENDINBLUE_API_KEY : $value;
|
507 |
-
break;
|
508 |
-
}
|
509 |
-
|
510 |
-
break;
|
511 |
-
|
512 |
-
case 'pepipostapi':
|
513 |
-
switch ( $key ) {
|
514 |
-
case 'api_key':
|
515 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
516 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_PEPIPOST_API_KEY : $value;
|
517 |
-
break;
|
518 |
-
}
|
519 |
-
|
520 |
-
break;
|
521 |
-
|
522 |
-
case 'license':
|
523 |
-
switch ( $key ) {
|
524 |
-
case 'key':
|
525 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
526 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_LICENSE_KEY : $value;
|
527 |
-
break;
|
528 |
-
}
|
529 |
-
|
530 |
-
break;
|
531 |
-
|
532 |
-
case 'general':
|
533 |
-
switch ( $key ) {
|
534 |
-
case 'do_not_send':
|
535 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
536 |
-
$return = $this->is_const_defined( $group, $key ) ? WPMS_DO_NOT_SEND : $value;
|
537 |
-
break;
|
538 |
-
}
|
539 |
-
|
540 |
-
break;
|
541 |
-
|
542 |
-
default:
|
543 |
-
// Always return the default value if nothing from above matches the request.
|
544 |
-
$return = $value;
|
545 |
-
}
|
546 |
-
|
547 |
-
return apply_filters( 'wp_mail_smtp_options_get_const_value', $return, $group, $key, $value );
|
548 |
-
}
|
549 |
-
|
550 |
-
/**
|
551 |
-
* Whether constants redefinition is enabled or not.
|
552 |
-
*
|
553 |
-
* @since 1.0.0
|
554 |
-
* @since 1.5.0 Added filter to redefine the value.
|
555 |
-
*
|
556 |
-
* @return bool
|
557 |
-
*/
|
558 |
-
public function is_const_enabled() {
|
559 |
-
|
560 |
-
$return = defined( 'WPMS_ON' ) && WPMS_ON === true;
|
561 |
-
|
562 |
-
return apply_filters( 'wp_mail_smtp_options_is_const_enabled', $return );
|
563 |
-
}
|
564 |
-
|
565 |
-
/**
|
566 |
-
* We need this check to reuse later in admin area,
|
567 |
-
* to distinguish settings fields that were redefined,
|
568 |
-
* and display them differently.
|
569 |
-
*
|
570 |
-
* @since 1.0.0
|
571 |
-
* @since 1.5.0 Added a filter, Outlook/AmazonSES, license key support.
|
572 |
-
* @since 1.6.0 Added Sendinblue.
|
573 |
-
* @since 1.7.0 Added Do Not Send.
|
574 |
-
* @since 1.8.0 Added Pepipost API.
|
575 |
-
*
|
576 |
-
* @param string $group
|
577 |
-
* @param string $key
|
578 |
-
*
|
579 |
-
* @return bool
|
580 |
-
*/
|
581 |
-
public function is_const_defined( $group, $key ) {
|
582 |
-
|
583 |
-
if ( ! $this->is_const_enabled() ) {
|
584 |
-
return false;
|
585 |
-
}
|
586 |
-
|
587 |
-
// Just to feel safe.
|
588 |
-
$group = sanitize_key( $group );
|
589 |
-
$key = sanitize_key( $key );
|
590 |
-
$return = false;
|
591 |
-
|
592 |
-
switch ( $group ) {
|
593 |
-
case 'mail':
|
594 |
-
switch ( $key ) {
|
595 |
-
case 'from_name':
|
596 |
-
$return = defined( 'WPMS_MAIL_FROM_NAME' ) && WPMS_MAIL_FROM_NAME;
|
597 |
-
break;
|
598 |
-
case 'from_email':
|
599 |
-
$return = defined( 'WPMS_MAIL_FROM' ) && WPMS_MAIL_FROM;
|
600 |
-
break;
|
601 |
-
case 'mailer':
|
602 |
-
$return = defined( 'WPMS_MAILER' ) && WPMS_MAILER;
|
603 |
-
break;
|
604 |
-
case 'return_path':
|
605 |
-
$return = defined( 'WPMS_SET_RETURN_PATH' ) && ( WPMS_SET_RETURN_PATH === 'true' || WPMS_SET_RETURN_PATH === true );
|
606 |
-
break;
|
607 |
-
case 'from_name_force':
|
608 |
-
$return = defined( 'WPMS_MAIL_FROM_NAME_FORCE' ) && ( WPMS_MAIL_FROM_NAME_FORCE === 'true' || WPMS_MAIL_FROM_NAME_FORCE === true );
|
609 |
-
break;
|
610 |
-
case 'from_email_force':
|
611 |
-
$return = defined( 'WPMS_MAIL_FROM_FORCE' ) && ( WPMS_MAIL_FROM_FORCE === 'true' || WPMS_MAIL_FROM_FORCE === true );
|
612 |
-
break;
|
613 |
-
}
|
614 |
-
|
615 |
-
break;
|
616 |
-
|
617 |
-
case 'smtp':
|
618 |
-
switch ( $key ) {
|
619 |
-
case 'host':
|
620 |
-
$return = defined( 'WPMS_SMTP_HOST' ) && WPMS_SMTP_HOST;
|
621 |
-
break;
|
622 |
-
case 'port':
|
623 |
-
$return = defined( 'WPMS_SMTP_PORT' ) && WPMS_SMTP_PORT;
|
624 |
-
break;
|
625 |
-
case 'encryption':
|
626 |
-
$return = defined( 'WPMS_SSL' );
|
627 |
-
break;
|
628 |
-
case 'auth':
|
629 |
-
$return = defined( 'WPMS_SMTP_AUTH' ) && WPMS_SMTP_AUTH;
|
630 |
-
break;
|
631 |
-
case 'autotls':
|
632 |
-
$return = defined( 'WPMS_SMTP_AUTOTLS' ) && ( WPMS_SMTP_AUTOTLS === 'true' || WPMS_SMTP_AUTOTLS === true );
|
633 |
-
break;
|
634 |
-
case 'user':
|
635 |
-
$return = defined( 'WPMS_SMTP_USER' ) && WPMS_SMTP_USER;
|
636 |
-
break;
|
637 |
-
case 'pass':
|
638 |
-
$return = defined( 'WPMS_SMTP_PASS' ) && WPMS_SMTP_PASS;
|
639 |
-
break;
|
640 |
-
}
|
641 |
-
|
642 |
-
break;
|
643 |
-
|
644 |
-
case 'gmail':
|
645 |
-
switch ( $key ) {
|
646 |
-
case 'client_id':
|
647 |
-
$return = defined( 'WPMS_GMAIL_CLIENT_ID' ) && WPMS_GMAIL_CLIENT_ID;
|
648 |
-
break;
|
649 |
-
case 'client_secret':
|
650 |
-
$return = defined( 'WPMS_GMAIL_CLIENT_SECRET' ) && WPMS_GMAIL_CLIENT_SECRET;
|
651 |
-
break;
|
652 |
-
}
|
653 |
-
|
654 |
-
break;
|
655 |
-
|
656 |
-
case 'outlook':
|
657 |
-
switch ( $key ) {
|
658 |
-
case 'client_id':
|
659 |
-
$return = defined( 'WPMS_OUTLOOK_CLIENT_ID' ) && WPMS_OUTLOOK_CLIENT_ID;
|
660 |
-
break;
|
661 |
-
case 'client_secret':
|
662 |
-
$return = defined( 'WPMS_OUTLOOK_CLIENT_SECRET' ) && WPMS_OUTLOOK_CLIENT_SECRET;
|
663 |
-
break;
|
664 |
-
}
|
665 |
-
|
666 |
-
break;
|
667 |
-
|
668 |
-
case 'amazonses':
|
669 |
-
switch ( $key ) {
|
670 |
-
case 'client_id':
|
671 |
-
$return = defined( 'WPMS_AMAZONSES_CLIENT_ID' ) && WPMS_AMAZONSES_CLIENT_ID;
|
672 |
-
break;
|
673 |
-
case 'client_secret':
|
674 |
-
$return = defined( 'WPMS_AMAZONSES_CLIENT_SECRET' ) && WPMS_AMAZONSES_CLIENT_SECRET;
|
675 |
-
break;
|
676 |
-
case 'region':
|
677 |
-
$return = defined( 'WPMS_AMAZONSES_REGION' ) && WPMS_AMAZONSES_REGION;
|
678 |
-
break;
|
679 |
-
}
|
680 |
-
|
681 |
-
break;
|
682 |
-
|
683 |
-
case 'mailgun':
|
684 |
-
switch ( $key ) {
|
685 |
-
case 'api_key':
|
686 |
-
$return = defined( 'WPMS_MAILGUN_API_KEY' ) && WPMS_MAILGUN_API_KEY;
|
687 |
-
break;
|
688 |
-
case 'domain':
|
689 |
-
$return = defined( 'WPMS_MAILGUN_DOMAIN' ) && WPMS_MAILGUN_DOMAIN;
|
690 |
-
break;
|
691 |
-
case 'region':
|
692 |
-
$return = defined( 'WPMS_MAILGUN_REGION' ) && WPMS_MAILGUN_REGION;
|
693 |
-
break;
|
694 |
-
}
|
695 |
-
|
696 |
-
break;
|
697 |
-
|
698 |
-
case 'sendgrid':
|
699 |
-
switch ( $key ) {
|
700 |
-
case 'api_key':
|
701 |
-
$return = defined( 'WPMS_SENDGRID_API_KEY' ) && WPMS_SENDGRID_API_KEY;
|
702 |
-
break;
|
703 |
-
}
|
704 |
-
|
705 |
-
break;
|
706 |
-
|
707 |
-
case 'sendinblue':
|
708 |
-
switch ( $key ) {
|
709 |
-
case 'api_key':
|
710 |
-
$return = defined( 'WPMS_SENDINBLUE_API_KEY' ) && WPMS_SENDINBLUE_API_KEY;
|
711 |
-
break;
|
712 |
-
}
|
713 |
-
|
714 |
-
break;
|
715 |
-
|
716 |
-
case 'pepipostapi':
|
717 |
-
switch ( $key ) {
|
718 |
-
case 'api_key':
|
719 |
-
$return = defined( 'WPMS_PEPIPOST_API_KEY' ) && WPMS_PEPIPOST_API_KEY;
|
720 |
-
break;
|
721 |
-
}
|
722 |
-
|
723 |
-
break;
|
724 |
-
|
725 |
-
case 'license':
|
726 |
-
switch ( $key ) {
|
727 |
-
case 'key':
|
728 |
-
$return = defined( 'WPMS_LICENSE_KEY' ) && WPMS_LICENSE_KEY;
|
729 |
-
break;
|
730 |
-
}
|
731 |
-
|
732 |
-
break;
|
733 |
-
|
734 |
-
case 'general':
|
735 |
-
switch ( $key ) {
|
736 |
-
case 'do_not_send':
|
737 |
-
/** @noinspection PhpUndefinedConstantInspection */
|
738 |
-
$return = defined( 'WPMS_DO_NOT_SEND' ) && WPMS_DO_NOT_SEND;
|
739 |
-
break;
|
740 |
-
}
|
741 |
-
|
742 |
-
break;
|
743 |
-
}
|
744 |
-
|
745 |
-
return apply_filters( 'wp_mail_smtp_options_is_const_defined', $return, $group, $key );
|
746 |
-
}
|
747 |
-
|
748 |
-
/**
|
749 |
-
* Set plugin options, all at once.
|
750 |
-
*
|
751 |
-
* @since 1.0.0
|
752 |
-
* @since 1.3.0 Added $once argument to save options only if they don't exist already.
|
753 |
-
* @since 1.4.0 Added Mailgun:region.
|
754 |
-
* @since 1.5.0 Added Outlook/AmazonSES, Email Log. Stop saving const values into DB.
|
755 |
-
*
|
756 |
-
* @param array $options Plugin options to save.
|
757 |
-
* @param bool $once Whether to update existing options or to add these options only once.
|
758 |
-
*/
|
759 |
-
public function set( $options, $once = false ) {
|
760 |
-
/*
|
761 |
-
* Process generic options.
|
762 |
-
*/
|
763 |
-
foreach ( (array) $options as $group => $keys ) {
|
764 |
-
foreach ( $keys as $option_name => $option_value ) {
|
765 |
-
switch ( $group ) {
|
766 |
-
case 'mail':
|
767 |
-
switch ( $option_name ) {
|
768 |
-
case 'from_name':
|
769 |
-
case 'mailer':
|
770 |
-
$options[ $group ][ $option_name ] = sanitize_text_field( $option_value );
|
771 |
-
break;
|
772 |
-
case 'from_email':
|
773 |
-
if ( filter_var( $option_value, FILTER_VALIDATE_EMAIL ) ) {
|
774 |
-
$options[ $group ][ $option_name ] = sanitize_email( $option_value );
|
775 |
-
}
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
$
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
case '
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
case '
|
822 |
-
$
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
case '
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
case '
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
*
|
869 |
-
*
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
if (
|
889 |
-
|
890 |
-
}
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
$merged[ $key ]
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
*
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
*
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPMailSMTP;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Class Options to handle all options management.
|
7 |
+
* WordPress does all the heavy work for caching get_option() data,
|
8 |
+
* so we don't have to do that. But we want to minimize cyclomatic complexity
|
9 |
+
* of calling a bunch of WP functions, thus we will cache them in a class as well.
|
10 |
+
*
|
11 |
+
* @since 1.0.0
|
12 |
+
*/
|
13 |
+
class Options {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* All the options keys.
|
17 |
+
*
|
18 |
+
* @since 1.3.0
|
19 |
+
* @since 1.4.0 Added Mailgun:region.
|
20 |
+
* @since 1.5.0 Added Outlook/AmazonSES.
|
21 |
+
* @since 1.8.0 Added Pepipost API.
|
22 |
+
*
|
23 |
+
* @since
|
24 |
+
*
|
25 |
+
* @var array Map of all the default options of the plugin.
|
26 |
+
*/
|
27 |
+
private static $map = array(
|
28 |
+
'mail' => array(
|
29 |
+
'from_name',
|
30 |
+
'from_email',
|
31 |
+
'mailer',
|
32 |
+
'return_path',
|
33 |
+
'from_name_force',
|
34 |
+
'from_email_force',
|
35 |
+
),
|
36 |
+
'smtp' => array(
|
37 |
+
'host',
|
38 |
+
'port',
|
39 |
+
'encryption',
|
40 |
+
'autotls',
|
41 |
+
'auth',
|
42 |
+
'user',
|
43 |
+
'pass',
|
44 |
+
),
|
45 |
+
'gmail' => array(
|
46 |
+
'client_id',
|
47 |
+
'client_secret',
|
48 |
+
),
|
49 |
+
'outlook' => array(
|
50 |
+
'client_id',
|
51 |
+
'client_secret',
|
52 |
+
),
|
53 |
+
'amazonses' => array(
|
54 |
+
'client_id',
|
55 |
+
'client_secret',
|
56 |
+
'region',
|
57 |
+
'emails_pending',
|
58 |
+
),
|
59 |
+
'mailgun' => array(
|
60 |
+
'api_key',
|
61 |
+
'domain',
|
62 |
+
'region',
|
63 |
+
),
|
64 |
+
'sendgrid' => array(
|
65 |
+
'api_key',
|
66 |
+
),
|
67 |
+
'sendinblue' => array(
|
68 |
+
'api_key',
|
69 |
+
),
|
70 |
+
'pepipostapi' => array(
|
71 |
+
'api_key',
|
72 |
+
),
|
73 |
+
'pepipost' => array(
|
74 |
+
'host',
|
75 |
+
'port',
|
76 |
+
'encryption',
|
77 |
+
'auth',
|
78 |
+
'user',
|
79 |
+
'pass',
|
80 |
+
),
|
81 |
+
'license' => array(
|
82 |
+
'key',
|
83 |
+
),
|
84 |
+
);
|
85 |
+
|
86 |
+
/**
|
87 |
+
* That's where plugin options are saved in wp_options table.
|
88 |
+
*
|
89 |
+
* @var string
|
90 |
+
*/
|
91 |
+
const META_KEY = 'wp_mail_smtp';
|
92 |
+
|
93 |
+
/**
|
94 |
+
* All the plugin options.
|
95 |
+
*
|
96 |
+
* @var array
|
97 |
+
*/
|
98 |
+
private $_options = array();
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Init the Options class.
|
102 |
+
* TODO: add a flag to process without retrieving const values.
|
103 |
+
*
|
104 |
+
* @since 1.0.0
|
105 |
+
*/
|
106 |
+
public function __construct() {
|
107 |
+
$this->populate_options();
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Initialize all the options, used for chaining.
|
112 |
+
*
|
113 |
+
* One-liner:
|
114 |
+
* Options::init()->get('smtp', 'host');
|
115 |
+
* Options::init()->is_pepipost_active();
|
116 |
+
*
|
117 |
+
* Or multiple-usage:
|
118 |
+
* $options = new Options();
|
119 |
+
* $options->get('smtp', 'host');
|
120 |
+
*
|
121 |
+
* @since 1.0.0
|
122 |
+
*
|
123 |
+
* @return Options
|
124 |
+
*/
|
125 |
+
public static function init() {
|
126 |
+
|
127 |
+
static $instance;
|
128 |
+
|
129 |
+
if ( ! $instance ) {
|
130 |
+
$instance = new self();
|
131 |
+
}
|
132 |
+
|
133 |
+
return $instance;
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Default options that are saved on plugin activation.
|
138 |
+
*
|
139 |
+
* @since 1.3.0
|
140 |
+
*
|
141 |
+
* @return array
|
142 |
+
*/
|
143 |
+
public static function get_defaults() {
|
144 |
+
|
145 |
+
return array(
|
146 |
+
'mail' => array(
|
147 |
+
'from_email' => get_option( 'admin_email' ),
|
148 |
+
'from_name' => get_bloginfo( 'name' ),
|
149 |
+
'mailer' => 'mail',
|
150 |
+
'return_path' => false,
|
151 |
+
'from_email_force' => false,
|
152 |
+
'from_name_force' => false,
|
153 |
+
),
|
154 |
+
'smtp' => array(
|
155 |
+
'autotls' => true,
|
156 |
+
'auth' => true,
|
157 |
+
),
|
158 |
+
);
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Retrieve all options of the plugin.
|
163 |
+
*
|
164 |
+
* @since 1.0.0
|
165 |
+
*/
|
166 |
+
protected function populate_options() {
|
167 |
+
$this->_options = get_option( self::META_KEY, array() );
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Get all the options.
|
172 |
+
*
|
173 |
+
* Options::init()->get_all();
|
174 |
+
*
|
175 |
+
* @since 1.0.0
|
176 |
+
*
|
177 |
+
* @return array
|
178 |
+
*/
|
179 |
+
public function get_all() {
|
180 |
+
|
181 |
+
$options = $this->_options;
|
182 |
+
|
183 |
+
foreach ( $options as $group => $g_value ) {
|
184 |
+
foreach ( $g_value as $key => $value ) {
|
185 |
+
$options[ $group ][ $key ] = $this->get( $group, $key );
|
186 |
+
}
|
187 |
+
}
|
188 |
+
|
189 |
+
return apply_filters( 'wp_mail_smtp_options_get_all', $options );
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Get all the options for a group.
|
194 |
+
*
|
195 |
+
* Options::init()->get_group('smtp') - will return the array of options for the group, including defaults and constants.
|
196 |
+
*
|
197 |
+
* @since 1.0.0
|
198 |
+
* @since 1.5.0 Process values through the get() method which is aware of constants.
|
199 |
+
*
|
200 |
+
* @param string $group
|
201 |
+
*
|
202 |
+
* @return array
|
203 |
+
*/
|
204 |
+
public function get_group( $group ) {
|
205 |
+
|
206 |
+
// Just to feel safe.
|
207 |
+
$group = sanitize_key( $group );
|
208 |
+
|
209 |
+
/*
|
210 |
+
* Get the values saved in DB.
|
211 |
+
* If plugin is configured with constants right from the start - this will not have all the values.
|
212 |
+
*/
|
213 |
+
$options = isset( $this->_options[ $group ] ) ? $this->_options[ $group ] : array();
|
214 |
+
|
215 |
+
// We need to process certain constants-aware options through actual constants.
|
216 |
+
if ( isset( self::$map[ $group ] ) ) {
|
217 |
+
foreach ( self::$map[ $group ] as $key ) {
|
218 |
+
$options[ $key ] = $this->get( $group, $key );
|
219 |
+
}
|
220 |
+
}
|
221 |
+
|
222 |
+
return apply_filters( 'wp_mail_smtp_options_get_group', $options, $group );
|
223 |
+
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* Get options by a group and a key.
|
227 |
+
*
|
228 |
+
* Options::init()->get( 'smtp', 'host' ) - will return only SMTP 'host' option.
|
229 |
+
*
|
230 |
+
* @since 1.0.0
|
231 |
+
*
|
232 |
+
* @param string $group
|
233 |
+
* @param string $key
|
234 |
+
*
|
235 |
+
* @return mixed|null Null if value doesn't exist anywhere: in constants, in DB, in a map. So it's completely custom or a typo.
|
236 |
+
*/
|
237 |
+
public function get( $group, $key ) {
|
238 |
+
|
239 |
+
// Just to feel safe.
|
240 |
+
$group = sanitize_key( $group );
|
241 |
+
$key = sanitize_key( $key );
|
242 |
+
$value = null;
|
243 |
+
|
244 |
+
// Get the const value if we have one.
|
245 |
+
$value = $this->get_const_value( $group, $key, $value );
|
246 |
+
|
247 |
+
// We don't have a const value.
|
248 |
+
if ( $value === null ) {
|
249 |
+
// Ordinary database or default values.
|
250 |
+
if ( isset( $this->_options[ $group ] ) ) {
|
251 |
+
// Get the options key of a group.
|
252 |
+
if ( isset( $this->_options[ $group ][ $key ] ) ) {
|
253 |
+
$value = $this->_options[ $group ][ $key ];
|
254 |
+
} else {
|
255 |
+
$value = $this->postprocess_key_defaults( $group, $key );
|
256 |
+
}
|
257 |
+
} else {
|
258 |
+
/*
|
259 |
+
* Fallback to default if it doesn't exist in a map.
|
260 |
+
* Allow to retrieve only values from a map.
|
261 |
+
*/
|
262 |
+
if (
|
263 |
+
isset( self::$map[ $group ] ) &&
|
264 |
+
in_array( $key, self::$map[ $group ], true )
|
265 |
+
) {
|
266 |
+
$value = $this->postprocess_key_defaults( $group, $key );
|
267 |
+
}
|
268 |
+
}
|
269 |
+
}
|
270 |
+
|
271 |
+
// Strip slashes only from values saved in DB. Constants should be processed as is.
|
272 |
+
if ( is_string( $value ) && ! $this->is_const_defined( $group, $key ) ) {
|
273 |
+
$value = stripslashes( $value );
|
274 |
+
}
|
275 |
+
|
276 |
+
return apply_filters( 'wp_mail_smtp_options_get', $value, $group, $key );
|
277 |
+
}
|
278 |
+
|
279 |
+
/**
|
280 |
+
* Some options may be non-empty by default,
|
281 |
+
* so we need to postprocess them to convert.
|
282 |
+
*
|
283 |
+
* @since 1.0.0
|
284 |
+
* @since 1.4.0 Added Mailgun:region.
|
285 |
+
* @since 1.5.0 Added Outlook/AmazonSES, license key support.
|
286 |
+
*
|
287 |
+
* @param string $group
|
288 |
+
* @param string $key
|
289 |
+
*
|
290 |
+
* @return mixed
|
291 |
+
*/
|
292 |
+
protected function postprocess_key_defaults( $group, $key ) {
|
293 |
+
|
294 |
+
$value = '';
|
295 |
+
|
296 |
+
switch ( $key ) {
|
297 |
+
case 'from_email_force':
|
298 |
+
case 'from_name_force':
|
299 |
+
case 'return_path':
|
300 |
+
$value = $group === 'mail' ? false : true;
|
301 |
+
break;
|
302 |
+
|
303 |
+
case 'mailer':
|
304 |
+
$value = 'mail';
|
305 |
+
break;
|
306 |
+
|
307 |
+
case 'encryption':
|
308 |
+
$value = in_array( $group, array( 'smtp', 'pepipost' ), true ) ? 'none' : $value;
|
309 |
+
break;
|
310 |
+
|
311 |
+
case 'region':
|
312 |
+
$value = $group === 'mailgun' ? 'US' : $value;
|
313 |
+
break;
|
314 |
+
|
315 |
+
case 'emails_pending':
|
316 |
+
$value = array();
|
317 |
+
break;
|
318 |
+
|
319 |
+
case 'auth':
|
320 |
+
case 'autotls':
|
321 |
+
$value = in_array( $group, array( 'smtp', 'pepipost' ), true ) ? false : true;
|
322 |
+
break;
|
323 |
+
|
324 |
+
case 'pass':
|
325 |
+
$value = $this->get_const_value( $group, $key, $value );
|
326 |
+
break;
|
327 |
+
|
328 |
+
case 'type':
|
329 |
+
$value = $group === 'license' ? 'lite' : '';
|
330 |
+
break;
|
331 |
+
}
|
332 |
+
|
333 |
+
return apply_filters( 'wp_mail_smtp_options_postprocess_key_defaults', $value, $group, $key );
|
334 |
+
}
|
335 |
+
|
336 |
+
/**
|
337 |
+
* Process the options values through the constants check.
|
338 |
+
* If we have defined associated constant - use it instead of a DB value.
|
339 |
+
* Backward compatibility is hard.
|
340 |
+
* General section of options won't have constants, so we are omitting those checks and just return default value.
|
341 |
+
*
|
342 |
+
* @since 1.0.0
|
343 |
+
* @since 1.4.0 Added WPMS_MAILGUN_REGION.
|
344 |
+
* @since 1.5.0 Added Outlook/AmazonSES, license key support.
|
345 |
+
* @since 1.6.0 Added Sendinblue.
|
346 |
+
* @since 1.7.0 Added Do Not Send.
|
347 |
+
* @since 1.8.0 Added Pepipost API.
|
348 |
+
*
|
349 |
+
* @param string $group
|
350 |
+
* @param string $key
|
351 |
+
* @param mixed $value
|
352 |
+
*
|
353 |
+
* @return mixed
|
354 |
+
*/
|
355 |
+
protected function get_const_value( $group, $key, $value ) {
|
356 |
+
|
357 |
+
if ( ! $this->is_const_enabled() ) {
|
358 |
+
return $value;
|
359 |
+
}
|
360 |
+
|
361 |
+
$return = null;
|
362 |
+
|
363 |
+
switch ( $group ) {
|
364 |
+
case 'mail':
|
365 |
+
switch ( $key ) {
|
366 |
+
case 'from_name':
|
367 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
368 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_MAIL_FROM_NAME : $value;
|
369 |
+
break;
|
370 |
+
case 'from_email':
|
371 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
372 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_MAIL_FROM : $value;
|
373 |
+
break;
|
374 |
+
case 'mailer':
|
375 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
376 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_MAILER : $value;
|
377 |
+
break;
|
378 |
+
case 'return_path':
|
379 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
380 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_SET_RETURN_PATH : $value;
|
381 |
+
break;
|
382 |
+
case 'from_name_force':
|
383 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
384 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_MAIL_FROM_NAME_FORCE : $value;
|
385 |
+
break;
|
386 |
+
case 'from_email_force':
|
387 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
388 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_MAIL_FROM_FORCE : $value;
|
389 |
+
break;
|
390 |
+
}
|
391 |
+
|
392 |
+
break;
|
393 |
+
|
394 |
+
case 'smtp':
|
395 |
+
switch ( $key ) {
|
396 |
+
case 'host':
|
397 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
398 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_HOST : $value;
|
399 |
+
break;
|
400 |
+
case 'port':
|
401 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
402 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_PORT : $value;
|
403 |
+
break;
|
404 |
+
case 'encryption':
|
405 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
406 |
+
$return = $this->is_const_defined( $group, $key ) ? ( WPMS_SSL === '' ? 'none' : WPMS_SSL ) : $value;
|
407 |
+
break;
|
408 |
+
case 'auth':
|
409 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
410 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_AUTH : $value;
|
411 |
+
break;
|
412 |
+
case 'autotls':
|
413 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
414 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_AUTOTLS : $value;
|
415 |
+
break;
|
416 |
+
case 'user':
|
417 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
418 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_USER : $value;
|
419 |
+
break;
|
420 |
+
case 'pass':
|
421 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
422 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_PASS : $value;
|
423 |
+
break;
|
424 |
+
}
|
425 |
+
|
426 |
+
break;
|
427 |
+
|
428 |
+
case 'gmail':
|
429 |
+
switch ( $key ) {
|
430 |
+
case 'client_id':
|
431 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
432 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_GMAIL_CLIENT_ID : $value;
|
433 |
+
break;
|
434 |
+
case 'client_secret':
|
435 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
436 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_GMAIL_CLIENT_SECRET : $value;
|
437 |
+
break;
|
438 |
+
}
|
439 |
+
|
440 |
+
break;
|
441 |
+
|
442 |
+
case 'outlook':
|
443 |
+
switch ( $key ) {
|
444 |
+
case 'client_id':
|
445 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
446 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_OUTLOOK_CLIENT_ID : $value;
|
447 |
+
break;
|
448 |
+
case 'client_secret':
|
449 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
450 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_OUTLOOK_CLIENT_SECRET : $value;
|
451 |
+
break;
|
452 |
+
}
|
453 |
+
|
454 |
+
break;
|
455 |
+
|
456 |
+
case 'amazonses':
|
457 |
+
switch ( $key ) {
|
458 |
+
case 'client_id':
|
459 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
460 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_AMAZONSES_CLIENT_ID : $value;
|
461 |
+
break;
|
462 |
+
case 'client_secret':
|
463 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
464 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_AMAZONSES_CLIENT_SECRET : $value;
|
465 |
+
break;
|
466 |
+
case 'region':
|
467 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
468 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_AMAZONSES_REGION : $value;
|
469 |
+
break;
|
470 |
+
}
|
471 |
+
|
472 |
+
break;
|
473 |
+
|
474 |
+
case 'mailgun':
|
475 |
+
switch ( $key ) {
|
476 |
+
case 'api_key':
|
477 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
478 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_MAILGUN_API_KEY : $value;
|
479 |
+
break;
|
480 |
+
case 'domain':
|
481 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
482 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_MAILGUN_DOMAIN : $value;
|
483 |
+
break;
|
484 |
+
case 'region':
|
485 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
486 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_MAILGUN_REGION : $value;
|
487 |
+
break;
|
488 |
+
}
|
489 |
+
|
490 |
+
break;
|
491 |
+
|
492 |
+
case 'sendgrid':
|
493 |
+
switch ( $key ) {
|
494 |
+
case 'api_key':
|
495 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
496 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_SENDGRID_API_KEY : $value;
|
497 |
+
break;
|
498 |
+
}
|
499 |
+
|
500 |
+
break;
|
501 |
+
|
502 |
+
case 'sendinblue':
|
503 |
+
switch ( $key ) {
|
504 |
+
case 'api_key':
|
505 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
506 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_SENDINBLUE_API_KEY : $value;
|
507 |
+
break;
|
508 |
+
}
|
509 |
+
|
510 |
+
break;
|
511 |
+
|
512 |
+
case 'pepipostapi':
|
513 |
+
switch ( $key ) {
|
514 |
+
case 'api_key':
|
515 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
516 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_PEPIPOST_API_KEY : $value;
|
517 |
+
break;
|
518 |
+
}
|
519 |
+
|
520 |
+
break;
|
521 |
+
|
522 |
+
case 'license':
|
523 |
+
switch ( $key ) {
|
524 |
+
case 'key':
|
525 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
526 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_LICENSE_KEY : $value;
|
527 |
+
break;
|
528 |
+
}
|
529 |
+
|
530 |
+
break;
|
531 |
+
|
532 |
+
case 'general':
|
533 |
+
switch ( $key ) {
|
534 |
+
case 'do_not_send':
|
535 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
536 |
+
$return = $this->is_const_defined( $group, $key ) ? WPMS_DO_NOT_SEND : $value;
|
537 |
+
break;
|
538 |
+
}
|
539 |
+
|
540 |
+
break;
|
541 |
+
|
542 |
+
default:
|
543 |
+
// Always return the default value if nothing from above matches the request.
|
544 |
+
$return = $value;
|
545 |
+
}
|
546 |
+
|
547 |
+
return apply_filters( 'wp_mail_smtp_options_get_const_value', $return, $group, $key, $value );
|
548 |
+
}
|
549 |
+
|
550 |
+
/**
|
551 |
+
* Whether constants redefinition is enabled or not.
|
552 |
+
*
|
553 |
+
* @since 1.0.0
|
554 |
+
* @since 1.5.0 Added filter to redefine the value.
|
555 |
+
*
|
556 |
+
* @return bool
|
557 |
+
*/
|
558 |
+
public function is_const_enabled() {
|
559 |
+
|
560 |
+
$return = defined( 'WPMS_ON' ) && WPMS_ON === true;
|
561 |
+
|
562 |
+
return apply_filters( 'wp_mail_smtp_options_is_const_enabled', $return );
|
563 |
+
}
|
564 |
+
|
565 |
+
/**
|
566 |
+
* We need this check to reuse later in admin area,
|
567 |
+
* to distinguish settings fields that were redefined,
|
568 |
+
* and display them differently.
|
569 |
+
*
|
570 |
+
* @since 1.0.0
|
571 |
+
* @since 1.5.0 Added a filter, Outlook/AmazonSES, license key support.
|
572 |
+
* @since 1.6.0 Added Sendinblue.
|
573 |
+
* @since 1.7.0 Added Do Not Send.
|
574 |
+
* @since 1.8.0 Added Pepipost API.
|
575 |
+
*
|
576 |
+
* @param string $group
|
577 |
+
* @param string $key
|
578 |
+
*
|
579 |
+
* @return bool
|
580 |
+
*/
|
581 |
+
public function is_const_defined( $group, $key ) {
|
582 |
+
|
583 |
+
if ( ! $this->is_const_enabled() ) {
|
584 |
+
return false;
|
585 |
+
}
|
586 |
+
|
587 |
+
// Just to feel safe.
|
588 |
+
$group = sanitize_key( $group );
|
589 |
+
$key = sanitize_key( $key );
|
590 |
+
$return = false;
|
591 |
+
|
592 |
+
switch ( $group ) {
|
593 |
+
case 'mail':
|
594 |
+
switch ( $key ) {
|
595 |
+
case 'from_name':
|
596 |
+
$return = defined( 'WPMS_MAIL_FROM_NAME' ) && WPMS_MAIL_FROM_NAME;
|
597 |
+
break;
|
598 |
+
case 'from_email':
|
599 |
+
$return = defined( 'WPMS_MAIL_FROM' ) && WPMS_MAIL_FROM;
|
600 |
+
break;
|
601 |
+
case 'mailer':
|
602 |
+
$return = defined( 'WPMS_MAILER' ) && WPMS_MAILER;
|
603 |
+
break;
|
604 |
+
case 'return_path':
|
605 |
+
$return = defined( 'WPMS_SET_RETURN_PATH' ) && ( WPMS_SET_RETURN_PATH === 'true' || WPMS_SET_RETURN_PATH === true );
|
606 |
+
break;
|
607 |
+
case 'from_name_force':
|
608 |
+
$return = defined( 'WPMS_MAIL_FROM_NAME_FORCE' ) && ( WPMS_MAIL_FROM_NAME_FORCE === 'true' || WPMS_MAIL_FROM_NAME_FORCE === true );
|
609 |
+
break;
|
610 |
+
case 'from_email_force':
|
611 |
+
$return = defined( 'WPMS_MAIL_FROM_FORCE' ) && ( WPMS_MAIL_FROM_FORCE === 'true' || WPMS_MAIL_FROM_FORCE === true );
|
612 |
+
break;
|
613 |
+
}
|
614 |
+
|
615 |
+
break;
|
616 |
+
|
617 |
+
case 'smtp':
|
618 |
+
switch ( $key ) {
|
619 |
+
case 'host':
|
620 |
+
$return = defined( 'WPMS_SMTP_HOST' ) && WPMS_SMTP_HOST;
|
621 |
+
break;
|
622 |
+
case 'port':
|
623 |
+
$return = defined( 'WPMS_SMTP_PORT' ) && WPMS_SMTP_PORT;
|
624 |
+
break;
|
625 |
+
case 'encryption':
|
626 |
+
$return = defined( 'WPMS_SSL' );
|
627 |
+
break;
|
628 |
+
case 'auth':
|
629 |
+
$return = defined( 'WPMS_SMTP_AUTH' ) && WPMS_SMTP_AUTH;
|
630 |
+
break;
|
631 |
+
case 'autotls':
|
632 |
+
$return = defined( 'WPMS_SMTP_AUTOTLS' ) && ( WPMS_SMTP_AUTOTLS === 'true' || WPMS_SMTP_AUTOTLS === true );
|
633 |
+
break;
|
634 |
+
case 'user':
|
635 |
+
$return = defined( 'WPMS_SMTP_USER' ) && WPMS_SMTP_USER;
|
636 |
+
break;
|
637 |
+
case 'pass':
|
638 |
+
$return = defined( 'WPMS_SMTP_PASS' ) && WPMS_SMTP_PASS;
|
639 |
+
break;
|
640 |
+
}
|
641 |
+
|
642 |
+
break;
|
643 |
+
|
644 |
+
case 'gmail':
|
645 |
+
switch ( $key ) {
|
646 |
+
case 'client_id':
|
647 |
+
$return = defined( 'WPMS_GMAIL_CLIENT_ID' ) && WPMS_GMAIL_CLIENT_ID;
|
648 |
+
break;
|
649 |
+
case 'client_secret':
|
650 |
+
$return = defined( 'WPMS_GMAIL_CLIENT_SECRET' ) && WPMS_GMAIL_CLIENT_SECRET;
|
651 |
+
break;
|
652 |
+
}
|
653 |
+
|
654 |
+
break;
|
655 |
+
|
656 |
+
case 'outlook':
|
657 |
+
switch ( $key ) {
|
658 |
+
case 'client_id':
|
659 |
+
$return = defined( 'WPMS_OUTLOOK_CLIENT_ID' ) && WPMS_OUTLOOK_CLIENT_ID;
|
660 |
+
break;
|
661 |
+
case 'client_secret':
|
662 |
+
$return = defined( 'WPMS_OUTLOOK_CLIENT_SECRET' ) && WPMS_OUTLOOK_CLIENT_SECRET;
|
663 |
+
break;
|
664 |
+
}
|
665 |
+
|
666 |
+
break;
|
667 |
+
|
668 |
+
case 'amazonses':
|
669 |
+
switch ( $key ) {
|
670 |
+
case 'client_id':
|
671 |
+
$return = defined( 'WPMS_AMAZONSES_CLIENT_ID' ) && WPMS_AMAZONSES_CLIENT_ID;
|
672 |
+
break;
|
673 |
+
case 'client_secret':
|
674 |
+
$return = defined( 'WPMS_AMAZONSES_CLIENT_SECRET' ) && WPMS_AMAZONSES_CLIENT_SECRET;
|
675 |
+
break;
|
676 |
+
case 'region':
|
677 |
+
$return = defined( 'WPMS_AMAZONSES_REGION' ) && WPMS_AMAZONSES_REGION;
|
678 |
+
break;
|
679 |
+
}
|
680 |
+
|
681 |
+
break;
|
682 |
+
|
683 |
+
case 'mailgun':
|
684 |
+
switch ( $key ) {
|
685 |
+
case 'api_key':
|
686 |
+
$return = defined( 'WPMS_MAILGUN_API_KEY' ) && WPMS_MAILGUN_API_KEY;
|
687 |
+
break;
|
688 |
+
case 'domain':
|
689 |
+
$return = defined( 'WPMS_MAILGUN_DOMAIN' ) && WPMS_MAILGUN_DOMAIN;
|
690 |
+
break;
|
691 |
+
case 'region':
|
692 |
+
$return = defined( 'WPMS_MAILGUN_REGION' ) && WPMS_MAILGUN_REGION;
|
693 |
+
break;
|
694 |
+
}
|
695 |
+
|
696 |
+
break;
|
697 |
+
|
698 |
+
case 'sendgrid':
|
699 |
+
switch ( $key ) {
|
700 |
+
case 'api_key':
|
701 |
+
$return = defined( 'WPMS_SENDGRID_API_KEY' ) && WPMS_SENDGRID_API_KEY;
|
702 |
+
break;
|
703 |
+
}
|
704 |
+
|
705 |
+
break;
|
706 |
+
|
707 |
+
case 'sendinblue':
|
708 |
+
switch ( $key ) {
|
709 |
+
case 'api_key':
|
710 |
+
$return = defined( 'WPMS_SENDINBLUE_API_KEY' ) && WPMS_SENDINBLUE_API_KEY;
|
711 |
+
break;
|
712 |
+
}
|
713 |
+
|
714 |
+
break;
|
715 |
+
|
716 |
+
case 'pepipostapi':
|
717 |
+
switch ( $key ) {
|
718 |
+
case 'api_key':
|
719 |
+
$return = defined( 'WPMS_PEPIPOST_API_KEY' ) && WPMS_PEPIPOST_API_KEY;
|
720 |
+
break;
|
721 |
+
}
|
722 |
+
|
723 |
+
break;
|
724 |
+
|
725 |
+
case 'license':
|
726 |
+
switch ( $key ) {
|
727 |
+
case 'key':
|
728 |
+
$return = defined( 'WPMS_LICENSE_KEY' ) && WPMS_LICENSE_KEY;
|
729 |
+
break;
|
730 |
+
}
|
731 |
+
|
732 |
+
break;
|
733 |
+
|
734 |
+
case 'general':
|
735 |
+
switch ( $key ) {
|
736 |
+
case 'do_not_send':
|
737 |
+
/** @noinspection PhpUndefinedConstantInspection */
|
738 |
+
$return = defined( 'WPMS_DO_NOT_SEND' ) && WPMS_DO_NOT_SEND;
|
739 |
+
break;
|
740 |
+
}
|
741 |
+
|
742 |
+
break;
|
743 |
+
}
|
744 |
+
|
745 |
+
return apply_filters( 'wp_mail_smtp_options_is_const_defined', $return, $group, $key );
|
746 |
+
}
|
747 |
+
|
748 |
+
/**
|
749 |
+
* Set plugin options, all at once.
|
750 |
+
*
|
751 |
+
* @since 1.0.0
|
752 |
+
* @since 1.3.0 Added $once argument to save options only if they don't exist already.
|
753 |
+
* @since 1.4.0 Added Mailgun:region.
|
754 |
+
* @since 1.5.0 Added Outlook/AmazonSES, Email Log. Stop saving const values into DB.
|
755 |
+
*
|
756 |
+
* @param array $options Plugin options to save.
|
757 |
+
* @param bool $once Whether to update existing options or to add these options only once.
|
758 |
+
*/
|
759 |
+
public function set( $options, $once = false ) {
|
760 |
+
/*
|
761 |
+
* Process generic options.
|
762 |
+
*/
|
763 |
+
foreach ( (array) $options as $group => $keys ) {
|
764 |
+
foreach ( $keys as $option_name => $option_value ) {
|
765 |
+
switch ( $group ) {
|
766 |
+
case 'mail':
|
767 |
+
switch ( $option_name ) {
|
768 |
+
case 'from_name':
|
769 |
+
case 'mailer':
|
770 |
+
$options[ $group ][ $option_name ] = sanitize_text_field( $option_value );
|
771 |
+
break;
|
772 |
+
case 'from_email':
|
773 |
+
if ( filter_var( $option_value, FILTER_VALIDATE_EMAIL ) ) {
|
774 |
+
$options[ $group ][ $option_name ] = sanitize_email( $option_value );
|
775 |
+
} else {
|
776 |
+
$options[ $group ][ $option_name ] = sanitize_email(
|
777 |
+
wp_mail_smtp()->get_processor()->get_default_email()
|
778 |
+
);
|
779 |
+
}
|
780 |
+
break;
|
781 |
+
case 'return_path':
|
782 |
+
case 'from_name_force':
|
783 |
+
case 'from_email_force':
|
784 |
+
$options[ $group ][ $option_name ] = (bool) $option_value;
|
785 |
+
break;
|
786 |
+
}
|
787 |
+
break;
|
788 |
+
|
789 |
+
case 'general':
|
790 |
+
switch ( $option_name ) {
|
791 |
+
case 'do_not_send':
|
792 |
+
case 'am_notifications_hidden':
|
793 |
+
case 'email_delivery_errors_hidden':
|
794 |
+
case 'uninstall':
|
795 |
+
$options[ $group ][ $option_name ] = (bool) $option_value;
|
796 |
+
break;
|
797 |
+
}
|
798 |
+
}
|
799 |
+
}
|
800 |
+
}
|
801 |
+
|
802 |
+
/*
|
803 |
+
* Process mailers-specific options.
|
804 |
+
*/
|
805 |
+
if (
|
806 |
+
! empty( $options['mail']['mailer'] ) &&
|
807 |
+
isset( $options[ $options['mail']['mailer'] ] ) &&
|
808 |
+
in_array( $options['mail']['mailer'], array( 'pepipost', 'pepipostapi', 'smtp', 'sendgrid', 'sendinblue', 'mailgun', 'gmail', 'outlook' ), true )
|
809 |
+
) {
|
810 |
+
|
811 |
+
$mailer = $options['mail']['mailer'];
|
812 |
+
|
813 |
+
foreach ( $options[ $mailer ] as $option_name => $option_value ) {
|
814 |
+
switch ( $option_name ) {
|
815 |
+
case 'host': // smtp.
|
816 |
+
case 'user': // smtp.
|
817 |
+
case 'encryption': // smtp.
|
818 |
+
case 'region': // mailgun/amazonses.
|
819 |
+
$options[ $mailer ][ $option_name ] = $this->is_const_defined( $mailer, $option_name ) ? '' : sanitize_text_field( $option_value );
|
820 |
+
break; // smtp.
|
821 |
+
case 'port':
|
822 |
+
$options[ $mailer ][ $option_name ] = $this->is_const_defined( $mailer, $option_name ) ? 25 : (int) $option_value;
|
823 |
+
break;
|
824 |
+
case 'auth': // smtp.
|
825 |
+
case 'autotls': // smtp.
|
826 |
+
$option_value = (bool) $option_value;
|
827 |
+
|
828 |
+
$options[ $mailer ][ $option_name ] = $this->is_const_defined( $mailer, $option_name ) ? false : $option_value;
|
829 |
+
break;
|
830 |
+
|
831 |
+
case 'pass': // smtp.
|
832 |
+
// Do not process as they may contain certain special characters, but allow to be overwritten using constants.
|
833 |
+
$options[ $mailer ][ $option_name ] = $this->is_const_defined( $mailer, $option_name ) ? '' : trim( (string) $option_value );
|
834 |
+
break;
|
835 |
+
|
836 |
+
case 'api_key': // mailgun/sendgrid/sendinblue/pepipostapi.
|
837 |
+
case 'domain': // mailgun.
|
838 |
+
case 'client_id': // gmail/outlook/amazonses.
|
839 |
+
case 'client_secret': // gmail/outlook/amazonses.
|
840 |
+
case 'auth_code': // gmail/outlook.
|
841 |
+
$options[ $mailer ][ $option_name ] = $this->is_const_defined( $mailer, $option_name ) ? '' : sanitize_text_field( $option_value );
|
842 |
+
break;
|
843 |
+
|
844 |
+
case 'access_token': // gmail/outlook, array().
|
845 |
+
case 'user_details': // outlook, array().
|
846 |
+
case 'emails_pending': // amazonses, array().
|
847 |
+
// These options don't support constants.
|
848 |
+
$options[ $mailer ][ $option_name ] = $option_value;
|
849 |
+
break;
|
850 |
+
}
|
851 |
+
}
|
852 |
+
}
|
853 |
+
|
854 |
+
$options = apply_filters( 'wp_mail_smtp_options_set', $options );
|
855 |
+
|
856 |
+
// Whether to update existing options or to add these options only once if they don't exist yet.
|
857 |
+
if ( $once ) {
|
858 |
+
add_option( self::META_KEY, $options, '', 'no' ); // Do not autoload these options.
|
859 |
+
} else {
|
860 |
+
update_option( self::META_KEY, $options, 'no' );
|
861 |
+
}
|
862 |
+
|
863 |
+
// Now we need to re-cache values.
|
864 |
+
$this->populate_options();
|
865 |
+
}
|
866 |
+
|
867 |
+
/**
|
868 |
+
* Merge recursively, including a proper substitution of values in sub-arrays when keys are the same.
|
869 |
+
* It's more like array_merge() and array_merge_recursive() combined.
|
870 |
+
*
|
871 |
+
* @since 1.0.0
|
872 |
+
*
|
873 |
+
* @return array
|
874 |
+
*/
|
875 |
+
public static function array_merge_recursive() {
|
876 |
+
|
877 |
+
$arrays = func_get_args();
|
878 |
+
|
879 |
+
if ( count( $arrays ) < 2 ) {
|
880 |
+
return isset( $arrays[0] ) ? $arrays[0] : array();
|
881 |
+
}
|
882 |
+
|
883 |
+
$merged = array();
|
884 |
+
|
885 |
+
while ( $arrays ) {
|
886 |
+
$array = array_shift( $arrays );
|
887 |
+
|
888 |
+
if ( ! is_array( $array ) ) {
|
889 |
+
return array();
|
890 |
+
}
|
891 |
+
|
892 |
+
if ( empty( $array ) ) {
|
893 |
+
continue;
|
894 |
+
}
|
895 |
+
|
896 |
+
foreach ( $array as $key => $value ) {
|
897 |
+
if ( is_string( $key ) ) {
|
898 |
+
if (
|
899 |
+
is_array( $value ) &&
|
900 |
+
array_key_exists( $key, $merged ) &&
|
901 |
+
is_array( $merged[ $key ] )
|
902 |
+
) {
|
903 |
+
$merged[ $key ] = call_user_func( __METHOD__, $merged[ $key ], $value );
|
904 |
+
} else {
|
905 |
+
$merged[ $key ] = $value;
|
906 |
+
}
|
907 |
+
} else {
|
908 |
+
$merged[] = $value;
|
909 |
+
}
|
910 |
+
}
|
911 |
+
}
|
912 |
+
|
913 |
+
return $merged;
|
914 |
+
}
|
915 |
+
|
916 |
+
/**
|
917 |
+
* Check whether the site is using Pepipost SMTP or not.
|
918 |
+
*
|
919 |
+
* @since 1.0.0
|
920 |
+
*
|
921 |
+
* @return bool
|
922 |
+
*/
|
923 |
+
public function is_pepipost_active() {
|
924 |
+
return apply_filters( 'wp_mail_smtp_options_is_pepipost_active', $this->get( 'mail', 'mailer' ) === 'pepipost' );
|
925 |
+
}
|
926 |
+
|
927 |
+
/**
|
928 |
+
* Check whether the site is using Pepipost/SMTP as a mailer or not.
|
929 |
+
*
|
930 |
+
* @since 1.1.0
|
931 |
+
*
|
932 |
+
* @return bool
|
933 |
+
*/
|
934 |
+
public function is_mailer_smtp() {
|
935 |
+
return apply_filters( 'wp_mail_smtp_options_is_mailer_smtp', in_array( $this->get( 'mail', 'mailer' ), array( 'pepipost', 'smtp' ), true ) );
|
936 |
+
}
|
937 |
+
}
|
src/Processor.php
CHANGED
@@ -229,4 +229,24 @@ class Processor {
|
|
229 |
public function get_default_name() {
|
230 |
return 'WordPress';
|
231 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
}
|
229 |
public function get_default_name() {
|
230 |
return 'WordPress';
|
231 |
}
|
232 |
+
|
233 |
+
/**
|
234 |
+
* Get or create the phpmailer.
|
235 |
+
*
|
236 |
+
* @since {VERSION}
|
237 |
+
*
|
238 |
+
* @return \WPMailSMTP\MailCatcher
|
239 |
+
*/
|
240 |
+
public function get_phpmailer() {
|
241 |
+
|
242 |
+
global $phpmailer;
|
243 |
+
|
244 |
+
// Make sure the PHPMailer class has been instantiated.
|
245 |
+
if ( ! is_object( $phpmailer ) || ! is_a( $phpmailer, 'PHPMailer' ) ) {
|
246 |
+
require_once ABSPATH . WPINC . '/class-phpmailer.php';
|
247 |
+
$phpmailer = new MailCatcher( true ); // phpcs:ignore
|
248 |
+
}
|
249 |
+
|
250 |
+
return $phpmailer;
|
251 |
+
}
|
252 |
}
|
src/Providers/Gmail/Mailer.php
CHANGED
@@ -1,209 +1,222 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPMailSMTP\Providers\Gmail;
|
4 |
-
|
5 |
-
use WPMailSMTP\Debug;
|
6 |
-
use WPMailSMTP\MailCatcher;
|
7 |
-
use WPMailSMTP\Providers\MailerAbstract;
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Class Mailer.
|
11 |
-
*
|
12 |
-
* @since 1.0.0
|
13 |
-
*/
|
14 |
-
class Mailer extends MailerAbstract {
|
15 |
-
|
16 |
-
/**
|
17 |
-
* URL to make an API request to.
|
18 |
-
* Not used for Gmail, as we are using its API.
|
19 |
-
*
|
20 |
-
* @since 1.0.0
|
21 |
-
*
|
22 |
-
* @var string
|
23 |
-
*/
|
24 |
-
protected $url = 'https://www.googleapis.com/upload/gmail/v1/users/{userId}/messages/send';
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Gmail message.
|
28 |
-
*
|
29 |
-
* @since 1.0.0
|
30 |
-
*
|
31 |
-
* @var \Google_Service_Gmail_Message
|
32 |
-
*/
|
33 |
-
protected $message;
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Mailer constructor.
|
37 |
-
*
|
38 |
-
* @since 1.0.0
|
39 |
-
*
|
40 |
-
* @param \WPMailSMTP\MailCatcher $phpmailer
|
41 |
-
*/
|
42 |
-
public function __construct( $phpmailer ) {
|
43 |
-
parent::__construct( $phpmailer );
|
44 |
-
|
45 |
-
if ( ! $this->is_php_compatible() ) {
|
46 |
-
return;
|
47 |
-
}
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Re-use the MailCatcher class methods and properties.
|
52 |
-
*
|
53 |
-
* @since 1.2.0
|
54 |
-
*
|
55 |
-
* @param \WPMailSMTP\MailCatcher $phpmailer
|
56 |
-
*/
|
57 |
-
public function process_phpmailer( $phpmailer ) {
|
58 |
-
// Make sure that we have access to MailCatcher class methods.
|
59 |
-
if (
|
60 |
-
! $phpmailer instanceof MailCatcher &&
|
61 |
-
! $phpmailer instanceof \PHPMailer
|
62 |
-
) {
|
63 |
-
return;
|
64 |
-
}
|
65 |
-
|
66 |
-
$this->phpmailer = $phpmailer;
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Use Google API Services to send emails.
|
71 |
-
*
|
72 |
-
* @since 1.0.0
|
73 |
-
*/
|
74 |
-
public function send() {
|
75 |
-
|
76 |
-
// Include the Google library.
|
77 |
-
require_once wp_mail_smtp()->plugin_path . '/vendor/autoload.php';
|
78 |
-
|
79 |
-
$auth = new Auth();
|
80 |
-
$message = new \Google_Service_Gmail_Message();
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
);
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
*
|
125 |
-
*
|
126 |
-
*
|
127 |
-
*
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
$
|
171 |
-
$
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPMailSMTP\Providers\Gmail;
|
4 |
+
|
5 |
+
use WPMailSMTP\Debug;
|
6 |
+
use WPMailSMTP\MailCatcher;
|
7 |
+
use WPMailSMTP\Providers\MailerAbstract;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class Mailer.
|
11 |
+
*
|
12 |
+
* @since 1.0.0
|
13 |
+
*/
|
14 |
+
class Mailer extends MailerAbstract {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* URL to make an API request to.
|
18 |
+
* Not used for Gmail, as we are using its API.
|
19 |
+
*
|
20 |
+
* @since 1.0.0
|
21 |
+
*
|
22 |
+
* @var string
|
23 |
+
*/
|
24 |
+
protected $url = 'https://www.googleapis.com/upload/gmail/v1/users/{userId}/messages/send';
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Gmail message.
|
28 |
+
*
|
29 |
+
* @since 1.0.0
|
30 |
+
*
|
31 |
+
* @var \Google_Service_Gmail_Message
|
32 |
+
*/
|
33 |
+
protected $message;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Mailer constructor.
|
37 |
+
*
|
38 |
+
* @since 1.0.0
|
39 |
+
*
|
40 |
+
* @param \WPMailSMTP\MailCatcher $phpmailer
|
41 |
+
*/
|
42 |
+
public function __construct( $phpmailer ) {
|
43 |
+
parent::__construct( $phpmailer );
|
44 |
+
|
45 |
+
if ( ! $this->is_php_compatible() ) {
|
46 |
+
return;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Re-use the MailCatcher class methods and properties.
|
52 |
+
*
|
53 |
+
* @since 1.2.0
|
54 |
+
*
|
55 |
+
* @param \WPMailSMTP\MailCatcher $phpmailer
|
56 |
+
*/
|
57 |
+
public function process_phpmailer( $phpmailer ) {
|
58 |
+
// Make sure that we have access to MailCatcher class methods.
|
59 |
+
if (
|
60 |
+
! $phpmailer instanceof MailCatcher &&
|
61 |
+
! $phpmailer instanceof \PHPMailer
|
62 |
+
) {
|
63 |
+
return;
|
64 |
+
}
|
65 |
+
|
66 |
+
$this->phpmailer = $phpmailer;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Use Google API Services to send emails.
|
71 |
+
*
|
72 |
+
* @since 1.0.0
|
73 |
+
*/
|
74 |
+
public function send() {
|
75 |
+
|
76 |
+
// Include the Google library.
|
77 |
+
require_once wp_mail_smtp()->plugin_path . '/vendor/autoload.php';
|
78 |
+
|
79 |
+
$auth = new Auth();
|
80 |
+
$message = new \Google_Service_Gmail_Message();
|
81 |
+
|
82 |
+
/*
|
83 |
+
* Right now Gmail doesn't allow to redefine From and Sender email headers.
|
84 |
+
* It always uses the email address that was used to connect to its API.
|
85 |
+
* With code below we are making sure that Email Log archive and single Email Log
|
86 |
+
* have the save value for From email header.
|
87 |
+
*/
|
88 |
+
$gmail_creds = $auth->get_user_info();
|
89 |
+
|
90 |
+
if ( ! empty( $gmail_creds['email'] ) ) {
|
91 |
+
$this->phpmailer->From = $gmail_creds['email'];
|
92 |
+
$this->phpmailer->Sender = $gmail_creds['email'];
|
93 |
+
}
|
94 |
+
|
95 |
+
// Get the raw MIME email using MailCatcher data.
|
96 |
+
// We need here to make base64URL-safe string.
|
97 |
+
$base64 = str_replace(
|
98 |
+
array( '+', '/', '=' ),
|
99 |
+
array( '-', '_', '' ),
|
100 |
+
base64_encode( $this->phpmailer->getSentMIMEMessage() )
|
101 |
+
);
|
102 |
+
|
103 |
+
$message->setRaw( $base64 );
|
104 |
+
|
105 |
+
$service = new \Google_Service_Gmail( $auth->get_client() );
|
106 |
+
|
107 |
+
try {
|
108 |
+
$response = $service->users_messages->send( 'me', $message );
|
109 |
+
|
110 |
+
$this->process_response( $response );
|
111 |
+
} catch ( \Exception $e ) {
|
112 |
+
Debug::set(
|
113 |
+
'Mailer: Gmail' . "\r\n" .
|
114 |
+
$e->getMessage()
|
115 |
+
);
|
116 |
+
|
117 |
+
return;
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Save response from the API to use it later.
|
123 |
+
*
|
124 |
+
* @since 1.0.0
|
125 |
+
* @since 1.5.0 Added action "wp_mail_smtp_providers_gmail_mailer_process_response" with $response.
|
126 |
+
*
|
127 |
+
* @param \Google_Service_Gmail_Message $response
|
128 |
+
*/
|
129 |
+
protected function process_response( $response ) {
|
130 |
+
|
131 |
+
$this->response = $response;
|
132 |
+
|
133 |
+
do_action( 'wp_mail_smtp_providers_gmail_mailer_process_response', $this->response, $this->phpmailer );
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Check whether the email was sent.
|
138 |
+
*
|
139 |
+
* @since 1.0.0
|
140 |
+
*
|
141 |
+
* @return bool
|
142 |
+
*/
|
143 |
+
public function is_email_sent() {
|
144 |
+
|
145 |
+
$is_sent = false;
|
146 |
+
|
147 |
+
if ( method_exists( $this->response, 'getId' ) ) {
|
148 |
+
$message_id = $this->response->getId();
|
149 |
+
if ( ! empty( $message_id ) ) {
|
150 |
+
$is_sent = true;
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
// Clear debug messages if email is successfully sent.
|
155 |
+
if ( $is_sent ) {
|
156 |
+
Debug::clear();
|
157 |
+
}
|
158 |
+
|
159 |
+
return $is_sent;
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* @inheritdoc
|
164 |
+
*/
|
165 |
+
public function get_debug_info() {
|
166 |
+
|
167 |
+
$gmail_text = array();
|
168 |
+
|
169 |
+
$options = new \WPMailSMTP\Options();
|
170 |
+
$gmail = $options->get_group( 'gmail' );
|
171 |
+
$curl_ver = 'No';
|
172 |
+
if ( function_exists( 'curl_version' ) ) {
|
173 |
+
$curl = curl_version(); // phpcs:ignore
|
174 |
+
$curl_ver = $curl['version'];
|
175 |
+
}
|
176 |
+
|
177 |
+
$gmail_text[] = '<strong>Client ID/Secret:</strong> ' . ( ! empty( $gmail['client_id'] ) && ! empty( $gmail['client_secret'] ) ? 'Yes' : 'No' );
|
178 |
+
$gmail_text[] = '<strong>Auth Code:</strong> ' . ( ! empty( $gmail['auth_code'] ) ? 'Yes' : 'No' );
|
179 |
+
$gmail_text[] = '<strong>Access Token:</strong> ' . ( ! empty( $gmail['access_token'] ) ? 'Yes' : 'No' );
|
180 |
+
|
181 |
+
$gmail_text[] = '<br><strong>Server:</strong>';
|
182 |
+
|
183 |
+
$gmail_text[] = '<strong>OpenSSL:</strong> ' . ( extension_loaded( 'openssl' ) && defined( 'OPENSSL_VERSION_TEXT' ) ? OPENSSL_VERSION_TEXT : 'No' );
|
184 |
+
$gmail_text[] = '<strong>PHP.allow_url_fopen:</strong> ' . ( ini_get( 'allow_url_fopen' ) ? 'Yes' : 'No' );
|
185 |
+
$gmail_text[] = '<strong>PHP.stream_socket_client():</strong> ' . ( function_exists( 'stream_socket_client' ) ? 'Yes' : 'No' );
|
186 |
+
$gmail_text[] = '<strong>PHP.fsockopen():</strong> ' . ( function_exists( 'fsockopen' ) ? 'Yes' : 'No' );
|
187 |
+
$gmail_text[] = '<strong>PHP.curl_version():</strong> ' . $curl_ver; // phpcs:ignore
|
188 |
+
if ( function_exists( 'apache_get_modules' ) ) {
|
189 |
+
$modules = apache_get_modules();
|
190 |
+
$gmail_text[] = '<strong>Apache.mod_security:</strong> ' . ( in_array( 'mod_security', $modules, true ) || in_array( 'mod_security2', $modules, true ) ? 'Yes' : 'No' );
|
191 |
+
}
|
192 |
+
if ( function_exists( 'selinux_is_enabled' ) ) {
|
193 |
+
$gmail_text[] = '<strong>OS.SELinux:</strong> ' . ( selinux_is_enabled() ? 'Yes' : 'No' );
|
194 |
+
}
|
195 |
+
if ( function_exists( 'grsecurity_is_enabled' ) ) {
|
196 |
+
$gmail_text[] = '<strong>OS.grsecurity:</strong> ' . ( grsecurity_is_enabled() ? 'Yes' : 'No' );
|
197 |
+
}
|
198 |
+
|
199 |
+
return implode( '<br>', $gmail_text );
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* @inheritdoc
|
204 |
+
*/
|
205 |
+
public function is_mailer_complete() {
|
206 |
+
|
207 |
+
if ( ! $this->is_php_compatible() ) {
|
208 |
+
return false;
|
209 |
+
}
|
210 |
+
|
211 |
+
$auth = new Auth();
|
212 |
+
|
213 |
+
if (
|
214 |
+
$auth->is_clients_saved() &&
|
215 |
+
! $auth->is_auth_required()
|
216 |
+
) {
|
217 |
+
return true;
|
218 |
+
}
|
219 |
+
|
220 |
+
return false;
|
221 |
+
}
|
222 |
+
}
|
src/Providers/MailerAbstract.php
CHANGED
@@ -1,417 +1,417 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPMailSMTP\Providers;
|
4 |
-
|
5 |
-
use WPMailSMTP\Conflicts;
|
6 |
-
use WPMailSMTP\Debug;
|
7 |
-
use WPMailSMTP\MailCatcher;
|
8 |
-
use WPMailSMTP\Options;
|
9 |
-
use WPMailSMTP\WP;
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Class MailerAbstract.
|
13 |
-
*
|
14 |
-
* @since 1.0.0
|
15 |
-
*/
|
16 |
-
abstract class MailerAbstract implements MailerInterface {
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Which response code from HTTP provider is considered to be successful?
|
20 |
-
*
|
21 |
-
* @since 1.0.0
|
22 |
-
*
|
23 |
-
* @var int
|
24 |
-
*/
|
25 |
-
protected $email_sent_code = 200;
|
26 |
-
/**
|
27 |
-
* @since 1.0.0
|
28 |
-
*
|
29 |
-
* @var Options
|
30 |
-
*/
|
31 |
-
protected $options;
|
32 |
-
/**
|
33 |
-
* @since 1.0.0
|
34 |
-
*
|
35 |
-
* @var MailCatcher
|
36 |
-
*/
|
37 |
-
protected $phpmailer;
|
38 |
-
/**
|
39 |
-
* @since 1.0.0
|
40 |
-
*
|
41 |
-
* @var string
|
42 |
-
*/
|
43 |
-
protected $mailer = '';
|
44 |
-
|
45 |
-
/**
|
46 |
-
* URL to make an API request to.
|
47 |
-
*
|
48 |
-
* @since 1.0.0
|
49 |
-
*
|
50 |
-
* @var string
|
51 |
-
*/
|
52 |
-
protected $url = '';
|
53 |
-
/**
|
54 |
-
* @since 1.0.0
|
55 |
-
*
|
56 |
-
* @var array
|
57 |
-
*/
|
58 |
-
protected $headers = array();
|
59 |
-
/**
|
60 |
-
* @since 1.0.0
|
61 |
-
*
|
62 |
-
* @var array
|
63 |
-
*/
|
64 |
-
protected $body = array();
|
65 |
-
/**
|
66 |
-
* @since 1.0.0
|
67 |
-
*
|
68 |
-
* @var mixed
|
69 |
-
*/
|
70 |
-
protected $response = array();
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Mailer constructor.
|
74 |
-
*
|
75 |
-
* @since 1.0.0
|
76 |
-
*
|
77 |
-
* @param MailCatcher $phpmailer
|
78 |
-
*/
|
79 |
-
public function __construct( MailCatcher $phpmailer ) {
|
80 |
-
|
81 |
-
$this->options = new Options();
|
82 |
-
$this->mailer = $this->options->get( 'mail', 'mailer' );
|
83 |
-
|
84 |
-
// Only non-SMTP mailers need URL and extra processing for PHPMailer class.
|
85 |
-
if ( ! $this->options->is_mailer_smtp() && empty( $this->url ) ) {
|
86 |
-
return;
|
87 |
-
}
|
88 |
-
|
89 |
-
$this->process_phpmailer( $phpmailer );
|
90 |
-
}
|
91 |
-
|
92 |
-
/**
|
93 |
-
* Re-use the MailCatcher class methods and properties.
|
94 |
-
*
|
95 |
-
* @since 1.0.0
|
96 |
-
*
|
97 |
-
* @param MailCatcher $phpmailer
|
98 |
-
*/
|
99 |
-
public function process_phpmailer( $phpmailer ) {
|
100 |
-
|
101 |
-
// Make sure that we have access to MailCatcher class methods.
|
102 |
-
if (
|
103 |
-
! $phpmailer instanceof MailCatcher &&
|
104 |
-
! $phpmailer instanceof \PHPMailer
|
105 |
-
) {
|
106 |
-
return;
|
107 |
-
}
|
108 |
-
|
109 |
-
$this->phpmailer = $phpmailer;
|
110 |
-
|
111 |
-
// Prevent working with those methods, as they are not needed for SMTP-like mailers.
|
112 |
-
if ( $this->options->is_mailer_smtp() ) {
|
113 |
-
return;
|
114 |
-
}
|
115 |
-
|
116 |
-
$this->set_headers( $this->phpmailer->getCustomHeaders() );
|
117 |
-
$this->set_from( $this->phpmailer->From, $this->phpmailer->FromName );
|
118 |
-
$this->set_recipients(
|
119 |
-
array(
|
120 |
-
'to' => $this->phpmailer->getToAddresses(),
|
121 |
-
'cc' => $this->phpmailer->getCcAddresses(),
|
122 |
-
'bcc' => $this->phpmailer->getBccAddresses(),
|
123 |
-
)
|
124 |
-
);
|
125 |
-
$this->set_subject( $this->phpmailer->Subject );
|
126 |
-
if ( $this->phpmailer->ContentType === 'text/plain' ) {
|
127 |
-
$this->set_content( $this->phpmailer->Body );
|
128 |
-
} else {
|
129 |
-
$this->set_content(
|
130 |
-
array(
|
131 |
-
'text' => $this->phpmailer->AltBody,
|
132 |
-
'html' => $this->phpmailer->Body,
|
133 |
-
)
|
134 |
-
);
|
135 |
-
}
|
136 |
-
$this->set_return_path( $this->phpmailer->From );
|
137 |
-
$this->set_reply_to( $this->phpmailer->getReplyToAddresses() );
|
138 |
-
|
139 |
-
/*
|
140 |
-
* In some cases we will need to modify the internal structure
|
141 |
-
* of the body content, if attachments are present.
|
142 |
-
* So lets make this call the last one.
|
143 |
-
*/
|
144 |
-
$this->set_attachments( $this->phpmailer->getAttachments() );
|
145 |
-
}
|
146 |
-
|
147 |
-
/**
|
148 |
-
* Set the email headers.
|
149 |
-
*
|
150 |
-
* @since 1.0.0
|
151 |
-
*
|
152 |
-
* @param array $headers List of key=>value pairs.
|
153 |
-
*/
|
154 |
-
public function set_headers( $headers ) {
|
155 |
-
|
156 |
-
foreach ( $headers as $header ) {
|
157 |
-
$name = isset( $header[0] ) ? $header[0] : false;
|
158 |
-
$value = isset( $header[1] ) ? $header[1] : false;
|
159 |
-
|
160 |
-
if ( empty( $name ) || empty( $value ) ) {
|
161 |
-
continue;
|
162 |
-
}
|
163 |
-
|
164 |
-
$this->set_header( $name, $value );
|
165 |
-
}
|
166 |
-
}
|
167 |
-
|
168 |
-
/**
|
169 |
-
* Set individual header key=>value pair for the email.
|
170 |
-
*
|
171 |
-
* @since 1.0.0
|
172 |
-
*
|
173 |
-
* @param string $name
|
174 |
-
* @param string $value
|
175 |
-
*/
|
176 |
-
public function set_header( $name, $value ) {
|
177 |
-
|
178 |
-
$name = sanitize_text_field( $name );
|
179 |
-
|
180 |
-
$this->headers[ $name ] = WP::sanitize_value( $value );
|
181 |
-
}
|
182 |
-
|
183 |
-
/**
|
184 |
-
* Set email subject.
|
185 |
-
*
|
186 |
-
* @since 1.0.0
|
187 |
-
*
|
188 |
-
* @param string $subject
|
189 |
-
*/
|
190 |
-
public function set_subject( $subject ) {
|
191 |
-
|
192 |
-
$this->set_body_param(
|
193 |
-
array(
|
194 |
-
'subject' => $subject,
|
195 |
-
)
|
196 |
-
);
|
197 |
-
}
|
198 |
-
|
199 |
-
/**
|
200 |
-
* Set the request params, that goes to the body of the HTTP request.
|
201 |
-
*
|
202 |
-
* @since 1.0.0
|
203 |
-
*
|
204 |
-
* @param array $param Key=>value of what should be sent to a 3rd party API.
|
205 |
-
*
|
206 |
-
* @internal param array $params
|
207 |
-
*/
|
208 |
-
protected function set_body_param( $param ) {
|
209 |
-
|
210 |
-
$this->body = Options::array_merge_recursive( $this->body, $param );
|
211 |
-
}
|
212 |
-
|
213 |
-
/**
|
214 |
-
* Get the email body.
|
215 |
-
*
|
216 |
-
* @since 1.0.0
|
217 |
-
*
|
218 |
-
* @return string|array
|
219 |
-
*/
|
220 |
-
public function get_body() {
|
221 |
-
|
222 |
-
return apply_filters( 'wp_mail_smtp_providers_mailer_get_body', $this->body, $this->mailer );
|
223 |
-
}
|
224 |
-
|
225 |
-
/**
|
226 |
-
* Get the email headers.
|
227 |
-
*
|
228 |
-
* @since 1.0.0
|
229 |
-
*
|
230 |
-
* @return array
|
231 |
-
*/
|
232 |
-
public function get_headers() {
|
233 |
-
|
234 |
-
return apply_filters( 'wp_mail_smtp_providers_mailer_get_headers', $this->headers, $this->mailer );
|
235 |
-
}
|
236 |
-
|
237 |
-
/**
|
238 |
-
* Send the email.
|
239 |
-
*
|
240 |
-
* @since 1.0.0
|
241 |
-
* @since 1.8.0 Added timeout for requests, same as max_execution_time.
|
242 |
-
*/
|
243 |
-
public function send() {
|
244 |
-
|
245 |
-
$timeout = (int) ini_get( 'max_execution_time' );
|
246 |
-
|
247 |
-
$params = Options::array_merge_recursive(
|
248 |
-
$this->get_default_params(),
|
249 |
-
array(
|
250 |
-
'headers' => $this->get_headers(),
|
251 |
-
'body' => $this->get_body(),
|
252 |
-
'timeout' => $timeout ? $timeout : 30,
|
253 |
-
)
|
254 |
-
);
|
255 |
-
|
256 |
-
$response = wp_safe_remote_post( $this->url, $params );
|
257 |
-
|
258 |
-
$this->process_response( $response );
|
259 |
-
}
|
260 |
-
|
261 |
-
/**
|
262 |
-
* We might need to do something after the email was sent to the API.
|
263 |
-
* In this method we preprocess the response from the API.
|
264 |
-
*
|
265 |
-
* @since 1.0.0
|
266 |
-
*
|
267 |
-
* @param mixed $response
|
268 |
-
*/
|
269 |
-
protected function process_response( $response ) {
|
270 |
-
|
271 |
-
if ( is_wp_error( $response ) ) {
|
272 |
-
// Save the error text.
|
273 |
-
$errors = $response->get_error_messages();
|
274 |
-
foreach ( $errors as $error ) {
|
275 |
-
Debug::set( $error );
|
276 |
-
}
|
277 |
-
|
278 |
-
return;
|
279 |
-
}
|
280 |
-
|
281 |
-
if ( isset( $response['body'] ) && WP::is_json( $response['body'] ) ) {
|
282 |
-
$response['body'] = \json_decode( $response['body'] );
|
283 |
-
}
|
284 |
-
|
285 |
-
$this->response = $response;
|
286 |
-
}
|
287 |
-
|
288 |
-
/**
|
289 |
-
* Get the default params, required for wp_safe_remote_post().
|
290 |
-
*
|
291 |
-
* @since 1.0.0
|
292 |
-
*
|
293 |
-
* @return array
|
294 |
-
*/
|
295 |
-
protected function get_default_params() {
|
296 |
-
|
297 |
-
return apply_filters(
|
298 |
-
'wp_mail_smtp_providers_mailer_get_default_params',
|
299 |
-
array(
|
300 |
-
'timeout' => 15,
|
301 |
-
'httpversion' => '1.1',
|
302 |
-
'blocking' => true,
|
303 |
-
),
|
304 |
-
$this->mailer
|
305 |
-
);
|
306 |
-
}
|
307 |
-
|
308 |
-
/**
|
309 |
-
* Whether the email is sent or not.
|
310 |
-
* We basically check the response code from a request to provider.
|
311 |
-
* Might not be 100% correct, not guarantees that email is delivered.
|
312 |
-
*
|
313 |
-
* @since 1.0.0
|
314 |
-
*
|
315 |
-
* @return bool
|
316 |
-
*/
|
317 |
-
public function is_email_sent() {
|
318 |
-
|
319 |
-
$is_sent = false;
|
320 |
-
|
321 |
-
if ( wp_remote_retrieve_response_code( $this->response ) === $this->email_sent_code ) {
|
322 |
-
$is_sent = true;
|
323 |
-
} else {
|
324 |
-
$error = $this->get_response_error();
|
325 |
-
|
326 |
-
if ( ! empty( $error ) ) {
|
327 |
-
// Add mailer to the beginning and save to display later.
|
328 |
-
$message = 'Mailer: ' . esc_html( wp_mail_smtp()->get_providers()->get_options( $this->mailer )->get_title() ) . "\r\n";
|
329 |
-
|
330 |
-
$conflicts = new Conflicts();
|
331 |
-
if ( $conflicts->is_detected() ) {
|
332 |
-
$message .= 'Conflicts: ' . esc_html( $conflicts->get_conflict_name() ) . "\r\n";
|
333 |
-
}
|
334 |
-
|
335 |
-
Debug::set( $message . $error );
|
336 |
-
}
|
337 |
-
}
|
338 |
-
|
339 |
-
// Clear debug messages if email is successfully sent.
|
340 |
-
if ( $is_sent ) {
|
341 |
-
Debug::clear();
|
342 |
-
}
|
343 |
-
|
344 |
-
return apply_filters( 'wp_mail_smtp_providers_mailer_is_email_sent', $is_sent, $this->mailer );
|
345 |
-
}
|
346 |
-
|
347 |
-
/**
|
348 |
-
* Should be overwritten when appropriate.
|
349 |
-
*
|
350 |
-
* @since 1.2.0
|
351 |
-
*
|
352 |
-
* @return string
|
353 |
-
*/
|
354 |
-
protected function get_response_error() {
|
355 |
-
|
356 |
-
return '';
|
357 |
-
}
|
358 |
-
|
359 |
-
/**
|
360 |
-
* Whether the mailer supports the current PHP version or not.
|
361 |
-
*
|
362 |
-
* @since 1.0.0
|
363 |
-
*
|
364 |
-
* @return bool
|
365 |
-
*/
|
366 |
-
public function is_php_compatible() {
|
367 |
-
|
368 |
-
$options = wp_mail_smtp()->get_providers()->get_options( $this->mailer );
|
369 |
-
|
370 |
-
return version_compare( phpversion(), $options->get_php_version(), '>=' );
|
371 |
-
}
|
372 |
-
|
373 |
-
/**
|
374 |
-
* This method is relevant to SMTP and Pepipost.
|
375 |
-
* All other custom mailers should override it with own information.
|
376 |
-
*
|
377 |
-
* @since 1.2.0
|
378 |
-
*
|
379 |
-
* @return string
|
380 |
-
*/
|
381 |
-
public function get_debug_info() {
|
382 |
-
|
383 |
-
global $phpmailer;
|
384 |
-
|
385 |
-
$smtp_text = array();
|
386 |
-
|
387 |
-
// Mail mailer has nothing to return.
|
388 |
-
if ( $this->options->is_mailer_smtp() ) {
|
389 |
-
// phpcs:disable
|
390 |
-
$smtp_text[] = '<strong>ErrorInfo:</strong> ' . make_clickable( wp_strip_all_tags( $phpmailer->ErrorInfo ) );
|
391 |
-
$smtp_text[] = '<strong>Host:</strong> ' . $phpmailer->Host;
|
392 |
-
$smtp_text[] = '<strong>Port:</strong> ' . $phpmailer->Port;
|
393 |
-
$smtp_text[] = '<strong>SMTPSecure:</strong> ' . Debug::pvar( $phpmailer->SMTPSecure );
|
394 |
-
$smtp_text[] = '<strong>SMTPAutoTLS:</strong> ' . Debug::pvar( $phpmailer->SMTPAutoTLS );
|
395 |
-
$smtp_text[] = '<strong>SMTPAuth:</strong> ' . Debug::pvar( $phpmailer->SMTPAuth );
|
396 |
-
if ( ! empty( $phpmailer->SMTPOptions ) ) {
|
397 |
-
$smtp_text[] = '<strong>SMTPOptions:</strong> <code>' . wp_json_encode( $phpmailer->SMTPOptions ) . '</code>';
|
398 |
-
}
|
399 |
-
// phpcs:enable
|
400 |
-
}
|
401 |
-
|
402 |
-
$smtp_text[] = '<br><strong>Server:</strong>';
|
403 |
-
$smtp_text[] = '<strong>OpenSSL:</strong> ' . ( extension_loaded( 'openssl' ) && defined( 'OPENSSL_VERSION_TEXT' ) ? OPENSSL_VERSION_TEXT : 'No' );
|
404 |
-
if ( function_exists( 'apache_get_modules' ) ) {
|
405 |
-
$modules = apache_get_modules();
|
406 |
-
$smtp_text[] = '<strong>Apache.mod_security:</strong> ' . ( in_array( 'mod_security', $modules, true ) || in_array( 'mod_security2', $modules, true ) ? 'Yes' : 'No' );
|
407 |
-
}
|
408 |
-
if ( function_exists( 'selinux_is_enabled' ) ) {
|
409 |
-
$smtp_text[] = '<strong>OS.SELinux:</strong> ' . ( selinux_is_enabled() ? 'Yes' : 'No' );
|
410 |
-
}
|
411 |
-
if ( function_exists( 'grsecurity_is_enabled' ) ) {
|
412 |
-
$smtp_text[] = '<strong>OS.grsecurity:</strong> ' . ( grsecurity_is_enabled() ? 'Yes' : 'No' );
|
413 |
-
}
|
414 |
-
|
415 |
-
return implode( '<br>', $smtp_text );
|
416 |
-
}
|
417 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPMailSMTP\Providers;
|
4 |
+
|
5 |
+
use WPMailSMTP\Conflicts;
|
6 |
+
use WPMailSMTP\Debug;
|
7 |
+
use WPMailSMTP\MailCatcher;
|
8 |
+
use WPMailSMTP\Options;
|
9 |
+
use WPMailSMTP\WP;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Class MailerAbstract.
|
13 |
+
*
|
14 |
+
* @since 1.0.0
|
15 |
+
*/
|
16 |
+
abstract class MailerAbstract implements MailerInterface {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Which response code from HTTP provider is considered to be successful?
|
20 |
+
*
|
21 |
+
* @since 1.0.0
|
22 |
+
*
|
23 |
+
* @var int
|
24 |
+
*/
|
25 |
+
protected $email_sent_code = 200;
|
26 |
+
/**
|
27 |
+
* @since 1.0.0
|
28 |
+
*
|
29 |
+
* @var Options
|
30 |
+
*/
|
31 |
+
protected $options;
|
32 |
+
/**
|
33 |
+
* @since 1.0.0
|
34 |
+
*
|
35 |
+
* @var MailCatcher
|
36 |
+
*/
|
37 |
+
protected $phpmailer;
|
38 |
+
/**
|
39 |
+
* @since 1.0.0
|
40 |
+
*
|
41 |
+
* @var string
|
42 |
+
*/
|
43 |
+
protected $mailer = '';
|
44 |
+
|
45 |
+
/**
|
46 |
+
* URL to make an API request to.
|
47 |
+
*
|
48 |
+
* @since 1.0.0
|
49 |
+
*
|
50 |
+
* @var string
|
51 |
+
*/
|
52 |
+
protected $url = '';
|
53 |
+
/**
|
54 |
+
* @since 1.0.0
|
55 |
+
*
|
56 |
+
* @var array
|
57 |
+
*/
|
58 |
+
protected $headers = array();
|
59 |
+
/**
|
60 |
+
* @since 1.0.0
|
61 |
+
*
|
62 |
+
* @var array
|
63 |
+
*/
|
64 |
+
protected $body = array();
|
65 |
+
/**
|
66 |
+
* @since 1.0.0
|
67 |
+
*
|
68 |
+
* @var mixed
|
69 |
+
*/
|
70 |
+
protected $response = array();
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Mailer constructor.
|
74 |
+
*
|
75 |
+
* @since 1.0.0
|
76 |
+
*
|
77 |
+
* @param MailCatcher $phpmailer
|
78 |
+
*/
|
79 |
+
public function __construct( MailCatcher $phpmailer ) {
|
80 |
+
|
81 |
+
$this->options = new Options();
|
82 |
+
$this->mailer = $this->options->get( 'mail', 'mailer' );
|
83 |
+
|
84 |
+
// Only non-SMTP mailers need URL and extra processing for PHPMailer class.
|
85 |
+
if ( ! $this->options->is_mailer_smtp() && empty( $this->url ) ) {
|
86 |
+
return;
|
87 |
+
}
|
88 |
+
|
89 |
+
$this->process_phpmailer( $phpmailer );
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Re-use the MailCatcher class methods and properties.
|
94 |
+
*
|
95 |
+
* @since 1.0.0
|
96 |
+
*
|
97 |
+
* @param MailCatcher $phpmailer
|
98 |
+
*/
|
99 |
+
public function process_phpmailer( $phpmailer ) {
|
100 |
+
|
101 |
+
// Make sure that we have access to MailCatcher class methods.
|
102 |
+
if (
|
103 |
+
! $phpmailer instanceof MailCatcher &&
|
104 |
+
! $phpmailer instanceof \PHPMailer
|
105 |
+
) {
|
106 |
+
return;
|
107 |
+
}
|
108 |
+
|
109 |
+
$this->phpmailer = $phpmailer;
|
110 |
+
|
111 |
+
// Prevent working with those methods, as they are not needed for SMTP-like mailers.
|
112 |
+
if ( $this->options->is_mailer_smtp() ) {
|
113 |
+
return;
|
114 |
+
}
|
115 |
+
|
116 |
+
$this->set_headers( $this->phpmailer->getCustomHeaders() );
|
117 |
+
$this->set_from( $this->phpmailer->From, $this->phpmailer->FromName );
|
118 |
+
$this->set_recipients(
|
119 |
+
array(
|
120 |
+
'to' => $this->phpmailer->getToAddresses(),
|
121 |
+
'cc' => $this->phpmailer->getCcAddresses(),
|
122 |
+
'bcc' => $this->phpmailer->getBccAddresses(),
|
123 |
+
)
|
124 |
+
);
|
125 |
+
$this->set_subject( $this->phpmailer->Subject );
|
126 |
+
if ( $this->phpmailer->ContentType === 'text/plain' ) {
|
127 |
+
$this->set_content( $this->phpmailer->Body );
|
128 |
+
} else {
|
129 |
+
$this->set_content(
|
130 |
+
array(
|
131 |
+
'text' => $this->phpmailer->AltBody,
|
132 |
+
'html' => $this->phpmailer->Body,
|
133 |
+
)
|
134 |
+
);
|
135 |
+
}
|
136 |
+
$this->set_return_path( $this->phpmailer->From );
|
137 |
+
$this->set_reply_to( $this->phpmailer->getReplyToAddresses() );
|
138 |
+
|
139 |
+
/*
|
140 |
+
* In some cases we will need to modify the internal structure
|
141 |
+
* of the body content, if attachments are present.
|
142 |
+
* So lets make this call the last one.
|
143 |
+
*/
|
144 |
+
$this->set_attachments( $this->phpmailer->getAttachments() );
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Set the email headers.
|
149 |
+
*
|
150 |
+
* @since 1.0.0
|
151 |
+
*
|
152 |
+
* @param array $headers List of key=>value pairs.
|
153 |
+
*/
|
154 |
+
public function set_headers( $headers ) {
|
155 |
+
|
156 |
+
foreach ( $headers as $header ) {
|
157 |
+
$name = isset( $header[0] ) ? $header[0] : false;
|
158 |
+
$value = isset( $header[1] ) ? $header[1] : false;
|
159 |
+
|
160 |
+
if ( empty( $name ) || empty( $value ) ) {
|
161 |
+
continue;
|
162 |
+
}
|
163 |
+
|
164 |
+
$this->set_header( $name, $value );
|
165 |
+
}
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Set individual header key=>value pair for the email.
|
170 |
+
*
|
171 |
+
* @since 1.0.0
|
172 |
+
*
|
173 |
+
* @param string $name
|
174 |
+
* @param string $value
|
175 |
+
*/
|
176 |
+
public function set_header( $name, $value ) {
|
177 |
+
|
178 |
+
$name = sanitize_text_field( $name );
|
179 |
+
|
180 |
+
$this->headers[ $name ] = WP::sanitize_value( $value );
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Set email subject.
|
185 |
+
*
|
186 |
+
* @since 1.0.0
|
187 |
+
*
|
188 |
+
* @param string $subject
|
189 |
+
*/
|
190 |
+
public function set_subject( $subject ) {
|
191 |
+
|
192 |
+
$this->set_body_param(
|
193 |
+
array(
|
194 |
+
'subject' => $subject,
|
195 |
+
)
|
196 |
+
);
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Set the request params, that goes to the body of the HTTP request.
|
201 |
+
*
|
202 |
+
* @since 1.0.0
|
203 |
+
*
|
204 |
+
* @param array $param Key=>value of what should be sent to a 3rd party API.
|
205 |
+
*
|
206 |
+
* @internal param array $params
|
207 |
+
*/
|
208 |
+
protected function set_body_param( $param ) {
|
209 |
+
|
210 |
+
$this->body = Options::array_merge_recursive( $this->body, $param );
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Get the email body.
|
215 |
+
*
|
216 |
+
* @since 1.0.0
|
217 |
+
*
|
218 |
+
* @return string|array
|
219 |
+
*/
|
220 |
+
public function get_body() {
|
221 |
+
|
222 |
+
return apply_filters( 'wp_mail_smtp_providers_mailer_get_body', $this->body, $this->mailer );
|
223 |
+
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* Get the email headers.
|
227 |
+
*
|
228 |
+
* @since 1.0.0
|
229 |
+
*
|
230 |
+
* @return array
|
231 |
+
*/
|
232 |
+
public function get_headers() {
|
233 |
+
|
234 |
+
return apply_filters( 'wp_mail_smtp_providers_mailer_get_headers', $this->headers, $this->mailer );
|
235 |
+
}
|
236 |
+
|
237 |
+
/**
|
238 |
+
* Send the email.
|
239 |
+
*
|
240 |
+
* @since 1.0.0
|
241 |
+
* @since 1.8.0 Added timeout for requests, same as max_execution_time.
|
242 |
+
*/
|
243 |
+
public function send() {
|
244 |
+
|
245 |
+
$timeout = (int) ini_get( 'max_execution_time' );
|
246 |
+
|
247 |
+
$params = Options::array_merge_recursive(
|
248 |
+
$this->get_default_params(),
|
249 |
+
array(
|
250 |
+
'headers' => $this->get_headers(),
|
251 |
+
'body' => $this->get_body(),
|
252 |
+
'timeout' => $timeout ? $timeout : 30,
|
253 |
+
)
|
254 |
+
);
|
255 |
+
|
256 |
+
$response = wp_safe_remote_post( $this->url, $params );
|
257 |
+
|
258 |
+
$this->process_response( $response );
|
259 |
+
}
|
260 |
+
|
261 |
+
/**
|
262 |
+
* We might need to do something after the email was sent to the API.
|
263 |
+
* In this method we preprocess the response from the API.
|
264 |
+
*
|
265 |
+
* @since 1.0.0
|
266 |
+
*
|
267 |
+
* @param mixed $response
|
268 |
+
*/
|
269 |
+
protected function process_response( $response ) {
|
270 |
+
|
271 |
+
if ( is_wp_error( $response ) ) {
|
272 |
+
// Save the error text.
|
273 |
+
$errors = $response->get_error_messages();
|
274 |
+
foreach ( $errors as $error ) {
|
275 |
+
Debug::set( $error );
|
276 |
+
}
|
277 |
+
|
278 |
+
return;
|
279 |
+
}
|
280 |
+
|
281 |
+
if ( isset( $response['body'] ) && WP::is_json( $response['body'] ) ) {
|
282 |
+
$response['body'] = \json_decode( $response['body'] );
|
283 |
+
}
|
284 |
+
|
285 |
+
$this->response = $response;
|
286 |
+
}
|
287 |
+
|
288 |
+
/**
|
289 |
+
* Get the default params, required for wp_safe_remote_post().
|
290 |
+
*
|
291 |
+
* @since 1.0.0
|
292 |
+
*
|
293 |
+
* @return array
|
294 |
+
*/
|
295 |
+
protected function get_default_params() {
|
296 |
+
|
297 |
+
return apply_filters(
|
298 |
+
'wp_mail_smtp_providers_mailer_get_default_params',
|
299 |
+
array(
|
300 |
+
'timeout' => 15,
|
301 |
+
'httpversion' => '1.1',
|
302 |
+
'blocking' => true,
|
303 |
+
),
|
304 |
+
$this->mailer
|
305 |
+
);
|
306 |
+
}
|
307 |
+
|
308 |
+
/**
|
309 |
+
* Whether the email is sent or not.
|
310 |
+
* We basically check the response code from a request to provider.
|
311 |
+
* Might not be 100% correct, not guarantees that email is delivered.
|
312 |
+
*
|
313 |
+
* @since 1.0.0
|
314 |
+
*
|
315 |
+
* @return bool
|
316 |
+
*/
|
317 |
+
public function is_email_sent() {
|
318 |
+
|
319 |
+
$is_sent = false;
|
320 |
+
|
321 |
+
if ( wp_remote_retrieve_response_code( $this->response ) === $this->email_sent_code ) {
|
322 |
+
$is_sent = true;
|
323 |
+
} else {
|
324 |
+
$error = $this->get_response_error();
|
325 |
+
|
326 |
+
if ( ! empty( $error ) ) {
|
327 |
+
// Add mailer to the beginning and save to display later.
|
328 |
+
$message = 'Mailer: ' . esc_html( wp_mail_smtp()->get_providers()->get_options( $this->mailer )->get_title() ) . "\r\n";
|
329 |
+
|
330 |
+
$conflicts = new Conflicts();
|
331 |
+
if ( $conflicts->is_detected() ) {
|
332 |
+
$message .= 'Conflicts: ' . esc_html( $conflicts->get_conflict_name() ) . "\r\n";
|
333 |
+
}
|
334 |
+
|
335 |
+
Debug::set( $message . $error );
|
336 |
+
}
|
337 |
+
}
|
338 |
+
|
339 |
+
// Clear debug messages if email is successfully sent.
|
340 |
+
if ( $is_sent ) {
|
341 |
+
Debug::clear();
|
342 |
+
}
|
343 |
+
|
344 |
+
return apply_filters( 'wp_mail_smtp_providers_mailer_is_email_sent', $is_sent, $this->mailer );
|
345 |
+
}
|
346 |
+
|
347 |
+
/**
|
348 |
+
* Should be overwritten when appropriate.
|
349 |
+
*
|
350 |
+
* @since 1.2.0
|
351 |
+
*
|
352 |
+
* @return string
|
353 |
+
*/
|
354 |
+
protected function get_response_error() {
|
355 |
+
|
356 |
+
return '';
|
357 |
+
}
|
358 |
+
|
359 |
+
/**
|
360 |
+
* Whether the mailer supports the current PHP version or not.
|
361 |
+
*
|
362 |
+
* @since 1.0.0
|
363 |
+
*
|
364 |
+
* @return bool
|
365 |
+
*/
|
366 |
+
public function is_php_compatible() {
|
367 |
+
|
368 |
+
$options = wp_mail_smtp()->get_providers()->get_options( $this->mailer );
|
369 |
+
|
370 |
+
return version_compare( phpversion(), $options->get_php_version(), '>=' );
|
371 |
+
}
|
372 |
+
|
373 |
+
/**
|
374 |
+
* This method is relevant to SMTP and Pepipost.
|
375 |
+
* All other custom mailers should override it with own information.
|
376 |
+
*
|
377 |
+
* @since 1.2.0
|
378 |
+
*
|
379 |
+
* @return string
|
380 |
+
*/
|
381 |
+
public function get_debug_info() {
|
382 |
+
|
383 |
+
global $phpmailer;
|
384 |
+
|
385 |
+
$smtp_text = array();
|
386 |
+
|
387 |
+
// Mail mailer has nothing to return.
|
388 |
+
if ( $this->options->is_mailer_smtp() ) {
|
389 |
+
// phpcs:disable
|
390 |
+
$smtp_text[] = '<strong>ErrorInfo:</strong> ' . make_clickable( wp_strip_all_tags( $phpmailer->ErrorInfo ) );
|
391 |
+
$smtp_text[] = '<strong>Host:</strong> ' . $phpmailer->Host;
|
392 |
+
$smtp_text[] = '<strong>Port:</strong> ' . $phpmailer->Port;
|
393 |
+
$smtp_text[] = '<strong>SMTPSecure:</strong> ' . Debug::pvar( $phpmailer->SMTPSecure );
|
394 |
+
$smtp_text[] = '<strong>SMTPAutoTLS:</strong> ' . Debug::pvar( $phpmailer->SMTPAutoTLS );
|
395 |
+
$smtp_text[] = '<strong>SMTPAuth:</strong> ' . Debug::pvar( $phpmailer->SMTPAuth );
|
396 |
+
if ( ! empty( $phpmailer->SMTPOptions ) ) {
|
397 |
+
$smtp_text[] = '<strong>SMTPOptions:</strong> <code>' . wp_json_encode( $phpmailer->SMTPOptions ) . '</code>';
|
398 |
+
}
|
399 |
+
// phpcs:enable
|
400 |
+
}
|
401 |
+
|
402 |
+
$smtp_text[] = '<br><strong>Server:</strong>';
|
403 |
+
$smtp_text[] = '<strong>OpenSSL:</strong> ' . ( extension_loaded( 'openssl' ) && defined( 'OPENSSL_VERSION_TEXT' ) ? OPENSSL_VERSION_TEXT : 'No' );
|
404 |
+
if ( function_exists( 'apache_get_modules' ) ) {
|
405 |
+
$modules = apache_get_modules();
|
406 |
+
$smtp_text[] = '<strong>Apache.mod_security:</strong> ' . ( in_array( 'mod_security', $modules, true ) || in_array( 'mod_security2', $modules, true ) ? 'Yes' : 'No' );
|
407 |
+
}
|
408 |
+
if ( function_exists( 'selinux_is_enabled' ) ) {
|
409 |
+
$smtp_text[] = '<strong>OS.SELinux:</strong> ' . ( selinux_is_enabled() ? 'Yes' : 'No' );
|
410 |
+
}
|
411 |
+
if ( function_exists( 'grsecurity_is_enabled' ) ) {
|
412 |
+
$smtp_text[] = '<strong>OS.grsecurity:</strong> ' . ( grsecurity_is_enabled() ? 'Yes' : 'No' );
|
413 |
+
}
|
414 |
+
|
415 |
+
return implode( '<br>', $smtp_text );
|
416 |
+
}
|
417 |
+
}
|
src/Providers/Mailgun/Options.php
CHANGED
@@ -1,161 +1,161 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPMailSMTP\Providers\Mailgun;
|
4 |
-
|
5 |
-
use WPMailSMTP\Providers\OptionsAbstract;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Class Option.
|
9 |
-
*
|
10 |
-
* @since 1.0.0
|
11 |
-
*/
|
12 |
-
class Options extends OptionsAbstract {
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Mailgun constructor.
|
16 |
-
*
|
17 |
-
* @since 1.0.0
|
18 |
-
*/
|
19 |
-
public function __construct() {
|
20 |
-
|
21 |
-
parent::__construct(
|
22 |
-
array(
|
23 |
-
'logo_url' => wp_mail_smtp()->assets_url . '/images/providers/mailgun.svg',
|
24 |
-
'slug' => 'mailgun',
|
25 |
-
'title' => esc_html__( 'Mailgun', 'wp-mail-smtp' ),
|
26 |
-
'description' => sprintf(
|
27 |
-
wp_kses(
|
28 |
-
/* translators: %1$s - opening link tag; %2$s - closing link tag; %3$s - opening link tag; %4$s - closing link tag. */
|
29 |
-
__( '%1$sMailgun%2$s is one of the leading transactional email services trusted by over
|
30 |
-
array(
|
31 |
-
'br' => array(),
|
32 |
-
'a' => array(
|
33 |
-
'href' => array(),
|
34 |
-
'rel' => array(),
|
35 |
-
'target' => array(),
|
36 |
-
),
|
37 |
-
)
|
38 |
-
),
|
39 |
-
'<a href="https://www.mailgun.com" target="_blank" rel="noopener noreferrer">',
|
40 |
-
'</a>',
|
41 |
-
'<a href="https://wpmailsmtp.com/docs/how-to-set-up-the-mailgun-mailer-in-wp-mail-smtp/" target="_blank" rel="noopener noreferrer">',
|
42 |
-
'</a>'
|
43 |
-
),
|
44 |
-
)
|
45 |
-
);
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* @inheritdoc
|
50 |
-
*/
|
51 |
-
public function display_options() {
|
52 |
-
?>
|
53 |
-
|
54 |
-
<!-- API Key -->
|
55 |
-
<div id="wp-mail-smtp-setting-row-<?php echo esc_attr( $this->get_slug() ); ?>-api_key" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-text wp-mail-smtp-clear">
|
56 |
-
<div class="wp-mail-smtp-setting-label">
|
57 |
-
<label for="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-api_key"><?php esc_html_e( 'Private API Key', 'wp-mail-smtp' ); ?></label>
|
58 |
-
</div>
|
59 |
-
<div class="wp-mail-smtp-setting-field">
|
60 |
-
<?php if ( $this->options->is_const_defined( $this->get_slug(), 'api_key' ) ) : ?>
|
61 |
-
<input type="text" disabled value="****************************************"
|
62 |
-
id="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-api_key"
|
63 |
-
/>
|
64 |
-
<?php $this->display_const_set_message( 'WPMS_MAILGUN_API_KEY' ); ?>
|
65 |
-
<?php else : ?>
|
66 |
-
<input type="password" spellcheck="false"
|
67 |
-
name="wp-mail-smtp[<?php echo esc_attr( $this->get_slug() ); ?>][api_key]"
|
68 |
-
value="<?php echo esc_attr( $this->options->get( $this->get_slug(), 'api_key' ) ); ?>"
|
69 |
-
id="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-api_key"
|
70 |
-
/>
|
71 |
-
<?php endif; ?>
|
72 |
-
<p class="desc">
|
73 |
-
<?php
|
74 |
-
printf(
|
75 |
-
/* translators: %s - API key link. */
|
76 |
-
esc_html__( 'Follow this link to get an API Key from Mailgun: %s.', 'wp-mail-smtp' ),
|
77 |
-
'<a href="https://app.mailgun.com/app/account/security/api_keys" target="_blank" rel="noopener noreferrer">' .
|
78 |
-
esc_html__( 'Get a Private API Key', 'wp-mail-smtp' ) .
|
79 |
-
'</a>'
|
80 |
-
);
|
81 |
-
?>
|
82 |
-
</p>
|
83 |
-
</div>
|
84 |
-
</div>
|
85 |
-
|
86 |
-
<!-- Domain -->
|
87 |
-
<div id="wp-mail-smtp-setting-row-<?php echo esc_attr( $this->get_slug() ); ?>-domain" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-text wp-mail-smtp-clear">
|
88 |
-
<div class="wp-mail-smtp-setting-label">
|
89 |
-
<label for="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-domain"><?php esc_html_e( 'Domain Name', 'wp-mail-smtp' ); ?></label>
|
90 |
-
</div>
|
91 |
-
<div class="wp-mail-smtp-setting-field">
|
92 |
-
<input name="wp-mail-smtp[<?php echo esc_attr( $this->get_slug() ); ?>][domain]" type="text"
|
93 |
-
value="<?php echo esc_attr( $this->options->get( $this->get_slug(), 'domain' ) ); ?>"
|
94 |
-
<?php echo $this->options->is_const_defined( $this->get_slug(), 'domain' ) ? 'disabled' : ''; ?>
|
95 |
-
id="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-domain" spellcheck="false"
|
96 |
-
/>
|
97 |
-
<p class="desc">
|
98 |
-
<?php
|
99 |
-
printf(
|
100 |
-
/* translators: %s - Domain Name link. */
|
101 |
-
esc_html__( 'Follow this link to get a Domain Name from Mailgun: %s.', 'wp-mail-smtp' ),
|
102 |
-
'<a href="https://app.mailgun.com/app/domains" target="_blank" rel="noopener noreferrer">' .
|
103 |
-
esc_html__( 'Get a Domain Name', 'wp-mail-smtp' ) .
|
104 |
-
'</a>'
|
105 |
-
);
|
106 |
-
?>
|
107 |
-
</p>
|
108 |
-
</div>
|
109 |
-
</div>
|
110 |
-
|
111 |
-
<!-- Region -->
|
112 |
-
<div id="wp-mail-smtp-setting-row-<?php echo esc_attr( $this->get_slug() ); ?>-region" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-radio wp-mail-smtp-clear">
|
113 |
-
<div class="wp-mail-smtp-setting-label">
|
114 |
-
<label><?php esc_html_e( 'Region', 'wp-mail-smtp' ); ?></label>
|
115 |
-
</div>
|
116 |
-
<div class="wp-mail-smtp-setting-field">
|
117 |
-
|
118 |
-
<label for="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-region-us">
|
119 |
-
<input type="radio" id="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-region-us"
|
120 |
-
name="wp-mail-smtp[<?php echo esc_attr( $this->get_slug() ); ?>][region]" value="US"
|
121 |
-
<?php echo $this->options->is_const_defined( $this->get_slug(), 'region' ) ? 'disabled' : ''; ?>
|
122 |
-
<?php checked( 'US', $this->options->get( $this->get_slug(), 'region' ) ); ?>
|
123 |
-
/>
|
124 |
-
<?php esc_html_e( 'US', 'wp-mail-smtp' ); ?>
|
125 |
-
</label>
|
126 |
-
|
127 |
-
<label for="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-region-eu">
|
128 |
-
<input type="radio" id="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-region-eu"
|
129 |
-
name="wp-mail-smtp[<?php echo esc_attr( $this->get_slug() ); ?>][region]" value="EU"
|
130 |
-
<?php echo $this->options->is_const_defined( $this->get_slug(), 'region' ) ? 'disabled' : ''; ?>
|
131 |
-
<?php checked( 'EU', $this->options->get( $this->get_slug(), 'region' ) ); ?>
|
132 |
-
/>
|
133 |
-
<?php esc_html_e( 'EU', 'wp-mail-smtp' ); ?>
|
134 |
-
</label>
|
135 |
-
|
136 |
-
<p class="desc">
|
137 |
-
<?php esc_html_e( 'Define which endpoint you want to use for sending messages.', 'wp-mail-smtp' ); ?><br>
|
138 |
-
<?php esc_html_e( 'If you are operating under EU laws, you may be required to use EU region.', 'wp-mail-smtp' ); ?>
|
139 |
-
<?php
|
140 |
-
printf(
|
141 |
-
wp_kses(
|
142 |
-
/* translators: %s - URL to Mailgun.com page. */
|
143 |
-
__( '<a href="%s" rel="" target="_blank">More information</a> on Mailgun.com.', 'wp-mail-smtp' ),
|
144 |
-
array(
|
145 |
-
'a' => array(
|
146 |
-
'href' => array(),
|
147 |
-
'rel' => array(),
|
148 |
-
'target' => array(),
|
149 |
-
),
|
150 |
-
)
|
151 |
-
),
|
152 |
-
'https://www.mailgun.com/regions'
|
153 |
-
);
|
154 |
-
?>
|
155 |
-
</p>
|
156 |
-
</div>
|
157 |
-
</div>
|
158 |
-
|
159 |
-
<?php
|
160 |
-
}
|
161 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPMailSMTP\Providers\Mailgun;
|
4 |
+
|
5 |
+
use WPMailSMTP\Providers\OptionsAbstract;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Class Option.
|
9 |
+
*
|
10 |
+
* @since 1.0.0
|
11 |
+
*/
|
12 |
+
class Options extends OptionsAbstract {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Mailgun constructor.
|
16 |
+
*
|
17 |
+
* @since 1.0.0
|
18 |
+
*/
|
19 |
+
public function __construct() {
|
20 |
+
|
21 |
+
parent::__construct(
|
22 |
+
array(
|
23 |
+
'logo_url' => wp_mail_smtp()->assets_url . '/images/providers/mailgun.svg',
|
24 |
+
'slug' => 'mailgun',
|
25 |
+
'title' => esc_html__( 'Mailgun', 'wp-mail-smtp' ),
|
26 |
+
'description' => sprintf(
|
27 |
+
wp_kses(
|
28 |
+
/* translators: %1$s - opening link tag; %2$s - closing link tag; %3$s - opening link tag; %4$s - closing link tag. */
|
29 |
+
__( '%1$sMailgun%2$s is one of the leading transactional email services trusted by over 150,000+ businesses. They provide 5,000 free emails per month for 3 months.<br><br>Read our %3$sMailgun documentation%4$s to learn how to configure Mailgun and improve your email deliverability.', 'wp-mail-smtp' ),
|
30 |
+
array(
|
31 |
+
'br' => array(),
|
32 |
+
'a' => array(
|
33 |
+
'href' => array(),
|
34 |
+
'rel' => array(),
|
35 |
+
'target' => array(),
|
36 |
+
),
|
37 |
+
)
|
38 |
+
),
|
39 |
+
'<a href="https://www.mailgun.com" target="_blank" rel="noopener noreferrer">',
|
40 |
+
'</a>',
|
41 |
+
'<a href="https://wpmailsmtp.com/docs/how-to-set-up-the-mailgun-mailer-in-wp-mail-smtp/" target="_blank" rel="noopener noreferrer">',
|
42 |
+
'</a>'
|
43 |
+
),
|
44 |
+
)
|
45 |
+
);
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* @inheritdoc
|
50 |
+
*/
|
51 |
+
public function display_options() {
|
52 |
+
?>
|
53 |
+
|
54 |
+
<!-- API Key -->
|
55 |
+
<div id="wp-mail-smtp-setting-row-<?php echo esc_attr( $this->get_slug() ); ?>-api_key" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-text wp-mail-smtp-clear">
|
56 |
+
<div class="wp-mail-smtp-setting-label">
|
57 |
+
<label for="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-api_key"><?php esc_html_e( 'Private API Key', 'wp-mail-smtp' ); ?></label>
|
58 |
+
</div>
|
59 |
+
<div class="wp-mail-smtp-setting-field">
|
60 |
+
<?php if ( $this->options->is_const_defined( $this->get_slug(), 'api_key' ) ) : ?>
|
61 |
+
<input type="text" disabled value="****************************************"
|
62 |
+
id="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-api_key"
|
63 |
+
/>
|
64 |
+
<?php $this->display_const_set_message( 'WPMS_MAILGUN_API_KEY' ); ?>
|
65 |
+
<?php else : ?>
|
66 |
+
<input type="password" spellcheck="false"
|
67 |
+
name="wp-mail-smtp[<?php echo esc_attr( $this->get_slug() ); ?>][api_key]"
|
68 |
+
value="<?php echo esc_attr( $this->options->get( $this->get_slug(), 'api_key' ) ); ?>"
|
69 |
+
id="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-api_key"
|
70 |
+
/>
|
71 |
+
<?php endif; ?>
|
72 |
+
<p class="desc">
|
73 |
+
<?php
|
74 |
+
printf(
|
75 |
+
/* translators: %s - API key link. */
|
76 |
+
esc_html__( 'Follow this link to get an API Key from Mailgun: %s.', 'wp-mail-smtp' ),
|
77 |
+
'<a href="https://app.mailgun.com/app/account/security/api_keys" target="_blank" rel="noopener noreferrer">' .
|
78 |
+
esc_html__( 'Get a Private API Key', 'wp-mail-smtp' ) .
|
79 |
+
'</a>'
|
80 |
+
);
|
81 |
+
?>
|
82 |
+
</p>
|
83 |
+
</div>
|
84 |
+
</div>
|
85 |
+
|
86 |
+
<!-- Domain -->
|
87 |
+
<div id="wp-mail-smtp-setting-row-<?php echo esc_attr( $this->get_slug() ); ?>-domain" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-text wp-mail-smtp-clear">
|
88 |
+
<div class="wp-mail-smtp-setting-label">
|
89 |
+
<label for="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-domain"><?php esc_html_e( 'Domain Name', 'wp-mail-smtp' ); ?></label>
|
90 |
+
</div>
|
91 |
+
<div class="wp-mail-smtp-setting-field">
|
92 |
+
<input name="wp-mail-smtp[<?php echo esc_attr( $this->get_slug() ); ?>][domain]" type="text"
|
93 |
+
value="<?php echo esc_attr( $this->options->get( $this->get_slug(), 'domain' ) ); ?>"
|
94 |
+
<?php echo $this->options->is_const_defined( $this->get_slug(), 'domain' ) ? 'disabled' : ''; ?>
|
95 |
+
id="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-domain" spellcheck="false"
|
96 |
+
/>
|
97 |
+
<p class="desc">
|
98 |
+
<?php
|
99 |
+
printf(
|
100 |
+
/* translators: %s - Domain Name link. */
|
101 |
+
esc_html__( 'Follow this link to get a Domain Name from Mailgun: %s.', 'wp-mail-smtp' ),
|
102 |
+
'<a href="https://app.mailgun.com/app/domains" target="_blank" rel="noopener noreferrer">' .
|
103 |
+
esc_html__( 'Get a Domain Name', 'wp-mail-smtp' ) .
|
104 |
+
'</a>'
|
105 |
+
);
|
106 |
+
?>
|
107 |
+
</p>
|
108 |
+
</div>
|
109 |
+
</div>
|
110 |
+
|
111 |
+
<!-- Region -->
|
112 |
+
<div id="wp-mail-smtp-setting-row-<?php echo esc_attr( $this->get_slug() ); ?>-region" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-radio wp-mail-smtp-clear">
|
113 |
+
<div class="wp-mail-smtp-setting-label">
|
114 |
+
<label><?php esc_html_e( 'Region', 'wp-mail-smtp' ); ?></label>
|
115 |
+
</div>
|
116 |
+
<div class="wp-mail-smtp-setting-field">
|
117 |
+
|
118 |
+
<label for="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-region-us">
|
119 |
+
<input type="radio" id="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-region-us"
|
120 |
+
name="wp-mail-smtp[<?php echo esc_attr( $this->get_slug() ); ?>][region]" value="US"
|
121 |
+
<?php echo $this->options->is_const_defined( $this->get_slug(), 'region' ) ? 'disabled' : ''; ?>
|
122 |
+
<?php checked( 'US', $this->options->get( $this->get_slug(), 'region' ) ); ?>
|
123 |
+
/>
|
124 |
+
<?php esc_html_e( 'US', 'wp-mail-smtp' ); ?>
|
125 |
+
</label>
|
126 |
+
|
127 |
+
<label for="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-region-eu">
|
128 |
+
<input type="radio" id="wp-mail-smtp-setting-<?php echo esc_attr( $this->get_slug() ); ?>-region-eu"
|
129 |
+
name="wp-mail-smtp[<?php echo esc_attr( $this->get_slug() ); ?>][region]" value="EU"
|
130 |
+
<?php echo $this->options->is_const_defined( $this->get_slug(), 'region' ) ? 'disabled' : ''; ?>
|
131 |
+
<?php checked( 'EU', $this->options->get( $this->get_slug(), 'region' ) ); ?>
|
132 |
+
/>
|
133 |
+
<?php esc_html_e( 'EU', 'wp-mail-smtp' ); ?>
|
134 |
+
</label>
|
135 |
+
|
136 |
+
<p class="desc">
|
137 |
+
<?php esc_html_e( 'Define which endpoint you want to use for sending messages.', 'wp-mail-smtp' ); ?><br>
|
138 |
+
<?php esc_html_e( 'If you are operating under EU laws, you may be required to use EU region.', 'wp-mail-smtp' ); ?>
|
139 |
+
<?php
|
140 |
+
printf(
|
141 |
+
wp_kses(
|
142 |
+
/* translators: %s - URL to Mailgun.com page. */
|
143 |
+
__( '<a href="%s" rel="" target="_blank">More information</a> on Mailgun.com.', 'wp-mail-smtp' ),
|
144 |
+
array(
|
145 |
+
'a' => array(
|
146 |
+
'href' => array(),
|
147 |
+
'rel' => array(),
|
148 |
+
'target' => array(),
|
149 |
+
),
|
150 |
+
)
|
151 |
+
),
|
152 |
+
'https://www.mailgun.com/regions'
|
153 |
+
);
|
154 |
+
?>
|
155 |
+
</p>
|
156 |
+
</div>
|
157 |
+
</div>
|
158 |
+
|
159 |
+
<?php
|
160 |
+
}
|
161 |
+
}
|
src/Providers/OptionsAbstract.php
CHANGED
@@ -441,7 +441,7 @@ abstract class OptionsAbstract implements OptionsInterface {
|
|
441 |
<?php
|
442 |
printf(
|
443 |
/* translators: %s - Provider name. */
|
444 |
-
esc_html__( '%s requires a SSL certificate on a site to work and does not support
|
445 |
esc_html( $this->get_title() )
|
446 |
);
|
447 |
?>
|
441 |
<?php
|
442 |
printf(
|
443 |
/* translators: %s - Provider name. */
|
444 |
+
esc_html__( '%s requires a SSL certificate on a site to work and does not support your current installation. Please contact your host and request a SSL certificate or install a free one, like Let\'s Encrypt.', 'wp-mail-smtp' ),
|
445 |
esc_html( $this->get_title() )
|
446 |
);
|
447 |
?>
|
src/Providers/Pepipost/Options.php
CHANGED
@@ -1,29 +1,29 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPMailSMTP\Providers\Pepipost;
|
4 |
-
|
5 |
-
use WPMailSMTP\Providers\OptionsAbstract;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Class Options.
|
9 |
-
*
|
10 |
-
* @since 1.0.0
|
11 |
-
*/
|
12 |
-
class Options extends OptionsAbstract {
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Pepipost constructor.
|
16 |
-
*
|
17 |
-
* @since 1.0.0
|
18 |
-
*/
|
19 |
-
public function __construct() {
|
20 |
-
|
21 |
-
parent::__construct(
|
22 |
-
array(
|
23 |
-
'logo_url' => wp_mail_smtp()->assets_url . '/images/providers/pepipost-smtp.png',
|
24 |
-
'slug' => 'pepipost',
|
25 |
-
'title' => esc_html__( 'Pepipost SMTP', 'wp-mail-smtp' ),
|
26 |
-
)
|
27 |
-
);
|
28 |
-
}
|
29 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPMailSMTP\Providers\Pepipost;
|
4 |
+
|
5 |
+
use WPMailSMTP\Providers\OptionsAbstract;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Class Options.
|
9 |
+
*
|
10 |
+
* @since 1.0.0
|
11 |
+
*/
|
12 |
+
class Options extends OptionsAbstract {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Pepipost constructor.
|
16 |
+
*
|
17 |
+
* @since 1.0.0
|
18 |
+
*/
|
19 |
+
public function __construct() {
|
20 |
+
|
21 |
+
parent::__construct(
|
22 |
+
array(
|
23 |
+
'logo_url' => wp_mail_smtp()->assets_url . '/images/providers/pepipost-smtp.png',
|
24 |
+
'slug' => 'pepipost',
|
25 |
+
'title' => esc_html__( 'Pepipost SMTP', 'wp-mail-smtp' ),
|
26 |
+
)
|
27 |
+
);
|
28 |
+
}
|
29 |
+
}
|
src/Providers/PepipostAPI/Mailer.php
CHANGED
@@ -1,440 +1,440 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPMailSMTP\Providers\PepipostAPI;
|
4 |
-
|
5 |
-
use WPMailSMTP\Providers\MailerAbstract;
|
6 |
-
use WPMailSMTP\WP;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Class Mailer is basically a Sendgrid copy-paste, as Pepipost support SG migration.
|
10 |
-
* In the future we may rewrite the class to use the native Pepipost API.
|
11 |
-
*
|
12 |
-
* @since 1.8.0
|
13 |
-
*/
|
14 |
-
class Mailer extends MailerAbstract {
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Which response code from HTTP provider is considered to be successful?
|
18 |
-
*
|
19 |
-
* @since 1.8.0
|
20 |
-
*
|
21 |
-
* @var int
|
22 |
-
*/
|
23 |
-
protected $email_sent_code = 202;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* URL to make an API request to.
|
27 |
-
*
|
28 |
-
* @since 1.8.0
|
29 |
-
*
|
30 |
-
* @var string
|
31 |
-
*/
|
32 |
-
protected $url = 'https://sgapi.pepipost.com/v3/mail/send';
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Mailer constructor.
|
36 |
-
*
|
37 |
-
* @since 1.8.0
|
38 |
-
*
|
39 |
-
* @param \WPMailSMTP\MailCatcher $phpmailer
|
40 |
-
*/
|
41 |
-
public function __construct( $phpmailer ) {
|
42 |
-
|
43 |
-
// We want to prefill everything from \WPMailSMTP\MailCatcher class, which extends \PHPMailer.
|
44 |
-
parent::__construct( $phpmailer );
|
45 |
-
|
46 |
-
$this->set_header( 'Authorization', 'Bearer ' . $this->options->get( $this->mailer, 'api_key' ) );
|
47 |
-
$this->set_header( 'content-type', 'application/json' );
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Redefine the way email body is returned.
|
52 |
-
* By default we are sending an array of data.
|
53 |
-
* Pepipost requires a JSON, so we encode the body.
|
54 |
-
*
|
55 |
-
* @since 1.8.0
|
56 |
-
*
|
57 |
-
* @return string
|
58 |
-
*/
|
59 |
-
public function get_body() {
|
60 |
-
|
61 |
-
$body = parent::get_body();
|
62 |
-
|
63 |
-
return wp_json_encode( $body );
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Set the FROM header of the email.
|
68 |
-
*
|
69 |
-
* @since 1.8.0
|
70 |
-
*
|
71 |
-
* @param string $email From mail.
|
72 |
-
* @param string $name From name.
|
73 |
-
*/
|
74 |
-
public function set_from( $email, $name = '' ) {
|
75 |
-
|
76 |
-
if ( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) ) {
|
77 |
-
return;
|
78 |
-
}
|
79 |
-
|
80 |
-
$from['email'] = $email;
|
81 |
-
|
82 |
-
if ( ! empty( $name ) ) {
|
83 |
-
$from['name'] = $name;
|
84 |
-
}
|
85 |
-
|
86 |
-
$this->set_body_param(
|
87 |
-
array(
|
88 |
-
'from' => $from,
|
89 |
-
)
|
90 |
-
);
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Set the names/emails of people who will receive the email.
|
95 |
-
*
|
96 |
-
* @since 1.8.0
|
97 |
-
*
|
98 |
-
* @param array $recipients List of recipients: cc/bcc/to.
|
99 |
-
*/
|
100 |
-
public function set_recipients( $recipients ) {
|
101 |
-
|
102 |
-
if ( empty( $recipients ) ) {
|
103 |
-
return;
|
104 |
-
}
|
105 |
-
|
106 |
-
// Allow for now only these recipient types.
|
107 |
-
$default = array( 'to', 'cc', 'bcc' );
|
108 |
-
$data = array();
|
109 |
-
|
110 |
-
foreach ( $recipients as $type => $emails ) {
|
111 |
-
if (
|
112 |
-
! in_array( $type, $default, true ) ||
|
113 |
-
empty( $emails ) ||
|
114 |
-
! is_array( $emails )
|
115 |
-
) {
|
116 |
-
continue;
|
117 |
-
}
|
118 |
-
|
119 |
-
$data[ $type ] = array();
|
120 |
-
|
121 |
-
// Iterate over all emails for each type.
|
122 |
-
// There might be multiple cc/to/bcc emails.
|
123 |
-
foreach ( $emails as $email ) {
|
124 |
-
$holder = array();
|
125 |
-
$addr = isset( $email[0] ) ? $email[0] : false;
|
126 |
-
$name = isset( $email[1] ) ? $email[1] : false;
|
127 |
-
|
128 |
-
if ( ! filter_var( $addr, FILTER_VALIDATE_EMAIL ) ) {
|
129 |
-
continue;
|
130 |
-
}
|
131 |
-
|
132 |
-
$holder['email'] = $addr;
|
133 |
-
if ( ! empty( $name ) ) {
|
134 |
-
$holder['name'] = $name;
|
135 |
-
}
|
136 |
-
|
137 |
-
array_push( $data[ $type ], $holder );
|
138 |
-
}
|
139 |
-
}
|
140 |
-
|
141 |
-
if ( ! empty( $data ) ) {
|
142 |
-
$this->set_body_param(
|
143 |
-
array(
|
144 |
-
'personalizations' => array( $data ),
|
145 |
-
)
|
146 |
-
);
|
147 |
-
|
148 |
-
if ( ! empty( $data['bcc'] ) ) {
|
149 |
-
// Only the 1st BCC email address, ignore the rest - is not supported by Pepipost.
|
150 |
-
$bcc['mail_settings']['bcc']['email'] = $data['bcc'][0]['email'];
|
151 |
-
$this->set_body_param(
|
152 |
-
$bcc
|
153 |
-
);
|
154 |
-
}
|
155 |
-
}
|
156 |
-
}
|
157 |
-
|
158 |
-
/**
|
159 |
-
* Set the email content.
|
160 |
-
*
|
161 |
-
* @since 1.8.0
|
162 |
-
*
|
163 |
-
* @param array|string $content Email content.
|
164 |
-
*/
|
165 |
-
public function set_content( $content ) {
|
166 |
-
|
167 |
-
if ( empty( $content ) ) {
|
168 |
-
return;
|
169 |
-
}
|
170 |
-
|
171 |
-
if ( is_array( $content ) ) {
|
172 |
-
|
173 |
-
$default = array( 'text', 'html' );
|
174 |
-
$data = array();
|
175 |
-
|
176 |
-
foreach ( $content as $type => $body ) {
|
177 |
-
if (
|
178 |
-
! in_array( $type, $default, true ) ||
|
179 |
-
empty( $body )
|
180 |
-
) {
|
181 |
-
continue;
|
182 |
-
}
|
183 |
-
|
184 |
-
$content_type = 'text/plain';
|
185 |
-
$content_value = $body;
|
186 |
-
|
187 |
-
if ( $type === 'html' ) {
|
188 |
-
$content_type = 'text/html';
|
189 |
-
}
|
190 |
-
|
191 |
-
$data[] = array(
|
192 |
-
'type' => $content_type,
|
193 |
-
'value' => $content_value,
|
194 |
-
);
|
195 |
-
}
|
196 |
-
|
197 |
-
$this->set_body_param(
|
198 |
-
array(
|
199 |
-
'content' => $data,
|
200 |
-
)
|
201 |
-
);
|
202 |
-
} else {
|
203 |
-
$data['type'] = 'text/html';
|
204 |
-
$data['value'] = $content;
|
205 |
-
|
206 |
-
if ( $this->phpmailer->ContentType === 'text/plain' ) {
|
207 |
-
$data['type'] = 'text/plain';
|
208 |
-
}
|
209 |
-
|
210 |
-
$this->set_body_param(
|
211 |
-
array(
|
212 |
-
'content' => array( $data ),
|
213 |
-
)
|
214 |
-
);
|
215 |
-
}
|
216 |
-
}
|
217 |
-
|
218 |
-
/**
|
219 |
-
* Redefine the way custom headers are processed for this mailer - they should be in body.
|
220 |
-
*
|
221 |
-
* @since 1.8.0
|
222 |
-
*
|
223 |
-
* @param array $headers
|
224 |
-
*/
|
225 |
-
public function set_headers( $headers ) {
|
226 |
-
|
227 |
-
foreach ( $headers as $header ) {
|
228 |
-
$name = isset( $header[0] ) ? $header[0] : false;
|
229 |
-
$value = isset( $header[1] ) ? $header[1] : false;
|
230 |
-
|
231 |
-
$this->set_body_header( $name, $value );
|
232 |
-
}
|
233 |
-
|
234 |
-
// Add custom PHPMailer-specific header.
|
235 |
-
$this->set_body_header( 'X-Mailer', 'WPMailSMTP/Mailer/' . $this->mailer . ' ' . WPMS_PLUGIN_VER );
|
236 |
-
}
|
237 |
-
|
238 |
-
/**
|
239 |
-
* This mailer supports email-related custom headers inside a body of the message.
|
240 |
-
*
|
241 |
-
* @since 1.8.0
|
242 |
-
*
|
243 |
-
* @param string $name
|
244 |
-
* @param string $value
|
245 |
-
*/
|
246 |
-
public function set_body_header( $name, $value ) {
|
247 |
-
|
248 |
-
$name = sanitize_text_field( $name );
|
249 |
-
if ( empty( $name ) ) {
|
250 |
-
return;
|
251 |
-
}
|
252 |
-
|
253 |
-
$headers = isset( $this->body['headers'] ) ? (array) $this->body['headers'] : array();
|
254 |
-
|
255 |
-
$headers[ $name ] = WP::sanitize_value( $value );
|
256 |
-
|
257 |
-
$this->set_body_param(
|
258 |
-
array(
|
259 |
-
'headers' => $headers,
|
260 |
-
)
|
261 |
-
);
|
262 |
-
}
|
263 |
-
|
264 |
-
/**
|
265 |
-
* Pepipost accepts an array of files content in body, so we will include all files and send.
|
266 |
-
* Doesn't handle exceeding the limits etc, as this is done and reported by SendGrid API.
|
267 |
-
*
|
268 |
-
* @since 1.8.0
|
269 |
-
*
|
270 |
-
* @param array $attachments
|
271 |
-
*/
|
272 |
-
public function set_attachments( $attachments ) {
|
273 |
-
|
274 |
-
if ( empty( $attachments ) ) {
|
275 |
-
return;
|
276 |
-
}
|
277 |
-
|
278 |
-
$data = array();
|
279 |
-
|
280 |
-
foreach ( $attachments as $attachment ) {
|
281 |
-
$file = false;
|
282 |
-
|
283 |
-
/*
|
284 |
-
* We are not using WP_Filesystem API as we can't reliably work with it.
|
285 |
-
* It is not always available, same as credentials for FTP.
|
286 |
-
*/
|
287 |
-
try {
|
288 |
-
if ( is_file( $attachment[0] ) && is_readable( $attachment[0] ) ) {
|
289 |
-
$file = file_get_contents( $attachment[0] ); // phpcs:ignore
|
290 |
-
}
|
291 |
-
}
|
292 |
-
catch ( \Exception $e ) {
|
293 |
-
$file = false;
|
294 |
-
}
|
295 |
-
|
296 |
-
if ( $file === false ) {
|
297 |
-
continue;
|
298 |
-
}
|
299 |
-
|
300 |
-
$data[] = array(
|
301 |
-
'content' => base64_encode( $file ),
|
302 |
-
'type' => $attachment[4],
|
303 |
-
'filename' => $attachment[2],
|
304 |
-
'disposition' => $attachment[6],
|
305 |
-
);
|
306 |
-
}
|
307 |
-
|
308 |
-
if ( ! empty( $data ) ) {
|
309 |
-
$this->set_body_param(
|
310 |
-
array(
|
311 |
-
'attachments' => $data,
|
312 |
-
)
|
313 |
-
);
|
314 |
-
}
|
315 |
-
}
|
316 |
-
|
317 |
-
/**
|
318 |
-
* Set the reply-to property of the email.
|
319 |
-
*
|
320 |
-
* @since 1.8.0
|
321 |
-
*
|
322 |
-
* @param array $reply_to Name/email for reply-to feature.
|
323 |
-
*/
|
324 |
-
public function set_reply_to( $reply_to ) {
|
325 |
-
|
326 |
-
if ( empty( $reply_to ) ) {
|
327 |
-
return;
|
328 |
-
}
|
329 |
-
|
330 |
-
$data = array();
|
331 |
-
|
332 |
-
foreach ( $reply_to as $key => $emails ) {
|
333 |
-
if (
|
334 |
-
empty( $emails ) ||
|
335 |
-
! is_array( $emails )
|
336 |
-
) {
|
337 |
-
continue;
|
338 |
-
}
|
339 |
-
|
340 |
-
$addr = isset( $emails[0] ) ? $emails[0] : false;
|
341 |
-
$name = isset( $emails[1] ) ? $emails[1] : false;
|
342 |
-
|
343 |
-
if ( ! filter_var( $addr, FILTER_VALIDATE_EMAIL ) ) {
|
344 |
-
continue;
|
345 |
-
}
|
346 |
-
|
347 |
-
$data['email'] = $addr;
|
348 |
-
if ( ! empty( $name ) ) {
|
349 |
-
$data['name'] = $name;
|
350 |
-
}
|
351 |
-
}
|
352 |
-
|
353 |
-
if ( ! empty( $data ) ) {
|
354 |
-
$this->set_body_param(
|
355 |
-
array(
|
356 |
-
'reply_to' => $data,
|
357 |
-
)
|
358 |
-
);
|
359 |
-
}
|
360 |
-
}
|
361 |
-
|
362 |
-
/**
|
363 |
-
* Pepipost doesn't support sender or return_path params.
|
364 |
-
* So we do nothing.
|
365 |
-
*
|
366 |
-
* @since 1.8.0
|
367 |
-
*
|
368 |
-
* @param string $from_email
|
369 |
-
*/
|
370 |
-
public function set_return_path( $from_email ) {}
|
371 |
-
|
372 |
-
/**
|
373 |
-
* Get a Pepipost-specific response with a helpful error.
|
374 |
-
*
|
375 |
-
* @see https://developers.pepipost.com/migration-api/new-subpage/errorcodes
|
376 |
-
*
|
377 |
-
* @since 1.8.0
|
378 |
-
*
|
379 |
-
* @return string
|
380 |
-
*/
|
381 |
-
protected function get_response_error() {
|
382 |
-
|
383 |
-
$body = (array) wp_remote_retrieve_body( $this->response );
|
384 |
-
|
385 |
-
$error_text = array();
|
386 |
-
|
387 |
-
if ( ! empty( $body['errors'] ) ) {
|
388 |
-
foreach ( $body['errors'] as $error ) {
|
389 |
-
if ( property_exists( $error, 'message' ) ) {
|
390 |
-
// Prepare additional information from SendGrid API.
|
391 |
-
$extra = '';
|
392 |
-
if ( property_exists( $error, 'field' ) && ! empty( $error->field ) ) {
|
393 |
-
$extra .= $error->field . '; ';
|
394 |
-
}
|
395 |
-
if ( property_exists( $error, 'help' ) && ! empty( $error->help ) ) {
|
396 |
-
$extra .= $error->help;
|
397 |
-
}
|
398 |
-
|
399 |
-
// Assign both the main message and perhaps extra information, if exists.
|
400 |
-
$error_text[] = $error->message . ( ! empty( $extra ) ? ' - ' . $extra : '' );
|
401 |
-
}
|
402 |
-
}
|
403 |
-
}
|
404 |
-
|
405 |
-
return implode( '<br>', array_map( 'esc_textarea', $error_text ) );
|
406 |
-
}
|
407 |
-
|
408 |
-
/**
|
409 |
-
* Get mailer debug information, that is helpful during support.
|
410 |
-
*
|
411 |
-
* @since 1.8.0
|
412 |
-
*
|
413 |
-
* @return string
|
414 |
-
*/
|
415 |
-
public function get_debug_info() {
|
416 |
-
|
417 |
-
$sendgrid_text[] = '<strong>Api Key:</strong> ' . ( $this->is_mailer_complete() ? 'Yes' : 'No' );
|
418 |
-
|
419 |
-
return implode( '<br>', $sendgrid_text );
|
420 |
-
}
|
421 |
-
|
422 |
-
/**
|
423 |
-
* Whether the mailer has all its settings correctly set up and saved.
|
424 |
-
*
|
425 |
-
* @since 1.8.0
|
426 |
-
*
|
427 |
-
* @return bool
|
428 |
-
*/
|
429 |
-
public function is_mailer_complete() {
|
430 |
-
|
431 |
-
$options = $this->options->get_group( $this->mailer );
|
432 |
-
|
433 |
-
// API key is the only required option.
|
434 |
-
if ( ! empty( $options['api_key'] ) ) {
|
435 |
-
return true;
|
436 |
-
}
|
437 |
-
|
438 |
-
return false;
|
439 |
-
}
|
440 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPMailSMTP\Providers\PepipostAPI;
|
4 |
+
|
5 |
+
use WPMailSMTP\Providers\MailerAbstract;
|
6 |
+
use WPMailSMTP\WP;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class Mailer is basically a Sendgrid copy-paste, as Pepipost support SG migration.
|
10 |
+
* In the future we may rewrite the class to use the native Pepipost API.
|
11 |
+
*
|
12 |
+
* @since 1.8.0
|
13 |
+
*/
|
14 |
+
class Mailer extends MailerAbstract {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Which response code from HTTP provider is considered to be successful?
|
18 |
+
*
|
19 |
+
* @since 1.8.0
|
20 |
+
*
|
21 |
+
* @var int
|
22 |
+
*/
|
23 |
+
protected $email_sent_code = 202;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* URL to make an API request to.
|
27 |
+
*
|
28 |
+
* @since 1.8.0
|
29 |
+
*
|
30 |
+
* @var string
|
31 |
+
*/
|
32 |
+
protected $url = 'https://sgapi.pepipost.com/v3/mail/send';
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Mailer constructor.
|
36 |
+
*
|
37 |
+
* @since 1.8.0
|
38 |
+
*
|
39 |
+
* @param \WPMailSMTP\MailCatcher $phpmailer
|
40 |
+
*/
|
41 |
+
public function __construct( $phpmailer ) {
|
42 |
+
|
43 |
+
// We want to prefill everything from \WPMailSMTP\MailCatcher class, which extends \PHPMailer.
|
44 |
+
parent::__construct( $phpmailer );
|
45 |
+
|
46 |
+
$this->set_header( 'Authorization', 'Bearer ' . $this->options->get( $this->mailer, 'api_key' ) );
|
47 |
+
$this->set_header( 'content-type', 'application/json' );
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Redefine the way email body is returned.
|
52 |
+
* By default we are sending an array of data.
|
53 |
+
* Pepipost requires a JSON, so we encode the body.
|
54 |
+
*
|
55 |
+
* @since 1.8.0
|
56 |
+
*
|
57 |
+
* @return string
|
58 |
+
*/
|
59 |
+
public function get_body() {
|
60 |
+
|
61 |
+
$body = parent::get_body();
|
62 |
+
|
63 |
+
return wp_json_encode( $body );
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Set the FROM header of the email.
|
68 |
+
*
|
69 |
+
* @since 1.8.0
|
70 |
+
*
|
71 |
+
* @param string $email From mail.
|
72 |
+
* @param string $name From name.
|
73 |
+
*/
|
74 |
+
public function set_from( $email, $name = '' ) {
|
75 |
+
|
76 |
+
if ( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) ) {
|
77 |
+
return;
|
78 |
+
}
|
79 |
+
|
80 |
+
$from['email'] = $email;
|
81 |
+
|
82 |
+
if ( ! empty( $name ) ) {
|
83 |
+
$from['name'] = $name;
|
84 |
+
}
|
85 |
+
|
86 |
+
$this->set_body_param(
|
87 |
+
array(
|
88 |
+
'from' => $from,
|
89 |
+
)
|
90 |
+
);
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Set the names/emails of people who will receive the email.
|
95 |
+
*
|
96 |
+
* @since 1.8.0
|
97 |
+
*
|
98 |
+
* @param array $recipients List of recipients: cc/bcc/to.
|
99 |
+
*/
|
100 |
+
public function set_recipients( $recipients ) {
|
101 |
+
|
102 |
+
if ( empty( $recipients ) ) {
|
103 |
+
return;
|
104 |
+
}
|
105 |
+
|
106 |
+
// Allow for now only these recipient types.
|
107 |
+
$default = array( 'to', 'cc', 'bcc' );
|
108 |
+
$data = array();
|
109 |
+
|
110 |
+
foreach ( $recipients as $type => $emails ) {
|
111 |
+
if (
|
112 |
+
! in_array( $type, $default, true ) ||
|
113 |
+
empty( $emails ) ||
|
114 |
+
! is_array( $emails )
|
115 |
+
) {
|
116 |
+
continue;
|
117 |
+
}
|
118 |
+
|
119 |
+
$data[ $type ] = array();
|
120 |
+
|
121 |
+
// Iterate over all emails for each type.
|
122 |
+
// There might be multiple cc/to/bcc emails.
|
123 |
+
foreach ( $emails as $email ) {
|
124 |
+
$holder = array();
|
125 |
+
$addr = isset( $email[0] ) ? $email[0] : false;
|
126 |
+
$name = isset( $email[1] ) ? $email[1] : false;
|
127 |
+
|
128 |
+
if ( ! filter_var( $addr, FILTER_VALIDATE_EMAIL ) ) {
|
129 |
+
continue;
|
130 |
+
}
|
131 |
+
|
132 |
+
$holder['email'] = $addr;
|
133 |
+
if ( ! empty( $name ) ) {
|
134 |
+
$holder['name'] = $name;
|
135 |
+
}
|
136 |
+
|
137 |
+
array_push( $data[ $type ], $holder );
|
138 |
+
}
|
139 |
+
}
|
140 |
+
|
141 |
+
if ( ! empty( $data ) ) {
|
142 |
+
$this->set_body_param(
|
143 |
+
array(
|
144 |
+
'personalizations' => array( $data ),
|
145 |
+
)
|
146 |
+
);
|
147 |
+
|
148 |
+
if ( ! empty( $data['bcc'] ) ) {
|
149 |
+
// Only the 1st BCC email address, ignore the rest - is not supported by Pepipost.
|
150 |
+
$bcc['mail_settings']['bcc']['email'] = $data['bcc'][0]['email'];
|
151 |
+
$this->set_body_param(
|
152 |
+
$bcc
|
153 |
+
);
|
154 |
+
}
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Set the email content.
|
160 |
+
*
|
161 |
+
* @since 1.8.0
|
162 |
+
*
|
163 |
+
* @param array|string $content Email content.
|
164 |
+
*/
|
165 |
+
public function set_content( $content ) {
|
166 |
+
|
167 |
+
if ( empty( $content ) ) {
|
168 |
+
return;
|
169 |
+
}
|
170 |
+
|
171 |
+
if ( is_array( $content ) ) {
|
172 |
+
|
173 |
+
$default = array( 'text', 'html' );
|
174 |
+
$data = array();
|
175 |
+
|
176 |
+
foreach ( $content as $type => $body ) {
|
177 |
+
if (
|
178 |
+
! in_array( $type, $default, true ) ||
|
179 |
+
empty( $body )
|
180 |
+
) {
|
181 |
+
continue;
|
182 |
+
}
|
183 |
+
|
184 |
+
$content_type = 'text/plain';
|
185 |
+
$content_value = $body;
|
186 |
+
|
187 |
+
if ( $type === 'html' ) {
|
188 |
+
$content_type = 'text/html';
|
189 |
+
}
|
190 |
+
|
191 |
+
$data[] = array(
|
192 |
+
'type' => $content_type,
|
193 |
+
'value' => $content_value,
|
194 |
+
);
|
195 |
+
}
|
196 |
+
|
197 |
+
$this->set_body_param(
|
198 |
+
array(
|
199 |
+
'content' => $data,
|
200 |
+
)
|
201 |
+
);
|
202 |
+
} else {
|
203 |
+
$data['type'] = 'text/html';
|
204 |
+
$data['value'] = $content;
|
205 |
+
|
206 |
+
if ( $this->phpmailer->ContentType === 'text/plain' ) {
|
207 |
+
$data['type'] = 'text/plain';
|
208 |
+
}
|
209 |
+
|
210 |
+
$this->set_body_param(
|
211 |
+
array(
|
212 |
+
'content' => array( $data ),
|
213 |
+
)
|
214 |
+
);
|
215 |
+
}
|
216 |
+
}
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Redefine the way custom headers are processed for this mailer - they should be in body.
|
220 |
+
*
|
221 |
+
* @since 1.8.0
|
222 |
+
*
|
223 |
+
* @param array $headers
|
224 |
+
*/
|
225 |
+
public function set_headers( $headers ) {
|
226 |
+
|
227 |
+
foreach ( $headers as $header ) {
|
228 |
+
$name = isset( $header[0] ) ? $header[0] : false;
|
229 |
+
$value = isset( $header[1] ) ? $header[1] : false;
|
230 |
+
|
231 |
+
$this->set_body_header( $name, $value );
|
232 |
+
}
|
233 |
+
|
234 |
+
// Add custom PHPMailer-specific header.
|
235 |
+
$this->set_body_header( 'X-Mailer', 'WPMailSMTP/Mailer/' . $this->mailer . ' ' . WPMS_PLUGIN_VER );
|
236 |
+
}
|
237 |
+
|
238 |
+
/**
|
239 |
+
* This mailer supports email-related custom headers inside a body of the message.
|
240 |
+
*
|
241 |
+
* @since 1.8.0
|
242 |
+
*
|
243 |
+
* @param string $name
|
244 |
+
* @param string $value
|
245 |
+
*/
|
246 |
+
public function set_body_header( $name, $value ) {
|
247 |
+
|
248 |
+
$name = sanitize_text_field( $name );
|
249 |
+
if ( empty( $name ) ) {
|
250 |
+
return;
|
251 |
+
}
|
252 |
+
|
253 |
+
$headers = isset( $this->body['headers'] ) ? (array) $this->body['headers'] : array();
|
254 |
+
|
255 |
+
$headers[ $name ] = WP::sanitize_value( $value );
|
256 |
+
|
257 |
+
$this->set_body_param(
|
258 |
+
array(
|
259 |
+
'headers' => $headers,
|
260 |
+
)
|
261 |
+
);
|
262 |
+
}
|
263 |
+
|
264 |
+
/**
|
265 |
+
* Pepipost accepts an array of files content in body, so we will include all files and send.
|
266 |
+
* Doesn't handle exceeding the limits etc, as this is done and reported by SendGrid API.
|
267 |
+
*
|
268 |
+
* @since 1.8.0
|
269 |
+
*
|
270 |
+
* @param array $attachments
|
271 |
+
*/
|
272 |
+
public function set_attachments( $attachments ) {
|
273 |
+
|
274 |
+
if ( empty( $attachments ) ) {
|
275 |
+
return;
|
276 |
+
}
|
277 |
+
|
278 |
+
$data = array();
|
279 |
+
|
280 |
+
foreach ( $attachments as $attachment ) {
|
281 |
+
$file = false;
|
282 |
+
|
283 |
+
/*
|
284 |
+
* We are not using WP_Filesystem API as we can't reliably work with it.
|
285 |
+
* It is not always available, same as credentials for FTP.
|
286 |
+
*/
|
287 |
+
try {
|
288 |
+
if ( is_file( $attachment[0] ) && is_readable( $attachment[0] ) ) {
|
289 |
+
$file = file_get_contents( $attachment[0] ); // phpcs:ignore
|
290 |
+
}
|
291 |
+
}
|
292 |
+
catch ( \Exception $e ) {
|
293 |
+
$file = false;
|
294 |
+
}
|
295 |
+
|
296 |
+
if ( $file === false ) {
|
297 |
+
continue;
|
298 |
+
}
|
299 |
+
|
300 |
+
$data[] = array(
|
301 |
+
'content' => base64_encode( $file ),
|
302 |
+
'type' => $attachment[4],
|
303 |
+
'filename' => $attachment[2],
|
304 |
+
'disposition' => $attachment[6],
|
305 |
+
);
|
306 |
+
}
|
307 |
+
|
308 |
+
if ( ! empty( $data ) ) {
|
309 |
+
$this->set_body_param(
|
310 |
+
array(
|
311 |
+
'attachments' => $data,
|
312 |
+
)
|
313 |
+
);
|
314 |
+
}
|
315 |
+
}
|
316 |
+
|
317 |
+
/**
|
318 |
+
* Set the reply-to property of the email.
|
319 |
+
*
|
320 |
+
* @since 1.8.0
|
321 |
+
*
|
322 |
+
* @param array $reply_to Name/email for reply-to feature.
|
323 |
+
*/
|
324 |
+
public function set_reply_to( $reply_to ) {
|
325 |
+
|
326 |
+
if ( empty( $reply_to ) ) {
|
327 |
+
return;
|
328 |
+
}
|
329 |
+
|
330 |
+
$data = array();
|
331 |
+
|
332 |
+
foreach ( $reply_to as $key => $emails ) {
|
333 |
+
if (
|
334 |
+
empty( $emails ) ||
|
335 |
+
! is_array( $emails )
|
336 |
+
) {
|
337 |
+
continue;
|
338 |
+
}
|
339 |
+
|
340 |
+
$addr = isset( $emails[0] ) ? $emails[0] : false;
|
341 |
+
$name = isset( $emails[1] ) ? $emails[1] : false;
|
342 |
+
|
343 |
+
if ( ! filter_var( $addr, FILTER_VALIDATE_EMAIL ) ) {
|
344 |
+
continue;
|
345 |
+
}
|
346 |
+
|
347 |
+
$data['email'] = $addr;
|
348 |
+
if ( ! empty( $name ) ) {
|
349 |
+
$data['name'] = $name;
|
350 |
+
}
|
351 |
+
}
|
352 |
+
|
353 |
+
if ( ! empty( $data ) ) {
|
354 |
+
$this->set_body_param(
|
355 |
+
array(
|
356 |
+
'reply_to' => $data,
|
357 |
+
)
|
358 |
+
);
|
359 |
+
}
|
360 |
+
}
|
361 |
+
|
362 |
+
/**
|
363 |
+
* Pepipost doesn't support sender or return_path params.
|
364 |
+
* So we do nothing.
|
365 |
+
*
|
366 |
+
* @since 1.8.0
|
367 |
+
*
|
368 |
+
* @param string $from_email
|
369 |
+
*/
|
370 |
+
public function set_return_path( $from_email ) {}
|
371 |
+
|
372 |
+
/**
|
373 |
+
* Get a Pepipost-specific response with a helpful error.
|
374 |
+
*
|
375 |
+
* @see https://developers.pepipost.com/migration-api/new-subpage/errorcodes
|
376 |
+
*
|
377 |
+
* @since 1.8.0
|
378 |
+
*
|
379 |
+
* @return string
|
380 |
+
*/
|
381 |
+
protected function get_response_error() {
|
382 |
+
|
383 |
+
$body = (array) wp_remote_retrieve_body( $this->response );
|
384 |
+
|
385 |
+
$error_text = array();
|
386 |
+
|
387 |
+
if ( ! empty( $body['errors'] ) ) {
|
388 |
+
foreach ( $body['errors'] as $error ) {
|
389 |
+
if ( property_exists( $error, 'message' ) ) {
|
390 |
+
// Prepare additional information from SendGrid API.
|
391 |
+
$extra = '';
|
392 |
+
if ( property_exists( $error, 'field' ) && ! empty( $error->field ) ) {
|
393 |
+
$extra .= $error->field . '; ';
|
394 |
+
}
|
395 |
+
if ( property_exists( $error, 'help' ) && ! empty( $error->help ) ) {
|
396 |
+
$extra .= $error->help;
|
397 |
+
}
|
398 |
+
|
399 |
+
// Assign both the main message and perhaps extra information, if exists.
|
400 |
+
$error_text[] = $error->message . ( ! empty( $extra ) ? ' - ' . $extra : '' );
|
401 |
+
}
|
402 |
+
}
|
403 |
+
}
|
404 |
+
|
405 |
+
return implode( '<br>', array_map( 'esc_textarea', $error_text ) );
|
406 |
+
}
|
407 |
+
|
408 |
+
/**
|
409 |
+
* Get mailer debug information, that is helpful during support.
|
410 |
+
*
|
411 |
+
* @since 1.8.0
|
412 |
+
*
|
413 |
+
* @return string
|
414 |
+
*/
|
415 |
+
public function get_debug_info() {
|
416 |
+
|
417 |
+
$sendgrid_text[] = '<strong>Api Key:</strong> ' . ( $this->is_mailer_complete() ? 'Yes' : 'No' );
|
418 |
+
|
419 |
+
return implode( '<br>', $sendgrid_text );
|
420 |
+
}
|
421 |
+
|
422 |
+
/**
|
423 |
+
* Whether the mailer has all its settings correctly set up and saved.
|
424 |
+
*
|
425 |
+
* @since 1.8.0
|
426 |
+
*
|
427 |
+
* @return bool
|
428 |
+
*/
|
429 |
+
public function is_mailer_complete() {
|
430 |
+
|
431 |
+
$options = $this->options->get_group( $this->mailer );
|
432 |
+
|
433 |
+
// API key is the only required option.
|
434 |
+
if ( ! empty( $options['api_key'] ) ) {
|
435 |
+
return true;
|
436 |
+
}
|
437 |
+
|
438 |
+
return false;
|
439 |
+
}
|
440 |
+
}
|
src/Providers/PepipostAPI/Options.php
CHANGED
@@ -28,7 +28,7 @@ class Options extends OptionsAbstract {
|
|
28 |
|
29 |
$description = sprintf(
|
30 |
wp_kses( /* translators: %1$s - URL to pepipost.com site. */
|
31 |
-
__( '<strong><a href="%1$s" target="_blank" rel="noopener noreferrer">Pepipost</a> is a recommended transactional email service.</strong> Every month Pepipost delivers over 8 billion emails from 20,000+ customers. Their mission is to reliably send emails in the most efficient way and at the most disruptive pricing ever. Pepipost provides users 30,000 free emails the first 30 days
|
32 |
'<br><br>' .
|
33 |
/* translators: %1$s - URL to wpmailsmtp.com doc. */
|
34 |
__( 'Read our <a href="%2$s" target="_blank" rel="noopener noreferrer">Pepipost documentation</a> to learn how to configure Pepipost and improve your email deliverability.', 'wp-mail-smtp' ),
|
28 |
|
29 |
$description = sprintf(
|
30 |
wp_kses( /* translators: %1$s - URL to pepipost.com site. */
|
31 |
+
__( '<strong><a href="%1$s" target="_blank" rel="noopener noreferrer">Pepipost</a> is a recommended transactional email service.</strong> Every month Pepipost delivers over 8 billion emails from 20,000+ customers. Their mission is to reliably send emails in the most efficient way and at the most disruptive pricing ever. Pepipost provides users 30,000 free emails the first 30 days.', 'wp-mail-smtp' ) .
|
32 |
'<br><br>' .
|
33 |
/* translators: %1$s - URL to wpmailsmtp.com doc. */
|
34 |
__( 'Read our <a href="%2$s" target="_blank" rel="noopener noreferrer">Pepipost documentation</a> to learn how to configure Pepipost and improve your email deliverability.', 'wp-mail-smtp' ),
|
src/Providers/Sendgrid/Mailer.php
CHANGED
@@ -1,409 +1,409 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPMailSMTP\Providers\Sendgrid;
|
4 |
-
|
5 |
-
use WPMailSMTP\Providers\MailerAbstract;
|
6 |
-
use WPMailSMTP\WP;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Class Mailer.
|
10 |
-
*
|
11 |
-
* @since 1.0.0
|
12 |
-
*/
|
13 |
-
class Mailer extends MailerAbstract {
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Which response code from HTTP provider is considered to be successful?
|
17 |
-
*
|
18 |
-
* @since 1.0.0
|
19 |
-
*
|
20 |
-
* @var int
|
21 |
-
*/
|
22 |
-
protected $email_sent_code = 202;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* URL to make an API request to.
|
26 |
-
*
|
27 |
-
* @since 1.0.0
|
28 |
-
*
|
29 |
-
* @var string
|
30 |
-
*/
|
31 |
-
protected $url = 'https://api.sendgrid.com/v3/mail/send';
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Mailer constructor.
|
35 |
-
*
|
36 |
-
* @since 1.0.0
|
37 |
-
*
|
38 |
-
* @param \WPMailSMTP\MailCatcher $phpmailer
|
39 |
-
*/
|
40 |
-
public function __construct( $phpmailer ) {
|
41 |
-
|
42 |
-
// We want to prefill everything from \WPMailSMTP\MailCatcher class, which extends \PHPMailer.
|
43 |
-
parent::__construct( $phpmailer );
|
44 |
-
|
45 |
-
$this->set_header( 'Authorization', 'Bearer ' . $this->options->get( $this->mailer, 'api_key' ) );
|
46 |
-
$this->set_header( 'content-type', 'application/json' );
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Redefine the way email body is returned.
|
51 |
-
* By default we are sending an array of data.
|
52 |
-
* SendGrid requires a JSON, so we encode the body.
|
53 |
-
*
|
54 |
-
* @since 1.0.0
|
55 |
-
*/
|
56 |
-
public function get_body() {
|
57 |
-
|
58 |
-
$body = parent::get_body();
|
59 |
-
|
60 |
-
return wp_json_encode( $body );
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* @inheritdoc
|
65 |
-
*/
|
66 |
-
public function set_from( $email, $name = '' ) {
|
67 |
-
|
68 |
-
if ( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) ) {
|
69 |
-
return;
|
70 |
-
}
|
71 |
-
|
72 |
-
$from['email'] = $email;
|
73 |
-
|
74 |
-
if ( ! empty( $name ) ) {
|
75 |
-
$from['name'] = $name;
|
76 |
-
}
|
77 |
-
|
78 |
-
$this->set_body_param(
|
79 |
-
array(
|
80 |
-
'from' => $from,
|
81 |
-
)
|
82 |
-
);
|
83 |
-
}
|
84 |
-
|
85 |
-
/**
|
86 |
-
* @inheritdoc
|
87 |
-
*/
|
88 |
-
public function set_recipients( $recipients ) {
|
89 |
-
|
90 |
-
if ( empty( $recipients ) ) {
|
91 |
-
return;
|
92 |
-
}
|
93 |
-
|
94 |
-
// Allow for now only these recipient types.
|
95 |
-
$default = array( 'to', 'cc', 'bcc' );
|
96 |
-
$data = array();
|
97 |
-
|
98 |
-
foreach ( $recipients as $type => $emails ) {
|
99 |
-
if (
|
100 |
-
! in_array( $type, $default, true ) ||
|
101 |
-
empty( $emails ) ||
|
102 |
-
! is_array( $emails )
|
103 |
-
) {
|
104 |
-
continue;
|
105 |
-
}
|
106 |
-
|
107 |
-
$data[ $type ] = array();
|
108 |
-
|
109 |
-
// Iterate over all emails for each type.
|
110 |
-
// There might be multiple cc/to/bcc emails.
|
111 |
-
foreach ( $emails as $email ) {
|
112 |
-
$holder = array();
|
113 |
-
$addr = isset( $email[0] ) ? $email[0] : false;
|
114 |
-
$name = isset( $email[1] ) ? $email[1] : false;
|
115 |
-
|
116 |
-
if ( ! filter_var( $addr, FILTER_VALIDATE_EMAIL ) ) {
|
117 |
-
continue;
|
118 |
-
}
|
119 |
-
|
120 |
-
$holder['email'] = $addr;
|
121 |
-
if ( ! empty( $name ) ) {
|
122 |
-
$holder['name'] = $name;
|
123 |
-
}
|
124 |
-
|
125 |
-
array_push( $data[ $type ], $holder );
|
126 |
-
}
|
127 |
-
}
|
128 |
-
|
129 |
-
if ( ! empty( $data ) ) {
|
130 |
-
$this->set_body_param(
|
131 |
-
array(
|
132 |
-
'personalizations' => array( $data ),
|
133 |
-
)
|
134 |
-
);
|
135 |
-
}
|
136 |
-
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
* @inheritdoc
|
140 |
-
*/
|
141 |
-
public function set_content( $content ) {
|
142 |
-
|
143 |
-
if ( empty( $content ) ) {
|
144 |
-
return;
|
145 |
-
}
|
146 |
-
|
147 |
-
if ( is_array( $content ) ) {
|
148 |
-
|
149 |
-
$default = array( 'text', 'html' );
|
150 |
-
$data = array();
|
151 |
-
|
152 |
-
foreach ( $content as $type => $body ) {
|
153 |
-
if (
|
154 |
-
! in_array( $type, $default, true ) ||
|
155 |
-
empty( $body )
|
156 |
-
) {
|
157 |
-
continue;
|
158 |
-
}
|
159 |
-
|
160 |
-
$content_type = 'text/plain';
|
161 |
-
$content_value = $body;
|
162 |
-
|
163 |
-
if ( $type === 'html' ) {
|
164 |
-
$content_type = 'text/html';
|
165 |
-
}
|
166 |
-
|
167 |
-
$data[] = array(
|
168 |
-
'type' => $content_type,
|
169 |
-
'value' => $content_value,
|
170 |
-
);
|
171 |
-
}
|
172 |
-
|
173 |
-
$this->set_body_param(
|
174 |
-
array(
|
175 |
-
'content' => $data,
|
176 |
-
)
|
177 |
-
);
|
178 |
-
} else {
|
179 |
-
$data['type'] = 'text/html';
|
180 |
-
$data['value'] = $content;
|
181 |
-
|
182 |
-
if ( $this->phpmailer->ContentType === 'text/plain' ) {
|
183 |
-
$data['type'] = 'text/plain';
|
184 |
-
}
|
185 |
-
|
186 |
-
$this->set_body_param(
|
187 |
-
array(
|
188 |
-
'content' => array( $data ),
|
189 |
-
)
|
190 |
-
);
|
191 |
-
}
|
192 |
-
}
|
193 |
-
|
194 |
-
/**
|
195 |
-
* Redefine the way custom headers are processed for this mailer - they should be in body.
|
196 |
-
*
|
197 |
-
* @since 1.5.0
|
198 |
-
*
|
199 |
-
* @param array $headers
|
200 |
-
*/
|
201 |
-
public function set_headers( $headers ) {
|
202 |
-
|
203 |
-
foreach ( $headers as $header ) {
|
204 |
-
$name = isset( $header[0] ) ? $header[0] : false;
|
205 |
-
$value = isset( $header[1] ) ? $header[1] : false;
|
206 |
-
|
207 |
-
$this->set_body_header( $name, $value );
|
208 |
-
}
|
209 |
-
|
210 |
-
// Add custom PHPMailer-specific header.
|
211 |
-
$this->set_body_header( 'X-Mailer', 'WPMailSMTP/Mailer/' . $this->mailer . ' ' . WPMS_PLUGIN_VER );
|
212 |
-
}
|
213 |
-
|
214 |
-
/**
|
215 |
-
* This mailer supports email-related custom headers inside a body of the message.
|
216 |
-
*
|
217 |
-
* @since 1.5.0
|
218 |
-
*
|
219 |
-
* @param string $name
|
220 |
-
* @param string $value
|
221 |
-
*/
|
222 |
-
public function set_body_header( $name, $value ) {
|
223 |
-
|
224 |
-
$name = sanitize_text_field( $name );
|
225 |
-
if ( empty( $name ) ) {
|
226 |
-
return;
|
227 |
-
}
|
228 |
-
|
229 |
-
$headers = isset( $this->body['headers'] ) ? (array) $this->body['headers'] : array();
|
230 |
-
|
231 |
-
$headers[ $name ] = WP::sanitize_value( $value );
|
232 |
-
|
233 |
-
$this->set_body_param(
|
234 |
-
array(
|
235 |
-
'headers' => $headers,
|
236 |
-
)
|
237 |
-
);
|
238 |
-
}
|
239 |
-
|
240 |
-
/**
|
241 |
-
* SendGrid accepts an array of files content in body, so we will include all files and send.
|
242 |
-
* Doesn't handle exceeding the limits etc, as this is done and reported by SendGrid API.
|
243 |
-
*
|
244 |
-
* @since 1.0.0
|
245 |
-
*
|
246 |
-
* @param array $attachments
|
247 |
-
*/
|
248 |
-
public function set_attachments( $attachments ) {
|
249 |
-
|
250 |
-
if ( empty( $attachments ) ) {
|
251 |
-
return;
|
252 |
-
}
|
253 |
-
|
254 |
-
$data = array();
|
255 |
-
|
256 |
-
foreach ( $attachments as $attachment ) {
|
257 |
-
$file = false;
|
258 |
-
|
259 |
-
/*
|
260 |
-
* We are not using WP_Filesystem API as we can't reliably work with it.
|
261 |
-
* It is not always available, same as credentials for FTP.
|
262 |
-
*/
|
263 |
-
try {
|
264 |
-
if ( is_file( $attachment[0] ) && is_readable( $attachment[0] ) ) {
|
265 |
-
$file = file_get_contents( $attachment[0] ); // phpcs:ignore
|
266 |
-
}
|
267 |
-
}
|
268 |
-
catch ( \Exception $e ) {
|
269 |
-
$file = false;
|
270 |
-
}
|
271 |
-
|
272 |
-
if ( $file === false ) {
|
273 |
-
continue;
|
274 |
-
}
|
275 |
-
|
276 |
-
$filetype = str_replace( ';', '', trim( $attachment[4] ) );
|
277 |
-
|
278 |
-
$data[] = array(
|
279 |
-
'content' => base64_encode( $file ), // string, 1 character.
|
280 |
-
'type' => $filetype, // string, no ;, no CRLF.
|
281 |
-
'filename' => empty( $attachment[2] ) ? 'file-' . wp_hash( microtime() ) . '.' . $filetype : trim( $attachment[2] ), // required string, no CRLF.
|
282 |
-
'disposition' => in_array( $attachment[6], array( 'inline', 'attachment' ), true ) ? $attachment[6] : 'attachment', // either inline or attachment.
|
283 |
-
'content_id' => empty( $attachment[7] ) ? '' : trim( (string) $attachment[7] ), // string, no CRLF.
|
284 |
-
);
|
285 |
-
}
|
286 |
-
|
287 |
-
if ( ! empty( $data ) ) {
|
288 |
-
$this->set_body_param(
|
289 |
-
array(
|
290 |
-
'attachments' => $data,
|
291 |
-
)
|
292 |
-
);
|
293 |
-
}
|
294 |
-
}
|
295 |
-
|
296 |
-
/**
|
297 |
-
* @inheritdoc
|
298 |
-
*/
|
299 |
-
public function set_reply_to( $reply_to ) {
|
300 |
-
|
301 |
-
if ( empty( $reply_to ) ) {
|
302 |
-
return;
|
303 |
-
}
|
304 |
-
|
305 |
-
$data = array();
|
306 |
-
|
307 |
-
foreach ( $reply_to as $key => $emails ) {
|
308 |
-
if (
|
309 |
-
empty( $emails ) ||
|
310 |
-
! is_array( $emails )
|
311 |
-
) {
|
312 |
-
continue;
|
313 |
-
}
|
314 |
-
|
315 |
-
$addr = isset( $emails[0] ) ? $emails[0] : false;
|
316 |
-
$name = isset( $emails[1] ) ? $emails[1] : false;
|
317 |
-
|
318 |
-
if ( ! filter_var( $addr, FILTER_VALIDATE_EMAIL ) ) {
|
319 |
-
continue;
|
320 |
-
}
|
321 |
-
|
322 |
-
$data['email'] = $addr;
|
323 |
-
if ( ! empty( $name ) ) {
|
324 |
-
$data['name'] = $name;
|
325 |
-
}
|
326 |
-
}
|
327 |
-
|
328 |
-
if ( ! empty( $data ) ) {
|
329 |
-
$this->set_body_param(
|
330 |
-
array(
|
331 |
-
'reply_to' => $data,
|
332 |
-
)
|
333 |
-
);
|
334 |
-
}
|
335 |
-
}
|
336 |
-
|
337 |
-
/**
|
338 |
-
* SendGrid doesn't support sender or return_path params.
|
339 |
-
* So we do nothing.
|
340 |
-
*
|
341 |
-
* @since 1.0.0
|
342 |
-
*
|
343 |
-
* @param string $from_email
|
344 |
-
*/
|
345 |
-
public function set_return_path( $from_email ) {}
|
346 |
-
|
347 |
-
/**
|
348 |
-
* Get a SendGrid-specific response with a helpful error.
|
349 |
-
*
|
350 |
-
* @since 1.2.0
|
351 |
-
*
|
352 |
-
* @return string
|
353 |
-
*/
|
354 |
-
protected function get_response_error() {
|
355 |
-
|
356 |
-
$body = (array) wp_remote_retrieve_body( $this->response );
|
357 |
-
|
358 |
-
$error_text = array();
|
359 |
-
|
360 |
-
if ( ! empty( $body['errors'] ) ) {
|
361 |
-
foreach ( $body['errors'] as $error ) {
|
362 |
-
if ( property_exists( $error, 'message' ) ) {
|
363 |
-
// Prepare additional information from SendGrid API.
|
364 |
-
$extra = '';
|
365 |
-
if ( property_exists( $error, 'field' ) && ! empty( $error->field ) ) {
|
366 |
-
$extra .= $error->field . '; ';
|
367 |
-
}
|
368 |
-
if ( property_exists( $error, 'help' ) && ! empty( $error->help ) ) {
|
369 |
-
$extra .= $error->help;
|
370 |
-
}
|
371 |
-
|
372 |
-
// Assign both the main message and perhaps extra information, if exists.
|
373 |
-
$error_text[] = $error->message . ( ! empty( $extra ) ? ' - ' . $extra : '' );
|
374 |
-
}
|
375 |
-
}
|
376 |
-
}
|
377 |
-
|
378 |
-
return implode( '<br>', array_map( 'esc_textarea', $error_text ) );
|
379 |
-
}
|
380 |
-
|
381 |
-
/**
|
382 |
-
* Get mailer debug information, that is helpful during support.
|
383 |
-
*
|
384 |
-
* @since 1.2.0
|
385 |
-
*
|
386 |
-
* @return string
|
387 |
-
*/
|
388 |
-
public function get_debug_info() {
|
389 |
-
|
390 |
-
$sendgrid_text[] = '<strong>Api Key:</strong> ' . ( $this->is_mailer_complete() ? 'Yes' : 'No' );
|
391 |
-
|
392 |
-
return implode( '<br>', $sendgrid_text );
|
393 |
-
}
|
394 |
-
|
395 |
-
/**
|
396 |
-
* @inheritdoc
|
397 |
-
*/
|
398 |
-
public function is_mailer_complete() {
|
399 |
-
|
400 |
-
$options = $this->options->get_group( $this->mailer );
|
401 |
-
|
402 |
-
// API key is the only required option.
|
403 |
-
if ( ! empty( $options['api_key'] ) ) {
|
404 |
-
return true;
|
405 |
-
}
|
406 |
-
|
407 |
-
return false;
|
408 |
-
}
|
409 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPMailSMTP\Providers\Sendgrid;
|
4 |
+
|
5 |
+
use WPMailSMTP\Providers\MailerAbstract;
|
6 |
+
use WPMailSMTP\WP;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class Mailer.
|
10 |
+
*
|
11 |
+
* @since 1.0.0
|
12 |
+
*/
|
13 |
+
class Mailer extends MailerAbstract {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Which response code from HTTP provider is considered to be successful?
|
17 |
+
*
|
18 |
+
* @since 1.0.0
|
19 |
+
*
|
20 |
+
* @var int
|
21 |
+
*/
|
22 |
+
protected $email_sent_code = 202;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* URL to make an API request to.
|
26 |
+
*
|
27 |
+
* @since 1.0.0
|
28 |
+
*
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
+
protected $url = 'https://api.sendgrid.com/v3/mail/send';
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Mailer constructor.
|
35 |
+
*
|
36 |
+
* @since 1.0.0
|
37 |
+
*
|
38 |
+
* @param \WPMailSMTP\MailCatcher $phpmailer
|
39 |
+
*/
|
40 |
+
public function __construct( $phpmailer ) {
|
41 |
+
|
42 |
+
// We want to prefill everything from \WPMailSMTP\MailCatcher class, which extends \PHPMailer.
|
43 |
+
parent::__construct( $phpmailer );
|
44 |
+
|
45 |
+
$this->set_header( 'Authorization', 'Bearer ' . $this->options->get( $this->mailer, 'api_key' ) );
|
46 |
+
$this->set_header( 'content-type', 'application/json' );
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Redefine the way email body is returned.
|
51 |
+
* By default we are sending an array of data.
|
52 |
+
* SendGrid requires a JSON, so we encode the body.
|
53 |
+
*
|
54 |
+
* @since 1.0.0
|
55 |
+
*/
|
56 |
+
public function get_body() {
|
57 |
+
|
58 |
+
$body = parent::get_body();
|
59 |
+
|
60 |
+
return wp_json_encode( $body );
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* @inheritdoc
|
65 |
+
*/
|
66 |
+
public function set_from( $email, $name = '' ) {
|
67 |
+
|
68 |
+
if ( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) ) {
|
69 |
+
return;
|
70 |
+
}
|
71 |
+
|
72 |
+
$from['email'] = $email;
|
73 |
+
|
74 |
+
if ( ! empty( $name ) ) {
|
75 |
+
$from['name'] = $name;
|
76 |
+
}
|
77 |
+
|
78 |
+
$this->set_body_param(
|
79 |
+
array(
|
80 |
+
'from' => $from,
|
81 |
+
)
|
82 |
+
);
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* @inheritdoc
|
87 |
+
*/
|
88 |
+
public function set_recipients( $recipients ) {
|
89 |
+
|
90 |
+
if ( empty( $recipients ) ) {
|
91 |
+
return;
|
92 |
+
}
|
93 |
+
|
94 |
+
// Allow for now only these recipient types.
|
95 |
+
$default = array( 'to', 'cc', 'bcc' );
|
96 |
+
$data = array();
|
97 |
+
|
98 |
+
foreach ( $recipients as $type => $emails ) {
|
99 |
+
if (
|
100 |
+
! in_array( $type, $default, true ) ||
|
101 |
+
empty( $emails ) ||
|
102 |
+
! is_array( $emails )
|
103 |
+
) {
|
104 |
+
continue;
|
105 |
+
}
|
106 |
+
|
107 |
+
$data[ $type ] = array();
|
108 |
+
|
109 |
+
// Iterate over all emails for each type.
|
110 |
+
// There might be multiple cc/to/bcc emails.
|
111 |
+
foreach ( $emails as $email ) {
|
112 |
+
$holder = array();
|
113 |
+
$addr = isset( $email[0] ) ? $email[0] : false;
|
114 |
+
$name = isset( $email[1] ) ? $email[1] : false;
|
115 |
+
|
116 |
+
if ( ! filter_var( $addr, FILTER_VALIDATE_EMAIL ) ) {
|
117 |
+
continue;
|
118 |
+
}
|
119 |
+
|
120 |
+
$holder['email'] = $addr;
|
121 |
+
if ( ! empty( $name ) ) {
|
122 |
+
$holder['name'] = $name;
|
123 |
+
}
|
124 |
+
|
125 |
+
array_push( $data[ $type ], $holder );
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
if ( ! empty( $data ) ) {
|
130 |
+
$this->set_body_param(
|
131 |
+
array(
|
132 |
+
'personalizations' => array( $data ),
|
133 |
+
)
|
134 |
+
);
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* @inheritdoc
|
140 |
+
*/
|
141 |
+
public function set_content( $content ) {
|
142 |
+
|
143 |
+
if ( empty( $content ) ) {
|
144 |
+
return;
|
145 |
+
}
|
146 |
+
|
147 |
+
if ( is_array( $content ) ) {
|
148 |
+
|
149 |
+
$default = array( 'text', 'html' );
|
150 |
+
$data = array();
|
151 |
+
|
152 |
+
foreach ( $content as $type => $body ) {
|
153 |
+
if (
|
154 |
+
! in_array( $type, $default, true ) ||
|
155 |
+
empty( $body )
|
156 |
+
) {
|
157 |
+
continue;
|
158 |
+
}
|
159 |
+
|
160 |
+
$content_type = 'text/plain';
|
161 |
+
$content_value = $body;
|
162 |
+
|
163 |
+
if ( $type === 'html' ) {
|
164 |
+
$content_type = 'text/html';
|
165 |
+
}
|
166 |
+
|
167 |
+
$data[] = array(
|
168 |
+
'type' => $content_type,
|
169 |
+
'value' => $content_value,
|
170 |
+
);
|
171 |
+
}
|
172 |
+
|
173 |
+
$this->set_body_param(
|
174 |
+
array(
|
175 |
+
'content' => $data,
|
176 |
+
)
|
177 |
+
);
|
178 |
+
} else {
|
179 |
+
$data['type'] = 'text/html';
|
180 |
+
$data['value'] = $content;
|
181 |
+
|
182 |
+
if ( $this->phpmailer->ContentType === 'text/plain' ) {
|
183 |
+
$data['type'] = 'text/plain';
|
184 |
+
}
|
185 |
+
|
186 |
+
$this->set_body_param(
|
187 |
+
array(
|
188 |
+
'content' => array( $data ),
|
189 |
+
)
|
190 |
+
);
|
191 |
+
}
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Redefine the way custom headers are processed for this mailer - they should be in body.
|
196 |
+
*
|
197 |
+
* @since 1.5.0
|
198 |
+
*
|
199 |
+
* @param array $headers
|
200 |
+
*/
|
201 |
+
public function set_headers( $headers ) {
|
202 |
+
|
203 |
+
foreach ( $headers as $header ) {
|
204 |
+
$name = isset( $header[0] ) ? $header[0] : false;
|
205 |
+
$value = isset( $header[1] ) ? $header[1] : false;
|
206 |
+
|
207 |
+
$this->set_body_header( $name, $value );
|
208 |
+
}
|
209 |
+
|
210 |
+
// Add custom PHPMailer-specific header.
|
211 |
+
$this->set_body_header( 'X-Mailer', 'WPMailSMTP/Mailer/' . $this->mailer . ' ' . WPMS_PLUGIN_VER );
|
212 |
+
}
|
213 |
+
|
214 |
+
/**
|
215 |
+
* This mailer supports email-related custom headers inside a body of the message.
|
216 |
+
*
|
217 |
+
* @since 1.5.0
|
218 |
+
*
|
219 |
+
* @param string $name
|
220 |
+
* @param string $value
|
221 |
+
*/
|
222 |
+
public function set_body_header( $name, $value ) {
|
223 |
+
|
224 |
+
$name = sanitize_text_field( $name );
|
225 |
+
if ( empty( $name ) ) {
|
226 |
+
return;
|
227 |
+
}
|
228 |
+
|
229 |
+
$headers = isset( $this->body['headers'] ) ? (array) $this->body['headers'] : array();
|
230 |
+
|
231 |
+
$headers[ $name ] = WP::sanitize_value( $value );
|
232 |
+
|
233 |
+
$this->set_body_param(
|
234 |
+
array(
|
235 |
+
'headers' => $headers,
|
236 |
+
)
|
237 |
+
);
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* SendGrid accepts an array of files content in body, so we will include all files and send.
|
242 |
+
* Doesn't handle exceeding the limits etc, as this is done and reported by SendGrid API.
|
243 |
+
*
|
244 |
+
* @since 1.0.0
|
245 |
+
*
|
246 |
+
* @param array $attachments
|
247 |
+
*/
|
248 |
+
public function set_attachments( $attachments ) {
|
249 |
+
|
250 |
+
if ( empty( $attachments ) ) {
|
251 |
+
return;
|
252 |
+
}
|
253 |
+
|
254 |
+
$data = array();
|
255 |
+
|
256 |
+
foreach ( $attachments as $attachment ) {
|
257 |
+
$file = false;
|
258 |
+
|
259 |
+
/*
|
260 |
+
* We are not using WP_Filesystem API as we can't reliably work with it.
|
261 |
+
* It is not always available, same as credentials for FTP.
|
262 |
+
*/
|
263 |
+
try {
|
264 |
+
if ( is_file( $attachment[0] ) && is_readable( $attachment[0] ) ) {
|
265 |
+
$file = file_get_contents( $attachment[0] ); // phpcs:ignore
|
266 |
+
}
|
267 |
+
}
|
268 |
+
catch ( \Exception $e ) {
|
269 |
+
$file = false;
|
270 |
+
}
|
271 |
+
|
272 |
+
if ( $file === false ) {
|
273 |
+
continue;
|
274 |
+
}
|
275 |
+
|
276 |
+
$filetype = str_replace( ';', '', trim( $attachment[4] ) );
|
277 |
+
|
278 |
+
$data[] = array(
|
279 |
+
'content' => base64_encode( $file ), // string, 1 character.
|
280 |
+
'type' => $filetype, // string, no ;, no CRLF.
|
281 |
+
'filename' => empty( $attachment[2] ) ? 'file-' . wp_hash( microtime() ) . '.' . $filetype : trim( $attachment[2] ), // required string, no CRLF.
|
282 |
+
'disposition' => in_array( $attachment[6], array( 'inline', 'attachment' ), true ) ? $attachment[6] : 'attachment', // either inline or attachment.
|
283 |
+
'content_id' => empty( $attachment[7] ) ? '' : trim( (string) $attachment[7] ), // string, no CRLF.
|
284 |
+
);
|
285 |
+
}
|
286 |
+
|
287 |
+
if ( ! empty( $data ) ) {
|
288 |
+
$this->set_body_param(
|
289 |
+
array(
|
290 |
+
'attachments' => $data,
|
291 |
+
)
|
292 |
+
);
|
293 |
+
}
|
294 |
+
}
|
295 |
+
|
296 |
+
/**
|
297 |
+
* @inheritdoc
|
298 |
+
*/
|
299 |
+
public function set_reply_to( $reply_to ) {
|
300 |
+
|
301 |
+
if ( empty( $reply_to ) ) {
|
302 |
+
return;
|
303 |
+
}
|
304 |
+
|
305 |
+
$data = array();
|
306 |
+
|
307 |
+
foreach ( $reply_to as $key => $emails ) {
|
308 |
+
if (
|
309 |
+
empty( $emails ) ||
|
310 |
+
! is_array( $emails )
|
311 |
+
) {
|
312 |
+
continue;
|
313 |
+
}
|
314 |
+
|
315 |
+
$addr = isset( $emails[0] ) ? $emails[0] : false;
|
316 |
+
$name = isset( $emails[1] ) ? $emails[1] : false;
|
317 |
+
|
318 |
+
if ( ! filter_var( $addr, FILTER_VALIDATE_EMAIL ) ) {
|
319 |
+
continue;
|
320 |
+
}
|
321 |
+
|
322 |
+
$data['email'] = $addr;
|
323 |
+
if ( ! empty( $name ) ) {
|
324 |
+
$data['name'] = $name;
|
325 |
+
}
|
326 |
+
}
|
327 |
+
|
328 |
+
if ( ! empty( $data ) ) {
|
329 |
+
$this->set_body_param(
|
330 |
+
array(
|
331 |
+
'reply_to' => $data,
|
332 |
+
)
|
333 |
+
);
|
334 |
+
}
|
335 |
+
}
|
336 |
+
|
337 |
+
/**
|
338 |
+
* SendGrid doesn't support sender or return_path params.
|
339 |
+
* So we do nothing.
|
340 |
+
*
|
341 |
+
* @since 1.0.0
|
342 |
+
*
|
343 |
+
* @param string $from_email
|
344 |
+
*/
|
345 |
+
public function set_return_path( $from_email ) {}
|
346 |
+
|
347 |
+
/**
|
348 |
+
* Get a SendGrid-specific response with a helpful error.
|
349 |
+
*
|
350 |
+
* @since 1.2.0
|
351 |
+
*
|
352 |
+
* @return string
|
353 |
+
*/
|
354 |
+
protected function get_response_error() {
|
355 |
+
|
356 |
+
$body = (array) wp_remote_retrieve_body( $this->response );
|
357 |
+
|
358 |
+
$error_text = array();
|
359 |
+
|
360 |
+
if ( ! empty( $body['errors'] ) ) {
|
361 |
+
foreach ( $body['errors'] as $error ) {
|
362 |
+
if ( property_exists( $error, 'message' ) ) {
|
363 |
+
// Prepare additional information from SendGrid API.
|
364 |
+
$extra = '';
|
365 |
+
if ( property_exists( $error, 'field' ) && ! empty( $error->field ) ) {
|
366 |
+
$extra .= $error->field . '; ';
|
367 |
+
}
|
368 |
+
if ( property_exists( $error, 'help' ) && ! empty( $error->help ) ) {
|
369 |
+
$extra .= $error->help;
|
370 |
+
}
|
371 |
+
|
372 |
+
// Assign both the main message and perhaps extra information, if exists.
|
373 |
+
$error_text[] = $error->message . ( ! empty( $extra ) ? ' - ' . $extra : '' );
|
374 |
+
}
|
375 |
+
}
|
376 |
+
}
|
377 |
+
|
378 |
+
return implode( '<br>', array_map( 'esc_textarea', $error_text ) );
|
379 |
+
}
|
380 |
+
|
381 |
+
/**
|
382 |
+
* Get mailer debug information, that is helpful during support.
|
383 |
+
*
|
384 |
+
* @since 1.2.0
|
385 |
+
*
|
386 |
+
* @return string
|
387 |
+
*/
|
388 |
+
public function get_debug_info() {
|
389 |
+
|
390 |
+
$sendgrid_text[] = '<strong>Api Key:</strong> ' . ( $this->is_mailer_complete() ? 'Yes' : 'No' );
|
391 |
+
|
392 |
+
return implode( '<br>', $sendgrid_text );
|
393 |
+
}
|
394 |
+
|
395 |
+
/**
|
396 |
+
* @inheritdoc
|
397 |
+
*/
|
398 |
+
public function is_mailer_complete() {
|
399 |
+
|
400 |
+
$options = $this->options->get_group( $this->mailer );
|
401 |
+
|
402 |
+
// API key is the only required option.
|
403 |
+
if ( ! empty( $options['api_key'] ) ) {
|
404 |
+
return true;
|
405 |
+
}
|
406 |
+
|
407 |
+
return false;
|
408 |
+
}
|
409 |
+
}
|
src/SiteHealth.php
ADDED
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPMailSMTP;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Class SiteHealth adds the plugin status and information to the WP Site Health admin page.
|
7 |
+
*
|
8 |
+
* @since {VERSION}
|
9 |
+
*/
|
10 |
+
class SiteHealth {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* String of a badge color.
|
14 |
+
* Options: blue, green, red, orange, purple and gray.
|
15 |
+
*
|
16 |
+
* @see https://make.wordpress.org/core/2019/04/25/site-health-check-in-5-2/
|
17 |
+
*
|
18 |
+
* @since {VERSION}
|
19 |
+
*/
|
20 |
+
const BADGE_COLOR = 'blue';
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Debug info plugin slug.
|
24 |
+
* This should be a plugin unique string, which will be used in the WP Site Health page,
|
25 |
+
* for the "info" tab and will present the plugin info section.
|
26 |
+
*
|
27 |
+
* @since {VERSION}
|
28 |
+
*/
|
29 |
+
const DEBUG_INFO_SLUG = 'wp_mail_smtp';
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Translatable string for the plugin label.
|
33 |
+
*
|
34 |
+
* @since {VERSION}
|
35 |
+
*
|
36 |
+
* @return string
|
37 |
+
*/
|
38 |
+
public function get_label() {
|
39 |
+
|
40 |
+
return esc_html__( 'WP Mail SMTP', 'wp-mail-smtp' );
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Initialize the site heath functionality.
|
45 |
+
*
|
46 |
+
* @since {VERSION}
|
47 |
+
*/
|
48 |
+
public function init() {
|
49 |
+
|
50 |
+
add_filter( 'site_status_tests', array( $this, 'register_site_status_tests' ) );
|
51 |
+
add_filter( 'debug_information', array( $this, 'register_debug_information' ) );
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Register plugin WP site health tests.
|
56 |
+
* This will be displayed in the "Status" tab of the WP Site Health page.
|
57 |
+
*
|
58 |
+
* @since {VERSION}
|
59 |
+
*
|
60 |
+
* @param array $tests The array with all WP site health tests.
|
61 |
+
*
|
62 |
+
* @return array
|
63 |
+
*/
|
64 |
+
public function register_site_status_tests( $tests ) {
|
65 |
+
|
66 |
+
$tests['direct']['wp_mail_smtp_mailer_setup_complete'] = array(
|
67 |
+
'label' => esc_html__( 'Is WP Mail SMTP mailer setup complete?', 'wp-mail-smtp' ),
|
68 |
+
'test' => array( $this, 'mailer_setup_complete_test' ),
|
69 |
+
);
|
70 |
+
|
71 |
+
return $tests;
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Register plugin WP Site Health debug information.
|
76 |
+
* This will be displayed in the "Info" tab of the WP Site Health page.
|
77 |
+
*
|
78 |
+
* @since {VERSION}
|
79 |
+
*
|
80 |
+
* @param array $debug_info Array of existing debug information.
|
81 |
+
*
|
82 |
+
* @return array
|
83 |
+
*/
|
84 |
+
public function register_debug_information( $debug_info ) {
|
85 |
+
|
86 |
+
$debug_notices = Debug::get();
|
87 |
+
|
88 |
+
$debug_info[ self::DEBUG_INFO_SLUG ] = array(
|
89 |
+
'label' => $this->get_label(),
|
90 |
+
'fields' => array(
|
91 |
+
'version' => array(
|
92 |
+
'label' => esc_html__( 'Version', 'wp-mail-smtp' ),
|
93 |
+
'value' => WPMS_PLUGIN_VER,
|
94 |
+
),
|
95 |
+
'license_key_type' => array(
|
96 |
+
'label' => esc_html__( 'License key type', 'wp-mail-smtp' ),
|
97 |
+
'value' => wp_mail_smtp()->get_license_type(),
|
98 |
+
),
|
99 |
+
'debug' => array(
|
100 |
+
'label' => esc_html__( 'Debug', 'wp-mail-smtp' ),
|
101 |
+
'value' => ! empty( $debug_notices ) ? implode( '. ', $debug_notices ) : esc_html__( 'No debug notices found.', 'wp-mail-smtp' ),
|
102 |
+
),
|
103 |
+
),
|
104 |
+
);
|
105 |
+
|
106 |
+
return $debug_info;
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Perform the WP site health test for checking, if the mailer setup is complete.
|
111 |
+
*
|
112 |
+
* @since {VERSION}
|
113 |
+
*/
|
114 |
+
public function mailer_setup_complete_test() {
|
115 |
+
|
116 |
+
$mailer = Options::init()->get( 'mail', 'mailer' );
|
117 |
+
$mailer_complete = wp_mail_smtp()
|
118 |
+
->get_providers()
|
119 |
+
->get_mailer(
|
120 |
+
$mailer,
|
121 |
+
wp_mail_smtp()->get_processor()->get_phpmailer()
|
122 |
+
)->is_mailer_complete();
|
123 |
+
|
124 |
+
// The default mailer should be considered as a non-complete mailer.
|
125 |
+
if ( $mailer === 'mail' ) {
|
126 |
+
$mailer_complete = false;
|
127 |
+
}
|
128 |
+
|
129 |
+
$mailer_text = sprintf(
|
130 |
+
'%s: <strong>%s</strong>',
|
131 |
+
esc_html__( 'Current mailer', 'wp-mail-smtp' ),
|
132 |
+
esc_html( wp_mail_smtp()->get_providers()->get_options( $mailer )->get_title() )
|
133 |
+
);
|
134 |
+
|
135 |
+
$result = array(
|
136 |
+
'label' => esc_html__( 'WP Mail SMTP mailer setup is complete', 'wp-mail-smtp' ),
|
137 |
+
'status' => 'good',
|
138 |
+
'badge' => array(
|
139 |
+
'label' => $this->get_label(),
|
140 |
+
'color' => self::BADGE_COLOR,
|
141 |
+
),
|
142 |
+
'description' => sprintf(
|
143 |
+
'<p>%s</p><p>%s</p>',
|
144 |
+
$mailer_text,
|
145 |
+
esc_html__( 'The WP Mail SMTP plugin mailer setup is complete. You can send a test email, to make sure it\'s working properly.', 'wp-mail-smtp' )
|
146 |
+
),
|
147 |
+
'actions' => sprintf(
|
148 |
+
'<p><a href="%s">%s</a></p>',
|
149 |
+
esc_url( add_query_arg( 'tab', 'test', wp_mail_smtp()->get_admin()->get_admin_page_url() ) ),
|
150 |
+
esc_html__( 'Test email sending', 'wp-mail-smtp' )
|
151 |
+
),
|
152 |
+
'test' => 'wp_mail_smtp_mailer_setup_complete',
|
153 |
+
);
|
154 |
+
|
155 |
+
if ( $mailer === 'mail' ) {
|
156 |
+
$mailer_text .= sprintf( /* translators: %s - explanation why default mailer is not a valid mailer option. */
|
157 |
+
'<p>%s</p>',
|
158 |
+
esc_html__( 'You currently have the default mailer selected, which means that you haven’t set up SMTP yet.', 'wp-mail-smtp' )
|
159 |
+
);
|
160 |
+
}
|
161 |
+
|
162 |
+
if ( $mailer_complete === false ) {
|
163 |
+
$result['label'] = esc_html__( 'WP Mail SMTP mailer setup is incomplete', 'wp-mail-smtp' );
|
164 |
+
$result['status'] = 'recommended';
|
165 |
+
$result['badge']['color'] = 'orange';
|
166 |
+
$result['description'] = sprintf(
|
167 |
+
'<p>%s</p><p>%s</p>',
|
168 |
+
$mailer_text,
|
169 |
+
esc_html__( 'The WP Mail SMTP plugin mailer setup is incomplete. Please click on the link below to access plugin settings and configure the mailer.', 'wp-mail-smtp' )
|
170 |
+
);
|
171 |
+
$result['actions'] = sprintf(
|
172 |
+
'<p><a href="%s">%s</a></p>',
|
173 |
+
esc_url( wp_mail_smtp()->get_admin()->get_admin_page_url() ),
|
174 |
+
esc_html__( 'Configure mailer', 'wp-mail-smtp' )
|
175 |
+
);
|
176 |
+
}
|
177 |
+
|
178 |
+
return $result;
|
179 |
+
}
|
180 |
+
}
|
wp_mail_smtp.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: WP Mail SMTP
|
4 |
-
* Version: 1.
|
5 |
* Plugin URI: https://wpmailsmtp.com/
|
6 |
* Description: Reconfigures the <code>wp_mail()</code> function to use Gmail/Mailgun/SendGrid/SMTP instead of the default <code>mail()</code> and creates an options page to manage the settings.
|
7 |
* Author: WPForms
|
@@ -13,7 +13,7 @@
|
|
13 |
|
14 |
/**
|
15 |
* @author WPForms
|
16 |
-
* @copyright WPForms, 2007-
|
17 |
* This code is released under the GPL licence version 3 or later, available here
|
18 |
* https://www.gnu.org/licenses/gpl.txt
|
19 |
*/
|
@@ -143,7 +143,7 @@ if ( ! function_exists( 'wp_mail_smtp_check_pro_loading_allowed' ) ) {
|
|
143 |
}
|
144 |
|
145 |
if ( ! defined( 'WPMS_PLUGIN_VER' ) ) {
|
146 |
-
define( 'WPMS_PLUGIN_VER', '1.
|
147 |
}
|
148 |
if ( ! defined( 'WPMS_PHP_VER' ) ) {
|
149 |
define( 'WPMS_PHP_VER', '5.3.6' );
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: WP Mail SMTP
|
4 |
+
* Version: 1.9.0
|
5 |
* Plugin URI: https://wpmailsmtp.com/
|
6 |
* Description: Reconfigures the <code>wp_mail()</code> function to use Gmail/Mailgun/SendGrid/SMTP instead of the default <code>mail()</code> and creates an options page to manage the settings.
|
7 |
* Author: WPForms
|
13 |
|
14 |
/**
|
15 |
* @author WPForms
|
16 |
+
* @copyright WPForms, 2007-20, All Rights Reserved
|
17 |
* This code is released under the GPL licence version 3 or later, available here
|
18 |
* https://www.gnu.org/licenses/gpl.txt
|
19 |
*/
|
143 |
}
|
144 |
|
145 |
if ( ! defined( 'WPMS_PLUGIN_VER' ) ) {
|
146 |
+
define( 'WPMS_PLUGIN_VER', '1.9.0' );
|
147 |
}
|
148 |
if ( ! defined( 'WPMS_PHP_VER' ) ) {
|
149 |
define( 'WPMS_PHP_VER', '5.3.6' );
|