{"id":14137188,"date":"2021-03-05T05:35:50","date_gmt":"2021-03-05T05:35:50","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/error-on-php-8-0\/"},"modified":"2021-03-05T05:35:50","modified_gmt":"2021-03-05T05:35:50","slug":"error-on-php-8-0","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/error-on-php-8-0\/","title":{"rendered":"Error on PHP 8.0"},"content":{"rendered":"<p>WP-FFPC 1.11.2 does not work with PHP 8.0.<\/p>\n<p>How to fix as follow:<\/p>\n<p>wp-ffpc-class.php<br \/>\n1016-1018 lines<\/p>\n<p>[Before fixed]<\/p>\n<pre><code>\n\tpublic function plugin_options_migrate( &amp;$options ) {\n\n\t\tif ( version_compare ( $options[&#039;version&#039;], $this-&gt;plugin_version, &#039;&lt;&#039; )  ) {\n<\/code><\/pre>\n<p>[After fixed]<\/p>\n<pre><code>\n\tpublic function plugin_options_migrate( &amp;$options ) {\n\t\tif($options === false) $options = array(&#039;version&#039; =&gt; &#039;0.0&#039;);\n\t\tif ( version_compare ( $options[&#039;version&#039;], $this-&gt;plugin_version, &#039;&lt;&#039; )  ) {\n<\/code><\/pre>\n<p>This is caused by the<\/p>\n<p>wp-ffpc-abstract.php<br \/>\nFrom line 514<br \/>\n\tpublic static function _get_option ( $optionID, $network = false ) {<\/p>\n<p>In _get_options( $optionID, $network = false ), the return value $options has several patterns such as false (bool value), array, etc. When installing for the first time, the WP-FFPC setting does not exist in the database used by WordPress, so the value of $options becomes false (bool value).<\/p>\n<p>Then the following $options[&#8216;version\u2019] (public function plugin_options_migrate in wp-ffpc-class.php)<br \/>\n) will not exist ($options = false), and the first argument of version_compare will be false. However, since version_compare expects a string as an argument, a type mismatch will occur, and as of PHP 8.0, it is an error to do so.<\/p>\n<p>Please fix the issue.<\/p>\n","protected":false},"template":"","class_list":["post-14137188","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14137188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14137188\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=14137188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}