Title: PHP error message
Last modified: June 27, 2017

---

# PHP error message

 *  Resolved [tbo460](https://wordpress.org/support/users/thibotus01/)
 * (@thibotus01)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/php-error-message-32/)
 * Hi,
 * This plugin return this error message:
 * `Got error 'PHP message: post was called incorrectly. Product properties should
   not be accessed directly. Backtrace: do_action('wp_ajax_nopriv_wc-livechat-check-
   cart'), WP_Hook->do_action, WP_Hook->apply_filters, WooCommerce_LiveChat->check_cart,
   WooCommerce_LiveChat->get_custom_livechat_data, WooCommerce_LiveChat->get_products_data,
   WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong. This message was added 
   in version 3.0.\n'`
 * I think you should fix this and update the plugin that has not received any update
   for a year… Thanks

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

 *  [davebonds](https://wordpress.org/support/users/davebonds/)
 * (@davebonds)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/php-error-message-32/#post-9581978)
 * We had the same issue with this showing in the error logs and thought nothing
   of it. Then WP Engine contacted us and said it’s a problem.
 * `post was called incorrectly. Product properties should not be accessed directly.
   Backtrace: do_action('wp_ajax_wc-livechat-check-cart'), WP_Hook->do_action, WP_Hook-
   >apply_filters, call_user_func_array, WooCommerce_LiveChat->check_cart, WooCommerce_LiveChat-
   >get_custom_livechat_data, WooCommerce_LiveChat->get_products_data, WC_Product_Subscription_Variation-
   >__get, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong. This message was
   added in version 3.0.`
 * You guys can fix it by changing `class-woocommerce-livechat.php` in the `get_products_data()`
   method by getting a WC_Product object from the cart data using `wc_get_product()`
   first instead of trying to access it directly.
 * Change:
 *     ```
       $url = htmlspecialchars_decode( $product['data']->get_permalink() );
       $title = $product['data']->get_title();
       ```
   
 * To:
 *     ```
       $wc_product = wc_get_product( $product['data'] );
       $url = htmlspecialchars_decode( $wc_product->get_permalink() );
       $title = $wc_product->get_title();
       ```
   
 *  Plugin Author [Text](https://wordpress.org/support/users/livechat/)
 * (@livechat)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/php-error-message-32/#post-9598182)
 * Hi Davebonds,
 * Thank you for your advice. We have implemented that in version 1.1.10.
 * If you have any other questions, please let me know.

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

The topic ‘PHP error message’ is closed to new replies.

 * ![](https://ps.w.org/livechat-woocommerce/assets/icon-256x256.gif?rev=3059648)
 * [Live Chat Plugin for WooCommerce - LiveChat](https://wordpress.org/plugins/livechat-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/livechat-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/livechat-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/livechat-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/livechat-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/livechat-woocommerce/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Text](https://wordpress.org/support/users/livechat/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/php-error-message-32/#post-9598182)
 * Status: resolved