Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ public function get_email_signature() {
https://make.wordpress.org/plugins', 'wporg-plugins' );
}

/**
* Return the plugin's title with HTML entities decoded for plain-text use (e.g., email subjects).
*/
protected function plugin_title() {
return html_entity_decode( $this->plugin->post_title, ENT_QUOTES | ENT_HTML5, 'UTF-8' );
Comment thread
dd32 marked this conversation as resolved.
}

/**
* A simple way to convert a WP_User object to a displayable username.
* This shouldn't be needed, but unfortunately often is on WordPress.org.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function subject() {
return sprintf(
/* translators: 1: Plugin Name */
__( 'New committer added to %s', 'wporg-plugins' ),
$this->plugin->post_title
$this->plugin_title()
);
}

Expand Down Expand Up @@ -52,7 +52,7 @@ function body() {
$email_text,
$this->user_text( $this->user ),
$this->user_text( $this->args['committer'] ),
$this->plugin->post_title,
$this->plugin_title(),
$this->user_text( $this->who ),
$committer_list,
$advanced_url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function body() {

private function replace_placeholders( $text ) {
$items = [
'###PLUGIN###' => $this->plugin->post_title,
'###PLUGIN###' => $this->plugin_title(),
'###URL###' => get_permalink( $this->plugin ),
'###SLUG###' => $this->plugin->post_name,
'###USER###' => $this->user_text( $this->user ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function subject() {
return sprintf(
/* translators: 1: Plugin Name */
__( '%s has been approved!', 'wporg-plugins' ),
$this->plugin->post_title
$this->plugin_title()
);
}

Expand Down Expand Up @@ -66,7 +66,7 @@ function markdown() {

return sprintf(
$email_text,
$this->plugin->post_title,
$this->plugin_title(),
$this->user->user_login,
$this->plugin->post_name,
"https://profiles.wordpress.org/{$this->user->user_nicename}/profile/edit/group/3/?screen=svn-password"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ function subject() {
return sprintf(
/* translators: 1: Plugin Name */
__( '%s has been rejected', 'wporg-plugins' ),
$this->plugin->post_title
$this->plugin_title()
);
}

function markdown() {
$placeholders = [
// Should be first, to allow placeholders in the rejection reasons too.
'###REASON###' => $this->get_rejection_reason(),
'###NAME###' => $this->plugin->post_title,
'###NAME###' => $this->plugin_title(),
'###SLUG###' => ( $this->args['slug'] ?? '' ) ?: $this->plugin->post_name,
'###SUBMISSION_DATE###' => $this->args['submission_date'],
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function subject() {
return sprintf(
/* translators: 1: Plugin Name */
__( 'Successful Plugin Submission - %s', 'wporg-plugins' ),
$this->plugin->post_title
$this->plugin_title()
);
}

Expand All @@ -19,7 +19,7 @@ function subject() {
public function markdown() {

$placeholders = [
'###NAME###' => $this->plugin->post_title,
'###NAME###' => $this->plugin_title(),
'###SLUG###' => $this->plugin->post_name,
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function subject() {
return sprintf(
/* translators: 1: Plugin Name */
__( '%s has been transferred', 'wporg-plugins' ),
$this->plugin->post_title
$this->plugin_title()
);
}

Expand All @@ -24,7 +24,7 @@ function body() {
$email_text,
$this->user_text( wp_get_current_user() ),
gmdate( 'Y-m-d H:i:s \G\M\T' ),
$this->plugin->post_title,
$this->plugin_title(),
$this->user_text( $this->args['owner'] ) . ' (' . $this->args['owner']->user_login . ')',
PLUGIN_TEAM_EMAIL
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function subject() {
return sprintf(
/* translators: 1: Plugin Name */
__( 'Release confirmation now required for %s', 'wporg-plugins' ),
$this->plugin->post_title
$this->plugin_title()
);
}

Expand All @@ -31,7 +31,7 @@ function body() {
%6$s', 'wporg-plugins' ),
$this->user_text( $this->user ),
$this->user_text( $this->who ),
$this->plugin->post_title,
$this->plugin_title(),
get_permalink( $this->plugin ),
$this->plugin->post_name,
'https://developer.wordpress.org/plugins/wordpress-org/release-confirmation-emails/'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function subject() {
return sprintf(
/* translators: 1: Plugin Name */
__( 'Pending release for %s', 'wporg-plugins' ),
$this->plugin->post_title
$this->plugin_title()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function subject() {
return sprintf(
/* translators: 1: Plugin Name */
__( 'New support rep added to %s', 'wporg-plugins' ),
$this->plugin->post_title
$this->plugin_title()
);
}

Expand Down Expand Up @@ -40,7 +40,7 @@ function body() {
$email_text,
$this->user_text( $this->user ),
$this->user_text( $this->args['rep'] ),
$this->plugin->post_title,
$this->plugin_title(),
$this->user_text( $this->who ),
$rep_list,
$advanced_url,
Expand Down
Loading