Title: Uncaught TypeError
Last modified: August 2, 2025

---

# Uncaught TypeError

 *  Resolved [mtg169](https://wordpress.org/support/users/mtg169/)
 * (@mtg169)
 * [8 months, 1 week ago](https://wordpress.org/support/topic/uncaught-typeerror-96/)
 * 3.1.6 is throwing the following fatal on a site:
 *     ```wp-block-code
       PHP Fatal error:  Uncaught TypeError: array_search(): Argument #2 ($haystack) must be of type array, false given in /srv/htdocs/wp-content/plugins/woolentor-addons/includes/helper-function.php:318Stack trace:#0 /srv/htdocs/wp-content/plugins/woolentor-addons/includes/helper-function.php(318): array_search(1531, false)#1 /srv/htdocs/wp-content/plugins/woolentor-addons/includes/base.php(411): woolentor_set_views_count(1531, 'product')#2 /wordpress/core/6.8.2/wp-includes/class-wp-hook.php(324): WooLentor\Base->track_user_viewed_products('')#3 /wordpress/core/6.8.2/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)#4 /wordpress/core/6.8.2/wp-includes/plugin.php(517): WP_Hook->do_action(Array)#5 /wordpress/core/6.8.2/wp-includes/template-loader.php(13): do_action('template_redire...')#6 /wordpress/core/6.8.2/wp-blog-header.php(19): require_once('/wordpress/core...')#7 /wordpress/core/6.8.2/index.php(17): require('/wordpress/core...')#8 {main}  thrown in /srv/htdocs/wp-content/plugins/woolentor-addons/includes/helper-function.php on line 318
       ```
   
 * Can you add better data type checks before calling array functions?

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

 *  Plugin Support [kamal025](https://wordpress.org/support/users/kamal025/)
 * (@kamal025)
 * [8 months, 1 week ago](https://wordpress.org/support/topic/uncaught-typeerror-96/#post-18583253)
 * Hello [@mtg169](https://wordpress.org/support/users/mtg169/) ,
 * Thank you for bringing this to our attention, and we’re very sorry for the inconvenience
   caused.
 * We’ve reviewed the error you’ve reported, and it appears to be due to a missing
   data type check before calling the `array_search()` function. We appreciate you
   pointing this out.
 * Our development team is already looking into it, and we’ll include a fix with
   proper data validation in the next plugin update as soon as possible.
 * Thank you again for your detailed report—it really helps us improve the plugin.
   If you have any further questions or need temporary assistance, feel free to 
   let us know.
 * Best regards,
   Kamal
 *  Plugin Author [Zenaul Islam](https://wordpress.org/support/users/zenaulislam/)
 * (@zenaulislam)
 * [8 months, 1 week ago](https://wordpress.org/support/topic/uncaught-typeerror-96/#post-18584040)
 * Hi [@mtg169](https://wordpress.org/support/users/mtg169/),
 * We’ve just released new version 3.1.7, which addresses the issue you encountered.
 * Feel free to update to the latest version, and do let us know if you face any
   further trouble. We appreciate your patience throughout this process.
 * Kind regards,
    Zenaul Islam

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

The topic ‘Uncaught TypeError’ is closed to new replies.

 * ![](https://ps.w.org/woolentor-addons/assets/icon-256x256.png?rev=3011160)
 * [ShopLentor – All-in-One WooCommerce Growth & Store Enhancement Plugin](https://wordpress.org/plugins/woolentor-addons/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woolentor-addons/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woolentor-addons/)
 * [Active Topics](https://wordpress.org/support/plugin/woolentor-addons/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woolentor-addons/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woolentor-addons/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Zenaul Islam](https://wordpress.org/support/users/zenaulislam/)
 * Last activity: [8 months, 1 week ago](https://wordpress.org/support/topic/uncaught-typeerror-96/#post-18584040)
 * Status: resolved