Making WordPress.org

Changeset 14553


Ignore:
Timestamp:
10/14/2025 02:26:22 AM (4 months ago)
Author:
dd32
Message:

Plugin Directory: Make it clearer (and double-confirm) that a user wants to subscribe to plugin commit emails.

See #7505.
Fixes #7882.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-developers.php

    r6287 r14553  
    8989        $output .= '<h3>' . __( 'Interested in development?', 'wporg-plugins' ) . '</h3>';
    9090
     91        $output .= '<p>' . sprintf(
     92            /* translators: 1: Trac URL, 2: SVN repository URL, 3: development log URL, 4: RSS URL */
     93            __( '<a href="%1$s">Browse the code</a>, check out the <a href="%2$s">SVN repository</a>, or subscribe to the <a href="%3$s">development log</a> by <a href="%4$s">RSS</a>.', 'wporg-plugins' ),
     94            esc_url( "https://plugins.trac.wordpress.org/browser/{$slug}/" ),
     95            esc_url( "https://plugins.svn.wordpress.org/{$slug}/" ),
     96            esc_url( "https://plugins.trac.wordpress.org/log/{$slug}/" ),
     97            esc_url( "https://plugins.trac.wordpress.org/log/{$slug}/?limit=100&mode=stop_on_copy&format=rss" )
     98        ) . '</p>';
     99
    91100        if ( is_user_logged_in() ) {
    92101            $subscribed = Tools::subscribed_to_plugin_commits( $post, get_current_user_id() );
     
    96105            ), home_url( "wp-json/plugins/v1/plugin/{$slug}/commit-subscription" ) ) );
    97106
    98             $output .= '<p>' . sprintf(
    99                 /* translators: 1: Trac URL, 2: SVN repository URL, 3: development log URL, 4: email subscription URL, 5: RSS URL */
    100                 __( '<a href="%1$s">Browse the code</a>, check out the <a href="%2$s">SVN repository</a>, or subscribe to the <a href="%3$s">development log</a> by <a href="%4$s">email</a> or <a href="%5$s">RSS</a>.', 'wporg-plugins' ),
    101                 esc_url( "https://plugins.trac.wordpress.org/browser/{$slug}/" ),
    102                 esc_url( "https://plugins.svn.wordpress.org/{$slug}/" ),
    103                 esc_url( "https://plugins.trac.wordpress.org/log/{$slug}/" ),
    104                 $email_url,
    105                 esc_url( "https://plugins.trac.wordpress.org/log/{$slug}/?limit=100&mode=stop_on_copy&format=rss" )
    106             ) . '</p>';
    107         } else {
    108             $output .= '<p>' . sprintf(
    109                 /* translators: 1: Trac URL, 2: SVN repository URL, 3: development log URL, 4: RSS URL */
    110                 __( '<a href="%1$s">Browse the code</a>, check out the <a href="%2$s">SVN repository</a>, or subscribe to the <a href="%3$s">development log</a> by <a href="%4$s">RSS</a>.', 'wporg-plugins' ),
    111                 esc_url( "https://plugins.trac.wordpress.org/browser/{$slug}/" ),
    112                 esc_url( "https://plugins.svn.wordpress.org/{$slug}/" ),
    113                 esc_url( "https://plugins.trac.wordpress.org/log/{$slug}/" ),
    114                 esc_url( "https://plugins.trac.wordpress.org/log/{$slug}/?limit=100&mode=stop_on_copy&format=rss" )
    115             ) . '</p>';
     107            if ( $subscribed ) {
     108                $output .= '<div class="notice notice-info notice-alt"><p>' . sprintf(
     109                    /* translators: 1: email subscription URL */
     110                    __( 'You are currently receiving emails for each plugin commit <a href="%1$s">unsubscribe by clicking here</a>.', 'wporg-plugins' ),
     111                    $email_url
     112                ) . '</p></div>';
     113            } else {
     114                $output .= '<p>' . sprintf(
     115                    /* translators: 1: email subscription URL, 2: Confirm of subscribe-by-email */
     116                    __( 'You can also subscribe to emails for each plugin commit by <a href="%1$s" onclick="confirm(%2$s)">clicking here</a>.', 'wporg-plugins' ),
     117                    $email_url,
     118                    esc_attr( wp_json_encode( sprintf(
     119                        __( 'Are you sure you want to subscribe to email notifications for each commit to %s?', 'wporg-plugins' ),
     120                        $title
     121                    ) ) )
     122                ) . '</p>';
     123            }
    116124        }
     125
    117126        $output .= '</div>';
    118127
Note: See TracChangeset for help on using the changeset viewer.