Changeset 1174582
- Timestamp:
- 06/04/2015 05:04:32 PM (11 years ago)
- Location:
- better-search-replace/trunk
- Files:
-
- 2 added
- 5 edited
-
README.md (modified) (1 diff)
-
README.txt (modified) (2 diffs)
-
better-search-replace.php (modified) (1 diff)
-
includes/class-better-search-replace-admin.php (modified) (1 diff)
-
includes/class-better-search-replace-db.php (modified) (1 diff)
-
languages/better-search-replace-fr_FR.mo (added)
-
languages/better-search-replace-fr_FR.po (added)
Legend:
- Unmodified
- Added
- Removed
-
better-search-replace/trunk/README.md
r1152926 r1174582 46 46 ## Changelog ## 47 47 48 ### 1.0.6 ### 49 * Added table sizes to the database table listing 50 * Added French translation (props @Jean Philippe) 51 48 52 ### 1.0.5 ### 49 53 * Added support for case-insensitive searches -
better-search-replace/trunk/README.txt
r1152926 r1174582 25 25 26 26 * English 27 * French 28 * German 27 29 * Spanish 28 * German29 30 30 31 **Want to contribute?** … … 89 90 == Changelog == 90 91 92 = 1.0.6 = 93 * Added table sizes to the database table listing 94 * Added French translation (props @Jean Philippe) 95 91 96 = 1.0.5 = 92 97 * Added support for case-insensitive searches -
better-search-replace/trunk/better-search-replace.php
r1152926 r1174582 14 14 * Plugin URI: http://expandedfronts.com/better-search-replace 15 15 * Description: A small plugin for running a search/replace on your WordPress database. 16 * Version: 1.0. 516 * Version: 1.0.6 17 17 * Author: Expanded Fronts 18 18 * Author URI: http://expandedfronts.com -
better-search-replace/trunk/includes/class-better-search-replace-admin.php
r1152926 r1174582 191 191 */ 192 192 public static function load_tables() { 193 194 // Get the tables and their sizes. 193 195 $tables = Better_Search_Replace_DB::get_tables(); 196 $sizes = Better_Search_Replace_DB::get_sizes(); 194 197 195 198 echo '<select id="select_tables" name="select_tables[]" multiple="multiple" style="width:25em;">'; 199 196 200 foreach ( $tables as $table ) { 201 202 // Try to get the size for this specific table. 203 $table_size = isset( $sizes[$table] ) ? $sizes[$table] : ''; 204 197 205 if ( isset( $_GET['result'] ) && get_transient( 'bsr_results' ) ) { 206 198 207 $result = get_transient( 'bsr_results' ); 208 199 209 if ( isset( $result['table_reports'][$table] ) ) { 200 echo "<option value='$table' selected>$table </option>";210 echo "<option value='$table' selected>$table $table_size</option>"; 201 211 } else { 202 echo "<option value='$table'>$table </option>";212 echo "<option value='$table'>$table $table_size</option>"; 203 213 } 214 204 215 } else { 205 echo "<option value='$table'>$table</option>"; 206 } 207 } 216 echo "<option value='$table'>$table $table_size</option>"; 217 } 218 219 } 220 208 221 echo '</select>'; 209 222 } -
better-search-replace/trunk/includes/class-better-search-replace-db.php
r1152926 r1174582 68 68 69 69 /** 70 * Returns an array containing the size of each database table. 71 * @access public 72 * @return array 73 */ 74 public static function get_sizes() { 75 global $wpdb; 76 77 $sizes = array(); 78 $tables = $wpdb->get_results( 'SHOW TABLE STATUS', ARRAY_A ); 79 80 if ( is_array( $tables ) && ! empty( $tables ) ) { 81 82 foreach ( $tables as $table ) { 83 $size = round( $table['Data_length'] / 1024 / 1024, 2 ); 84 $sizes[$table['Name']] = sprintf( __( '(%s MB)', 'better-search-replace' ), $size ); 85 } 86 87 } 88 89 return $sizes; 90 } 91 92 /** 70 93 * Runs the search replace. 71 94 * @access public
Note: See TracChangeset
for help on using the changeset viewer.