warfare-plugins / social-warfare

This is a public repository for the Social Warfare WordPress plugin created primarily for the purpose of publishing and maintaining a public list of bugs, known issues, and feature requests with the community at large.
35 stars 27 forks source link

Compatibility to WP older than 6.2 broken resulting in fatal PHP error on update #941

Closed DanWin closed 1 month ago

DanWin commented 2 months ago

cabf16c806f002425257d643cf8b6e886f8a9a2e introduced a change that requires WordPress 6.2 or higher. It breaks compatibility to older WP versions. There should be either a backward compatible solution, or the minimum version for WP should be increased, to prevent breaking existing installations trying to update to the latest plugin version. On a 5.8 WP this will result in the following error: PHP Fatal error: Uncaught Error: Class 'WpOrg\Requests\Requests' not found in /var/www/httpdocs/wp-content/plugins/social-warfare/lib/utilities/SWP_Requests.php:57

andbalashov commented 1 month ago

Hi @DanWin,

Thank you for bringing this to our attention. The issue with compatibility for WordPress versions older than 6.2, which caused the fatal error related to WpOrg\Requests\Requests, has been resolved.

We’ve added a backward compatibility fix that checks if the Requests class exists before using it, and provided a fallback to wp_remote_get() for older WordPress versions.

This fix will be included in the upcoming 4.5.5 release. Please let us know if you encounter any further issues!

Best,
Andrii