PHP error Spacious theme
-
Hello,
I have a problem with the theme and I get in hosting error log file the following errors
[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
[04-Sep-2024 17:35:17 UTC] PHP Deprecated: Func?ia spacious_options este considerat? <strong>?nvechit?</strong> ?ncepand cu versiunea 2.5.0. Folose?te ?n locul ei get_theme_mod. in /home/tradesof/public_html/wp-includes/functions.php on line 6085
[04-Sep-2024 17:35:17 UTC] PHP Deprecated: Func?ia spacious_options este considerat?
[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
and on and on the same error messages
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.
ORIGINAL code on line 320:
php
Copy code
$int = hexdec( str_replace( '#', '', $hexstr ) );
MODIFIED CODE with ChatGPT
php
Copy code
$hexstr = preg_replace('/[^0-9a-fA-F]/', '', $hexstr);
if (strlen($hexstr) == 3) {
$hexstr = $hexstr[0] . $hexstr[0] . $hexstr[1] . $hexstr[1] . $hexstr[2] . $hexstr[2];
} elseif (strlen($hexstr) != 6) {
$hexstr = '000000'; // Po?i ajusta valoarea implicit? dac? este necesar
}
$int = hexdec($hexstr);
ORIGINAL CODE ON LINE 350:
php
Copy code
$hex = str_replace( '#', '', $hex );
if ( strlen( $hex ) == 3 ) {
$hex = str_repeat( substr( $hex, 0, 1 ), 2 ) . str_repeat( substr( $hex, 1, 1 ), 2 ) . str_repeat( substr( $hex, 2, 1 ), 2 );
}
MODIFIED CODE with ChatGPT
php
Copy code
$hex = str_replace( '#', '', $hex );
$hex = preg_replace('/[^0-9a-fA-F]/', '', $hex);
if ( strlen( $hex ) == 3 ) {
$hex = str_repeat( substr( $hex, 0, 1 ), 2 ) . str_repeat( substr( $hex, 1, 1 ), 2 ) . str_repeat( substr( $hex, 2, 1 ), 2 );
} elseif (strlen($hex) != 6) {
$hex = '000000'; // Po?i ajusta valoarea implicit? dac? este necesar
}Please help me to fix this error as the website is loading very hard because of this errors.
Thank you,
Alin SbarnaureThe page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.