• Resolved in-no-v8

    (@in-no-v8)


    Hi there,
    I am recently having problems, I cannot access my website at all, I get the following error message on the entire website, plus the backend when I try and log in:

    Catchable fatal error: Object of class WP_Error could not be converted to string in /home/content/s/c/a/scarlettjames/html/wp-includes/default-constants.php on line 116

    I have tried looking around for a fix, but without luck. I have tried deactivating the plugins folder, and the problem is the same, so I don’t think it is an incompatible plugin.
    I don’t think the line of code it is pointing to is wrong, because I havent touched that code….I tried reuploading a fresh wordpress installation, from the latest downloads on wordpress, and the issue is the same.

    Here is the line of code that wordpress is telling me that is wrong:
    function wp_plugin_directory_constants() {
    if ( !defined(‘WP_CONTENT_URL’) )
    define( ‘WP_CONTENT_URL’, get_option(‘siteurl’) . ‘/wp-content’); // full url – WP_CONTENT_DIR is defined further up

    (its the third of those three lines of code specifically)

    Can you offer any help? This error suddenly came up on my site, I havent changed or updated anything recently, and I cant figure out what is suddenly causing it. Thanks in advance for your help.

    By the way, my website is:
    https://www.scarlettjames.com

    Running the latest stable wordpress build (4.3.1) and all plugins were up to date, last I checked, Simplicity is the site theme).

    I had contacted my host (Godaddy) about site caching, they told me there isnt a problem, and I have contacted the template theme designers, but no solid answer from them either. I have searched multiple cases of the same error message in wordpress forums and elsewhere, but cannot find a solution so far.

    Thanks in advance for any help that can be offered:)

Viewing 14 replies - 1 through 14 (of 14 total)
  • Hi,

    Please go to: https://www.remarpro.com and download the latest version of wordpress

    Extract and replace wp-includes and wp-admin folders in your ftp

    Done.

    Thread Starter in-no-v8

    (@in-no-v8)

    Hi there,
    Already did that, as mentioned above.

    ‘….I tried reuploading a fresh wordpress installation, from the latest downloads on wordpress, and the issue is the same.’

    No luck.

    Have you done any recent changes to the menu ? rename your theme folder and use twentyfifteen theme. see if you can login or preview your site.

    Thread Starter in-no-v8

    (@in-no-v8)

    I haven’t touched the site recently, for at least a week or two, its been down for a couple of days at least.

    I just deleted all my theme folders apart from twentyfifteen, and tried reloading, no change, same error message, cant log into the dashboard.

    Oh! I can see clearly now. Please go to Phpmyadmin > find and select your database > find and click wp_options table > look for siteurl and home, make sure they are both pointing to https://www.scarlettjames.com

    Thread Starter in-no-v8

    (@in-no-v8)

    Thanks for the feedback, so far, no luck:(

    Heres MyPhpAdmin:

    Edit Delete 1 siteurl https://www.scarlettjames.com yes
    Edit Delete 2 home https://www.scarlettjames.com yes
    Edit Delete 3 blogname Scarlett James Burlesque yes
    Edit Delete 4 blogdescription This is the exclusive home for Miss Scarlett James… yes

    Thread Starter in-no-v8

    (@in-no-v8)

    Has anyone got any suggestions? Im still stuck. I have tried optimizing/fixing myPhpAdmin tables, and all the other advice above has already been followed…getting desperate as i cant see a fix online. ANy help would greatly be appreciated:)

    if ( !defined(‘WP_CONTENT_URL’) )
    define( ‘WP_CONTENT_URL’, get_option(‘siteurl’) . ‘/wp-content’);

    I got same error at line number 116 in default-constants.php

    Here is the solution.

    In the line define( ‘WP_CONTENT_URL’, get_option(‘siteurl’) . ‘/wp-content’);

    get_option(‘siteurl’) will return site url and which will be set to WP_CONTENT_URL and this is a string value and fetched from the option table.

    so what I did, I checked siteurl option and what I found there is a json in stead of site url, I replaced that json value with siteurl and got my site back.

    Hope this will help!

    Thread Starter in-no-v8

    (@in-no-v8)

    Hey there,
    I have a feeling it will help…or might help…however, my skillset is obviously less advanced than yors:) You have to talk to me like I am a 5 year old in this situation, lol.

    From research, I know about this line, however, you lost me on this
    ‘and this is a string value and fetched from the option table.’

    What option table, where? Where do I check the siteurl option?
    Thanks in advance for your help…hopefully you are on to a fix…fingers crossed…:)

    @in-no-v8

    in database you will find <prefix>_options table, in that you will get the value

    Thread Starter in-no-v8

    (@in-no-v8)

    Hey SOlaxes…actually the solution was the same that was posted earlier in the thread too, but for some reason, this time around it fixed the issue….thanks a million:) I would say problem solved, closing the thread:)

    Thank you for having this as a solution. I had the same error, peeked into the wp_config site_url database entry and had garbage. Like an error message had lodged itself into the field. Replaced that with what should be there and the site came back up.

    Saved me a lot of further headache.

    The real question I have now is how it happened…

    Hello,

    do you find the reason of this problem ?
    I solve the bug in wp_option / siteurl, but it doesn’t solve for a long time.

    Thanks

    Hi,

    I solve the bug in wp_option / siteurl, but it doesn’t solve for a long time.

    If the url keeps changing though you fix it. Then It might be a malware or backdoor on your website. Scan your server is highly recommened with clamav or check locations where potentionally the virus is located in: wp-content/themes OR wp-content/plugins OR wp-config.php OR .htaccess OR index.php.

    The most tricky folders are “themes” and “plugins” You might need to rename them and add new folders with the same names. I have had pretty much the same problem, just that .htaccess used to changed instead of wp_option.

    Here are a couple of website scanner I recommend you to use for scanning your website before you proceed with any of the steps above:

    https://quttera.com/website-malware-scanner
    https://sitecheck.sucuri.net/

    I hope that will be of any help.

    Good Luck,

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Catchable fatal error: Object of class WP_Error could not be converted to string’ is closed to new replies.