Title: many PHP errors
Last modified: February 26, 2018

---

# many PHP errors

 *  Resolved [audioscavenger](https://wordpress.org/support/users/audioscavenger/)
 * (@audioscavenger)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/many-php-errors-2/)
 * hey Steven
 * I use your plugin because it’s so useful, many thanks.
 * 1) However I recently noticed a lot of PHP errors showing up here and there:
 *     ```
       Notice: Undefined index: _ez_toc_nonce in /path/site.com/wp-content/plugins/easy-table-of-contents/includes/class.admin.php on line 340
       ```
   
 * bugfix class.admin.php on line 340:
    `.. && array_key_exists('_ez_toc_nonce',
   $_REQUEST) ..`
 *     ```
       [25-Feb-2018 03:05:28 UTC] PHP Notice:  Trying to get property of non-object in /path/site.com/wp-content/plugins/easy-table-of-contents/easy-table-of-contents.php on line 594
       [25-Feb-2018 03:05:28 UTC] PHP Notice:  Trying to get property of non-object in /path/site.com/wp-content/plugins/easy-table-of-contents/easy-table-of-contents.php on line 595
       [25-Feb-2018 03:05:28 UTC] PHP Notice:  Trying to get property of non-object in /path/site.com/wp-content/plugins/easy-table-of-contents/easy-table-of-contents.php on line 596
       [25-Feb-2018 03:05:28 UTC] PHP Notice:  Trying to get property of non-object in /path/site.com/wp-content/plugins/easy-table-of-contents/easy-table-of-contents.php on line 844
       [25-Feb-2018 03:05:28 UTC] PHP Notice:  Trying to get property of non-object in /path/site.com/wp-content/plugins/easy-table-of-contents/easy-table-of-contents.php on line 883
       [25-Feb-2018 03:05:28 UTC] PHP Notice:  Trying to get property of non-object in /path/site.com/wp-content/plugins/easy-table-of-contents/easy-table-of-contents.php on line 887
       ```
   
 * Is it because of PHP 7? Or is it because of https? Or have you pushed some untested
   changes in your code?
    I could correct that myself but that would defeat the 
   purpose of relying on plugins to do a job we publishers do not want to do.
 * 2) why is your plugin active in the admin area at all?
 * Please let me know if I can help and if you need more log extracts!
 * best regards
    -  This topic was modified 8 years, 5 months ago by [audioscavenger](https://wordpress.org/support/users/audioscavenger/).
    -  This topic was modified 8 years, 5 months ago by [audioscavenger](https://wordpress.org/support/users/audioscavenger/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmany-php-errors-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [Steven](https://wordpress.org/support/users/shazahm1hotmailcom/)
 * (@shazahm1hotmailcom)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/many-php-errors-2/#post-10016532)
 * [@audioscavenger](https://wordpress.org/support/users/audioscavenger/)
 * **RE: Is it because of PHP 7?**
 * ezTOC is developed on an instance of PHP 7.1.x with debugging set to show and
   log notices and errors. I do not receive this notice in testing:
 * `Notice: Undefined index: _ez_toc_nonce in ../wp-content/plugins/easy-table-of-
   contents/includes/class.admin.php on line 340`
 * It should not be possible for `_ez_toc_nonce` not to be set in this instance 
   because the save callback is only invoked on post types for which support has
   been enabled in the settings.
 * So something is a miss… the metabox is not being rendered on the post type in
   which support has been enabled. Are you perhaps using another plugin or other
   technique to suppress the ezTOC metabox on a post type for which you have enabled
   support for?
 * **Or is it because of https?**
 * No.
 * **RE: Or have you pushed some untested changes in your code?**
 * No. There have been no changes surrounding the code for the metaboxes and saving
   their values to post meta since the original release.
 * **RE: why is your plugin active in the admin area at all?**
 * Hmmm… how do you think settings are done or the post type metabox added??? It
   has to run in the admin. It only runs under those specific circumstances. Even
   the CSS/JavaScript is loaded only on the pages where needed.
 * You can verify this yourself in the `class.admin.php` file within the `hook()`
   and `registerMetaboxes()` methods.
 * **In regards to the `PHP Notice: Trying to get property of non-object` notices**
 * I belive it may be related to this as reported in another support thread:
    [https://wordpress.org/support/topic/error-on-save-update-post/](https://wordpress.org/support/topic/error-on-save-update-post/)
 * I’m fairly certain this is because Yoast SEO applies `the_content` filter in 
   the admin context for its link checker when saving the post. These notices, I
   think, would occur because the code for ezTOC is designed to only run within 
   the loop context.
 * The odd thing is… I run Yoast SEO on both my dev and live eCommerce site with
   ezTOC and I do not receive these error notices. My live site is set to log all
   PHP error messages and notices to a non-public accessible folder on the server.
 * I’ve asked others to open a support ticket regarding this specific issue. Unfortunately
   none has so that limits my ability to help track down and resolve.
 * No sure if this helps, but I hope it does in some way.
 *  [Steven](https://wordpress.org/support/users/shazahm1hotmailcom/)
 * (@shazahm1hotmailcom)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/many-php-errors-2/#post-10260123)
 * These should not longer present themselves after the next update due to changes
   in the code to harden against them. Marking resolved 🙂

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

The topic ‘many PHP errors’ is closed to new replies.

 * ![](https://ps.w.org/easy-table-of-contents/assets/icon-256x256.png?rev=3045459)
 * [Easy Table of Contents](https://wordpress.org/plugins/easy-table-of-contents/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/easy-table-of-contents/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/easy-table-of-contents/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-table-of-contents/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-table-of-contents/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-table-of-contents/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Steven](https://wordpress.org/support/users/shazahm1hotmailcom/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/many-php-errors-2/#post-10260123)
 * Status: resolved