<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[13127] sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email: Plugin Directory: Add a new post-plugin-submission email, which references new features and reiterates expectations of the author.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/13127">13127</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/13127","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>dd32</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-01-19 04:30:50 +0000 (Fri, 19 Jan 2024)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Plugin Directory: Add a new post-plugin-submission email, which references new features and reiterates expectations of the author.
This introduces two new email classes, to provide HTML emails, and Markdown emails.
A markdown email is converted into a HTML email, but makes it easier to write the template.
Note: This email is not yet active.
See <a href="http://meta.trac.wordpress.org/ticket/6943">#6943</a>, <a href="http://meta.trac.wordpress.org/ticket/7384">#7384</a>.</pre>
<h3>Added Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryemailclasshtmlbasephp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-html-base.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryemailclassmarkdownbasephp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-markdown-base.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryemailclasspluginsubmissionphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-plugin-submission.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryemailclasshtmlbasephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-html-base.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-html-base.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-html-base.php 2024-01-19 04:30:50 UTC (rev 13127)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,105 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\Plugin_Directory\Email;
+
+abstract class HTML_Base extends Base {
+
+ /**
+ * The HTML content for the email template
+ */
+ abstract public function html();
+
+ /**
+ * The plain-text content for the email template
+ *
+ * This might be offered by the Email template, but if not, we'll convert the HTML.
+ *
+ * @return string
+ */
+ public function body() {
+ $html = $this->html();
+
+ // Perform some basic HTML conversions
+ $html = str_replace( '<br>', "\n", $html );
+ $html = str_replace( '<p>', "\n", $html );
+
+ // Use some markdown style syntax.
+ $html = preg_replace( '!<a[^>]*href=(.).+\\1[^>]*>([^<>]*)</a>!', '[$2]($1)', $html );
+ $html = str_replace( '<li>', "\n * ", $html );
+ $html = preg_replace_callback( '!<h(?P<level>[0-9])>(?P<text>[^<>]*)</h\\1>!', function( $m ) {
+ return str_repeat( '#', $m['level'] ) . ' ' . $m['text'];
+ }, $html );
+ $html = str_replace( array( '<strong>', '</strong>', '<b>', '</b>' ), ' ** ', $html );
+ $html = str_replace( array( '<em>', '</em>', '<i>', '</i>' ), ' __ ', $html );
+
+ // Remove anything else left.
+ $html = wp_strip_all_tags( $html );
+
+ return $html;
+ }
+
+ /**
+ * Send an individual email.
+ */
+ protected function _send() {
+ global $phpmailer;
+ if ( ! $this->should_send() ) {
+ return false;
+ }
+
+ $subject = sprintf(
+ /* translators: Email subject prefix. 1: The email subject. */
+ __( '[WordPress Plugin Directory] %1$s', 'wporg-plugins' ),
+ $this->subject()
+ );
+
+ $email = $this->user->user_email;
+ $text = $this->body();
+ $text .= "\n\n" . $this->get_email_signature();
+ $html = $this->html();
+ $html .= "<p>" . $this->get_email_signature( 'html' ) . "</p>";
+
+ // Configure the mailer to send HTML, the PHPMailer is likely not yet setup, so we wait for the init action.
+ $configure_multipart = function( $phpmailer ) use( $text ) {
+ $phpmailer->AltBody = $text;
+ $phpmailer->IsHTML( true );
+ };
+ add_action( 'phpmailer_init', $configure_multipart );
+
+ $result = wp_mail(
+ $email,
+ $subject,
+ $html,
+ sprintf(
+ 'From: "%s" <%s>',
+ 'WordPress Plugin Directory',
+ PLUGIN_TEAM_EMAIL
+ )
+ );
+
+ // Reset the mailer.
+ remove_action( 'phpmailer_init', $configure_multipart );
+ $phpmailer->AltBody = '';
+ $phpmailer->IsHTML( false );
+
+ return $result;
+ }
+
+ /**
+ * A common email signature to attach to the bottom of all emails.
+ *
+ * @param string $mode 'text' or 'html'
+ * @return string
+ */
+ public function get_email_signature( $mode = 'text' ) {
+ $template = parent::get_email_signature();
+
+ // Make it a bit more HTML friendly.
+ if ( 'html' === $mode ) {
+ $template = str_replace( "--\n", '<hr>', $template );
+ $template = nl2br( $template );
+ $template = make_clickable( $template );
+ }
+
+ return $template;
+ }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-html-base.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryemailclassmarkdownbasephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-markdown-base.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-markdown-base.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-markdown-base.php 2024-01-19 04:30:50 UTC (rev 13127)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,50 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\Plugin_Directory\Email;
+
+use WordPressdotorg\Plugin_Directory\Markdown;
+
+abstract class Markdown_Base extends HTML_Base {
+
+ /**
+ * The Markdown content of the email.
+ *
+ * @return string
+ */
+ abstract public function markdown();
+
+ /**
+ * The plain-text content for the email template.
+ *
+ * The email may specify it, but otherwise we'll just use the raw Markdown as the plain-text variant.
+ *
+ * @return string
+ */
+ public function body() {
+ return $this->markdown();
+ }
+
+ /**
+ * The HTML content for the email template
+ *
+ * @return string
+ */
+ public function html() {
+ static $markdown_converter = null;
+
+ $text = $this->markdown();
+
+ // Return early if the Markdown processor isn't available.
+ if ( class_exists( '\WordPressdotorg\Plugin_Directory\Markdown' ) ) {
+ if ( is_null( $markdown_converter ) ) {
+ $markdown_converter = new Markdown();
+ }
+
+ $text = $markdown_converter->transform( $text );
+ }
+
+ $text = make_clickable( $text );
+
+ return $text;
+ }
+
+}
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-markdown-base.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryemailclasspluginsubmissionphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-plugin-submission.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-plugin-submission.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-plugin-submission.php 2024-01-19 04:30:50 UTC (rev 13127)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,96 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\Plugin_Directory\Email;
+
+use WP_User;
+use WordPressdotorg\Plugin_Directory\Plugin_Directory;
+
+class Plugin_Submission extends Markdown_Base {
+ function subject() {
+ return sprintf(
+ /* translators: 1: Plugin Name */
+ __( 'Successful Plugin Submission - %s', 'wporg-plugins' ),
+ $this->plugin->post_title
+ );
+ }
+
+ /**
+ * The HTML content for the email template
+ */
+ public function markdown() {
+
+ $placeholders = [
+ '###NAME###' => $this->plugin->post_title,
+ '###SLUG###' => $this->plugin->post_name,
+ ];
+
+ /* translators: This is Markdown, please be extra careful to retain the formatting characters, including newlines, and the placeholders. */
+ $template = __( "Thank you for uploading ###NAME### to the WordPress Plugin Directory. We will review your submission as soon as possible and send you a follow up email with the results.
+
+**Slug / Permalink**
+
+Based on your display name of ###NAME### your plugin has been initially assigned the following permalink:
+http://wordpress.org/plugins/###SLUG###/ _(please note: This URL will not be operational until your plugin review is approved)_
+
+You can customize this on the [Plugin Submission page](https://wordpress.org/plugins/developers/add/), if you were unable to do this, please reply with the details of what you would like your plugin slug to be.
+Once your plugin is approved, _we cannot change it_. If the slug listed [on the submission page](https://wordpress.org/plugins/developers/add/) is incorrect, please tell us as soon as possible; if that's correct, you do not need to contact us.
+Your plugin slug / permalink is subject to change once a human review is completed.
+
+**Review Process**
+
+Our volunteer team of reviewers endeavours to perform all reviews in a timely manner, we are unable to provide an exact date of when your plugin will be reviewed.
+
+We encourage all plugin authors to use [Plugin Check](https://wordpress.org/plugins/plugin-check/) to ensure that most basic issues are resolved first.
+Please note: Automated tools may have false positives, or may miss issues. Plugin Check and other tools cannot guarantee our reviewers won’t find an issue that requires fixing or clarification.
+
+Please refer to the [Plugin Submission page](https://wordpress.org/plugins/developers/add/) for:
+
+* Up-to-date details of the currently review queue length and estimated times.
+* Upload a new version of the plugin: In case you wish to update the files of your plugin submission before we begin with the review.
+
+**Guidelines**
+
+All plugins are required to abide by our Plugin Guidelines. Please ensure you have read and understand these.
+https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/
+
+A common issue encountered by plugin authors is that we require your accounts email address to remain operational, not to have autoresponders, and not mark our emails as spam.
+To reduce the possibility of this affecting you, please ensure you add `plugins@wordpress.org` to your address book / contact list.
+If you use an email forwarder, alias, or group mailing list, please ensure that address is added to the Allow list.
+
+**Other Questions or Concerns?**
+
+Please refer to our Frequently Asked Questions list here:
+https://developer.wordpress.org/plugins/wordpress-org/plugin-developer-faq/
+
+If your question is not covered by this email, the submission page, or the above FAQ, please respond to this email with your question.
+
+**Additionally...**
+
+Please make sure to follow our official blog, for updates related to the team and review requirement changes:
+https://make.wordpress.org/plugins/
+
+Reviews are currently in English only. We apologize for the inconvenience.
+
+If you have no questions, concerns, or comments, please do not reply to this email.", 'wporg-plugins' );
+
+ $template = str_replace(
+ array_keys( $placeholders ),
+ array_values( $placeholders ),
+ $template
+ );
+
+ /*
+ * Localise the WordPress.org hostname, if we're on a non-wordpress.org host.
+ * This ensures that a submission from `de.wordpress.org/plugins` which results in a german translated message
+ * retains links to the german-facing pages.
+ *
+ * NOTE: {make,developer}.wordpress.org remains unchanged, as it is not localised.
+ *
+ * TODO: This may be better done by re-using a Rosetta-provided function.
+ */
+ if ( 'wordpress.org' !== $_SERVER['HTTP_HOST'] ) {
+ $template = str_replace( '://wordpress.org/', '://' . $_SERVER['HTTP_HOST'] . '/', $template );
+ }
+
+ return $template;
+ }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-plugin-submission.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span></div>
</body>
</html>