[wp-meta] [Making WordPress.org] #8231: Plugin submission email subject lines display HTML entities instead of plain text characters (e.g., "A & B" instead of "A & B")

Making WordPress.org noreply at wordpress.org
Tue Apr 14 13:00:27 UTC 2026


#8231: Plugin submission email subject lines display HTML entities instead of
plain text characters (e.g., "A & B" instead of "A & B")
------------------------------+-------------------------------
 Reporter:  nimeshatxecurify  |       Owner:  nimeshatxecurify
     Type:  defect (bug)      |      Status:  assigned
 Priority:  normal            |   Milestone:
Component:  Plugin Directory  |  Resolution:
 Keywords:  has-patch         |
------------------------------+-------------------------------

Comment (by darshitrajyaguru97):

 === Issue Summary ===

 Plugin names are stored with HTML entities (e.g., `&`) which are
 appropriate for HTML output, but they are currently used directly in email
 subject lines.

 ** This results in subjects like:

 {{{
 Successful Plugin Submission - A & B
 }}}

 **Instead of the expected:

 {{{
 Successful Plugin Submission - A & B
 }}}



 === Proposed Solution ===

 Decode the plugin title when used in plain-text contexts (such as email
 subjects).

 To ensure consistency and avoid duplication, I introduced a helper method
 in the base email class:

 {{{
 protected function plugin_title() {
     return html_entity_decode( $this->plugin->post_title, ENT_QUOTES |
 ENT_HTML5, 'UTF-8' );
 }
 }}}

 This method is then used across all email classes where the plugin title
 is rendered.



 === Benefits ===

 - Ensures correct display of plugin names in email subjects and bodies
 - Centralizes logic for maintainability
 - Avoids repeated inline decoding
 - Keeps HTML-safe storage intact while fixing plain-text output


 === Testing ===

 **Tested with plugin name:

 {{{
 A & B
 }}}

 **Result before patch:

 {{{
 Successful Plugin Submission - A & B
 }}}

 **Result after patch:

 {{{
 Successful Plugin Submission - A & B
 }}}

 === Notes / Questions ===

 - This change assumes email content (subject/body) should always be
 treated as plain text.
 - If there are cases where HTML output is required, we may want to
 explicitly escape at output instead of relying on stored values.

 **Happy to adjust approach if a different escaping strategy is preferred.

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/8231#comment:2>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list