WP Multibyte Patch - Version 2.9

Version Description

Download this release

Release Info

Developer tenpura
Plugin Icon wp plugin WP Multibyte Patch
Version 2.9
Comparing to
See all releases

Code changes from version 2.8.5 to 2.9

ext/ja/class.php CHANGED
@@ -3,7 +3,7 @@
3
  * WP Multibyte Patch Japanese Locale Extension
4
  *
5
  * @package WP_Multibyte_Patch
6
- * @version 2.8.5
7
  * @author Seisuke Kuraishi <210pura@gmail.com>
8
  * @copyright Copyright (c) 2020 Seisuke Kuraishi, Tinybit Inc.
9
  * @license https://opensource.org/licenses/gpl-2.0.php GPLv2
@@ -42,6 +42,29 @@ if ( class_exists( 'multibyte_patch' ) ) :
42
  return "=?$charset?B?" . base64_encode( $string ) . '?=';
43
  }
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  public function get_phpmailer_properties( $phpmailer ) {
46
  $array = (array) $phpmailer;
47
  $new = array();
@@ -197,7 +220,6 @@ if ( class_exists( 'multibyte_patch' ) ) :
197
  // mbstring functions are always required for ja.
198
  $this->mbfunctions_required = true;
199
 
200
- $this->conf['patch_wp_mail'] = true;
201
  $this->conf['patch_incoming_trackback'] = true;
202
  $this->conf['patch_incoming_pingback'] = true;
203
  $this->conf['patch_process_search_terms'] = true;
3
  * WP Multibyte Patch Japanese Locale Extension
4
  *
5
  * @package WP_Multibyte_Patch
6
+ * @version 2.9
7
  * @author Seisuke Kuraishi <210pura@gmail.com>
8
  * @copyright Copyright (c) 2020 Seisuke Kuraishi, Tinybit Inc.
9
  * @license https://opensource.org/licenses/gpl-2.0.php GPLv2
42
  return "=?$charset?B?" . base64_encode( $string ) . '?=';
43
  }
44
 
45
+ public function patch_wp_mail_with_custom_phpmailer( $atts ) {
46
+ global $phpmailer;
47
+
48
+ if ( ! $phpmailer instanceof PHPMailer\PHPMailer\PHPMailer ) {
49
+ require_once ABSPATH . WPINC . '/PHPMailer/PHPMailer.php';
50
+ require_once ABSPATH . WPINC . '/PHPMailer/SMTP.php';
51
+ require_once ABSPATH . WPINC . '/PHPMailer/Exception.php';
52
+ require_once dirname( dirname( dirname( __FILE__ ) ) ) . '/includes/class-wpmp-phpmailer.php';
53
+
54
+ $phpmailer = new WPMP_PHPMailer( true );
55
+
56
+ $phpmailer::$validator = static function ( $email ) {
57
+ return (bool) is_email( $email );
58
+ };
59
+
60
+ if ( $phpmailer instanceof PHPMailer\PHPMailer\PHPMailer ) {
61
+ add_action( 'phpmailer_init', array( $this, 'wp_mail' ) );
62
+ }
63
+ }
64
+
65
+ return $atts;
66
+ }
67
+
68
  public function get_phpmailer_properties( $phpmailer ) {
69
  $array = (array) $phpmailer;
70
  $new = array();
220
  // mbstring functions are always required for ja.
221
  $this->mbfunctions_required = true;
222
 
 
223
  $this->conf['patch_incoming_trackback'] = true;
224
  $this->conf['patch_incoming_pingback'] = true;
225
  $this->conf['patch_process_search_terms'] = true;
includes/class-wpmp-phpmailer.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WPMP_PHPMailer extends PHPMailer\PHPMailer\PHPMailer {
4
+ public function encodeHeader( $str, $position = 'text' ) {
5
+ if( 'text' === $position && ( 0 === stripos( $str , '=?UTF-8?' ) || 0 === stripos( $str , '=?ISO-2022-JP?' ) ) ) {
6
+ return $str;
7
+ }
8
+
9
+ return parent::encodeHeader( $str, $position );
10
+ }
11
+ }
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === WP Multibyte Patch ===
2
  Contributors: tenpura
3
  Tags: multibyte,i18n,wp-multibyte-patch,Japanese
4
- Requires at least: 4.5
5
- Tested up to: 5.4
6
- Stable tag: 2.8.5
7
 
8
  Multibyte functionality enhancement for the WordPress Japanese package.
9
 
1
  === WP Multibyte Patch ===
2
  Contributors: tenpura
3
  Tags: multibyte,i18n,wp-multibyte-patch,Japanese
4
+ Requires at least: 5.2
5
+ Tested up to: 6.1
6
+ Stable tag: 2.9
7
 
8
  Multibyte functionality enhancement for the WordPress Japanese package.
9
 
wp-multibyte-patch.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: WP Multibyte Patch
4
  Description: Multibyte functionality enhancement for the WordPress Japanese package.
5
- Version: 2.8.5
6
  Plugin URI: https://eastcoder.com/code/wp-multibyte-patch/
7
  Author: Seisuke Kuraishi
8
  Author URI: https://tinybit.co.jp/
@@ -15,7 +15,7 @@ Domain Path: /languages
15
  * Multibyte functionality enhancement for the WordPress Japanese package.
16
  *
17
  * @package WP_Multibyte_Patch
18
- * @version 2.8.5
19
  * @author Seisuke Kuraishi <210pura@gmail.com>
20
  * @copyright Copyright (c) 2020 Seisuke Kuraishi, Tinybit Inc.
21
  * @license https://opensource.org/licenses/gpl-2.0.php GPLv2
@@ -485,8 +485,14 @@ class multibyte_patch {
485
  if ( method_exists( $this, 'process_search_terms' ) && false !== $this->conf['patch_process_search_terms'] )
486
  add_action( 'sanitize_comment_cookies', array( $this, 'process_search_terms' ) );
487
 
488
- if ( method_exists( $this, 'wp_mail' ) && false !== $this->conf['patch_wp_mail'] )
489
- add_action( 'phpmailer_init', array( $this, 'wp_mail' ) );
 
 
 
 
 
 
490
 
491
  if ( method_exists( $this, 'admin_custom_css' ) && false !== $this->conf['patch_admin_custom_css'] ) {
492
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_custom_css' ), 99 );
2
  /*
3
  Plugin Name: WP Multibyte Patch
4
  Description: Multibyte functionality enhancement for the WordPress Japanese package.
5
+ Version: 2.9
6
  Plugin URI: https://eastcoder.com/code/wp-multibyte-patch/
7
  Author: Seisuke Kuraishi
8
  Author URI: https://tinybit.co.jp/
15
  * Multibyte functionality enhancement for the WordPress Japanese package.
16
  *
17
  * @package WP_Multibyte_Patch
18
+ * @version 2.9
19
  * @author Seisuke Kuraishi <210pura@gmail.com>
20
  * @copyright Copyright (c) 2020 Seisuke Kuraishi, Tinybit Inc.
21
  * @license https://opensource.org/licenses/gpl-2.0.php GPLv2
485
  if ( method_exists( $this, 'process_search_terms' ) && false !== $this->conf['patch_process_search_terms'] )
486
  add_action( 'sanitize_comment_cookies', array( $this, 'process_search_terms' ) );
487
 
488
+ if ( method_exists( $this, 'wp_mail' ) && false !== $this->conf['patch_wp_mail'] ) {
489
+ if( $this->is_wp_required_version( '5.5-RC2' ) && method_exists( $this, 'patch_wp_mail_with_custom_phpmailer' ) ) {
490
+ add_filter( 'wp_mail', array( $this, 'patch_wp_mail_with_custom_phpmailer' ), 99 );
491
+ }
492
+ else {
493
+ add_action( 'phpmailer_init', array( $this, 'wp_mail' ) );
494
+ }
495
+ }
496
 
497
  if ( method_exists( $this, 'admin_custom_css' ) && false !== $this->conf['patch_admin_custom_css'] ) {
498
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_custom_css' ), 99 );
wpmp-config-sample-ja.php CHANGED
@@ -84,7 +84,7 @@ $wpmp_conf['bp_excerpt_more'] = ' [&hellip;]';
84
 
85
 
86
  /* 機能を個別に有効化、無効化できます。有効化するには true を、無効化するには false を指定してください。 */
87
- $wpmp_conf['patch_wp_mail'] = true;
88
  $wpmp_conf['patch_incoming_trackback'] = true;
89
  $wpmp_conf['patch_incoming_pingback'] = true;
90
  $wpmp_conf['patch_wp_trim_excerpt'] = true;
84
 
85
 
86
  /* 機能を個別に有効化、無効化できます。有効化するには true を、無効化するには false を指定してください。 */
87
+ $wpmp_conf['patch_wp_mail'] = false;
88
  $wpmp_conf['patch_incoming_trackback'] = true;
89
  $wpmp_conf['patch_incoming_pingback'] = true;
90
  $wpmp_conf['patch_wp_trim_excerpt'] = true;