Import fails if no existing redirects present
-
First off, thanks for this plugin ??
I have found a small bug…
In the
save_bulk_redirects()
function, the current redirects are first fetched from the database (to then be added to) using:$current_redirects = get_option('301_redirects')
The subsequent import loop assumes that this is an array, however if this is not the case, i.e. it’s
false
(the option doesn’t exist), or an empty string, the import fails.This issue is guaranteed to occur if using the Clear 301 Redirect List (DO SO WITH CAUTION!) option prior to an import, as this sets the
301_redirects
option to an empty string in theclear_301_redirects()
function, so this should also be changed to set the option to an empty array instead, i.e:update_option('301_redirects', []);
Hope that helps ??
- The topic ‘Import fails if no existing redirects present’ is closed to new replies.