kanopi / wp-launch-checklist

Home of https://wordpress.org/plugins/launch-checklist/
GNU General Public License v2.0
4 stars 1 forks source link

Fix fatal error when attemting to save w/ nothing checked #10

Closed damonsharp closed 11 months ago

damonsharp commented 1 year ago

Description

As an admin user of the plugin I need to be able to save items without error.

_When trying to get a saved option of items checked the get_wp_launch_checklist_values() function would fail due to string return type. This bumps the required PHP version number to 8.0+ and uses a union return type._

Affected URL

N/A pull branch into a WP test site using the plugin

Related Tickets

Fix PHP Errors in the WP Launch Checklist Plugin

Steps to Validate

  1. Clone the plugin in /wp-content/plugins on an existing project, and checkout the branch. Don't activate it.
  2. Test with a PHP version lower than 8.0 and verify that attempting to activate the plugin fails.
  3. Switch to PHP v8+ and activate the plugin.
  4. Check some items in /wp-admin/admin.php?page=wp_launch_checklist, save, uncheck all of them and save.
  5. Verify this doesn't result in a fatal PHP error.

Deploy Notes

N/A.