{"id":17995193,"date":"2024-09-04T18:42:11","date_gmt":"2024-09-04T18:42:11","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/php-error-spacious-theme\/"},"modified":"2024-09-04T18:42:11","modified_gmt":"2024-09-04T18:42:11","slug":"php-error-spacious-theme","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/php-error-spacious-theme\/","title":{"rendered":"PHP error Spacious theme"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>Hello,<br \/><br \/>I have a problem with the theme and I get in hosting error log file the following errors<br \/><br \/>&#091;04-Sep-2024 17:35:17 UTC] PHP Deprecated:  Invalid characters passed for attempted conversion, these have been ignored in \/home\/tradesof\/public_html\/wp-content\/themes\/spacious\/inc\/functions.php on line 350<br \/><br \/>&#091;04-Sep-2024 17:35:17 UTC] PHP Deprecated:  Func\u021bia spacious_options este considerat\u0103 &lt;strong&gt;\u00eenvechit\u0103&lt;\/strong&gt; \u00eencep\u00e2nd cu versiunea 2.5.0. Folose\u0219te \u00een locul ei get_theme_mod. in \/home\/tradesof\/public_html\/wp-includes\/functions.php on line 6085<br \/><br \/>&#091;04-Sep-2024 17:35:17 UTC] PHP Deprecated:  Func\u021bia spacious_options este considerat\u0103 <br \/><br \/>&#091;04-Sep-2024 18:10:41 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at \/home\/tradesof\/public_html\/wp-cron.php:30) in \/home\/tradesof\/public_html\/wp-content\/plugins\/wp-yandex-metrika\/includes\/class.ya-metrika-woocommerce.php on line 87<br \/><br \/>and on and on the same error messages<br \/><br \/><br \/><strong>I tried to fix the error code with CHAT GPT, it worked, the website was loading fast and ok but it created problem to my contact 7 pop up form which was not working any more to send customers data.<\/strong><br \/><br \/><strong>ORIGINAL code on line 320:<\/strong><br \/>php<br \/>Copy code<br \/>$int = hexdec( str_replace( '#', '', $hexstr ) );<br \/><br \/><strong>MODIFIED CODE with ChatGPT<\/strong><br \/>php<br \/>Copy code<br \/>$hexstr = preg_replace('\/&#091;^0-9a-fA-F]\/', '', $hexstr);<br \/><br \/>if (strlen($hexstr) == 3) {<br \/>    $hexstr = $hexstr&#091;0] . $hexstr&#091;0] . $hexstr&#091;1] . $hexstr&#091;1] . $hexstr&#091;2] . $hexstr&#091;2];<br \/>} elseif (strlen($hexstr) != 6) {<br \/>    $hexstr = '000000'; \/\/ Po\u021bi ajusta valoarea implicit\u0103 dac\u0103 este necesar<br \/>}<br \/><br \/>$int = hexdec($hexstr);<br \/><br \/><br \/><strong>ORIGINAL CODE ON LINE 350:<\/strong><br \/>php<br \/>Copy code<br \/>$hex = str_replace( '#', '', $hex );<br \/>if ( strlen( $hex ) == 3 ) {<br \/>    $hex = str_repeat( substr( $hex, 0, 1 ), 2 ) . str_repeat( substr( $hex, 1, 1 ), 2 ) . str_repeat( substr( $hex, 2, 1 ), 2 );<br \/>}<br \/><br \/><strong>MODIFIED CODE with ChatGPT<\/strong><br \/>php<br \/>Copy code<br \/>$hex = str_replace( '#', '', $hex );<br \/><br \/>$hex = preg_replace('\/&#091;^0-9a-fA-F]\/', '', $hex);<br \/><br \/>if ( strlen( $hex ) == 3 ) {<br \/>    $hex = str_repeat( substr( $hex, 0, 1 ), 2 ) . str_repeat( substr( $hex, 1, 1 ), 2 ) . str_repeat( substr( $hex, 2, 1 ), 2 );<br \/>} elseif (strlen($hex) != 6) {<br \/>    $hex = '000000'; \/\/ Po\u021bi ajusta valoarea implicit\u0103 dac\u0103 este necesar<br \/>}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Please help me to fix this error as the website is loading very hard because of this errors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you,<br \/>Alin Sbarnaure<br \/><\/p>\n","protected":false},"template":"","class_list":["post-17995193","topic","type-topic","status-publish","hentry","topic-tag-php-error"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17995193","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\/17995193\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=17995193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}