• I am trying to activate the Metrolium theme on my website, but I receive the following error:

    Fatal error: Cannot redeclare add_unlink_script() (previously declared in /home/content/06/9931306/html/wp-content/themes/Metrolium/functions.php:554) in /home/content/06/9931306/html/wp-content/themes/Metrolium/backend/functions.php on line 55

    I’ve confirmed that no plugins are causing the issue. Also, the theme
    does work on a different WordPress site of mine. Does anyone know what the problem could be? I would rather not have to reinstall WordPress and import my posts, content, etc. all over again.

    Thank you!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Have you asked the developer for help?

    https://themeforest.net/item/metrolium-responsive-multipurpose-wp-theme/5018371

    These forums don’t have access to or provide support for commercial themes, so that would be your best place for an issue like this.

    Thread Starter daviddifranco

    (@daviddifranco)

    Yes, and they claim it’s a “hack” issue… when in reality, I know it’s not. I don’t understand why support teams automatically resort to the “Oh, you must’ve been hacked!” claim.

    I’ve done everything I can think of regarding this error… I don’t want to go through the trouble of reinstalling WordPress, reimporting my content, and it still not working. I want to understand what the actual cause is.

    Themes and plugins (and WordPress itself) contain functions, and unless they are name spaced (usually by using Object Oriented programming style), then if any two functions from separate sources have the same name there will be a “name collision” and you’ll see that error. Generally which ever function is found first “wins” the other(s) will throw an error saying the function name cannot be redeclared. add_unlink_script is a pretty generic name. Plugin and theme authors will usually add a prefix related to their plugin or theme to make name collision less likely to happen. The author needs to update the name of that function, say to something like:

    metrolium_add_unlink_script

    Thread Starter daviddifranco

    (@daviddifranco)

    Scriptrunner, thanks for the info! But how would that explain the theme working perfectly fine on another WordPress installation of mine? Is this something I can resolve myself?

    Are you using the exact same plugins on the other install? It only happens if there’s a conflict and it’s most likely a conflict between the theme and a plugin.

    As a quick test, disable all your plugins on the install throwing the error.

    Thread Starter daviddifranco

    (@daviddifranco)

    I’ve deactivated every single plugin on the primary site, yet the problem still persists. My test installation doesn’t currently have any plugins installed, however.

    Ah, just reread your initial message. From the error message, it looks like the theme itself is causing the issue:

    Fatal error: Cannot redeclare add_unlink_script() (previously declared in /home/content/06/9931306/html/wp-content/themes/Metrolium/functions.php:554) in /home/content/06/9931306/html/wp-content/themes/Metrolium/backend/functions.php on line 55

    so

    add_unlink_script() appears to be declared both in

    wp-content/themes/Metrolium/functions.php (line 554)

    and in

    wp-content/themes/Metrolium/backend/functions.php (line 55)

    Does the site that does work with this theme have the same version of the theme and can you check if it has the two function.php files…and if they both contain an add_unlink_script function?

    Beyond that, you’ll have to check with the theme author.

    Thread Starter daviddifranco

    (@daviddifranco)

    wp-content/themes/Metrolium/functions.php (line 554) contains nothing. The line is blank.

    wp-content/themes/Metrolium/backend/functions.php (line 55) contains the following: parent.children(“input.deleteinput”).eq(0).val(1);

    This is the same for both WordPress installations.

    I am David Knight, a Senior Web Developer at Euged.com, the developers of Metrolium.

    As you well know, daviddifranco, you have already created a thread on our private support forum in which we’ve advised you to reinstall the theme as both the function and the line numbers you’ve pasted do not exist in our theme. That’s why we suggested that you’ve either added additional code yourself or something else has and as a result you should reinstall the theme.

    I don’t understand why support teams automatically resort to the “Oh, you must’ve been hacked!” claim.

    I think I’ve covered this adequately above. I don’t understand why users ask for help but then when we advise you on what to do, you refuse because you don’t want to reinstall the theme. How can we help you when you won’t help yourself?

    For the record, backend/functions.php contains 18 lines of code, your error message quotes line 55. functions.php in the root of the theme contains 521 lines of code, your error message quotes line 554. This is what has led us to believe that either you, someone else or something else (a script) has added additional lines of code to your theme that are not supposed to be there.

    If you’re certain you didn’t add them, you’ll have bigger problems than just getting our theme working because essentially, you need to find out who or what did add them or you’ll have to assume that your hosting environment has been compromised and everything on there will need looking at, passwords changing and so on but that’s another conversation entirely and certainly not within the scope of our theme support as I’m sure you’d well expect.

    As previously advised by another poster above, this WordPress forum is not the place to ask for support for commercial themes. It is also clearly highlighted on our ThemeForest product page where you should go for support, which you’re clearly aware of because you’ve posted on our forum. I’d suggest that we shift conversation back to the original thread and that you try the steps that we advised you in the first place which is to reinstall your theme and find out where that code came from.

    I’d also recommend before reinstalling that you download a fresh copy from ThemeForest. For the sake of testing, you should install it on a fresh copy of WordPress, on the same server with no plugins. When you’ve seen that this works, you can then look at why it’s not working on your website.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    As this is a commercial theme and those are not supported here please take this up on the theme site.

    https://www.euged.com/support/?envato_item_id=5018371

    I am now closing this topic.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Fatal error — I have no idea how to resolve this!’ is closed to new replies.