https://github.com/woocommerce/woocommerce-admin/pull/2083 introduced traits and bumped the PHP requirements to PHP 5.4+.
There was some discussion in the above PR about bumping to WP 5.2 which would move PHP requirements to 5.6.20. So we have 3 options:
As we're going to merge this code into WC core for 3.7, I don't think we can require WP 5.2 (which is 5 days old at the moment). Also, WP 5.0's minimum requirements is PHP 5.2.4 (unless I'm mistaken). Which leaves us, unfortunately, with supporting PHP 5.2.4 at the moment, I think. Please let me know your thoughts.
An alternative for core would be to have WCA conditional on PHP 5.6 or higher. About 19% of WP installs are < 5.6 per https://wordpress.org/about/stats/. I'm not sure if there are better stats for WooCommerce.
Our tracker data is quite a bit more optimistic, it shows only 4% of users with PHP v < 5.6 (and only 0.5% < PHP 5.4), so we could make it load only for PHP 5.6 without losing many users.
And based on discussions with @timmyc it seems like WC admin will most likely depend on WP 5 as well, which is a stronger requirement, so requiring PHP 5.6 should not be a big deal.
it seems like WC admin will most likely depend on WP 5 as well, which is a stronger requirement, so requiring PHP 5.6 should not be a big deal.
Correct if 5.0 is not present, no wc-admin features will be functional in woo core - just like it is currently in the feature plugin.
We talked about it in the team meeting today.
Preliminary conclusion:
Therefore, according to my understanding, in this PR we need to add code to conditionally load the classes only if WP > 5 && PHP > 5.4.
As we're going to merge this code into WC core for 3.7
Since this is no longer the case, we should revisit this discussion. I'd be in favour of requiring WP 5.2.
Most helpful comment
We talked about it in the team meeting today.
Preliminary conclusion:
Therefore, according to my understanding, in this PR we need to add code to conditionally load the classes only if WP > 5 && PHP > 5.4.