Skip to content

Commit

Permalink
Fix +OK status (#3470)
Browse files Browse the repository at this point in the history
* Add a check for +OK status

Not sure where this comes from, but it appears in a very small number of sites. The sites are already upgraded, but somehow the database version is +OK, causing another upgrade to occur which fails.

* Build files
  • Loading branch information
johngodley authored Nov 12, 2022
1 parent 228538a commit 840ea3a
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 6 deletions.
4 changes: 4 additions & 0 deletions database/database-status.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ public function get_current_version() {
$settings = red_get_options();

if ( $settings['database'] !== '' && is_string( $settings['database'] ) ) {
if ( $settings['database'] === '+OK' ) {
return REDIRECTION_DB_VERSION;
}

return $settings['database'];
}

Expand Down
3 changes: 3 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ const SVN_SOURCE_FILES = [
'!psalm.xml',
'!redirection.js.LICENSE.txt',
'!tsconfig.json',
'!e2e-jest.js',
'!phpstan.neon',
'!jest-config.js'
];
const versionHeader = md5 => `<?php
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redirection",
"version": "5.3.5",
"version": "5.3.6",
"description": "Redirection is a WordPress plugin to manage 301 redirections and keep track of 404 errors without requiring knowledge of Apache .htaccess files.",
"main": "redirection.php",
"browser": {
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ The plugin works in a similar manner to how WordPress handles permalinks and sho

A x.1 version increase introduces new or updated features and can be considered to contain 'breaking' changes. A x.x.1 increase is purely a bug fix and introduces no new features, and can be considered as containing no breaking changes.

= 5.3.6 - 12th November 2022 =
* Fix for sites with a version of +OK

= 5.3.5 - 6th November 2022 =
* Fix crash on options page for Czech language

Expand Down
6 changes: 6 additions & 0 deletions redirection-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ public function redirection_head() {
$status = new Red_Database_Status();
$status->check_tables_exist();

// Fix some sites having a version set to +OK - not sure why
if ( isset( $options['database'] ) && $options['database'] === '+OK' ) {
red_set_options( [ 'database' => REDIRECTION_DB_VERSION ] );
$status->stop_update();
}

$translations = $this->get_i18n_data();

wp_localize_script( 'redirection', 'Redirectioni10n', array(
Expand Down
4 changes: 2 additions & 2 deletions redirection-version.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

define( 'REDIRECTION_VERSION', '5.3.5' );
define( 'REDIRECTION_BUILD', 'f0dac5b2b3267cd737c1a679e4c1fac3' );
define( 'REDIRECTION_VERSION', '5.3.6' );
define( 'REDIRECTION_BUILD', '852dc40b78f863aa321e5c393a7a4259' );
define( 'REDIRECTION_MIN_WP', '5.4' );
4 changes: 2 additions & 2 deletions redirection.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion redirection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Redirection
Plugin URI: https://redirection.me/
Description: Manage all your 301 redirects and monitor 404 errors
Version: 5.3.5
Version: 5.3.6
Author: John Godley
Text Domain: redirection
Domain Path: /locale
Expand Down

0 comments on commit 840ea3a

Please sign in to comment.