Changeset 1064127
- Timestamp:
- 01/09/2015 07:00:51 PM (11 years ago)
- Location:
- better-search-replace/trunk
- Files:
-
- 2 added
- 9 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) (3 diffs)
-
includes/class-better-search-replace-db.php (modified) (5 diffs)
-
includes/class-better-search-replace-i18n.php (modified) (3 diffs)
-
includes/class-better-search-replace.php (modified) (2 diffs)
-
languages/better-search-replace-es_ES.mo (added)
-
languages/better-search-replace-es_ES.po (added)
-
languages/better-search-replace.pot (modified) (1 diff)
-
templates/bsr-dashboard.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
better-search-replace/trunk/README.md
r1060924 r1064127 1 1 # Better Search Replace # 2 2 **Contributors:** ExpandedFronts 3 4 **Donate link:** http://expandedfronts.com5 3 6 4 **Tags:** search replace, update urls, database, search replace database, update database urls, update live url -
better-search-replace/trunk/README.txt
r1061413 r1064127 45 45 = Is my host supported? = 46 46 47 Yes , this plugin should be compatible with any host.47 Yes! This plugin should be compatible with any host. 48 48 49 49 = Can I damage my site with this plugin? = 50 50 51 51 Yes! 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 55 When 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. 52 56 53 57 == Screenshots == … … 58 62 == Changelog == 59 63 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 60 70 = 1.0 = 61 71 * Initial release -
better-search-replace/trunk/better-search-replace.php
r1060924 r1064127 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. 016 * Version: 1.0.1 17 17 * Author: Expanded Fronts 18 18 * Author URI: http://expandedfronts.com -
better-search-replace/trunk/includes/class-better-search-replace-admin.php
r1060924 r1064127 3 3 /** 4 4 * 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. 5 8 * 6 9 * @link http://expandedfronts.com/better-search-replace … … 9 12 * @package Better_Search_Replace 10 13 * @subpackage Better_Search_Replace/includes 14 * @author Expanded Fronts, LLC 11 15 */ 12 16 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_Replace20 * @subpackage Better_Search_Replace/admin21 * @author Expanded Fronts <support@expandedfronts.com>22 */23 17 class Better_Search_Replace_Admin { 24 18 … … 123 117 set_transient( 'bsr_results', $result, HOUR_IN_SECONDS ); 124 118 wp_redirect( get_admin_url() . 'tools.php?page=better-search-replace&result=true&dry_run=' . $dry_run ); 119 exit(); 125 120 } else { 126 121 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’ uh?', 'better-search-replace' ); 129 126 } 130 127 } -
better-search-replace/trunk/includes/class-better-search-replace-db.php
r1060924 r1064127 37 37 'updates' => 0, 38 38 'errors' => 0, 39 'start' => microtime( ),40 'end' => microtime( ),39 'start' => microtime( true ), 40 'end' => microtime( true ), 41 41 'search' => '', 42 42 'replace' => '', … … 54 54 public static function get_tables() { 55 55 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 57 63 return $tables; 58 64 } … … 85 91 86 92 // Return the results. 87 $this->report['end'] = microtime( );93 $this->report['end'] = microtime( true ); 88 94 return $this->report; 89 95 } … … 109 115 'change' => 0, 110 116 'updates' => 0, 111 'start' => microtime( ),112 'end' => microtime( ),117 'start' => microtime( true ), 118 'end' => microtime( true ), 113 119 'errors' => array() 114 120 ); … … 196 202 197 203 // Flush the results and return the report. 198 $table_report['end'] = microtime( );204 $table_report['end'] = microtime( true ); 199 205 $this->wpdb->flush(); 200 206 return $table_report; -
better-search-replace/trunk/includes/class-better-search-replace-i18n.php
r1060924 r1064127 1 1 <?php 2 3 /**4 * Define the internationalization functionality5 *6 * Loads and defines the internationalization files for this plugin7 * so that it is ready for translation.8 *9 * @link http://expandedfronts.com/better-search-replace10 * @since 1.0.011 *12 * @package Better_Search_Replace13 * @subpackage Better_Search_Replace/includes14 */15 2 16 3 /** … … 25 12 * @author Expanded Fronts <support@expandedfronts.com> 26 13 */ 14 27 15 class Better_Search_Replace_i18n { 28 16 … … 59 47 public function set_domain( $domain ) { 60 48 $this->domain = $domain; 49 $this->load_plugin_textdomain(); 61 50 } 62 51 -
better-search-replace/trunk/includes/class-better-search-replace.php
r1060924 r1064127 1 1 <?php 2 3 /**4 * The main plugin class, loads dependencies and sets up the plugin.5 * @since 1.06 *7 * @package Better_Search_Replace8 * @subpackage Better_Search_Replace/includes9 */10 2 11 3 /** … … 106 98 $plugin_i18n = new Better_Search_Replace_i18n(); 107 99 $plugin_i18n->set_domain( $this->get_plugin_name() ); 108 $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );109 100 } 110 101 -
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. 3 msgid "" 4 msgstr "" 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 16 msgid "" 17 "No search string was defined, please enter a URL or string to search for." 18 msgstr "" 19 20 #: includes/class-better-search-replace-admin.php:144 21 msgid "Please select the tables that you want to update." 22 msgstr "" 23 24 #: includes/class-better-search-replace-admin.php:153 25 msgid "" 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>" 31 msgstr "" 32 33 #: includes/class-better-search-replace-admin.php:160 34 msgid "" 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>" 39 msgstr "" 40 41 #. #-#-#-#-# plugin.pot (Better Search Replace 1.0.0) #-#-#-#-# 42 #. Plugin Name of the plugin/theme 43 #: templates/bsr-dashboard.php:17 44 msgid "Better Search Replace" 45 msgstr "" 46 47 #: templates/bsr-dashboard.php:19 48 msgid "" 49 "This tool allows you to search and replace text in your database (supports " 50 "serialized arrays and objects)." 51 msgstr "" 52 53 #: templates/bsr-dashboard.php:20 54 msgid "" 55 "To get started, use the form below to enter the text to be replaced and " 56 "select the tables to update." 57 msgstr "" 58 59 #: templates/bsr-dashboard.php:21 60 msgid "" 61 "<strong>WARNING:</strong> Make sure you backup your database before using " 62 "this plugin!" 63 msgstr "" 64 65 #: templates/bsr-dashboard.php:28 66 msgid "Search for" 67 msgstr "" 68 69 #: templates/bsr-dashboard.php:33 70 msgid "Replace with" 71 msgstr "" 72 73 #: templates/bsr-dashboard.php:38 74 msgid "Select tables" 75 msgstr "" 76 77 #: templates/bsr-dashboard.php:41 78 msgid "" 79 "Select multiple tables with Ctrl-Click for Windows or Cmd-Click for Mac." 80 msgstr "" 81 82 #: templates/bsr-dashboard.php:46 83 msgid "" 84 "Replace GUIDs<a href=\"http://codex.wordpress.org/" 85 "Changing_The_Site_URL#Important_GUID_Note\" target=\"_blank\">?</a>" 86 msgstr "" 87 88 #: templates/bsr-dashboard.php:49 89 msgid "If left unchecked, all database columns titled 'guid' will be skipped." 90 msgstr "" 91 92 #: templates/bsr-dashboard.php:54 93 msgid "Run as dry run?" 94 msgstr "" 95 96 #: templates/bsr-dashboard.php:57 97 msgid "" 98 "If checked, no changes will be made to the database, allowing you to check " 99 "the results beforehand." 100 msgstr "" 101 102 #. Plugin URI of the plugin/theme 103 msgid "http://expandedfronts.com/better-search-replace" 104 msgstr "" 105 106 #. Description of the plugin/theme 107 msgid "A small plugin for running a search/replace on your WordPress database." 108 msgstr "" 109 110 #. Author of the plugin/theme 111 msgid "Expanded Fronts" 112 msgstr "" 113 114 #. Author URI of the plugin/theme 115 msgid "http://expandedfronts.com" 116 msgstr "" -
better-search-replace/trunk/templates/bsr-dashboard.php
r1060924 r1064127 54 54 <td><label><strong><?php _e( 'Run as dry run?', 'better-search-replace' ); ?></strong></label></td> 55 55 <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 /> 57 57 <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> 58 58 </td>
Note: See TracChangeset
for help on using the changeset viewer.