white_label = new WhiteLabel(); $this->next_gen_manager = Next_Gen_Manager::get_instance(); $this->next_gen_configuration = $this->next_gen_manager->get_active_format_configuration(); $this->register_action( 'wp_smush_next_gen_formats_settings', array( $this, 'add_next_gen_formats_field' ), self::NEXT_GEN_FORMATS_FIELD_PRIORITY ); $this->register_action( 'wp_smush_next_gen_formats_settings', array( $this, 'add_legacy_browser_support_field' ), self::LEGACY_BROWSER_SUPPORT_FIELD_PRIORITY ); $this->register_action( 'wp_smush_next_gen_formats_settings', array( $this, 'add_supported_media_types_field' ), self::SUPPORTED_MEDIA_TYPES_FIELD_PRIORITY ); $this->register_action( 'wp_smush_next_gen_formats_settings', array( $this, 'add_revert_next_gen_conversion_field' ), self::REVERT_NEXT_GEN_CONVERSION_FIELD_PRIORITY ); $this->register_action( 'wp_smush_next_gen_formats_settings', array( $this, 'add_deactivate_button' ), self::DEACTIVATE_BUTTON_PRIORITY ); } public function add_next_gen_formats_field() { $settings_row = new Settings_Row( array( $this, 'get_next_gen_formats_field_title' ), __( 'Choose between WebP and AVIF next-gen formats, offering superior quality and compression for faster load times and better performance.', 'wp-smushit' ), array( $this, 'get_next_gen_formats_field_content' ), array( 'id' => 'next-gen-next-gen-formats-settings-row', ) ); $settings_row->render(); } public function add_legacy_browser_support_field() { $settings_row = new Settings_Row( __( 'Legacy Browser Support', 'wp-smushit' ), __( 'Use JavaScript to serve original image files to unsupported browsers.', 'wp-smushit' ), array( $this, 'get_legacy_browser_support_field_content' ), array( 'id' => 'next-gen-legacy-browser-support-settings-row', 'class' => $this->next_gen_configuration->direct_conversion_enabled() ? '' : 'sui-hidden', ) ); $settings_row->render(); } public function add_supported_media_types_field() { $settings_row = new Settings_Row( __( 'Supported Media Types', 'wp-smushit' ), array( $this, 'get_supported_media_types_field_description' ), array( $this, 'get_supported_media_types_field_content' ), array( 'id' => 'next-gen-supported-media-types-settings-row', ) ); $settings_row->render(); } public function add_revert_next_gen_conversion_field() { $settings_row = new Settings_Row( __( 'Revert Next-Gen Conversion', 'wp-smushit' ), __( 'If your server storage space is full, use this feature to revert the Next-Gen conversions by deleting all generated files. The files will fall back to normal PNGs or JPEGs once you delete them.', 'wp-smushit' ), array( $this, 'get_revert_next_gen_conversion_field_content' ), array( 'id' => 'next-gen-revert-conversion-settings-row', ) ); $settings_row->render(); } public function add_deactivate_button() { $settings_row = new Settings_Row( __( 'Deactivate', 'wp-smushit' ), array( $this, 'get_deactivate_button_description' ), array( $this, 'get_deactivate_button_content' ), array( 'id' => 'next-gen-deactivate-settings-row', ) ); $settings_row->render(); } public function get_deactivate_button_description() { /* translators: %s: Next-Gen format name */ printf( esc_html__( 'If you no longer require your images to be served in %s format, you can disable this feature.', 'wp-smushit' ), esc_html( $this->next_gen_configuration->get_format_name() ) ); } public function get_deactivate_button_content() { ?> next_gen_configuration->get_format_name() ) ); ?> next_gen_configuration->get_format_name() ) ); } public function get_supported_media_types_field_content() { ?>