10up / simple-page-ordering

Order your pages and other hierarchical post types with simple drag and drop right from the standard page list.
https://wordpress.org/plugins/simple-page-ordering/
GNU General Public License v2.0
143 stars 22 forks source link

Running PHP 5.6 the plugin fatals before the PHP requirements check runs #163

Closed peterwilsoncc closed 9 months ago

peterwilsoncc commented 9 months ago

Describe the bug

The plugin includes a requirements check to ensure the PHP version installed is above PHP 7.4

Due to the return type definition on the function for the minimum supported version of PHP the plugin throws a fatal error on older versions of PHP

https://github.com/10up/simple-page-ordering/blob/06f69f62b6d2ab7df98dd5508a113d44476fee2f/simple-page-ordering.php#L32-L45

I suggest:

Steps to Reproduce

  1. Activate the plugin running WP 6.2 and PHP 7.4
  2. Change the version of PHP to 5.6
  3. Reload the WP dashboard
  4. Observe the fatal error

Screenshots, screen recording, code snippet

[19-Sep-2023 00:28:36 UTC] PHP Parse error: syntax error, unexpected ':', expecting '{' in /vagrant/content/plugins/simple-page-ordering/simple-page-ordering.php on line 32 [19-Sep-2023 00:28:36 UTC] PHP Stack trace: [19-Sep-2023 00:28:36 UTC] PHP 1. {main}() /vagrant/wp-build/wp-admin/plugins.php:0 [19-Sep-2023 00:28:36 UTC] PHP 2. require_once() /vagrant/wp-build/wp-admin/plugins.php:10 [19-Sep-2023 00:28:36 UTC] PHP 3. require_once() /vagrant/wp-build/wp-admin/admin.php:34 [19-Sep-2023 00:28:36 UTC] PHP 4. require_once() /vagrant/wp-build/wp-load.php:55 [19-Sep-2023 00:28:36 UTC] PHP 5. require_once() /vagrant/wp-config.php:146

Environment information

No response

WordPress information

WordPress 6.2 PHP 5.6

Code of Conduct