Title: Fatal error: undefined function WpAssetCleanUp\json_last_error()
Last modified: April 17, 2019

---

# Fatal error: undefined function WpAssetCleanUp\json_last_error()

 *  Resolved [Jelle Roorda](https://wordpress.org/support/users/jifuss/)
 * (@jifuss)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-undefined-function-wpassetcleanupjson_last_error/)
 * Hi Gabriel,
 * I just installed the latest version of the plugin (1.3.2.6) on WordPress 5.1.1(
   at time of writing also the latest version).
 * After I installed the plugin, and switched on the “I’ve read and understood the
   use of this plugin” (or something like that), and pressed the “save” button, 
   I got the error below. Sadly, I had to remove the plugin again to get the site
   to function again. From the error it seems a function is missing from the main
   plugin class (maybe a slight mistake during checking in the code on the SVN repository?.
 * Please give me a heads up after you’ve found the time to fix it, since the plugin
   is very helpful!
 * If you’d like me to investigate the issue any further feel free to let me know.
 *     ```
       Fatal error: Uncaught Error: Call to undefined function WpAssetCleanUp\json_last_error() in USER_DIRECTORY/wp-content/plugins/wp-asset-clean-up/classes/Settings.php:262
       Stack trace: 
       #0 USER_DIRECTORY/wp-content/plugins/wp-asset-clean-up/classes/Main.php(237): WpAssetCleanUp\Settings->getAll()
       #1 USER_DIRECTORY/wp-includes/class-wp-hook.php(286): WpAssetCleanUp\Main->triggersAfterInit('')
       #2 USER_DIRECTORY/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
       #3 USER_DIRECTORY/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
       #4 USER_DIRECTORY/wp-settings.php(505): do_action('init')
       #5 USER_DIRECTORY/wp-config.php(92): require_once('/home/cizapeo34...') 
       #6 /home/cizapeo342/domains/fortranbigirimana in USER_DIRECTORY/wp-content/plugins/wp-asset-clean-up/classes/Settings.php on line 262
       ```
   
    -  This topic was modified 7 years, 1 month ago by [Jelle Roorda](https://wordpress.org/support/users/jifuss/).
      Reason: Added plugin version for explicity and better debugging

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Gabe Livan](https://wordpress.org/support/users/gabelivan/)
 * (@gabelivan)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-undefined-function-wpassetcleanupjson_last_error/#post-11439645)
 * Hello, Jelle!
 * The function json_last_error() is available from PHP 5.3 and if you didn’t get
   an error when you activated the plugin, then you’re likely using a higher version(
   which is strongly recommended). It could be that you’re in a rare situation where
   the configuration of the PHP on your server doesn’t have the JSON extension enabled.
 * What’s the hosting company you’re using? Can you verify through a php.ini check
   or via your hosting control panel if the extension is enabled? I have to admit
   this is very rare and you might have issues with other plugins or themes as well.
 * PS: I initially thought the error is due to the namespace, but I’ve checked the
   code and all is looking good and no one ever reported such an error so far. Here’s
   the same issue discussed here regarding a different plugin where they suggest
   the same fix: [https://wordpress.org/support/topic/problem-after-5-1-1-upgrade/](https://wordpress.org/support/topic/problem-after-5-1-1-upgrade/)
    -  This reply was modified 7 years, 1 month ago by [Gabe Livan](https://wordpress.org/support/users/gabelivan/).
 *  Plugin Author [Gabe Livan](https://wordpress.org/support/users/gabelivan/)
 * (@gabelivan)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-undefined-function-wpassetcleanupjson_last_error/#post-11448732)
 * [@jifuss](https://wordpress.org/support/users/jifuss/) I’ve added a fallback 
   in case json_last_error() is not defined. Can you please re-download the plugin
   and see if works now?
 *  Thread Starter [Jelle Roorda](https://wordpress.org/support/users/jifuss/)
 * (@jifuss)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-undefined-function-wpassetcleanupjson_last_error/#post-11463850)
 * Hi [@gabelivan](https://wordpress.org/support/users/gabelivan/), thanks for your
   reply!
 * I re-downloaded the plugin, and the issue seems to be fixed (without enabling
   the json extension, which was disabled as you guessed).
 * I’ll enable the json extension just to make sure I won’t be experiencing any 
   unnecessary errors in the future!
 * Thanks a bunch for your quick reply and resolution, really appreciated!
 *  Plugin Author [Gabe Livan](https://wordpress.org/support/users/gabelivan/)
 * (@gabelivan)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-undefined-function-wpassetcleanupjson_last_error/#post-11464210)
 * [@jifuss](https://wordpress.org/support/users/jifuss/) cool! Looking forward 
   to your feedback regarding the plugin! I hope it will strip the “fat” from your
   website 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Fatal error: undefined function WpAssetCleanUp\json_last_error()’ is 
closed to new replies.

 * ![](https://ps.w.org/wp-asset-clean-up/assets/icon-256x256.png?rev=1981952)
 * [Asset CleanUp: Page Speed Booster](https://wordpress.org/plugins/wp-asset-clean-up/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-asset-clean-up/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-asset-clean-up/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-asset-clean-up/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-asset-clean-up/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-asset-clean-up/reviews/)

## Tags

 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)
 * [missing function](https://wordpress.org/support/topic-tag/missing-function/)

 * 4 replies
 * 2 participants
 * Last reply from: [Gabe Livan](https://wordpress.org/support/users/gabelivan/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-undefined-function-wpassetcleanupjson_last_error/#post-11464210)
 * Status: resolved