PHP Notice
May 25, 2016 3:12 pmI wanted to let you guys know that I am getting a php notice with your premium plugin. I have debug set to true as I am developing the site right now, so I can see any errors or notices. When I do a search on my Woocommerce shop or anywhere that posts can be shown; if the search comes up empty (“No products were found matching your selection”, etc.) then this notice pops up:
“Notice: Trying to get property of non-object in /usr/local/www/apache24/data/wp-content/plugins/gotowp_g2w/_gtwp_g2w_inc.php on line 132
Notice: Trying to get property of non-object in /usr/local/www/apache24/data/wp-content/plugins/gotowp_g2w/_gtwp_g2w_inc.php on line 3956
Notice: Trying to get property of non-object in /usr/local/www/apache24/data/wp-content/plugins/gotowp_g2w/_gtwp_g2w_inc.php on line 150”
I realize this won’t appear when I set debug to false but I like to fix anything that pops up. I went through your code where the errors are occurring and was able to fix it. I thought I would let you know as I don’t want to edit your code. If you add if( !is_object($post) ) to your code it will prevent the notice from occurring. For example line 132 would now look like: if ( !is_object($post) || gotowp_premium_has_shortcode ( ‘register_webinar’ ) || $post->ID == $webinar_shop_page).
Thanks for the great plugin!
4 Comments
4 Replies
Thank you for posting! Appreciate the feedback and contribution!
I’ve actually found a few more notices which I can let you know of, if you would like. Its just a few deprecated notices. I certainly don’t want to be a pest and you might already be aware of these things. Let me know.
Yes, we are aware 🙂 Thanks for posting though. We’ve added suppressing these notices to our to do list.
Hello! We have released an update that gracefully handles and eliminates the PHP notices. Please see http://gotowp.supportico.us/release-note/version-1-0-2-5-gotowebinar/ for more details. If you would like the update please send the email address you purchased under to help [at] gotowp [dot] com and we’ll send you updated version. Thanks!