PluginProbe
MainWP Dashboard: Self-hosted WordPress Management for Agencies / 4.2
MainWP Dashboard: Self-hosted WordPress Management for Agencies v4.2
6.2 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1 6.0.12 6.0.11 4.6.0.1 5.0 5.0.1 5.0.2 5.0.3 5.0.3.1 5.0.3.2 5.1 5.1.1 5.2 5.2.1 5.2.2 5.3 All 153 releases
← All changes | class/class-mainwp-format.php +201 -246 6.24.2 View file →
@@ -6,248 +6,203 @@
6 6 */
7 7
8 8 namespace MainWP\Dashboard;
9 9
10 -// Exit if accessed directly.
11 -if ( ! defined( 'ABSPATH' ) ) {
12 - exit;
13 -}
14 -
15 10 /**
16 11 * Class MainWP_Format
17 12 *
18 13 * @package MainWP\Dashboard
19 14 */
20 -class MainWP_Format { // phpcs:ignore Generic.Classes.OpeningBraceSameLine.ContentAfterBrace -- NOSONAR.
15 +class MainWP_Format {
21 16
22 - /**
23 - * Method get_class_name()
24 - *
25 - * Get Class Name.
26 - *
27 - * @return object
28 - */
29 - public static function get_class_name() {
30 - return __CLASS__;
31 - }
17 + /**
18 + * Method get_class_name()
19 + *
20 + * Get Class Name.
21 + *
22 + * @return object
23 + */
24 + public static function get_class_name() {
25 + return __CLASS__;
26 + }
32 27
33 - /**
34 - * Method get_update_plugins_items().
35 - *
36 - * Get plugins update.
37 - *
38 - * @return array $update_items Plugins update items.
39 - *
40 - * @uses \MainWP\Dashboard\MainWP_Utility::array_merge()
41 - */
42 - public static function get_update_plugins_items() {
28 + /**
29 + * Method get_update_plugins_items().
30 + *
31 + * Get plugins update.
32 + *
33 + * @return array $update_items Plugins update items.
34 + *
35 + * @uses \MainWP\Dashboard\MainWP_Utility::array_merge()
36 + */
37 + public static function get_update_plugins_items() {
43 38
44 - $pluginsNewUpdate = get_option( 'mainwp_updatescheck_mail_update_plugins_new' );
45 - if ( ! is_array( $pluginsNewUpdate ) ) {
46 - $pluginsNewUpdate = array();
47 - }
48 - $pluginsToUpdate = get_option( 'mainwp_updatescheck_mail_update_plugins' );
49 - if ( ! is_array( $pluginsToUpdate ) ) {
50 - $pluginsToUpdate = array();
51 - }
52 - $notTrustedPluginsNewUpdate = get_option( 'mainwp_updatescheck_mail_ignore_plugins_new' );
53 - if ( ! is_array( $notTrustedPluginsNewUpdate ) ) {
54 - $notTrustedPluginsNewUpdate = array();
55 - }
56 - $notTrustedPluginsToUpdate = get_option( 'mainwp_updatescheck_mail_ignore_plugins' );
57 - if ( ! is_array( $notTrustedPluginsToUpdate ) ) {
58 - $notTrustedPluginsToUpdate = array();
59 - }
39 + $pluginsNewUpdate = get_option( 'mainwp_updatescheck_mail_update_plugins_new' );
40 + if ( ! is_array( $pluginsNewUpdate ) ) {
41 + $pluginsNewUpdate = array();
42 + }
43 + $pluginsToUpdate = get_option( 'mainwp_updatescheck_mail_update_plugins' );
44 + if ( ! is_array( $pluginsToUpdate ) ) {
45 + $pluginsToUpdate = array();
46 + }
47 + $notTrustedPluginsNewUpdate = get_option( 'mainwp_updatescheck_mail_ignore_plugins_new' );
48 + if ( ! is_array( $notTrustedPluginsNewUpdate ) ) {
49 + $notTrustedPluginsNewUpdate = array();
50 + }
51 + $notTrustedPluginsToUpdate = get_option( 'mainwp_updatescheck_mail_ignore_plugins' );
52 + if ( ! is_array( $notTrustedPluginsToUpdate ) ) {
53 + $notTrustedPluginsToUpdate = array();
54 + }
60 55
61 - $pluginsNewUpdate = static::remove_duplicate_updates( $pluginsNewUpdate, $pluginsToUpdate );
62 - $pluginsToUpdate = static::remove_duplicate_updates( $pluginsToUpdate );
63 - $notTrustedPluginsNewUpdate = static::remove_duplicate_updates( $notTrustedPluginsNewUpdate, $notTrustedPluginsToUpdate );
64 - $notTrustedPluginsToUpdate = static::remove_duplicate_updates( $notTrustedPluginsToUpdate );
56 + $update_items = array();
57 + $update_items = MainWP_Utility::array_merge( $pluginsNewUpdate, $pluginsToUpdate );
58 + $update_items = MainWP_Utility::array_merge( $update_items, $notTrustedPluginsNewUpdate );
59 + $update_items = MainWP_Utility::array_merge( $update_items, $notTrustedPluginsToUpdate );
65 60
66 - $update_items = array();
67 - $update_items = MainWP_Utility::array_merge( $pluginsNewUpdate, $pluginsToUpdate );
68 - $update_items = MainWP_Utility::array_merge( $update_items, $notTrustedPluginsNewUpdate );
69 - $update_items = MainWP_Utility::array_merge( $update_items, $notTrustedPluginsToUpdate );
61 + return $update_items;
62 + }
70 63
71 - return $update_items;
72 - }
64 + /**
65 + * Method get_update_themes_items().
66 + *
67 + * Get themes update items to email.
68 + *
69 + * @return array $update_items Update themes.
70 + *
71 + * @uses \MainWP\Dashboard\MainWP_Utility::array_merge()
72 + */
73 + public static function get_update_themes_items() {
73 74
75 + $themesNewUpdate = get_option( 'mainwp_updatescheck_mail_update_themes_new' );
76 + if ( ! is_array( $themesNewUpdate ) ) {
77 + $themesNewUpdate = array();
78 + }
79 + $themesToUpdate = get_option( 'mainwp_updatescheck_mail_update_themes' );
80 + if ( ! is_array( $themesToUpdate ) ) {
81 + $themesToUpdate = array();
82 + }
83 + $notTrustedThemesNewUpdate = get_option( 'mainwp_updatescheck_mail_ignore_themes_new' );
84 + if ( ! is_array( $notTrustedThemesNewUpdate ) ) {
85 + $notTrustedThemesNewUpdate = array();
86 + }
87 + $notTrustedThemesToUpdate = get_option( 'mainwp_updatescheck_mail_ignore_themes' );
88 + if ( ! is_array( $notTrustedThemesToUpdate ) ) {
89 + $notTrustedThemesToUpdate = array();
90 + }
74 91
75 - /**
76 - * Method remove_duplicate_updates
77 - *
78 - * @param array $checks checks.
79 - * @param array $inputs inputs.
80 - * @return mixed
81 - */
82 - public static function remove_duplicate_updates( $checks, $inputs = array() ) {
83 - $tmp = array();
84 - $filters = array();
85 - $done = false;
86 - if ( is_array( $inputs ) ) {
87 - foreach ( $inputs as $item ) {
88 - if ( isset( $item['slug'] ) && isset( $item['id'] ) && isset( $item['current'] ) && ! isset( $filters[ $item['id'] . '_' . $item['slug'] . '_' . $item['current'] ] ) ) {
89 - $filters[ $item['id'] . '_' . $item['slug'] . '_' . $item['current'] ] = 1;
90 - $done = true;
91 - }
92 - }
93 - }
94 - // check not duplicate item in both arrays, for $checks array.
95 - foreach ( $checks as $item ) {
96 - if ( isset( $item['slug'] ) && isset( $item['id'] ) && isset( $item['current'] ) && ! isset( $filters[ $item['id'] . '_' . $item['slug'] . '_' . $item['current'] ] ) ) {
97 - $filters[ $item['id'] . '_' . $item['slug'] . '_' . $item['current'] ] = 1;
98 - $tmp[] = $item;
99 - $done = true;
100 - }
101 - }
102 - return $done ? $tmp : $checks; // to prevent bad format data.
103 - }
92 + $update_items = array();
104 93
105 - /**
106 - * Method get_update_themes_items().
107 - *
108 - * Get themes update items to email.
109 - *
110 - * @return array $update_items Update themes.
111 - *
112 - * @uses \MainWP\Dashboard\MainWP_Utility::array_merge()
113 - */
114 - public static function get_update_themes_items() {
94 + $update_items = MainWP_Utility::array_merge( $themesNewUpdate, $themesToUpdate );
95 + $update_items = MainWP_Utility::array_merge( $update_items, $notTrustedThemesNewUpdate );
96 + $update_items = MainWP_Utility::array_merge( $update_items, $notTrustedThemesToUpdate );
115 97
116 - $themesNewUpdate = get_option( 'mainwp_updatescheck_mail_update_themes_new' );
117 - if ( ! is_array( $themesNewUpdate ) ) {
118 - $themesNewUpdate = array();
119 - }
120 - $themesToUpdate = get_option( 'mainwp_updatescheck_mail_update_themes' );
121 - if ( ! is_array( $themesToUpdate ) ) {
122 - $themesToUpdate = array();
123 - }
124 - $notTrustedThemesNewUpdate = get_option( 'mainwp_updatescheck_mail_ignore_themes_new' );
125 - if ( ! is_array( $notTrustedThemesNewUpdate ) ) {
126 - $notTrustedThemesNewUpdate = array();
127 - }
128 - $notTrustedThemesToUpdate = get_option( 'mainwp_updatescheck_mail_ignore_themes' );
129 - if ( ! is_array( $notTrustedThemesToUpdate ) ) {
130 - $notTrustedThemesToUpdate = array();
131 - }
98 + return $update_items;
99 + }
132 100
133 - $themesNewUpdate = static::remove_duplicate_updates( $themesNewUpdate, $themesToUpdate );
134 - $themesToUpdate = static::remove_duplicate_updates( $themesToUpdate );
135 - $notTrustedThemesNewUpdate = static::remove_duplicate_updates( $notTrustedThemesNewUpdate, $notTrustedThemesToUpdate );
136 - $notTrustedThemesToUpdate = static::remove_duplicate_updates( $notTrustedThemesToUpdate );
101 + /**
102 + * Method get_update_wp_items().
103 + *
104 + * Get WP update to email.
105 + *
106 + * @return array $update_items WP update items.
107 + *
108 + * @uses \MainWP\Dashboard\MainWP_Utility::array_merge()
109 + */
110 + public static function get_update_wp_items() {
137 111
138 - $update_items = array();
112 + $coreNewUpdate = get_option( 'mainwp_updatescheck_mail_update_core_new' );
113 + if ( ! is_array( $coreNewUpdate ) ) {
114 + $coreNewUpdate = array();
115 + }
116 + $coreToUpdate = get_option( 'mainwp_updatescheck_mail_update_core' );
117 + if ( ! is_array( $coreToUpdate ) ) {
118 + $coreToUpdate = array();
119 + }
120 + $ignoredCoreNewUpdate = get_option( 'mainwp_updatescheck_mail_ignore_core_new' );
121 + if ( ! is_array( $ignoredCoreNewUpdate ) ) {
122 + $ignoredCoreNewUpdate = array();
123 + }
124 + $ignoredCoreToUpdate = get_option( 'mainwp_updatescheck_mail_ignore_core' );
125 + if ( ! is_array( $ignoredCoreToUpdate ) ) {
126 + $ignoredCoreToUpdate = array();
127 + }
139 128
140 - $update_items = MainWP_Utility::array_merge( $themesNewUpdate, $themesToUpdate );
141 - $update_items = MainWP_Utility::array_merge( $update_items, $notTrustedThemesNewUpdate );
142 - $update_items = MainWP_Utility::array_merge( $update_items, $notTrustedThemesToUpdate );
129 + $update_items = array();
143 130
144 - return $update_items;
145 - }
131 + $update_items = MainWP_Utility::array_merge( $coreNewUpdate, $coreToUpdate );
132 + $update_items = MainWP_Utility::array_merge( $update_items, $ignoredCoreNewUpdate );
133 + $update_items = MainWP_Utility::array_merge( $update_items, $ignoredCoreToUpdate );
146 134
147 - /**
148 - * Method get_update_wp_items().
149 - *
150 - * Get WP update to email.
151 - *
152 - * @return array $update_items WP update items.
153 - *
154 - * @uses \MainWP\Dashboard\MainWP_Utility::array_merge()
155 - */
156 - public static function get_update_wp_items() {
135 + return $update_items;
136 + }
157 137
158 - $coreNewUpdate = get_option( 'mainwp_updatescheck_mail_update_core_new' );
159 - if ( ! is_array( $coreNewUpdate ) ) {
160 - $coreNewUpdate = array();
161 - }
162 - $coreToUpdate = get_option( 'mainwp_updatescheck_mail_update_core' );
163 - if ( ! is_array( $coreToUpdate ) ) {
164 - $coreToUpdate = array();
165 - }
166 - $ignoredCoreNewUpdate = get_option( 'mainwp_updatescheck_mail_ignore_core_new' );
167 - if ( ! is_array( $ignoredCoreNewUpdate ) ) {
168 - $ignoredCoreNewUpdate = array();
169 - }
170 - $ignoredCoreToUpdate = get_option( 'mainwp_updatescheck_mail_ignore_core' );
171 - if ( ! is_array( $ignoredCoreToUpdate ) ) {
172 - $ignoredCoreToUpdate = array();
173 - }
138 + /**
139 + * Method get_site_updates_items().
140 + *
141 + * Get Updates items of websites.
142 + *
143 + * @param string $what values: plugin, theme, wpcore.
144 + * @param array $sites_ids Websites ids filter (option).
145 + *
146 + * @return array $update_items WP update items.
147 + */
148 + public static function get_site_updates_items( $what, $sites_ids = false ) {
174 149
175 - $update_items = array();
150 + $items = array();
151 + if ( 'plugin' == $what ) {
152 + $items = self::get_update_plugins_items();
153 + } elseif ( 'theme' == $what ) {
154 + $items = self::get_update_themes_items();
155 + } elseif ( 'wpcore' == $what ) {
156 + $items = self::get_update_wp_items();
157 + }
176 158
177 - $update_items = MainWP_Utility::array_merge( $coreNewUpdate, $coreToUpdate );
178 - $update_items = MainWP_Utility::array_merge( $update_items, $ignoredCoreNewUpdate );
179 - $update_items = MainWP_Utility::array_merge( $update_items, $ignoredCoreToUpdate );
159 + $filters = array();
160 + foreach ( $items as $item ) {
161 + if ( isset( $item['id'] ) ) { // to valid and compatible data.
162 + if ( ! empty( $sites_ids ) ) { // if filter by sites ids.
163 + if ( ! in_array( $item['id'], $sites_ids ) ) {
164 + continue;
165 + }
166 + }
167 + $filters[] = $item;
168 + }
169 + }
170 + return $filters;
171 + }
180 172
181 - return $update_items;
182 - }
173 + /**
174 + * Method format_email()
175 + *
176 + * Format email.
177 + *
178 + * @param string $to_email Send to emails.
179 + * @param string $body Email's body.
180 + * @param string $title Email's title.
181 + * @param bool $plain_text text format.
182 + *
183 + * @return string Formatted content
184 + */
185 + public static function format_email( $to_email = null, $body = '', $title = '', $plain_text = false ) {
183 186
184 - /**
185 - * Method get_site_updates_items().
186 - *
187 - * Get Updates items of websites.
188 - *
189 - * @param string $what values: plugin, theme, wpcore.
190 - * @param array $sites_ids Websites ids filter (option).
191 - *
192 - * @return array $update_items WP update items.
193 - */
194 - public static function get_site_updates_items( $what, $sites_ids = false ) {
195 -
196 - $items = array();
197 - if ( 'plugin' === $what ) {
198 - $items = static::get_update_plugins_items();
199 - } elseif ( 'theme' === $what ) {
200 - $items = static::get_update_themes_items();
201 - } elseif ( 'wpcore' === $what ) {
202 - $items = static::get_update_wp_items();
203 - }
204 -
205 - $filters = array();
206 - foreach ( $items as $item ) {
207 - if ( isset( $item['id'] ) ) { // to valid and compatible data.
208 - if ( ! empty( $sites_ids ) && ! in_array( $item['id'], $sites_ids ) ) {
209 - continue;
210 - }
211 - $filters[] = $item;
212 - }
213 - }
214 - return $filters;
215 - }
216 -
217 - /**
218 - * Method format_email()
219 - *
220 - * Format email.
221 - *
222 - * @param string $to_email Send to emails.
223 - * @param string $body Email's body.
224 - * @param string $title Email's title.
225 - * @param bool $plain_text text format.
226 - *
227 - * @return string Formatted content
228 - */
229 - public static function format_email( $to_email = null, $body = '', $title = '', $plain_text = false ) { //phpcs:ignore -- NOSONAR - long function.
230 - unset( $to_email );
231 - $current_year = gmdate( 'Y' );
232 - if ( $plain_text ) {
233 - $mail_send['header'] = '';
234 - $mail_send['body'] = 'Hi,' . "\r\n\r\n" .
235 - ( ( ! empty( $title ) ) ? $title . "\r\n\r\n" : '' ) .
236 - $body . "\r\n\r\n";
237 - $mail_send['footer'] = 'MainWP: https://mainwp.com' . "\r\n" .
238 - 'Add-ons: https://mainwp.com/mainwp-add-ons/' . "\r\n" .
239 - 'Documentation: https://docs.mainwp.com/' . "\r\n" .
240 - 'Blog: https://mainwp.com/mainwp-blog/' . "\r\n" .
241 - 'Codex: https://mainwp.dev/' . "\r\n" .
242 - 'Support: https://mainwp.com/support/' . "\r\n\r\n" .
243 - 'Follow us on X: https://x.com/mymainwp' . "\r\n" .
244 - 'Friend us on Facebook: https://www.facebook.com/mainwp' . "\r\n\r\n" .
245 - "Copyright {$current_year} MainWP, All rights reserved.";
246 - } else {
247 - // phpcs:disable PluginCheck.CodeAnalysis.Heredoc.NotAllowed -- Email HTML templates; refactoring 250+ lines of HTML to string concatenation carries high regression risk with no security benefit as content is not browser-rendered.
248 - $mail_send['header'] = <<<EOT
249 - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
187 + $current_year = gmdate( 'Y' );
188 + if ( $plain_text ) {
189 + $mail_send['header'] = '';
190 + $mail_send['body'] = 'Hi,' . "\r\n\r\n" .
191 + ( ( ! empty( $title ) ) ? $title . "\r\n\r\n" : '' ) .
192 + $body . "\r\n\r\n";
193 + $mail_send['footer'] = 'MainWP: https://mainwp.com' . "\r\n" .
194 + 'Extensions: https://mainwp.com/mainwp-extensions/' . "\r\n" .
195 + 'Documentation: https://kb.mainwp.com/' . "\r\n" .
196 + 'Blog: https://mainwp.com/mainwp-blog/' . "\r\n" .
197 + 'Codex: https://mainwp.dev/' . "\r\n" .
198 + 'Support: https://mainwp.com/support/' . "\r\n\r\n" .
199 + 'Follow us on Twitter: https://twitter.com/mymainwp' . "\r\n" .
200 + 'Friend us on Facebook: https://www.facebook.com/mainwp' . "\r\n\r\n" .
201 + "Copyright {$current_year} MainWP, All rights reserved.";
202 + } else {
203 + $mail_send['header'] = <<<EOT
204 + <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
250 205 <html>
251 206 <head>
252 207 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
253 208 <title> {$title} </title>
@@ -430,28 +385,28 @@
430 385 max-width:190px;
431 386 }
432 387 </style>
433 388 </head>
434 - <body offset="0" style="-webkit-text-size-adjust: none;margin: 0;padding: 0;background-color: #FAFAFA;width: 100% !important;">
389 + <body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0" style="-webkit-text-size-adjust: none;margin: 0;padding: 0;background-color: #FAFAFA;width: 100% !important;">
435 390 <center>
436 - <table id="backgroundTable" style="margin 0;border-spacing:0;width:100%;height:100%;padding:0;background-color: #FAFAFA;height: 100% !important;width: 100% !important;">
391 + <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="backgroundTable" style="margin: 0;padding:0;background-color: #FAFAFA;height: 100% !important;width: 100% !important;">
437 392 <tr>
438 - <td style="text-align:center;border-collapse: collapse;vertical-align:top;">
393 + <td align="center" valign="top" style="border-collapse: collapse;">
439 394
440 395 <!-- // Begin: Template Pre-header \\ -->
441 396
442 - <table id="templatePreheader" style="padding:10px;border-spacing:0;width:600px;background-color: #FAFAFA;">
397 + <table border="0" cellpadding="10" cellspacing="0" width="600" id="templatePreheader" style="background-color: #FAFAFA;">
443 398 <tr>
444 - <td class="preheaderContent" style="border-collapse: collapse;vertical-align:top;">
399 + <td valign="top" class="preheaderContent" style="border-collapse: collapse;">
445 400
446 401 <!-- // Begin: Standard Preheader \ -->
447 402
448 - <table style="border:0;padding:10px;border-spacing:0;width:100%">
403 + <table border="0" cellpadding="10" cellspacing="0" width="100%">
449 404 <tr>
450 - <td style="border-collapse: collapse;vertical-align:top;">
405 + <td valign="top" style="border-collapse: collapse;">
451 406 <div style="color: #505050;font-family: Arial;font-size: 10px;line-height: 100%;text-align: left;"></div>
452 407 </td>
453 - <td style="border-collapse: collapse;vertical-align:top;width:190px;">
408 + <td valign="top" width="190" style="border-collapse: collapse;">
454 409 <div style="color: #505050;font-family: Arial;font-size: 10px;line-height: 100%;text-align: left;"></div>
455 410 </td>
456 411 </tr>
457 412 </table>
@@ -463,15 +418,15 @@
463 418 </table>
464 419
465 420 <!-- // End: Template Preheader \\ -->
466 421
467 - <table id="templateContainer" style="width:600px;padding:0;border-spacing:0;border: 1px solid #DDDDDD;background-color: #FFFFFF;">
422 + <table border="0" cellpadding="0" cellspacing="0" width="600" id="templateContainer" style="border: 1px solid #DDDDDD;background-color: #FFFFFF;">
468 423 <tr>
469 - <td style="text-align:center;vertical-align:top;border-collapse: collapse;">
424 + <td align="center" valign="top" style="border-collapse: collapse;">
470 425
471 426 <!-- // Begin: Template Header \\ -->
472 427
473 - <table id="templateHeader" style="width:600px;padding:0;border-spacing:0;background-color: #FFFFFF;border-bottom: 0;">
428 + <table border="0" cellpadding="0" cellspacing="0" width="600" id="templateHeader" style="background-color: #FFFFFF;border-bottom: 0;">
474 429 <tr>
475 430 <td class="headerContent" style="border-collapse: collapse;color: #202020;font-family: Arial;font-size: 34px;font-weight: bold;line-height: 100%;padding: 0;text-align: center;vertical-align: middle;">
476 431
477 432 <!-- // Begin: Standard Header Image \\ -->
@@ -488,25 +443,25 @@
488 443
489 444 </td>
490 445 </tr>
491 446 <tr>
492 - <td style="align:center;vertical-align:top;border-collapse: collapse;">
447 + <td align="center" valign="top" style="border-collapse: collapse;">
493 448
494 449 <!-- // Begin: Template Body \\ -->
495 450
496 - <tableid="templateBody" style="border:0;padding:0;border-spacing:0;width:600px;">
451 + <table border="0" cellpadding="0" cellspacing="0" width="600" id="templateBody">
497 452 <tr>
498 - <td class="bodyContent" style="vertical-align:top;border-collapse: collapse;background-color: #FFFFFF;">
453 + <td valign="top" class="bodyContent" style="border-collapse: collapse;background-color: #FFFFFF;">
499 454
500 455 <!-- // Begin: Standard Content \\ -->
501 456 EOT;
502 457
503 - $title_content = ! empty( $title ) ? '<b style="color: rgb(127, 177, 0); font-family: Helvetica, Sans; font-size: medium; line-height: normal;"> ' . $title . ' </b><br>' : '';
458 + $title_content = ! empty( $title ) ? '<b style="color: rgb(127, 177, 0); font-family: Helvetica, Sans; font-size: medium; line-height: normal;"> ' . $title . ' </b><br>' : '';
504 459
505 - $mail_send['body'] = <<<EOT
506 - <table style="vertical-align:top;border:0;padding:20px;border-spacing:0;width:100%;">
460 + $mail_send['body'] = <<<EOT
461 + <table border="0" cellpadding="20" cellspacing="0" width="100%">
507 462 <tr>
508 - <td style="vertical-align:top;border-collapse: collapse;">
463 + <td valign="top" style="border-collapse: collapse;">
509 464 <div style="color: #505050;font-family: Arial;font-size: 14px;line-height: 150%;text-align: left;"> Hi, <br><br>
510 465 {$title_content}
511 466 <br>{$body}<br>
512 467 </div>
@@ -514,9 +469,9 @@
514 469 </tr>
515 470 </table>
516 471 EOT;
517 472
518 - $mail_send['footer'] = <<<EOT
473 + $mail_send['footer'] = <<<EOT
519 474 <!-- // End: Standard Content \\ -->
520 475
521 476 </td>
522 477 </tr>
@@ -526,19 +481,19 @@
526 481
527 482 </td>
528 483 </tr>
529 484 <tr>
530 - <td style="text-align:center;vertical-align:top;border-collapse: collapse;">
485 + <td align="center" valign="top" style="border-collapse: collapse;">
531 486
532 487 <!-- // Begin: Template Footer \\ -->
533 488
534 - <table id="templateFooter" style="padding:10px;border-spacing:0;width:600px;background-color: #1d1b1c;border-top: 4px solid #7fb100;">
489 + <table border="0" cellpadding="10" cellspacing="0" width="600" id="templateFooter" style="background-color: #1d1b1c;border-top: 4px solid #7fb100;">
535 490 <tr>
536 - <td class="footerContent" style="vertical-align:top;border-collapse: collapse;">
491 + <td valign="top" class="footerContent" style="border-collapse: collapse;">
537 492
538 493 <!-- // Begin: Standard Footer \\ -->
539 494
540 - <table width="100%" style="border:0;padding:10px;border-spacing:0;width:100%;">
495 + <table border="0" cellpadding="10" cellspacing="0" width="100%">
541 496 <tr>
542 497 <td valign="middle" id="social" style="border-collapse: collapse;background-color: #1d1b1c;border: 0;">
543 498 <div style="color: #b8b8b8;font-family: Arial;font-size: 12px;line-height: 125%;text-align: center;">
544 499 <style type="text/css">
@@ -548,16 +503,16 @@
548 503 color: #7fb100 ;
549 504 }
550 505 </style>
551 506 <div class="tpl-content-highlight" id="mainwp-links" style="color: #b8b8b8;font-family: Arial;font-size: 12px;line-height: 125%;text-align: center;">
552 - <a href="https://mainwp.com" target="_self" style="color: #7fb100;font-weight: normal;text-decoration: none;text-transform: uppercase;">MainWP</a> | <a href="https://mainwp.com/mainwp-add-ons/" target="_self" style="color: #7fb100;font-weight: normal;text-decoration: none;text-transform: uppercase;">Add-ons</a> | <a href="https://docs.mainwp.com/" target="_self" style="color: #7fb100;font-weight: normal;text-decoration:none;text-transform: uppercase;">Documentation</a> | <a href="https://mainwp.com/mainwp-blog/" target="_self" style="color: #7fb100;font-weight: normal;text-decoration: none;text-transform: uppercase;">Blog</a> | <a href="https://mainwp.dev/" target="_self" style="color: #7fb100;font-weight: normal;text-decoration: none;text-transform: uppercase;">Codex</a> | <a href="https://mainwp.com/support/" target="_self" style="color: #7fb100;font-weight: normal;text-decoration: none;text-transform: uppercase;">Support</a></div>
507 + <a href="https://mainwp.com" target="_self" style="color: #7fb100;font-weight: normal;text-decoration: none;text-transform: uppercase;">MainWP</a> | <a href="https://mainwp.com/mainwp-extensions/" target="_self" style="color: #7fb100;font-weight: normal;text-decoration: none;text-transform: uppercase;">Extensions</a> | <a href="https://kb.mainwp.com/" target="_self" style="color: #7fb100;font-weight: normal;text-decoration:none;text-transform: uppercase;">Documentation</a> | <a href="https://mainwp.com/mainwp-blog/" target="_self" style="color: #7fb100;font-weight: normal;text-decoration: none;text-transform: uppercase;">Blog</a> | <a href="http://codex.mainwp.com" target="_self" style="color: #7fb100;font-weight: normal;text-decoration: none;text-transform: uppercase;">Codex</a> | <a href="https://mainwp.com/support/" target="_self" style="color: #7fb100;font-weight: normal;text-decoration: none;text-transform: uppercase;">Support</a></div>
553 508
554 509 <hr><br>
555 - <a href="https://x.com/mymainwp" target="_blank" style="color: #336699;font-weight: normal;text-decoration: underline;">Follow us on X</a> | <a href="https://www.facebook.com/mainwp" style="color:#336699;font-weight: normal;text-decoration: underline;">Friend us on Facebook</a>
510 + <a href="https://twitter.com/mymainwp" target="_blank" style="color: #336699;font-weight: normal;text-decoration: underline;">Follow us on Twitter</a> | <a href="https://www.facebook.com/mainwp" style="color:#336699;font-weight: normal;text-decoration: underline;">Friend us on Facebook</a>
556 511 </td>
557 512 </tr>
558 513 <tr>
559 - <td style="vertical-align:top;border-collapse: collapse;">
514 + <td valign="top" style="border-collapse: collapse;">
560 515 <div style="color: #b8b8b8;font-family: Arial;font-size: 12px;line-height: 125%;text-align: center;"><div style="text-align: left;color: #b8b8b8;font-family: Arial;font-size: 12px;line-height: 125%;"><em>Copyright &copy; {$current_year} MainWP, All rights reserved.</em><br></div></div>
561 516 </td>
562 517 </tr>
563 518 </table>
@@ -580,10 +535,10 @@
580 535 </center>
581 536 </body>
582 537 </html>
583 538 EOT;
584 - // phpcs:enable PluginCheck.CodeAnalysis.Heredoc.NotAllowed
585 - }
586 - $mail_send = apply_filters( 'mainwp_format_email', $mail_send );
587 - return $mail_send['header'] . $mail_send['body'] . $mail_send['footer'];
588 - }
539 + }
540 + $mail_send = apply_filters( 'mainwp_format_email', $mail_send );
541 + return $mail_send['header'] . $mail_send['body'] . $mail_send['footer'];
542 + }
543 +
589 544 }