Skip to content

Commit

Permalink
Merge pull request #182 from buddypress/core-code-review
Browse files Browse the repository at this point in the history
Core code review
  • Loading branch information
paulgibbs committed Jun 21, 2017
2 parents 3a58503 + 7779605 commit a641207
Show file tree
Hide file tree
Showing 91 changed files with 467 additions and 485 deletions.
10 changes: 5 additions & 5 deletions bp-templates/bp-nouveau/buddypress-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class BP_Nouveau extends BP_Theme_Compat {
public static function get_instance() {

// If the single instance hasn't been set, set it now.
if ( null == self::$instance ) {
if ( null === self::$instance ) {
self::$instance = new self;
}

Expand Down Expand Up @@ -638,7 +638,7 @@ public function setup_directory_nav() {
* warnings inside the Browser console to avoid
* messing with the page display.
*
* @since 1.0.0
* @since 1.0.0
*
* @return string HTML Output
*/
Expand Down Expand Up @@ -684,7 +684,7 @@ public function neutralize_core_template_notices(){
/**
* Set the BP Uri for the customizer in case of Ajax requests.
*
* @since 1.0.0
* @since 1.0.0
*
* @param string $path the BP Uri.
* @return string the BP Uri.
Expand Down Expand Up @@ -712,7 +712,7 @@ public function customizer_set_uri( $path ) {
/**
* Loads the translation files
*
* @since 1.0.0
* @since 1.0.0
*/
public function load_textdomain() {
// Traditional WordPress plugin locale filter
Expand All @@ -735,7 +735,7 @@ public function load_textdomain() {
/**
* Get a unique instance of BP Nouveau
*
* @since 1.0.0
* @since 1.0.0
*
* @return BP_Nouveau the main instance of the class
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
?>
<nav class="bp-navs bp-subnavs group-subnav bp-invites-nav" id="subnav" role="navigation" aria-label="<?php esc_attr_e( 'Group invitations menu', 'buddypress' ); ?>"></nav>

<h2 class="bp-screen-title <?php if(bp_is_group_create()) echo 'creation-step-name'; ?>">
<h2 class="bp-screen-title <?php if ( bp_is_group_create() ) { echo esc_attr( 'creation-step-name' ); } ?>">
<?php _e( 'Invite Members', 'bp-nouveau' ); ?>
</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<div class="bp-search messages-search">
<form action="" method="get" id="user_messages_search_form" class="bp-messages-search-form" data-bp-search="messages">
<label for="user_messages_search" class="bp-screen-reader-text">
<?php _e('Search Messages', 'bp-nouveau'); ?>
<?php _e( 'Search Messages', 'bp-nouveau' ); ?>
</label>
<input type="search" id="user_messages_search" placeholder="<?php esc_attr_e( __( 'Search', 'bp-nouveau' ) ); ?>"/>
<button type="submit" id="user_messages_search_submit">
Expand Down Expand Up @@ -123,7 +123,7 @@
</div>
<div class="thread-from">
<a class="user-link" href="{{data.sender_link}}">
<img class="avatar" src="{{data.sender_avatar}}" alt="{{data.sender_name}}<?php esc_attr_e(' profile picture', 'bp-nouveau'); ?>" />
<img class="avatar" src="{{data.sender_avatar}}" alt="{{data.sender_name}}<?php esc_attr_e( ' profile picture', 'bp-nouveau' ); ?>" />
<span class="user-name">{{data.sender_name}}</span>
</a>
</div>
Expand Down Expand Up @@ -152,7 +152,7 @@
<dd>
<ul class="participants-list">
<# for ( i in data.recipients ) { #>
<li><a href="{{data.recipients[i].user_link}}" class="bp-tooltip" data-bp-tooltip="{{data.recipients[i].user_name}}"><img class="avatar mini" src="{{data.recipients[i].avatar}}" alt="{{data.recipients[i].user_name}}<?php esc_attr_e(' profile picture', 'bp-nouveau'); ?>" /></a></li>
<li><a href="{{data.recipients[i].user_link}}" class="bp-tooltip" data-bp-tooltip="{{data.recipients[i].user_name}}"><img class="avatar mini" src="{{data.recipients[i].avatar}}" alt="{{data.recipients[i].user_name}}<?php esc_attr_e( ' profile picture', 'bp-nouveau' ); ?>" /></a></li>
<# } #>
</ul>
</dd>
Expand Down Expand Up @@ -201,7 +201,7 @@
<dd>
<ul class="participants-list">
<# for ( i in data.recipients ) { #>
<li><a href="{{data.recipients[i].user_link}}" class="bp-tooltip" data-bp-tooltip="{{data.recipients[i].user_name}}"><img class="avatar mini" src="{{data.recipients[i].avatar}}" alt="{{data.recipients[i].user_name}}<?php esc_attr_e(' profile picture', 'bp-nouveau'); ?>" /></a></li>
<li><a href="{{data.recipients[i].user_link}}" class="bp-tooltip" data-bp-tooltip="{{data.recipients[i].user_name}}"><img class="avatar mini" src="{{data.recipients[i].avatar}}" alt="{{data.recipients[i].user_name}}<?php esc_attr_e( ' profile picture', 'bp-nouveau' ); ?>" /></a></li>
<# } #>
</ul>
</dd>
Expand All @@ -224,7 +224,7 @@
<?php bp_nouveau_messages_hook( 'before', 'meta' ); ?>

<a href="{{data.sender_link}}" class="user-link">
<img class="avatar" src="{{data.sender_avatar}}" alt="{{data.sender_name}}<?php esc_attr_e(' profile picture', 'bp-nouveau'); ?>" />
<img class="avatar" src="{{data.sender_avatar}}" alt="{{data.sender_name}}<?php esc_attr_e( ' profile picture', 'bp-nouveau' ); ?>" />
<strong>{{data.sender_name}}</strong>
</a>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<?php else : ?>

<li id="activity-stream-message" class="bp-messages info">
<?php bp_nouveau_user_feedback( 'activity-loop-none' ) ;?>
<?php bp_nouveau_user_feedback( 'activity-loop-none' ); ?>
</li>

<?php endif; ?>
Expand Down
4 changes: 2 additions & 2 deletions bp-templates/bp-nouveau/buddypress/activity/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

<div class="acomment-meta">

<?php bp_nouveau_activity_comment_action() ;?>
<?php bp_nouveau_activity_comment_action(); ?>

</div>

<div class="acomment-content"><?php bp_activity_comment_content(); ?></div>

<?php bp_nouveau_activity_comment_buttons( array('container' => 'div') );?>
<?php bp_nouveau_activity_comment_buttons( array( 'container' => 'div' ) );?>

<?php bp_nouveau_activity_recurse_comments( bp_activity_current_comment() ); ?>
</li>
2 changes: 1 addition & 1 deletion bp-templates/bp-nouveau/buddypress/activity/entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<a href="<?php bp_activity_user_link(); ?>">

<?php bp_activity_avatar( array('type' => 'full') ); ?>
<?php bp_activity_avatar( array( 'type' => 'full' ) ); ?>

</a>

Expand Down
6 changes: 3 additions & 3 deletions bp-templates/bp-nouveau/buddypress/activity/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@

<div class="screen-content">

<?php bp_get_template_part( 'common/search-&-filters-bar' ); ?>
<?php bp_get_template_part( 'common/search-and-filters-bar' ); ?>

<?php bp_nouveau_activity_hook( 'before_directory', 'list' ); ?>

<div class="activity">

<ul id="activity-stream" class="activity-list item-list bp-list" data-bp-list="activity">

<li id="bp-ajax-loader"><?php bp_nouveau_user_feedback( 'directory-activity-loading' ) ;?></li>
<li id="bp-ajax-loader"><?php bp_nouveau_user_feedback( 'directory-activity-loading' ); ?></li>

</ul>

</div><!-- .activity -->

<?php bp_nouveau_after_activity_directory_content() ;?>
<?php bp_nouveau_after_activity_directory_content(); ?>
</div><!-- // .screen-content -->

4 changes: 2 additions & 2 deletions bp-templates/bp-nouveau/buddypress/activity/post-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Template tag to prepare the activity post form
* checks capability and enqueue needed scripts.
*/
bp_nouveau_before_activity_post_form() ;?>
bp_nouveau_before_activity_post_form(); ?>

<div id="bp-nouveau-activity-form" class="activity-update-form"></div>

Expand All @@ -22,4 +22,4 @@
* Template tag to load the Javascript
* templates of the Post form UI
*/
bp_nouveau_after_activity_post_form() ;?>
bp_nouveau_after_activity_post_form(); ?>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<ul id="activity-stream" class="activity-list item-list bp-list" data-bp-list="activity">

<li id="bp-ajax-loader"><?php bp_nouveau_user_feedback( 'single-activity-loading' ) ;?></li>
<li id="bp-ajax-loader"><?php bp_nouveau_user_feedback( 'single-activity-loading' ); ?></li>

</ul>

Expand Down
4 changes: 2 additions & 2 deletions bp-templates/bp-nouveau/buddypress/activity/widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</a>
</cite>

<?php echo bp_insert_activity_meta() ;?>
<?php echo bp_insert_activity_meta(); ?>

</footer>

Expand All @@ -51,7 +51,7 @@
<?php else : ?>

<div class="widget-error">
<?php bp_nouveau_user_feedback( 'activity-loop-none' ) ;?>
<?php bp_nouveau_user_feedback( 'activity-loop-none' ); ?>
</div>

<?php endif; ?>
4 changes: 2 additions & 2 deletions bp-templates/bp-nouveau/buddypress/assets/embeds/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<div class="wp-embed-meta">
<?php
/** This action is documented in wp-includes/theme-compat/embed-content.php */
do_action( 'embed_content_meta'); ?>
do_action( 'embed_content_meta' ); ?>
</div>
</div>
</div>
8 changes: 4 additions & 4 deletions bp-templates/bp-nouveau/buddypress/blogs/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
?>

<?php bp_nouveau_before_blogs_directory_content() ;?>
<?php bp_nouveau_before_blogs_directory_content(); ?>

<?php if ( ! bp_nouveau_is_object_nav_in_sidebar() ) : ?>

Expand All @@ -18,12 +18,12 @@

<div class="screen-content">

<?php bp_get_template_part( 'common/search-&-filters-bar' ); ?>
<?php bp_get_template_part( 'common/search-and-filters-bar' ); ?>

<div id="blogs-dir-list" class="blogs dir-list" data-bp-list="blogs">
<div id="bp-ajax-loader"><?php bp_nouveau_user_feedback( 'directory-blogs-loading' ) ;?></div>
<div id="bp-ajax-loader"><?php bp_nouveau_user_feedback( 'directory-blogs-loading' ); ?></div>
</div><!-- #blogs-dir-list -->

<?php bp_nouveau_after_blogs_directory_content() ;?>
<?php bp_nouveau_after_blogs_directory_content(); ?>
</div><!-- // .screen-content -->

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<span ><?php bp_nouveau_filter_label(); ?></span>
</label>
<div class="select-wrap">
<select id="<?php bp_nouveau_filter_id(); ?>" data-bp-filter="<?php bp_nouveau_filter_component(); ?>">
<select id="<?php bp_nouveau_filter_id(); ?>" data-bp-filter="<?php bp_nouveau_filter_component(); ?>">

<?php bp_nouveau_filter_options(); ?>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<span ><?php bp_nouveau_filter_label(); ?></span>
</label>
<div class="select-wrap">
<select id="<?php bp_nouveau_filter_id(); ?>" data-bp-filter="<?php bp_nouveau_filter_component(); ?>">
<select id="<?php bp_nouveau_filter_id(); ?>" data-bp-filter="<?php bp_nouveau_filter_component(); ?>">

<?php bp_nouveau_filter_options(); ?>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<?php if ( bp_nouveau_has_dismiss_button() ) : ?>

<button type="button" class="bp-tooltip" data-bp-tooltip="<?php esc_attr_e( 'Close', 'bp-nouveau'); ?>" aria-label="<?php esc_attr_e( 'Close this notice', 'bp-nouveau'); ?>" data-bp-close="<?php bp_nouveau_dismiss_button_type(); ?>"><span class="dashicons dashicons-dismiss" aria-hidden="true"></span></button>
<button type="button" class="bp-tooltip" data-bp-tooltip="<?php esc_attr_e( 'Close', 'bp-nouveau' ); ?>" aria-label="<?php esc_attr_e( 'Close this notice', 'bp-nouveau' ); ?>" data-bp-close="<?php bp_nouveau_dismiss_button_type(); ?>"><span class="dashicons dashicons-dismiss" aria-hidden="true"></span></button>

<?php endif ; ?>
</aside>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<?php if ( 'friends' !== bp_current_component() ) : ?>
<div class="subnav-search clearfix">

<?php if ( 'activity' == bp_current_component() ) :?>
<?php if ( 'activity' === bp_current_component() ) :?>
<div class="feed"><a href="<?php bp_sitewide_activity_feed_link(); ?>" class="bp-tooltip" data-bp-tooltip="<?php esc_attr_e( 'RSS Feed', 'bp-nouveau' ); ?>"><span class="bp-screen-reader-text"><?php _e( 'RSS', 'bp-nouveau' ); ?></span></a></div>
<?php endif; ?>

Expand All @@ -21,9 +21,9 @@
</div>
<?php endif; ?>

<?php if ( bp_is_user() && ! bp_is_current_action( 'requests') ) : ?>
<?php bp_get_template_part('common/filters/user-screens-filters'); ?>
<?php elseif ( 'groups' == bp_current_component() ) : ?>
<?php if ( bp_is_user() && ! bp_is_current_action( 'requests' ) ) : ?>
<?php bp_get_template_part( 'common/filters/user-screens-filters' ); ?>
<?php elseif ( 'groups' === bp_current_component() ) : ?>
<?php bp_get_template_part( 'common/filters/groups-screens-filters' ); ?>
<?php else : ?>
<?php bp_get_template_part( 'common/filters/directory-filters' ); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
?>

<div class="<?php bp_nouveau_search_container_class(); ?> bp-search">
<form action="" method="get" class="bp-dir-search-form" id="<?php bp_nouveau_search_selector_id( 'search-form' ) ;?>" role="search" data-bp-search="groups">
<form action="" method="get" class="bp-dir-search-form" id="<?php bp_nouveau_search_selector_id( 'search-form' ); ?>" role="search" data-bp-search="groups">

<label for="<?php bp_nouveau_search_selector_id( 'search' ) ;?>" class="bp-screen-reader-text"><?php bp_nouveau_search_default_text( '', false ); ?></label>
<label for="<?php bp_nouveau_search_selector_id( 'search' ); ?>" class="bp-screen-reader-text"><?php bp_nouveau_search_default_text( '', false ); ?></label>

<input id="<?php bp_nouveau_search_selector_id( 'search' ); ?>" name="<?php bp_nouveau_search_selector_name() ;?>" type="search" placeholder="<?php bp_nouveau_search_default_text(); ?>" />
<input id="<?php bp_nouveau_search_selector_id( 'search' ); ?>" name="<?php bp_nouveau_search_selector_name(); ?>" type="search" placeholder="<?php bp_nouveau_search_default_text(); ?>" />

<button type="submit" id="<?php bp_nouveau_search_selector_id( 'search-submit' ) ;?>" class="nouveau-search-submit" name="<?php bp_nouveau_search_selector_name( 'search_submit' ); ?>">
<button type="submit" id="<?php bp_nouveau_search_selector_id( 'search-submit' ); ?>" class="nouveau-search-submit" name="<?php bp_nouveau_search_selector_name( 'search_submit' ); ?>">
<span class="dashicons dashicons-search" aria-hidden="true"></span>
<span id="button-text" class="bp-screen-reader-text"><?php _e( 'Search', 'bp-nouveau' ); ?></span>
</button>
Expand Down
2 changes: 1 addition & 1 deletion bp-templates/bp-nouveau/buddypress/groups/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

bp_nouveau_groups_create_hook( 'before', 'page' ); ?>

<h2 class="bp-subhead"><?php _e('Create A New Group','bp-nouveau'); ?></h2>
<h2 class="bp-subhead"><?php _e( 'Create A New Group','bp-nouveau' ); ?></h2>

<?php bp_nouveau_groups_create_hook( 'before', 'content_template' ); ?>

Expand Down
6 changes: 3 additions & 3 deletions bp-templates/bp-nouveau/buddypress/groups/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* BP Nouveau - Groups Directory
*
* @since 1.0.0
* @since 1.0.0
*
* @package BP Nouveau
*/
Expand All @@ -20,10 +20,10 @@

<div class="screen-content">

<?php bp_get_template_part( 'common/search-&-filters-bar' ); ?>
<?php bp_get_template_part( 'common/search-and-filters-bar' ); ?>

<div id="groups-dir-list" class="groups dir-list" data-bp-list="groups">
<div id="bp-ajax-loader"><?php bp_nouveau_user_feedback( 'directory-groups-loading' ) ;?></div>
<div id="bp-ajax-loader"><?php bp_nouveau_user_feedback( 'directory-groups-loading' ); ?></div>
</div><!-- #groups-dir-list -->

<?php bp_nouveau_after_groups_directory_content(); ?>
Expand Down
6 changes: 3 additions & 3 deletions bp-templates/bp-nouveau/buddypress/groups/single/activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* BuddyPress - Groups Activity
*
* @since 1.0.0
* @since 1.0.0
*
* @package BP Nouveau
*/
Expand All @@ -20,7 +20,7 @@
<li class="group-act-search"><?php bp_nouveau_search_form(); ?></li>
</ul>

<?php bp_get_template_part('common/filters/groups-screens-filters'); ?>
<?php bp_get_template_part( 'common/filters/groups-screens-filters' ); ?>
</div><!-- // .subnav-filters -->


Expand All @@ -30,7 +30,7 @@

<ul id="activity-stream" class="activity-list item-list bp-list" data-bp-list="activity">

<li id="bp-activity-ajax-loader"><?php bp_nouveau_user_feedback( 'group-activity-loading' ) ;?></li>
<li id="bp-activity-ajax-loader"><?php bp_nouveau_user_feedback( 'group-activity-loading' ); ?></li>

</ul>

Expand Down
4 changes: 2 additions & 2 deletions bp-templates/bp-nouveau/buddypress/groups/single/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* BuddyPress - Groups Admin
*
* @since 1.0.0
* @since 1.0.0
*
* @package BP Nouveau
*/
Expand All @@ -11,7 +11,7 @@

<form action="<?php bp_group_admin_form_action(); ?>" name="group-settings-form" id="group-settings-form" class="standard-form" method="post" enctype="multipart/form-data">

<?php bp_nouveau_group_manage_screen() ;?>
<?php bp_nouveau_group_manage_screen(); ?>

</form><!-- #group-settings-form -->

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
<?php bp_nouveau_user_feedback( 'group-delete-warning' ); ?>

<label for="delete-group-understand" class="bp-label-text warn">
<input type="checkbox" name="delete-group-understand" id="delete-group-understand" value="1" onclick="if(this.checked) { document.getElementById('delete-group-button').disabled = ''; } else { document.getElementById('delete-group-button').disabled = 'disabled'; }" />
<input type="checkbox" name="delete-group-understand" id="delete-group-understand" value="1" onclick="if(this.checked) { document.getElementById( 'delete-group-button' ).disabled = ''; } else { document.getElementById( 'delete-group-button' ).disabled = 'disabled'; }" />
<?php _e( 'I understand the consequences of deleting this group.', 'bp-nouveau' ); ?>
</label>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @package BP Nouveau
*/
?>
<h2 class="bp-screen-title <?php if(bp_is_group_create()) echo 'creation-step-name'; ?>">
<h2 class="bp-screen-title <?php if ( bp_is_group_create() ) { echo esc_attr( 'creation-step-name' ); } ?>">
<?php _e( 'Edit your groups name &amp; description', 'bp-nouveau' ); ?>
</h2>

Expand Down
Loading

0 comments on commit a641207

Please sign in to comment.