Changeset 2908825
- Timestamp:
- 05/06/2023 09:24:20 AM (3 years ago)
- Location:
- database-collation-fix
- Files:
-
- 5 added
- 2 edited
-
tags/1.2.8 (added)
-
tags/1.2.8/README.md (added)
-
tags/1.2.8/databasecollationfix.php (added)
-
tags/1.2.8/prepend.php (added)
-
tags/1.2.8/readme.txt (added)
-
trunk/databasecollationfix.php (modified) (12 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
database-collation-fix/trunk/databasecollationfix.php
r2903073 r2908825 4 4 Plugin URL: https://serverpress.com/plugins/databasecollationfix 5 5 Description: Convert tables using utf8mb4_unicode_520_ci or utf8_unicode_520_ci collation to standard collation on a cron interval, plus on DesktopServer Create, Copy, Move, Import and Export operations. 6 Version: 1.2. 86 Version: 1.2.9 7 7 Author: Dave Jesch 8 8 Author URI: http://serverpress.com 9 9 Network: True 10 Text Domain: d bcollationfix10 Text Domain: database-collation-fix 11 11 Domain path: /language 12 12 License: GNU General Public License, version 2 http://www.gnu.org/license/gpl-20.0.html … … 17 17 private static $_instance = NULL; 18 18 19 const VERSION = '1.2. 8';19 const VERSION = '1.2.9'; 20 20 const CRON_NAME = 'ds_database_collation_fix'; 21 21 const TRIGGER_FILE = 'trigger.txt'; … … 135 135 echo '<div style="width:100%; margin-top:15px">'; 136 136 if ($force) { 137 echo '<p>', sprintf(__('Forcing Collation Algorithm to: <b>%s</b>.', 'd bcollationfix'),137 echo '<p>', sprintf(__('Forcing Collation Algorithm to: <b>%s</b>.', 'database-collation-fix'), 138 138 $force_algorithm), '</p>'; 139 139 } 140 140 } 141 141 142 $this->_report(sprintf(__('Changing database Collation Algorithm to: %s', 'd bcollationfix'),142 $this->_report(sprintf(__('Changing database Collation Algorithm to: %s', 'database-collation-fix'), 143 143 ($force ? $force_algorithm : $this->_collation))); 144 144 $sql = 'ALTER DATABASE `' . DB_NAME . '` COLLATE=' . ($force ? $force_algorithm : $this->_collation); … … 159 159 $indexes = array(); 160 160 161 $this->_report(sprintf(__('Checking table "%s"...', 'd bcollationfix'), $table));161 $this->_report(sprintf(__('Checking table "%s"...', 'database-collation-fix'), $table)); 162 162 // check how the table was created 163 163 $sql = "SHOW CREATE TABLE `{$table}`"; … … 220 220 $this->_log(__METHOD__.'() checking collation: ' . $collation_term); 221 221 $new_coll = $force ? $force_algorithm : $this->_collation; 222 $this->_report(sprintf(__('- found "%1$s" and ALTERing to "%2$s"...', 'd bcollationfix'),222 $this->_report(sprintf(__('- found "%1$s" and ALTERing to "%2$s"...', 'database-collation-fix'), 223 223 $old_coll, $new_coll)); 224 224 ++$table_count; … … 231 231 } 232 232 if (!$mod) { 233 $this->_report(__('- no ALTERations required.', 'd bcollationfix'));233 $this->_report(__('- no ALTERations required.', 'database-collation-fix')); 234 234 } 235 235 … … 255 255 $default = !empty($rpw['Default']) ? "DEFAULT '{$row['Default']}" : ''; 256 256 257 $this->_report(sprintf(__('- found column `%1$s` with collation of "%2$s" and ALTERing to "%3$s".', 'd bcollationfix'),257 $this->_report(sprintf(__('- found column `%1$s` with collation of "%2$s" and ALTERing to "%3$s".', 'database-collation-fix'), 258 258 $row['Field'], $row['Collation'], $this->_collation)); 259 259 // $row['Collation'] = $this->_collation; … … 279 279 } 280 280 281 $this->_report(sprintf(__('Altered %1$d tables, %2$d columns and %3$d indexes.', 'd bcollationfix'),281 $this->_report(sprintf(__('Altered %1$d tables, %2$d columns and %3$d indexes.', 'database-collation-fix'), 282 282 $table_count, $column_count, $index_count)); 283 283 if ($report) … … 317 317 public function admin_menu() 318 318 { 319 add_management_page(__('Collation Fix', 'd bcollationfix'),// page title320 __('Collation Fix', 'd bcollationfix'),// menu title319 add_management_page(__('Collation Fix', 'database-collation-fix'), // page title 320 __('Collation Fix', 'database-collation-fix'), // menu title 321 321 'manage_options', // capability 322 322 'ds-db-collation', // menu_slug … … 339 339 340 340 echo '<div class="wrap">'; 341 echo '<h2>', sprintf(__('ServerPress Database Collation Fix%1$s tool', 'd bcollationfix'), ' v' . self::VERSION), '</h2>';342 echo '<p>', __('This tool is used to convert your site\'s database tables from using the ...unicode_520_ci Collation Algorithms to use a slightly older, but more compatible utf8mb4_unicode_ci Collation Algorithm.', 'd bcollationfix'), '</p>';343 echo '<p>', __('The tool will automatically run every 24 hours and change any newly created database table. Or, you can use the button below to perform the database alterations on demand.', 'd bcollationfix'), '</p>';341 echo '<h2>', sprintf(__('ServerPress Database Collation Fix%1$s tool', 'database-collation-fix'), ' v' . self::VERSION), '</h2>'; 342 echo '<p>', __('This tool is used to convert your site\'s database tables from using the ...unicode_520_ci Collation Algorithms to use a slightly older, but more compatible utf8mb4_unicode_ci Collation Algorithm.', 'database-collation-fix'), '</p>'; 343 echo '<p>', __('The tool will automatically run every 24 hours and change any newly created database table. Or, you can use the button below to perform the database alterations on demand.', 'database-collation-fix'), '</p>'; 344 344 345 345 echo '<form action="', esc_url(add_query_arg()), '" method="post">'; … … 348 348 echo '<input type="hidden" name="force-collation" value="0" />'; 349 349 echo '<input type="checkbox" name="force-collation" value="1" />'; 350 echo ' ', __('Force Collation Algorithm to: ', 'd bcollationfix');350 echo ' ', __('Force Collation Algorithm to: ', 'database-collation-fix'); 351 351 352 352 echo '<select name="force-collation-algorithm">'; … … 358 358 echo '</p>'; 359 359 360 echo '<input type="submit" name="collation-fix" class="button-primary" value="', __('Fix Database Collation', 'd bcollationfix'), '" />';360 echo '<input type="submit" name="collation-fix" class="button-primary" value="', __('Fix Database Collation', 'database-collation-fix'), '" />'; 361 361 echo '</form>'; 362 362 -
database-collation-fix/trunk/readme.txt
r2903073 r2908825 14 14 == Description == 15 15 16 Since version 4.2, WordPress has been detecting the MySQL version and if it's version 5.5.3 or greater, 17 automatically selecting the 'utf8mb4_unicode_520_ci' Collation Algorithm. This works well until you need 18 to migrate your database to an older version of MySQL that does not support the utf8mb4 algorithms. Then, 19 you run into the error message: "#1273 - Unknown collation: 'utf8mb4_unicode_520_ci'" when importing your database. 16 Since version 4.2, WordPress has been detecting the MySQL version and if it's version 5.5.3 or greater, automatically selecting the 'utf8mb4_unicode_520_ci' Collation Algorithm. This works well until you need to migrate your database to an older version of MySQL that does not support the utf8mb4 algorithms. Then, you run into the error message: "#1273 - Unknown collation: 'utf8mb4_unicode_520_ci'" when importing your database. 20 17 21 With the WordPress 5.7 update and WooCommerce 5.1, some users are reporting an error: "SQLSTATE[HY000]: General 22 error: 1267 Illegal mix of collations (utf8mb4_unicode_520_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT)". The 23 Database Collation Fix tool also fixes this issue by changing the collation of all columns in your database to 24 use the same algorithm, removing the "mix" of collations. 18 With the WordPress 5.7 update and WooCommerce 5.1, some users are reporting an error: "SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (utf8mb4_unicode_520_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT)". The Database Collation Fix tool also fixes this issue by changing the collation of all columns in your database to use the same algorithm, removing the "mix" of collations. 25 19 26 20 <strong>Usage Scenarios:</strong> … … 68 62 = Is this safe? = 69 63 70 Yes. The Database Collation Fix tool does not change any data. It only changes the Collation 71 Algorithm that specified for your database columns and indexes. 64 Yes. The Database Collation Fix tool does not change any data. It only changes the Collation Algorithm that specified for your database columns and indexes. 72 65 73 66 = Do I need to backup my data before using this? = 74 67 75 Yes. Always backup your site before making database changes. The Database Collation Fix tool 76 is unlikely to cause any problems but there is still a small chance that something else (like 77 the version of MySQL/MariaDB that you're using) can have a compatibility issue. 68 Yes. Always backup your site before making database changes. The Database Collation Fix tool is unlikely to cause any problems but there is still a small chance that something else (like the version of MySQL/MariaDB that you're using) can have a compatibility issue. 78 69 79 70 = Once my tables are fixed, do I still need to use this tool? = 80 71 81 No. The Database Collation Fix tool changes the database. It only needs to do this once. However, 82 future versions of WordPress or one or more of your plugins can also make database changes. These 83 future changes may require updates to keep your Collation Algorithms updated. If you leave the 84 Database Collation Fix tool active, it will scan your database once per day and look for any tables 85 that need to be adjusted, fixing them automatically. 72 No. The Database Collation Fix tool changes the database. It only needs to do this once. However, future versions of WordPress or one or more of your plugins can also make database changes. These future changes may require updates to keep your Collation Algorithms updated. If you leave the Database Collation Fix tool active, it will scan your database once per day and look for any tables that need to be adjusted, fixing them automatically. 86 73 87 74 == Screenshots == … … 90 77 91 78 == Changelog == 79 = 1.2.9 - May 6, 2023 = 80 Update text domain to match plugin slug. 81 92 82 = 1.2.8 - Apr 24, 2023 = 93 83 Fix CSRF vulnerability.
Note: See TracChangeset
for help on using the changeset viewer.