FernleafSystems / Shield-Security-for-WordPress

Reflection of the Shield plugin on WordPress.org
https://getshieldsecurity.com
8 stars 4 forks source link

Undefined array key 1 in UpgradeReqLogsTable.php #44

Closed ghost closed 2 years ago

ghost commented 2 years ago

I get an update to version 14.1.1 and then I get a lot of: PHP Warning: Undefined array key 1 in wp-content/plugins/wp-simple-firewall/src/lib/src/Modules/Data/Lib/UpgradeReqLogsTable.php on line 76

paulgoodchild commented 2 years ago

This wont cause any lasting issues and you can ignore it - once the db table content has all been migrated, the warnings will stop. I'll update the code to ensure it doesn't throw out the warnings in future.

ghost commented 2 years ago

I know it isn't serious but I have got 52 entries in the log and the site isn't big. Thanks.

paulgoodchild commented 2 years ago

Are you still getting them?

ghost commented 2 years ago

I don't know how to retrigger the db update again but to avoid the warning is it enough to replace: $meta[ 'query' ] = $parts[ 1 ]; with: $meta[ 'query' ] = empty($parts[ 1 ]) ? '' : $parts[ 1 ]; here: https://github.com/FernleafSystems/Shield-Security-for-WordPress/blob/master/src/lib/src/Modules/Data/Lib/UpgradeReqLogsTable.php#L79

paulgoodchild commented 2 years ago

yep, we have the fix in there for the next release already. The db automatically upgrades itself if it's required so there's nothing you need to do. If you're not getting the error, it means the db table data is fully migrated.