Title: kses.php problem
Last modified: June 24, 2017

---

# kses.php problem

 *  Resolved [jurasjo](https://wordpress.org/support/users/jurasjo/)
 * (@jurasjo)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/kses-php-problem/)
 * 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)

 *  [Jacob Peattie](https://wordpress.org/support/users/jakept/)
 * (@jakept)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/kses-php-problem/#post-9257860)
 * 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 8 years, 12 months ago by [Jacob Peattie](https://wordpress.org/support/users/jakept/).
 *  Thread Starter [jurasjo](https://wordpress.org/support/users/jurasjo/)
 * (@jurasjo)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/kses-php-problem/#post-9257878)
 * 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.
 *  [Jacob Peattie](https://wordpress.org/support/users/jakept/)
 * (@jakept)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/kses-php-problem/#post-9257889)
 * 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 8 years, 12 months ago by [Jacob Peattie](https://wordpress.org/support/users/jakept/).
 *  [Abigailm](https://wordpress.org/support/users/abigailm/)
 * (@abigailm)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/kses-php-problem/#post-9261612)
 * 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 8 years, 12 months ago by [Abigailm](https://wordpress.org/support/users/abigailm/).
 *  Thread Starter [jurasjo](https://wordpress.org/support/users/jurasjo/)
 * (@jurasjo)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/kses-php-problem/#post-9261844)
 * 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.
 *  [Abigailm](https://wordpress.org/support/users/abigailm/)
 * (@abigailm)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/kses-php-problem/#post-9263359)
 * 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](https://wordpress.org/support/users/jurasjo/)
 * (@jurasjo)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/kses-php-problem/#post-9263399)
 * 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.
 *  [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/kses-php-problem/#post-9263497)
 * well, there’s [no wp_kses in autoptimize](https://github.com/futtta/autoptimize/search?utf8=%E2%9C%93&q=wp_kses&type=)
   🙂
 * frank (ao dev)
 *  [Abigailm](https://wordpress.org/support/users/abigailm/)
 * (@abigailm)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/kses-php-problem/#post-9263880)
 * 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](https://wordpress.org/support/users/jurasjo/)
 * (@jurasjo)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/kses-php-problem/#post-9268248)
 * 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](https://wordpress.org/support/users/jurasjo/)
 * (@jurasjo)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/kses-php-problem/#post-9269273)
 * Remove whole directory and replace it by version posted by dev of WP Fastest 
   Cache in this thread:
    [LINK](https://wordpress.org/support/topic/bug-error-messages/)
 *  [cloudres](https://wordpress.org/support/users/griotta/)
 * (@griotta)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/kses-php-problem/#post-9774441)
 * 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](https://wordpress.org/support/users/jurasjo/)
 * (@jurasjo)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/kses-php-problem/#post-9775692)
 * If I remember correctly it was connected to WP Fastest Cache plugin. After update
   there is no error.
 *  [cloudres](https://wordpress.org/support/users/griotta/)
 * (@griotta)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/kses-php-problem/#post-9775724)
 * 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.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 14 replies
 * 5 participants
 * Last reply from: [cloudres](https://wordpress.org/support/users/griotta/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/kses-php-problem/#post-9775724)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
