• Resolved Website Academy

    (@rfmcomposer)


    I am getting this error when I search for shortcodes:

    PHP Fatal error: Uncaught Error: Object of class FontAwesomeFour could not be converted to string in …/wp-content/plugins/shortcodes-finder/includes/shortcodes-finder-utils.php:350

    When I disable the plugin FontAwesomeFour, the error message becomes:

    PHP Fatal error: Uncaught Error: Object of class TOC_Plus could not be converted to string in …/wp-content/plugins/shortcodes-finder/includes/shortcodes-finder-utils.php:350

    So the error is the same but the class changed to a class from another plugin. Disabling this plugin leads to a similar error about another class from another plugin. So these plugins probably don’t cause the error.

    I used Shortcodes Finder on other sites without any problems. Any idea how to solve this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Scribit

    (@scribit)

    Hello @rfmcomposer and thanks for your reporting. Probably I found the error.

    If you are familiar with code editing you can open the file /wp-content/plugins/shortcodes-finder/includes/shortcodes-finder-utils.php and substitute this code from line 344:

    if (version_compare(PHP_VERSION, '8.0.0') < 0)
    	$callback_class = get_class( $callback[0] );
    
    if (!$callback_class)
    	$callback_class = $callback[0];

    with this one:

    if (is_object( $callback[0] ))
    	$callback_class = get_class( $callback[0] );
    else
    	$callback_class = $callback[0];

    Can you give me a feedback about the result on your website?
    If you cannot edit the file let me know and I will hurry the new version release for you ??

    Thread Starter Website Academy

    (@rfmcomposer)

    Thanks for your quick reply.

    Yes, I am familiar with code editing.

    And your code solved the problem!

    Plugin Author Scribit

    (@scribit)

    Nice. So, have a good coding!

    And don’t forget to leave a rate for plugin ??

    Thread Starter Website Academy

    (@rfmcomposer)

    Thanks. I left a review. You deserve it for the excellent plugin and support.

    I assume you will add the code to the next release so it keeps working… ??

    Plugin Author Scribit

    (@scribit)

    Sorry, I forgot to release the version with the fix.
    Now the 1.5.1 is ready and fixed!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP Fatal error: Uncaught Error:Object of class could not be converted to string’ is closed to new replies.