Title: Error in log
Last modified: April 3, 2026

---

# Error in log

 *  Resolved [hebhansen](https://wordpress.org/support/users/hebhansen/)
 * (@hebhansen)
 * [6 months, 1 week ago](https://wordpress.org/support/topic/error-in-log-21/)
 * Hi
 * I see this error in debug mode:
 *     ```wp-block-code
       [03-Apr-2026 14:59:38 UTC] PHP Fatal error:  Uncaught Error: Call to a member function get_cross_sells() on null in /site/public_html/wp-content/plugins/hide-category-by-user-role-for-woocommerce/public/public-ui-setup.php:477Stack trace:#0 /site/public_html/wp-includes/class-wp-hook.php(343): tswchc_customize_cross_sell_products_block(NULL, Array)#1 /site/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(NULL, Array)#2 /site/public_html/wp-includes/class-wp-block.php(555): apply_filters('pre_render_bloc...', NULL, Array, Object(WP_Block))#3 /site/public_html/wp-includes/class-wp-block.php(579): WP_Block->render()#4 /site/public_html/wp-includes/class-wp-block.php(579): WP_Block->render()#5 /site/public_html/wp-includes/blocks.php(2383): WP_Block->render()#6 /site/public_html/wp-includes/blocks.php(2466): render_block(Array)#7 /site/public_html/wp-includes/class-wp-hook.php(341): do_blocks('<!-- wp:woocomm...')#8 /site/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters('<!-- wp:woocomm...', Array)#9 /site/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(1972): apply_filters('the_content', '<!-- wp:woocomm...')#10 /site/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(476): WP_REST_Posts_Controller->prepare_item_for_response(Object(WP_Post), Object(WP_REST_Request))#11 /site/public_html/wp-includes/rest-api/class-wp-rest-server.php(1292): WP_REST_Posts_Controller->get_items(Object(WP_REST_Request))#12 /site/public_html/wp-includes/rest-api/class-wp-rest-server.php(1125): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wp/v2/pages', Array, NULL)#13 /site/public_html/wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server->dispatch(Object(WP_REST_Request))#14 /site/public_html/wp-includes/rest-api.php(467): WP_REST_Server->serve_request('/wp/v2/pages')#15 /site/public_html/wp-includes/class-wp-hook.php(341): rest_api_loaded(Object(WP))#16 /site/public_html/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters(NULL, Array)#17 /site/public_html/wp-includes/plugin.php(570): WP_Hook->do_action(Array)#18 /site/public_html/wp-includes/class-wp.php(418): do_action_ref_array('parse_request', Array)#19 /site/public_html/wp-includes/class-wp.php(821): WP->parse_request('')#20 /site/public_html/wp-includes/functions.php(1343): WP->main('')#21 /site/public_html/wp-blog-header.php(16): wp()#22 /site/public_html/index.php(17): require('/site/...')#23 {main}  thrown in /site/public_html/wp-content/plugins/hide-category-by-user-role-for-woocommerce/public/public-ui-setup.php on line 477
       ```
   
    -  This topic was modified 6 months, 1 week ago by [hebhansen](https://wordpress.org/support/users/hebhansen/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [ThemeSupport](https://wordpress.org/support/users/themesupport/)
 * (@themesupport)
 * [6 months, 1 week ago](https://wordpress.org/support/topic/error-in-log-21/#post-18871406)
 * Thank you for bringing this to our attention.
 * **We’ve pushed the fix in the new 2.4 version of the plugin.**
 * This new version addresses the issues you reported and also includes the following
   improvements:
    - Prevents direct URL access to hidden products based on category/role rules.
    - Centralized visibility logic to ensure consistent behavior across all critical
      points.
    - Parent category (hierarchy) validation to prevent restricted products from
      appearing through indirect relationships.
    - Consistent validation in the add-to-cart process to block hidden products 
      from being added to the cart.
    - Automatic cart cleanup to remove products that are no longer allowed under
      active rules.
    - Improved handling of restricted access using configurable modes: redirect (
      URL) or custom message (display-message).

Viewing 1 replies (of 1 total)

 The topic ‘Error in log’ is closed to new replies.

 * ![](https://ps.w.org/hide-category-by-user-role-for-woocommerce/assets/icon.svg?
   rev=2849407)
 * [Hide Category by User Role for WooCommerce](https://wordpress.org/plugins/hide-category-by-user-role-for-woocommerce/)
 * [Support Threads](https://wordpress.org/support/plugin/hide-category-by-user-role-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/hide-category-by-user-role-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/hide-category-by-user-role-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/hide-category-by-user-role-for-woocommerce/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [ThemeSupport](https://wordpress.org/support/users/themesupport/)
 * Last activity: [6 months, 1 week ago](https://wordpress.org/support/topic/error-in-log-21/#post-18871406)
 * Status: resolved