PluginProbe
bbPress / 2.6.17
bbPress v2.6.17
2.6.17 trunk 2.0 2.0-beta-1 2.0-beta-2b 2.0-beta-3 2.0-beta-3b 2.0-rc-2 2.0-rc-3 2.0-rc-4 2.0-rc-5 2.0.1 2.0.2 2.0.3 2.1 2.1-beta-1 2.1-rc1 2.1-rc2 2.1-rc3 2.1-rc4 2.1.1 2.1.2 2.1.3 2.2 2.2.1 All 72 releases
← All changes | includes/admin/tools/upgrade.php +55 -75 trunk2.6.17 View file →
@@ -1,8 +1,8 @@
1 1 <?php
2 2
3 3 /**
4 - * bbPress Admin Upgrade Functions.
4 + * bbPress Admin Upgrade Functions
5 5 *
6 6 * @package bbPress
7 7 * @subpackage Administration
8 8 */
@@ -10,11 +10,12 @@
10 10 // Exit if accessed directly
11 11 defined( 'ABSPATH' ) || exit;
12 12
13 13 /**
14 - * Admin repair page.
14 + * Admin repair page
15 15 *
16 16 * @since 2.6.0 bbPress (r6278)
17 + *
17 18 */
18 19 function bbp_admin_upgrade_page() {
19 20
20 21 // Get the registered upgrade tools
@@ -80,56 +81,42 @@
80 81 </label>
81 82 <input id="cb-select-all-1" type="checkbox">
82 83 </td>
83 84 <th scope="col" id="description" class="manage-column column-primary column-description sortable <?php echo ( 'priority' === $orderby ) ? esc_attr( $order ) : 'asc'; ?>">
84 - <a href="
85 - <?php
86 - echo esc_url(
87 - bbp_get_admin_repair_tool_page_url(
88 - array(
89 - 'orderby' => 'priority',
90 - 'order' => $new_order
91 - )
85 + <a href="<?php echo esc_url(
86 + bbp_get_admin_repair_tool_page_url(
87 + array(
88 + 'orderby' => 'priority',
89 + 'order' => $new_order
92 90 )
93 - );
94 - ?>">
95 - <span><?php esc_html_e( 'Description', 'bbpress' ); ?></span>
96 - <span class="sorting-indicator"></span>
91 + )
92 + );
93 + ?>"><span><?php esc_html_e( 'Description', 'bbpress' ); ?></span><span class="sorting-indicator"></span>
97 94 </a>
98 95 </th>
99 96 <th scope="col" id="version" class="manage-column column-version sortable <?php echo ( 'version' === $orderby ) ? esc_attr( $order ) : 'asc'; ?>">
100 - <a href="
101 - <?php
102 - echo esc_url(
103 - bbp_get_admin_repair_tool_page_url(
104 - array(
105 - 'orderby' => 'version',
106 - 'order' => $new_order
107 - )
97 + <a href="<?php echo esc_url(
98 + bbp_get_admin_repair_tool_page_url(
99 + array(
100 + 'orderby' => 'version',
101 + 'order' => $new_order
108 102 )
109 - );
110 - ?>">
111 - <span><?php esc_html_e( 'Version', 'bbpress' ); ?></span>
112 - <span class="sorting-indicator"></span>
103 + )
104 + );
105 + ?>"><span><?php esc_html_e( 'Version', 'bbpress' ); ?></span><span class="sorting-indicator"></span>
113 106 </a>
114 107 </th>
115 - <th scope="col" id="components" class="manage-column column-components">
116 - <?php esc_html_e( 'Components', 'bbpress' ); ?>
117 - </th>
108 + <th scope="col" id="components" class="manage-column column-components"><?php esc_html_e( 'Components', 'bbpress' ); ?></th>
118 109 <th scope="col" id="overhead" class="manage-column column-overhead sortable <?php echo ( 'overhead' === $orderby ) ? esc_attr( $order ) : 'asc'; ?>">
119 - <a href="
120 - <?php
121 - echo esc_url(
122 - bbp_get_admin_repair_tool_page_url(
123 - array(
124 - 'orderby' => 'overhead',
125 - 'order' => $new_order
126 - )
110 + <a href="<?php echo esc_url(
111 + bbp_get_admin_repair_tool_page_url(
112 + array(
113 + 'orderby' => 'overhead',
114 + 'order' => $new_order
127 115 )
128 - );
129 - ?>">
130 - <span><?php esc_html_e( 'Overhead', 'bbpress' ); ?></span>
131 - <span class="sorting-indicator"></span>
116 + )
117 + );
118 + ?>"><span><?php esc_html_e( 'Overhead', 'bbpress' ); ?></span><span class="sorting-indicator"></span>
132 119 </a>
133 120 </th>
134 121 </tr>
135 122 </thead>
@@ -149,24 +136,19 @@
149 136 <strong><?php echo esc_html( $item['title'] ); ?></strong><?php
150 137
151 138 // Optional description
152 139 if ( ! empty( $item['description'] ) ) :
153 - echo '<p class="description">' . esc_html( $item['description'] ) . '</p>';
140 + echo '<p class="description">' . esc_html( $item['description'] ) . '</p>';
154 141 endif;
155 142
156 143 ?><div class="row-actions hide-if-no-js">
157 144 <span class="run">
158 - <a href="<?php bbp_admin_repair_tool_run_url( $item ); ?>"
159 - id="<?php echo esc_attr( $item['id'] ); ?>"
160 - aria-label="<?php
161 - printf(
145 + <a href="<?php bbp_admin_repair_tool_run_url( $item ); ?>" aria-label="<?php printf(
162 146 /* translators: %s: Repair tool title */
163 147 esc_html__( 'Run %s', 'bbpress' ),
164 148 $item['title']
165 149 );
166 - ?>">
167 - <?php esc_html_e( 'Run', 'bbpress' ); ?>
168 - </a>
150 + ?>" id="<?php echo esc_attr( $item['id'] ); ?>" ><?php esc_html_e( 'Run', 'bbpress' ); ?></a>
169 151 </span>
170 152 </div>
171 153 <button type="button" class="toggle-row">
172 154 <span class="screen-reader-text"><?php esc_html_e( 'Show more details', 'bbpress' ); ?></span>
@@ -239,13 +221,13 @@
239 221 <?php
240 222 }
241 223
242 224 /**
243 - * Upgrade user engagements for bbPress 2.6 and higher.
225 + * Upgrade user engagements for bbPress 2.6 and higher
244 226 *
245 227 * @since 2.6.0 bbPress (r6320)
246 228 *
247 - * @return array An array of the status code and the message.
229 + * @return array An array of the status code and the message
248 230 */
249 231 function bbp_admin_upgrade_user_engagements() {
250 232
251 233 // Define variables
@@ -291,15 +273,15 @@
291 273 return array( 0, sprintf( $statement, $result ) );
292 274 }
293 275
294 276 /**
295 - * Upgrade group forum ID mappings after a bbPress 1.x to bbPress 2.x conversion.
277 + * Upgrade group forum ID mappings after a bbPress 1.x to bbPress 2.x conversion
296 278 *
297 - * Previously named: bbp_admin_repair_group_forum_relationships().
279 + * Previously named: bbp_admin_repair_group_forum_relationships()
298 280 *
299 281 * @since 2.6.0 bbPress (r4395)
300 282 *
301 - * @return If a wp_error() occurs and no converted forums are found.
283 + * @return If a wp_error() occurs and no converted forums are found
302 284 */
303 285 function bbp_admin_upgrade_group_forum_relationships() {
304 286
305 287 // Define variables
@@ -317,14 +299,14 @@
317 299
318 300 // Get the converted forum IDs
319 301 $forum_ids = $bbp_db->query(
320 302 "SELECT `forum`.`ID`, `forummeta`.`meta_value`
321 - FROM `{$bbp_db->posts}` AS `forum`
322 - LEFT JOIN `{$bbp_db->postmeta}` AS `forummeta`
323 - ON `forum`.`ID` = `forummeta`.`post_id`
324 - AND `forummeta`.`meta_key` = '_bbp_old_forum_id'
325 - WHERE `forum`.`post_type` = '" . bbp_get_forum_post_type() . "'
326 - GROUP BY `forum`.`ID`"
303 + FROM `{$bbp_db->posts}` AS `forum`
304 + LEFT JOIN `{$bbp_db->postmeta}` AS `forummeta`
305 + ON `forum`.`ID` = `forummeta`.`post_id`
306 + AND `forummeta`.`meta_key` = '_bbp_old_forum_id'
307 + WHERE `forum`.`post_type` = '" . bbp_get_forum_post_type() . "'
308 + GROUP BY `forum`.`ID`"
327 309 );
328 310
329 311 // Bail if forum IDs returned an error
330 312 if ( is_wp_error( $forum_ids ) || empty( $bbp_db->last_result ) ) {
@@ -432,25 +414,23 @@
432 414 remove_role( 'keymaster' );
433 415
434 416 // Complete results
435 417 $result = sprintf(
436 - /* translators: %1$s: Number of groups updated; %2$s: Number of forums updated; %3$s: Number of forum statuses synced */
418 + /* translators: 1: Number of groups, 2: Number of forums, 3: Number of forum statuses */
437 419 esc_html__( 'Complete! %1$s groups updated; %2$s forums updated; %3$s forum statuses synced.', 'bbpress' ),
438 420 bbp_number_format( $g_count ),
439 421 bbp_number_format( $f_count ),
440 422 bbp_number_format( $s_count )
441 423 );
442 -
443 - // Return
444 424 return array( 0, sprintf( $statement, $result ) );
445 425 }
446 426
447 427 /**
448 - * Upgrade user favorites for bbPress 2.6 and higher.
428 + * Upgrade user favorites for bbPress 2.6 and higher
449 429 *
450 430 * @since 2.6.0 bbPress (r6174)
451 431 *
452 - * @return array An array of the status code and the message.
432 + * @return array An array of the status code and the message
453 433 */
454 434 function bbp_admin_upgrade_user_favorites() {
455 435
456 436 // Define variables
@@ -506,13 +486,13 @@
506 486 return array( 0, sprintf( $statement, $result ) );
507 487 }
508 488
509 489 /**
510 - * Upgrade user topic subscriptions for bbPress 2.6 and higher.
490 + * Upgrade user topic subscriptions for bbPress 2.6 and higher
511 491 *
512 492 * @since 2.6.0 bbPress (r6174)
513 493 *
514 - * @return array An array of the status code and the message.
494 + * @return array An array of the status code and the message
515 495 */
516 496 function bbp_admin_upgrade_user_topic_subscriptions() {
517 497
518 498 // Define variables
@@ -568,13 +548,13 @@
568 548 return array( 0, sprintf( $statement, $result ) );
569 549 }
570 550
571 551 /**
572 - * Upgrade user forum subscriptions for bbPress 2.6 and higher.
552 + * Upgrade user forum subscriptions for bbPress 2.6 and higher
573 553 *
574 554 * @since 2.6.0 bbPress (r6193)
575 555 *
576 - * @return array An array of the status code and the message.
556 + * @return array An array of the status code and the message
577 557 */
578 558 function bbp_admin_upgrade_user_forum_subscriptions() {
579 559
580 560 // Define variables
@@ -630,13 +610,13 @@
630 610 return array( 0, sprintf( $statement, $result ) );
631 611 }
632 612
633 613 /**
634 - * Remove favorites data from user meta for bbPress 2.6 and higher.
614 + * Remove favorites data from user meta for bbPress 2.6 and higher
635 615 *
636 616 * @since 2.6.0 bbPress (r6281)
637 617 *
638 - * @return array An array of the status code and the message.
618 + * @return array An array of the status code and the message
639 619 */
640 620 function bbp_admin_upgrade_remove_favorites_from_usermeta() {
641 621
642 622 // Define variables
@@ -668,13 +648,13 @@
668 648 return array( 0, sprintf( $statement, $result ) );
669 649 }
670 650
671 651 /**
672 - * Remove topic subscriptions data from user meta for bbPress 2.6 and higher.
652 + * Remove topic subscriptions data from user meta for bbPress 2.6 and higher
673 653 *
674 654 * @since 2.6.0 bbPress (r6281)
675 655 *
676 - * @return array An array of the status code and the message.
656 + * @return array An array of the status code and the message
677 657 */
678 658 function bbp_admin_upgrade_remove_topic_subscriptions_from_usermeta() {
679 659
680 660 // Define variables
@@ -706,13 +686,13 @@
706 686 return array( 0, sprintf( $statement, $result ) );
707 687 }
708 688
709 689 /**
710 - * Remove topic subscriptions data from user meta for bbPress 2.6 and higher.
690 + * Remove topic subscriptions data from user meta for bbPress 2.6 and higher
711 691 *
712 692 * @since 2.6.0 bbPress (r6281)
713 693 *
714 - * @return array An array of the status code and the message.
694 + * @return array An array of the status code and the message
715 695 */
716 696 function bbp_admin_upgrade_remove_forum_subscriptions_from_usermeta() {
717 697
718 698 // Define variables