[SmartCrawl Pro] Smartcrawl 2.2.2.7 breaks function, WSOD

Hi!

I've upgraded from Smartcrawl 2.2.2.1 to 2.2.2.7. I can see that the versions in between had some WSOD-issues. Now I'm experiencing something similar with 2.2.2.7:

This is the error that occurs after updating:

"Fatal error: Cannot redeclare upcoming() (previously declared in /app/public/wp-content/themes/mai-lifestyle-pro/functions.php:163) in /app/public/wp-content/themes/mai-lifestyle-pro/functions.php on line 163"

And this is the referenced function:

"function upcoming($where) {
$where = str_replace("meta_key = 'neste_kurs_$", "meta_key LIKE 'neste_kurs_%", $where);
return $where;
}"

Any ideas? Thanks!

  • Adam Czajczyk
    • Support Gorilla

    Hi Arnstein

    I hope you're well today!

    Thank you for confirming that adding this constant (the "define" line) is fixing the issue for you.

    SmartCrawl is not using "upcoming()" function in the code so it's not a "code conflict" but I admit I'm surprised by this specific error. The way that "SMARTCRAWL_FORCE_REWRITE_TITLE" is set (true or false) affects the way SmartCrawl is buffering output as far as I'm aware but, to be perfectly honest, it's a bit of a mystery for me why it's causing such an error on a PHP level - like it was causing the function (the PHP code!) to duplicate.

    Not knowing the site and the theme, my shot would be that either there's some plugin/option used to "add php code via WP back-end" (e.g. some plugin to add php snippets or to execute php code in the post/page or widget) or the theme is doing something a bit "weird" on a code level.

    The SMARTCRAWL_FORCE_REWRITE_TITLE, however, is a perfectly valid and acceptable solution if it's fixing the case for you, in my opinion :slight_smile:

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.