Title: Uncaught Error
Last modified: July 1, 2025

---

# Uncaught Error

 *  Resolved [T.Libbrecht](https://wordpress.org/support/users/tlibbrecht/)
 * (@tlibbrecht)
 * [11 months, 1 week ago](https://wordpress.org/support/topic/uncaught-error-52/)
 * When I want to disable the thumbnails I get an “Uncaught Error”
 * [⌊Scherm-afbeelding-2025-07-01-om-18-35-51⌉⌊Scherm-afbeelding-2025-07-01-om-18-
   35-51⌉[

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

 *  [cheey2003](https://wordpress.org/support/users/cheey2003/)
 * (@cheey2003)
 * [8 months, 2 weeks ago](https://wordpress.org/support/topic/uncaught-error-52/#post-18658212)
 * The error occurs because the array_map() function in the Thumbnail Remover plugin
   is receiving a string instead of an array as its second argument. It is a common
   issue type, especially in PHP 8.x, which has stricter type checking.
   I temporarily
   disable the nonce checking to set the thumbnail sizes that I wanted to disable,
   and revert it to its original state once the options are set.
 *     ```wp-block-code
       // Verify nonce        // Disable the nonce conditional requirement	/** if ( isset( $_POST['thumbnail_manager_nonce'] ) ) {		$nonce = array_map( 'sanitize_text_field', wp_unslash( $_POST['thumbnail_manager_nonce'] ) );		if ( wp_verify_nonce( $nonce, 'thumbnail_manager_action' ) ) { **/			if ( isset( $_POST['disable_sizes'] ) ) {				$sizes_to_disable = isset( $_POST['disable'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_POST['disable'] ) ) : array();				update_option( 'trpl_disabled_image_sizes', $sizes_to_disable );				echo '<div class="updated"><p>' . esc_html__( 'Image sizes have been updated. The selected sizes will not be generated for future uploads.', 'thumbnail-remover' ) . '</p></div>';			}	/**	}} **/
       ```
   
 *  Plugin Author [Mehdi Rezaei](https://wordpress.org/support/users/mehdiraized/)
 * (@mehdiraized)
 * [2 months, 4 weeks ago](https://wordpress.org/support/topic/uncaught-error-52/#post-18849382)
 * Hi! We’ve identified and fixed the issue.
 * The crash was caused by the plugin expecting an array in a few places, while 
   on some sites WordPress/PHP was passing a string instead. This is especially 
   noticeable on PHP 8.x, where type checks are stricter. We’ve updated the plugin
   to safely normalize these values before processing them, and we also corrected
   the nonce handling in the settings form.
 * You should no longer need any workaround such as disabling the nonce check. Please
   update to the latest fixed version and test disabling thumbnail sizes again. 
   If you still see an error, please share the exact error message and your WordPress/
   PHP versions so we can investigate further.

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

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

 * ![](https://ps.w.org/thumbnail-remover/assets/icon-256x256.png?rev=3147825)
 * [Thumbnail Remover and Size Manager](https://wordpress.org/plugins/thumbnail-remover/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/thumbnail-remover/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/thumbnail-remover/)
 * [Active Topics](https://wordpress.org/support/plugin/thumbnail-remover/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/thumbnail-remover/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/thumbnail-remover/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Mehdi Rezaei](https://wordpress.org/support/users/mehdiraized/)
 * Last activity: [2 months, 4 weeks ago](https://wordpress.org/support/topic/uncaught-error-52/#post-18849382)
 * Status: resolved