WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Missing class-json.php (8 posts)

  1. Triplanetary
    Member
    Posted 2 years ago #

    I updated a site to the latest WP 3.2 nightly, and now the site won't render. The reason is this:

    <b>Warning</b>:  require_once(/home/content/80/7138980/html//wp-includes/class-json.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in <b>/home/content/80/7138980/html/wp-content/themes/igloo_free/lib_theme/theme_scripts.php</b> on line <b>30</b><br />
    <br />
    <b>Fatal error</b>:  require_once() [<a href='function.require'>function.require</a>]: Failed opening required '/home/content/80/7138980/html//wp-includes/class-json.php' (include_path='.:/usr/local/php5/lib/php') in <b>/home/content/80/7138980/html/wp-content/themes/igloo_free/lib_theme/theme_scripts.php</b> on line <b>30</b><br />

    So I checked /wp-includes/class-json.php and it's indeed gone. Has it been renamed or moved? (I don't think it's been moved, because I ran a search for it.) Thanks.

  2. It's definitively gone... Doesn't show up in trac anymore.

    Try the latest SVN? Maybe you caught a build before it was all cleaned out?

  3. Triplanetary
    Member
    Posted 2 years ago #

    Well, the require_once call is in one of the files for the site's theme, not in the WP Core. I'm comfortable altering the particular theme file, but I don't know if the class-json.php file has been replaced with another one, so I wouldn't know what to call on.

    Until I figure that one out, all I can do is copy the class-json.php from 3.1.3 back into the wp-includes directory. Which works, as I just discovered. But it bothers me because I have to figure there's a reason they removed class-json.php.

  4. Navjot Singh
    Member
    Posted 2 years ago #

    Check Ticket 16918 for why class-json.php was removed. It won't come back now.

  5. Dion Hulse
    WordPress Dev
    Posted 2 years ago #

    WordPress 3.2 required PHP 5.2.4 or later, class-json.php was included for compatibility with older versions of PHP only. It was removed here: http://core.trac.wordpress.org/changeset/17603

    Unfortunately, Your theme will need to be updated, you may find that simply commenting out the include line will allow it to continue working if it was using the PHP json functions like any well built theme would have been.

    Alternatively, Copy the json file into your themes folder, and modify the include line to reference the themes folder instead of WordPress's.

  6. Triplanetary
    Member
    Posted 2 years ago #

    Thanks, guys. That definitely clears things up.

  7. cah329a
    Member
    Posted 2 years ago #

    I just had the same problem, but the issue was not the theme, it was the TweetThis! plugin. The file was still on my site, it was just in the "wrong" directory. Moving it to where the error message said it was missing from (/public_html/wp-includes/) solved the problem completely.

    Of course if I'd simply updated my plugins before I updated WordPress I never would have had this problem. Duh!

    Cindy
    <who believes in not going into panic mode when something catastrophic happens. At least not until you've Googled the problem :-)>

  8. missdarling
    Member
    Posted 2 years ago #

    Thanks Cindy.

    FWIW, here is where I found my Tweet This class-json.php file:
    wp-content > plugins > tweet-this > lib > wp >

    That fixed it for me as well!

Topic Closed

This topic has been closed to new replies.

About this Topic