settings = Plugin::get_settings( 'media' ); add_filter( 'adminease_settings_fields', [ $this, 'adminease_settings_fields' ] ); if( !empty( $this->settings['disable_big_image_threshold'] ) ) { add_filter( 'big_image_size_threshold', '__return_false' ); } } /** * Modifies and returns the settings fields for the plugin. * * @param array $fields An array containing the existing fields configuration. * * @return array The updated fields array with the disable big image threshold configuration. */ public function adminease_settings_fields( array $fields ): array { $fields['media']['fields'][] = [ 'type' => 'switch', 'id' => 'disable-big-image-threshold', 'name' => 'adminease[media][disable_big_image_threshold]', 'value' => $this->settings['disable_big_image_threshold'] ?? '', 'label_class' => 'pwp-switch', 'input_class' => 'pwp-field-input', 'label' => __( 'Disable Big Image Threshold', 'adminease' ), 'description' => __( 'Disable WordPress automatic image downscaling for large images. Since WordPress 5.3, images larger than 2560 pixels (width or height) are automatically scaled down to save storage space and improve performance. This is useful for most websites, but photographers, artists, or sites that need to preserve full-resolution images may want to disable this feature. When enabled, WordPress will keep images at their original uploaded resolution without any automatic resizing.', 'adminease' ), ]; return $fields; } }