Title: PHP Fatal error
Last modified: December 1, 2022

---

# PHP Fatal error

 *  Resolved [mcseem42](https://wordpress.org/support/users/mcseem42/)
 * (@mcseem42)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-fatal-error-334/)
 * Hi!
    I open any Product, tab Facebook in Product data and see “There has been
   a critical error on this website…”
 * PHP Fatal error: Uncaught TypeError: Argument 1 passed to WooCommerce\Facebook\
   Admin\Products::render_google_product_category_fields_and_enhanced_attributes()
   must be an instance of WC_Product, bool given, called in /home/erd/web/lee/public_html/
   wp-content/plugins/facebook-for-woocommerce/includes/Admin.php on line 1256 and
   defined in /home/erd/web/lee/public_html/wp-content/plugins/facebook-for-woocommerce/
   includes/Admin/Products.php:44
    Stack trace: #0 /home/erd/web/lee/public_html/
   wp-content/plugins/facebook-for-woocommerce/includes/Admin.php(1256): WooCommerce\
   Facebook\Admin\Products::render_google_product_category_fields_and_enhanced_attributes()#
   1 /home/erd/web/lee/public_html/wp-includes/class-wp-hook.php(308): WooCommerce\
   Facebook\Admin->add_product_settings_tab_content() #2 /home/erd/web/lee/public_html/
   wp-includes/class-wp-hook.php(33 in /home/erd/web/lee/public_html/wp-content/
   plugins/facebook-for-woocommerce/includes/Admin/Products.php on line 44

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

 *  [anastas10s](https://wordpress.org/support/users/anastas10s/)
 * (@anastas10s)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-fatal-error-334/#post-16252347)
 * Hi there [@mcseem42](https://wordpress.org/support/users/mcseem42/) 👋
 * > PHP Fatal error
 * Thanks for reaching out, let’s figure out why things are not lining up!
 * A picture is worth a thousand words, as the saying goes, therefore, could you
   share a screenshot of the screen where the error appears, please? [https://snipboard.io/](https://snipboard.io/)
   is a good (online) tool of choice for sharing it here.
 * In order to investigate things further, could you please share the site’s URL
   and a copy of its System Status? You can find it via `WooCommerce > Status`. 
   Select `Get system report` and then click the `Copy for support` button. You 
   can either paste it in your response here, or use [https://pastebin.com/](https://pastebin.com/)
   for pasting it there and sharing it with us.
 * Also, could you please navigate to `WooCommerce > Status > Logs` and from the
   dropdown on the right side, please see if there are any logs starting with the
   words fatal-error.
 * If so, please select `View` and copy and paste them into your reply here.
 * Looking forward to hearing from you!
 *  Thread Starter [mcseem42](https://wordpress.org/support/users/mcseem42/)
 * (@mcseem42)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-fatal-error-334/#post-16253125)
 * oh sure
 * screenshot: [https://snipboard.io/C679md.jpg](https://snipboard.io/C679md.jpg)
   
   system report: [https://pastebin.com/pBCVfSxV](https://pastebin.com/pBCVfSxV)
   last log:
 *     ```
       2022-12-01T15:24:31+00:00 CRITICAL Uncaught TypeError: Argument 1 passed to WooCommerce\Facebook\Admin\Products::render_google_product_category_fields_and_enhanced_attributes() must be an instance of WC_Product, bool given, called in /home/erd/web/lee/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Admin.php on line 1256 and defined in /home/erd/web/lee/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Admin/Products.php:44
       Stack trace:
       #0 /home/erd/web/lee/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Admin.php(1256): WooCommerce\Facebook\Admin\Products::render_google_product_category_fields_and_enhanced_attributes()
       #1 /home/erd/web/lee/public_html/wp-includes/class-wp-hook.php(308): WooCommerce\Facebook\Admin->add_product_settings_tab_content()
       #2 /home/erd/web/lee/public_html/wp-includes/class-wp-hook.php(33 in /home/erd/web/lee/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Admin/Products.php on line 44
   
       2022-12-01T15:40:33+00:00 CRITICAL Uncaught TypeError: Argument 1 passed to WooCommerce\Facebook\Admin\Products::render_google_product_category_fields_and_enhanced_attributes() must be an instance of WC_Product, bool given, called in /home/erd/web/lee/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Admin.php on line 1256 and defined in /home/erd/web/lee/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Admin/Products.php:44
       Stack trace:
       #0 /home/erd/web/lee/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Admin.php(1256): WooCommerce\Facebook\Admin\Products::render_google_product_category_fields_and_enhanced_attributes()
       #1 /home/erd/web/lee/public_html/wp-includes/class-wp-hook.php(308): WooCommerce\Facebook\Admin->add_product_settings_tab_content()
       #2 /home/erd/web/lee/public_html/wp-includes/class-wp-hook.php(33 in /home/erd/web/lee/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Admin/Products.php on line 44
       ```
   
    -  This reply was modified 3 years, 5 months ago by [mcseem42](https://wordpress.org/support/users/mcseem42/).
 *  Thread Starter [mcseem42](https://wordpress.org/support/users/mcseem42/)
 * (@mcseem42)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-fatal-error-334/#post-16257230)
 * Hi!
    I debugged this error and saw that the problem is in this `Admin.php:1143
   global $post;` It doesn’t work, this `$post` returns my Size Chart for this product.
   I removed `global $post` and added instead
 *     ```
        $post_id = $_REQUEST['post'];
        $post = get_post( $post_id );
       ```
   
 * The error has been corrected.
    Good luck!
 *  [Saif](https://wordpress.org/support/users/babylon1999/)
 * (@babylon1999)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-fatal-error-334/#post-16258723)
 * Hello [@mcseem42](https://wordpress.org/support/users/mcseem42/),
 * > I debugged this error and saw that the problem is in this
   >  Admin.php:1143 global
   > $post; It doesn’t work, this $post returns my Size Chart for this product. 
   > I removed global $post and added instead
   >  $post_id = $_REQUEST[‘post’];
   >  $post = get_post( $post_id );
 * Glad to hear you’ve figured it out! If you’re able to reproduce the problem consistently,
   I invite you to open a GitHub report about it here: [https://github.com/woocommerce/facebook-for-woocommerce/issues](https://github.com/woocommerce/facebook-for-woocommerce/issues)
 * I will go ahead and mark the thread as solved, please feel free to open a new
   one if you have any other questions.
 * Cheers!

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

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

 * ![](https://ps.w.org/facebook-for-woocommerce/assets/icon.svg?rev=3469606)
 * [Meta for WooCommerce](https://wordpress.org/plugins/facebook-for-woocommerce/)
 * [Support Threads](https://wordpress.org/support/plugin/facebook-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/facebook-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/facebook-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/facebook-for-woocommerce/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Saif](https://wordpress.org/support/users/babylon1999/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/php-fatal-error-334/#post-16258723)
 * Status: resolved