[wp-trac] [WordPress Trac] #41750: Update PHPMailer to 6.0

WordPress Trac noreply at wordpress.org
Tue Apr 28 18:48:35 UTC 2020


#41750: Update PHPMailer to 6.0
-------------------------------------------------+-------------------------
 Reporter:  Synchro                              |       Owner:
                                                 |  SergeyBiryukov
     Type:  enhancement                          |      Status:  accepted
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  External Libraries                   |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-dev-   |     Focuses:
  note early                                     |
-------------------------------------------------+-------------------------

Comment (by desrosj):

 Thanks for working on this, everyone!

 I looked at the latest patch, and I think that this approach should work
 fine. However, I uploaded [attachment:"41750.4.diff"] with a few small
 changes.

 Some minor adjustments:
 - Changed the version notes to 5.5.0.
 - Updated the PHPMailer library to
 [https://github.com/PHPMailer/PHPMailer/releases/tag/v6.1.56.1.5 which was
 released on March 14, 2020].
 - Changed the wording a bit on the deprecated file calls and copied the
 same sentence into the inline documentation to be more consistent.

 Updating the library did introduce a test error to
 `Tests_Mail::test_wp_mail_custom_boundaries`,
 `PHPMailer\PHPMailer\Exception: Invalid header name or value`. I have not
 yet [https://travis-ci.org/github/desrosj/wordpress-
 develop/builds/680691761 gotten to investigate that], but it should be a
 result of one of the changes in 6.1.5.

 Lastly and most importantly, I am concerned that
 [attachment:"41750.6.patch"] is not quite there from a backwards
 compatibility standpoint and would break too many sites. Even if we get
 the word out to plugin developers and they update their plugins, there is
 no guarantee that site owners actually update their plugins.

 I did some exploring of the plugin directory to try and validate this and
 found [https://wpdirectory.net/search/01E70WYEGTN5SS62WVJYJQ7N9W 612
 plugins] that call `new PHPMailer()`. Only 11 had 50k+ installs, and there
 were a small handful of plugins that were bundling their own, updated
 versions of PHPMailer.

 [attachment:"41750.4.diff"] re-adds a `PHPMailer` class in the original
 `class-phpmailer.php` file and only contains a `__construct()` method that
 will return an instance of the new, correctly namespaced class and trigger
 a deprecated function notice. The idea here is to prevent fatal errors
 when calling `new PHPMailer()` the "old" way (even though that way was
 discouraged and technically incorrect). I'm trying to think of any
 "gotchas" with this approach.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/41750#comment:37>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list