• Resolved jurasjo

    (@jurasjo)


    Hi

    I have some problem with kses.php I believe. I can see errors like shown below. Looks like it is not related to plugin but WordPress itself. Any idea what is that?

    [24-Jun-2017 07:16:08 UTC] PHP Catchable fatal error:  Object of class WP_Error could not be converted to string in .../wp-includes/kses.php on line 1249
    [24-Jun-2017 08:16:05 UTC] PHP Catchable fatal error:  Object of class WP_Error could not be converted to string in .../wp-includes/kses.php on line 1249
    

    They are triggered every hour(cron). I have another sites with very similar setup and there are no problems.

Viewing 14 replies - 1 through 14 (of 14 total)
  • It’s not necessarily the fault of WordPress core. Judging by the line number, a plugin or theme you’re using is sending something that isn’t a string to wp_kses_no_null(). Specifically, something is generating a WP_Error object which isn’t being caught before being sent to wp_kses_no_null().

    What is you’re cron doing? One of the places wp_kses_no_null() appears to be used in Core is in sanitizing redirects. Could you be attempting to redirect to a variable that might be an error?

    • This reply was modified 6 years, 10 months ago by Jacob Peattie.
    Thread Starter jurasjo

    (@jurasjo)

    I use external cron in cooperation with Wp-cron control plugin instead of woocommerce cron. It is fired hourly. It doesn’t do something particular. It simply provides functionality for jobs which needs cron.

    Looks like something tries do something but I have no idea how to track this. Any idea?

    There where no changes on my sites lately and I don’t now why it is happening.

    Hm, this could be tricky to track down. The normal suggestion is to start disabling plugins one by one until the error stops occurring. In your case you’ll manually need to trigger cron between each plugin.

    If the error stops occurring after disabling a plugin, search that plugin’s code for any use of wp_kses_no_null or wp_kses (wp_kses uses wp_kses_no_null internally).

    • This reply was modified 6 years, 10 months ago by Jacob Peattie.

    I’ve been seeing the same error on one of my sites:
    PHP Recoverable fatal error: Object of class WP_Error could not be converted to string in [path]/kses.php on line 1249

    But in my case it is happening sporadically, roughly once every 5-7 minutes- and began around June 22.

    I’ll search code of various plugins to see if I can find a clue & post again if I can figure anything out.

    • This reply was modified 6 years, 10 months ago by Abigailm.
    Thread Starter jurasjo

    (@jurasjo)

    I have had no luck with tracking down this problem. Have no idea from where it comes from. Similar to Your problem mine also started I think week or two ago.

    Do you have a caching plugin on your site? If so, which one?

    I am thinking it might be a caching related area because when I make changes to the site that would clear the cache, the error messages stop for about an hour or so and then start up again.

    Thread Starter jurasjo

    (@jurasjo)

    I use WP Fastest Cache and Autoptimize. I have 5 sites, use the WP Fastest Cache and Autoptimize and have problem only on two of them.

    well, there’s no wp_kses in autoptimize πŸ™‚

    frank (ao dev)

    I’m also using WP Fastest Cache and suspect that is the source of the issue — I am running this plugin on 10+ sites but only one with the problem. I turned on debugging and the debug log shows entries like this:

    [26-Jun-2017 23:24:06 UTC] PHP Notice:  Undefined property: stdClass::$attachment in //wp-content/plugins/wp-fastest-cache/wpFastestCache.php on line 1170
    [26-Jun-2017 23:24:06 UTC] PHP Notice:  Array to string conversion in //wp-includes/class-requests.php on line 797
    [26-Jun-2017 23:24:06 UTC] PHP Recoverable fatal error:  Object of class WP_Error could not be converted to string in //wp-includes/kses.php on line 1249

    I’m going to report this to the plugin developer.

    Thread Starter jurasjo

    (@jurasjo)

    I have patched WP Fastest Cache by code provided by the Dev of WP Fastest Cache and looks like the problem with kses.php is gone.

    The only one notice is:
    [28-Jun-2017 04:53:46 UTC] PHP Notice: Array to string conversion in .../wp-includes/class-requests.php on line 797

    I don’t now if it is related to WP Fastest Cache. I think it is not.

    Thread Starter jurasjo

    (@jurasjo)

    Remove whole directory and replace it by version posted by dev of WP Fastest Cache in this thread:
    LINK

    Hey Jurasjo, did you find the cause of your PHP Notice: Array to string conversion in …/wp-includes/class-requests.php on line 797? I’m searching too right now.

    Thread Starter jurasjo

    (@jurasjo)

    If I remember correctly it was connected to WP Fastest Cache plugin. After update there is no error.

    My WPFC is updated. I’ll ask to plugin support. Thank you!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘kses.php problem’ is closed to new replies.