Plugin Directory

Changeset 1174582


Ignore:
Timestamp:
06/04/2015 05:04:32 PM (11 years ago)
Author:
ExpandedFronts
Message:

Updated to v1.0.6 (see readme for further details)

Location:
better-search-replace/trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • better-search-replace/trunk/README.md

    r1152926 r1174582  
    4646## Changelog ##
    4747
     48### 1.0.6 ###
     49* Added table sizes to the database table listing
     50* Added French translation (props @Jean Philippe)
     51
    4852### 1.0.5 ###
    4953* Added support for case-insensitive searches
  • better-search-replace/trunk/README.txt

    r1152926 r1174582  
    2525
    2626* English
     27* French
     28* German
    2729* Spanish
    28 * German
    2930
    3031**Want to contribute?**
     
    8990== Changelog ==
    9091
     92= 1.0.6 =
     93* Added table sizes to the database table listing
     94* Added French translation (props @Jean Philippe)
     95
    9196= 1.0.5 =
    9297* Added support for case-insensitive searches
  • better-search-replace/trunk/better-search-replace.php

    r1152926 r1174582  
    1414 * Plugin URI:        http://expandedfronts.com/better-search-replace
    1515 * Description:       A small plugin for running a search/replace on your WordPress database.
    16  * Version:           1.0.5
     16 * Version:           1.0.6
    1717 * Author:            Expanded Fronts
    1818 * Author URI:        http://expandedfronts.com
  • better-search-replace/trunk/includes/class-better-search-replace-admin.php

    r1152926 r1174582  
    191191     */
    192192    public static function load_tables() {
     193       
     194        // Get the tables and their sizes.
    193195        $tables = Better_Search_Replace_DB::get_tables();
     196        $sizes  = Better_Search_Replace_DB::get_sizes();
    194197
    195198        echo '<select id="select_tables" name="select_tables[]" multiple="multiple" style="width:25em;">';
     199       
    196200        foreach ( $tables as $table ) {
     201
     202            // Try to get the size for this specific table.
     203            $table_size = isset( $sizes[$table] ) ? $sizes[$table] : '';
     204
    197205            if ( isset( $_GET['result'] ) && get_transient( 'bsr_results' ) ) {
     206               
    198207                $result = get_transient( 'bsr_results' );
     208               
    199209                if ( isset( $result['table_reports'][$table] ) ) {
    200                     echo "<option value='$table' selected>$table</option>";
     210                    echo "<option value='$table' selected>$table $table_size</option>";
    201211                } else {
    202                     echo "<option value='$table'>$table</option>";
     212                    echo "<option value='$table'>$table $table_size</option>";
    203213                }
     214
    204215            } else {
    205                 echo "<option value='$table'>$table</option>";
    206             }
    207         }
     216                echo "<option value='$table'>$table $table_size</option>";
     217            }
     218           
     219        }
     220       
    208221        echo '</select>';
    209222    }
  • better-search-replace/trunk/includes/class-better-search-replace-db.php

    r1152926 r1174582  
    6868
    6969    /**
     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    /**
    7093     * Runs the search replace.
    7194     * @access public
Note: See TracChangeset for help on using the changeset viewer.