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.
// 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>';
}
/** }
} **/
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.