Plugin Directory

Changeset 1064127


Ignore:
Timestamp:
01/09/2015 07:00:51 PM (11 years ago)
Author:
ExpandedFronts
Message:

Updated to v1.0.1, see readme for further details

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

Legend:

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

    r1060924 r1064127  
    11# Better Search Replace #
    22**Contributors:** ExpandedFronts
    3  
    4 **Donate link:** http://expandedfronts.com
    53 
    64**Tags:** search replace, update urls, database, search replace database, update database urls, update live url
  • better-search-replace/trunk/README.txt

    r1061413 r1064127  
    4545= Is my host supported? =
    4646
    47 Yes, this plugin should be compatible with any host.
     47Yes! This plugin should be compatible with any host.
    4848
    4949= Can I damage my site with this plugin? =
    5050
    5151Yes! Entering a wrong search or replace string could damage your database. Because of this, it is always adviseable to have a backup of your database before using this plugin.
     52
     53= How does this work on WordPress Multisite? =
     54
     55When running this plugin on a WordPress Multisite installation, it will only be loaded and visible for Network admins. Network admins can go to the dashboard of any subsite to run a search/replace on just the tables for that subsite, or go to the dashboard of the main/base site to run a search/replace on all tables.
    5256
    5357== Screenshots ==
     
    5862== Changelog ==
    5963
     64= 1.0.1 =
     65* Fixed issue with loading translations and added Spanish translation (props Eduardo Larequi)
     66* Fixed bug with reporting timing
     67* Updated to use "Dry Run" as default
     68* Added support for WordPress Multisite (see FAQs for more info)
     69
    6070= 1.0 =
    6171* Initial release
  • better-search-replace/trunk/better-search-replace.php

    r1060924 r1064127  
    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.0
     16 * Version:           1.0.1
    1717 * Author:            Expanded Fronts
    1818 * Author URI:        http://expandedfronts.com
  • better-search-replace/trunk/includes/class-better-search-replace-admin.php

    r1060924 r1064127  
    33/**
    44 * The dashboard-specific functionality of the plugin.
     5 *
     6 * Registers styles and scripts, adds the custom administration page,
     7 * and processes user input on the "search/replace" form.
    58 *
    69 * @link       http://expandedfronts.com/better-search-replace
     
    912 * @package    Better_Search_Replace
    1013 * @subpackage Better_Search_Replace/includes
     14 * @author     Expanded Fronts, LLC
    1115 */
    1216
    13 /**
    14  * The dashboard-specific functionality of this plugin.
    15  *
    16  * Registers styles and scripts, adds the custom administration page,
    17  * and processes user input on the "search/replace" form.
    18  *
    19  * @package    Better_Search_Replace
    20  * @subpackage Better_Search_Replace/admin
    21  * @author     Expanded Fronts <support@expandedfronts.com>
    22  */
    2317class Better_Search_Replace_Admin {
    2418
     
    123117                set_transient( 'bsr_results', $result, HOUR_IN_SECONDS );
    124118                wp_redirect( get_admin_url() . 'tools.php?page=better-search-replace&result=true&dry_run=' . $dry_run );
     119                exit();
    125120            } else {
    126121                wp_redirect( get_admin_url() . 'tools.php?page=better-search-replace&error=no_tables' );
    127             }
    128             exit();
     122                exit();
     123            }
     124        } else {
     125            wp_die( 'Cheatin&#8217; uh?', 'better-search-replace' );
    129126        }
    130127    }
  • better-search-replace/trunk/includes/class-better-search-replace-db.php

    r1060924 r1064127  
    3737            'updates'       => 0,
    3838            'errors'        => 0,
    39             'start'         => microtime(),
    40             'end'           => microtime(),
     39            'start'         => microtime( true ),
     40            'end'           => microtime( true ),
    4141            'search'        => '',
    4242            'replace'       => '',
     
    5454    public static function get_tables() {
    5555        global $wpdb;
    56         $tables = $wpdb->get_col( 'SHOW TABLES' );
     56       
     57        if ( is_multisite() ) {
     58            $tables = $wpdb->get_col( "SHOW TABLES LIKE '" . $wpdb->prefix . "%'" );
     59        } else {
     60            $tables = $wpdb->get_col( 'SHOW TABLES' );
     61        }
     62       
    5763        return $tables;
    5864    }
     
    8591
    8692            // Return the results.
    87             $this->report['end'] = microtime();
     93            $this->report['end'] = microtime( true );
    8894            return $this->report;
    8995        }
     
    109115            'change'    => 0,
    110116            'updates'   => 0,
    111             'start'     => microtime(),
    112             'end'       => microtime(),
     117            'start'     => microtime( true ),
     118            'end'       => microtime( true ),
    113119            'errors'    => array()
    114120        );
     
    196202       
    197203        // Flush the results and return the report.
    198         $table_report['end'] = microtime();
     204        $table_report['end'] = microtime( true );
    199205        $this->wpdb->flush();
    200206        return $table_report;
  • better-search-replace/trunk/includes/class-better-search-replace-i18n.php

    r1060924 r1064127  
    11<?php
    2 
    3 /**
    4  * Define the internationalization functionality
    5  *
    6  * Loads and defines the internationalization files for this plugin
    7  * so that it is ready for translation.
    8  *
    9  * @link       http://expandedfronts.com/better-search-replace
    10  * @since      1.0.0
    11  *
    12  * @package    Better_Search_Replace
    13  * @subpackage Better_Search_Replace/includes
    14  */
    152
    163/**
     
    2512 * @author     Expanded Fronts <support@expandedfronts.com>
    2613 */
     14
    2715class Better_Search_Replace_i18n {
    2816
     
    5947    public function set_domain( $domain ) {
    6048        $this->domain = $domain;
     49        $this->load_plugin_textdomain();
    6150    }
    6251
  • better-search-replace/trunk/includes/class-better-search-replace.php

    r1060924 r1064127  
    11<?php
    2 
    3 /**
    4  * The main plugin class, loads dependencies and sets up the plugin.
    5  * @since      1.0
    6  *
    7  * @package    Better_Search_Replace
    8  * @subpackage Better_Search_Replace/includes
    9  */
    102
    113/**
     
    10698        $plugin_i18n = new Better_Search_Replace_i18n();
    10799        $plugin_i18n->set_domain( $this->get_plugin_name() );
    108         $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
    109100    }
    110101
  • better-search-replace/trunk/languages/better-search-replace.pot

    r1060924 r1064127  
     1# Copyright (C) 2015 Better Search Replace
     2# This file is distributed under the same license as the Better Search Replace package.
     3msgid ""
     4msgstr ""
     5"Project-Id-Version: Better Search Replace 1.0.0\n"
     6"Report-Msgid-Bugs-To: http://wordpress.org/tag/better-search-replace\n"
     7"POT-Creation-Date: 2015-01-08 01:07:11+00:00\n"
     8"MIME-Version: 1.0\n"
     9"Content-Type: text/plain; charset=UTF-8\n"
     10"Content-Transfer-Encoding: 8bit\n"
     11"PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
     12"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     13"Language-Team: LANGUAGE <LL@li.org>\n"
     14
     15#: includes/class-better-search-replace-admin.php:141
     16msgid ""
     17"No search string was defined, please enter a URL or string to search for."
     18msgstr ""
     19
     20#: includes/class-better-search-replace-admin.php:144
     21msgid "Please select the tables that you want to update."
     22msgstr ""
     23
     24#: includes/class-better-search-replace-admin.php:153
     25msgid ""
     26"<p><strong>DRY RUN:</strong> <strong>%d</strong> tables were searched, "
     27"<strong>%d</strong> cells were found that need to be updated, and <strong>"
     28"%d</strong> changes were made.</p><p><a href=\"%s\" class=\"thickbox\" title="
     29"\"Dry Run Details\">Click here</a> for more details, or click the submit "
     30"button below to run the search/replace.</p>"
     31msgstr ""
     32
     33#: includes/class-better-search-replace-admin.php:160
     34msgid ""
     35"<p>During the search/replace, <strong>%d</strong> tables were searched, with "
     36"<strong>%d</strong> cells changed in <strong>%d</strong> updates.</p><p><a "
     37"href=\"%s\" class=\"thickbox\" title=\"Search/Replace Details\">Click here</"
     38"a> for more details.</p>"
     39msgstr ""
     40
     41#. #-#-#-#-#  plugin.pot (Better Search Replace 1.0.0)  #-#-#-#-#
     42#. Plugin Name of the plugin/theme
     43#: templates/bsr-dashboard.php:17
     44msgid "Better Search Replace"
     45msgstr ""
     46
     47#: templates/bsr-dashboard.php:19
     48msgid ""
     49"This tool allows you to search and replace text in your database (supports "
     50"serialized arrays and objects)."
     51msgstr ""
     52
     53#: templates/bsr-dashboard.php:20
     54msgid ""
     55"To get started, use the form below to enter the text to be replaced and "
     56"select the tables to update."
     57msgstr ""
     58
     59#: templates/bsr-dashboard.php:21
     60msgid ""
     61"<strong>WARNING:</strong> Make sure you backup your database before using "
     62"this plugin!"
     63msgstr ""
     64
     65#: templates/bsr-dashboard.php:28
     66msgid "Search for"
     67msgstr ""
     68
     69#: templates/bsr-dashboard.php:33
     70msgid "Replace with"
     71msgstr ""
     72
     73#: templates/bsr-dashboard.php:38
     74msgid "Select tables"
     75msgstr ""
     76
     77#: templates/bsr-dashboard.php:41
     78msgid ""
     79"Select multiple tables with Ctrl-Click for Windows or Cmd-Click for Mac."
     80msgstr ""
     81
     82#: templates/bsr-dashboard.php:46
     83msgid ""
     84"Replace GUIDs<a href=\"http://codex.wordpress.org/"
     85"Changing_The_Site_URL#Important_GUID_Note\" target=\"_blank\">?</a>"
     86msgstr ""
     87
     88#: templates/bsr-dashboard.php:49
     89msgid "If left unchecked, all database columns titled 'guid' will be skipped."
     90msgstr ""
     91
     92#: templates/bsr-dashboard.php:54
     93msgid "Run as dry run?"
     94msgstr ""
     95
     96#: templates/bsr-dashboard.php:57
     97msgid ""
     98"If checked, no changes will be made to the database, allowing you to check "
     99"the results beforehand."
     100msgstr ""
     101
     102#. Plugin URI of the plugin/theme
     103msgid "http://expandedfronts.com/better-search-replace"
     104msgstr ""
     105
     106#. Description of the plugin/theme
     107msgid "A small plugin for running a search/replace on your WordPress database."
     108msgstr ""
     109
     110#. Author of the plugin/theme
     111msgid "Expanded Fronts"
     112msgstr ""
     113
     114#. Author URI of the plugin/theme
     115msgid "http://expandedfronts.com"
     116msgstr ""
  • better-search-replace/trunk/templates/bsr-dashboard.php

    r1060924 r1064127  
    5454                <td><label><strong><?php _e( 'Run as dry run?', 'better-search-replace' ); ?></strong></label></td>
    5555                <td>
    56                     <input id="dry_run" type="checkbox" name="dry_run" <?php Better_Search_Replace_Admin::prefill_value( 'dry_run', 'checkbox' ); ?> />
     56                    <input id="dry_run" type="checkbox" name="dry_run" checked />
    5757                    <label for="dry_run"><span class="description"><?php _e( 'If checked, no changes will be made to the database, allowing you to check the results beforehand.', 'better-search-replace' ); ?></span></label>
    5858                </td>
Note: See TracChangeset for help on using the changeset viewer.