Making WordPress.org

Changeset 13845


Ignore:
Timestamp:
06/21/2024 02:16:30 AM (21 months ago)
Author:
dufresnesteven
Message:

Plugin-Directory: Update commercial/community plugin link location to match theme directory.

See: https://github.com/WordPress/wordpress.org/issues/333

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets
Files:
2 edited

Legend:

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

    r13766 r13845  
    3535            $title       = __( 'Commercial plugin', 'wporg-plugins' );
    3636            $url         = get_post_meta( $post->ID, 'external_support_url', true );
    37             $link_text   = __( 'Support', 'wporg-plugins' );
     37            $link_text   = __( 'View support', 'wporg-plugins' );
    3838            $description = __( 'This plugin is free but offers additional paid commercial upgrades or support.', 'wporg-plugins' );
    3939        }
     
    4242            $title       = __( 'Community plugin', 'wporg-plugins' );
    4343            $url         = get_post_meta( $post->ID, 'external_repository_url', true );
    44             $link_text   = __( 'Contribute', 'wporg-plugins' );
     44            $link_text   = __( 'Contribute to this plugin', 'wporg-plugins' );
    4545            $description = __( 'This plugin is developed and supported by a community.', 'wporg-plugins' );
    4646        }
     
    5555            <div class="widget-head">
    5656                <h2><?php echo esc_html( apply_filters( 'widget_title', $title, $instance, $this->id_base ) ); ?></h2>
    57 
     57            </div>
     58   
     59            <p><?php echo esc_html( $description ); ?>
    5860                <?php
    5961                // Always show URL if there is one, but also output the markup if on the advanced view tab
     
    6264                // URL from being shown.)
    6365                if ( $url || ( get_query_var( 'plugin_advanced' ) && current_user_can( 'plugin_admin_edit', $post ) ) ) {
    64                     printf( '<a href="%1$s" rel="nofollow">%2$s</a>', esc_url( $url ), esc_html( $link_text ) );
     66                    printf( '<a class="external-link" href="%1$s" rel="nofollow">%2$s</a>', esc_url( $url ), esc_html( $link_text ) );
    6567                }
    6668                ?>
    67             </div>
    68    
    69             <p><?php echo esc_html( $description ); ?></p>
     69            </p>
    7070        </div>
    7171        <?php
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-ratings.php

    r13617 r13845  
    3939        }
    4040
     41        var_dump($ratings);
     42
    4143        $num_ratings = array_sum( $ratings );
    4244
     
    4648        if ( $rating ) :
    4749        ?>
    48             <a class="reviews-link" href="<?php echo esc_url( 'https://wordpress.org/support/plugin/' . $post->post_name . '/reviews/' ); ?>"><?php _ex( 'See all', 'reviews', 'wporg-plugins' ); ?></a>
    49 
    5050            <div class="rating">
    5151                <?php echo Template::dashicons_stars( $rating ); ?>
     
    7777        <?php endif; // $rating ?>
    7878
    79         <?php if ( is_user_logged_in() ) : ?>
    80             <div class="user-rating">
    81                 <a href="<?php echo esc_url( 'https://wordpress.org/support/plugin/' . $post->post_name . '/reviews/#new-post' ); ?>"><?php _e( 'Add my review', 'wporg-plugins' ); ?></a>
    82             </div>
    83         <?php else: ?>
    84             <div class="user-rating">
    85                 <a href="<?php echo esc_url( wp_login_url( 'https://wordpress.org/support/plugin/' . get_post()->post_name . '/reviews/#new-post' ) ); ?>" rel="nofollow" title="<?php esc_attr_e( 'Log in to WordPress.org', 'wporg-plugins' ); ?>"><?php _e( 'Log in to submit a review.', 'wporg-plugins' ); ?></a>
    86             </div>
    8779        <?php
    88         endif;
     80
     81            $action_link_url = is_user_logged_in() ? esc_url( 'https://wordpress.org/support/plugin/' . $post->post_name . '/reviews/#new-post' ) : esc_url( wp_login_url( 'https://wordpress.org/support/plugin/' . get_post()->post_name . '/reviews/#new-post' ) );
     82            $action_link_url_text =  is_user_logged_in() ? __( 'Add my review', 'wporg-plugins' ) : __( 'Log in to review.', 'wporg-plugins' );
     83
     84            $see_all_link_url = esc_url( 'https://wordpress.org/support/plugin/' . $post->post_name . '/reviews/' );
     85            $see_all_link_text = __( 'See all<span class="screen-reader-text"> reviews</span>', 'reviews', 'wporg-plugins' );
     86
     87            $block_markup = <<<EOT
     88                <!-- wp:group {"style":{"spacing":{"margin":{"top":"var:preset|spacing|10"},"blockGap":"var:preset|spacing|10"}},"layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"space-between"}} -->
     89                    <div class="wp-block-group" style="margin-top:var(--wp--preset--spacing--10)">
     90                    <a href="$action_link_url">$action_link_url_text</a>
     91                    <a href="$see_all_link_url">$see_all_link_text</a>
     92                </div>
     93                <!-- /wp:group -->
     94            EOT;
     95
     96            echo do_blocks( $block_markup );
     97        ?>
     98
     99        <?php
    89100
    90101        echo $args['after_widget'];
Note: See TracChangeset for help on using the changeset viewer.