Making WordPress.org

Ticket #5354: no-email-banned.diff

File no-email-banned.diff, 2.1 KB (added by Ipstenu, 4 years ago)

Don't email blocked users on plugin rejection.

  • trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php

     
    315315                        __(
    316316                                'Unfortunately your plugin submission for %1$s (%2$s), submitted on %3$s, has been rejected from the WordPress Plugin Directory.
    317317
    318 Plugins are rejected after six months when there has not been significant progress made on the review. If this is not the case for your plugin, you will receive a followup email explaining the reason for this decision within the next 24 hours.
     318Plugins are rejected after six months when there has not been significant progress made on the review. If this is not the case for your plugin, you will receive a followup email explaining the reason for this decision within the next 24 hours. Please wait for that email before requesting further details.
    319319
    320320If you believe this to be in error, please email %4$s with your plugin attached as a zip and explain why you feel your plugin should be accepted.
    321321
     
    332332                // Update last_updated to now.
    333333                update_post_meta( $post_id, 'last_updated', gmdate( 'Y-m-d H:i:s' ) );
    334334
    335                 // Log rejection.
    336                 Tools::audit_log( 'Plugin rejected.', $post_id );
     335                // If the user was banned, we don't want to email them, but we still need
     336                // to log this properly.
     337                $user = get_user_by( 'email', $email );
     338                if ( ! empty( $user->allcaps['bbp_blocked'] ) ) {
     339                        // Log rejection with note. DO NOT send email.
     340                        Tools::audit_log( 'Plugin rejected and submitter banned.', $post_id );
     341                } else {
     342                        // Log rejection.
     343                        Tools::audit_log( 'Plugin rejected.', $post_id );
    337344
    338                 // Send email.
    339                 wp_mail( $email, $subject, $content, 'From: plugins@wordpress.org' );
     345                        // Send email.
     346                        wp_mail( $email, $subject, $content, 'From: plugins@wordpress.org' );
     347                }
    340348        }
    341349
    342350        /**