Title: fatal PHP error
Last modified: December 15, 2025

---

# fatal PHP error

 *  Resolved [miruko](https://wordpress.org/support/users/miruko/)
 * (@miruko)
 * [5 months, 3 weeks ago](https://wordpress.org/support/topic/fatal-php-error-45/)
 *     ```wp-block-code
       Hello,I am experiencing a fatal PHP error caused by the plugin ACO Product Labels for WooCommerce.Error details:Uncaught Error: Call to a member function get_ID() on nullFile: /includes/class-acoplw-badge.phpLine: 144This happens when the badge is rendered outside of a standard WooCommerce product context (for example inside Porto / Elementor posts grid or during REST API calls). In these cases, the $product object is null, but the plugin still calls $product->get_ID() without checking if the product exists.Stack trace clearly shows the badge being triggered via acoplwBadgeHook in non-product contexts.It looks like a missing safety check before calling get_ID(). A simple guard such as:if ( ! is_object( $product ) || ! method_exists( $product, 'get_ID' ) ) {return '';}would prevent the fatal error.At the moment the only workaround is disabling the plugin or limiting the badge usage, otherwise the site crashes.Could you please confirm if this is a known issue and if a fix is planned?Thank you for your support.
       ```
   

Viewing 1 replies (of 1 total)

 *  [adhil_acowebs](https://wordpress.org/support/users/adhilps/)
 * (@adhilps)
 * [4 months, 3 weeks ago](https://wordpress.org/support/topic/fatal-php-error-45/#post-18783764)
 * Hi, 
   we apologize for the delayed response and any inconvenience this may have
   caused. We have released a new version that includes a fix for this issue. Please
   upgrade to the latest version and let us know if the problem is resolved.

Viewing 1 replies (of 1 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffatal-php-error-45%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/aco-product-labels-for-woocommerce/assets/icon-256x256.png?
   rev=2835042)
 * [Product Labels For Woocommerce (Sale Badges)](https://wordpress.org/plugins/aco-product-labels-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/aco-product-labels-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/aco-product-labels-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/aco-product-labels-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/aco-product-labels-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/aco-product-labels-for-woocommerce/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [adhil_acowebs](https://wordpress.org/support/users/adhilps/)
 * Last activity: [4 months, 3 weeks ago](https://wordpress.org/support/topic/fatal-php-error-45/#post-18783764)
 * Status: resolved