Wordpress error

Hi,

I received this email from wordpress:

First, go to your website (https://otbioelettronica.it/) and check if there are any visible problems. Next, go to the page where the error was found (https://otbioelettronica.it/wp-admin/customize.php?theme=betheme-child&return=https%3A%2F%2Fotbioelettronica.it%2Fwp-admin%2Fthemes.php) and check if there is any visible problem.


Please contact your host for assistance in further investigating this issue.


If your site appears corrupted and you can't access your dashboard normally, WordPress now has a special "recovery mode". This allows you to securely log into your dashboard to check what's wrong.


https://otbioelettronica.it/wp-login.php?action=enter_recovery_mode&rm_token=CUYfscDlOLKXmppjoyRhKi&rm_key=315ZCmWkfaUWxcR7oeD9dP


To keep your site safe, this link will expire in 1 day. Don't worry about that - a new link will be sent to you if the error occurs again after the deadline.


If you seek help with this issue, you may be asked for some of the following information:

WordPress version 6.2.2

Active theme: Betheme Child (version 1.0)

Current plugin: (version )

PHP version 7.4.33




Details of the error

====================

An error of E_ERROR was caused in line 220 of the file /data/sites/web/otbioelettronicait/www/wp-content/themes/betheme/functions.php. Error Message: Cannot redeclare fix_rewritebase() (previously declared in /data/sites/web/otbioelettronicait/www/wp-content/themes/betheme-child/functions.php:9)


I had to add this piece of code because there was a language issue that crashed the site and WPML support told me to add this (in functions.php):

add_filter('mod_rewrite_rules', 'fix_rewritebase');

function fix_rewritebase($rules){

    $home_root = parse_url(home_url());

    if ( isset( $home_root['path'] ) ) {

        $home_root = trailingslashit($home_root['path']);

    } else {

        $home_root = '/';

    }

 

    $wpml_root = parse_url(get_option('home'));

    if ( isset( $wpml_root['path'] ) ) {

        $wpml_root = trailingslashit($wpml_root['path']);

    } else {

        $wpml_root = '/';

    }

 

    $rules = str_replace("RewriteBase $home_root", "RewriteBase $wpml_root", $rules);

    $rules = str_replace("RewriteRule . $home_root", "RewriteRule . $wpml_root", $rules);

 

    return $rules;

}

Can this give problems with your theme?


Best regards

Davide

Comments

Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.