title = __('Google Fonts Detection Settings', $this->plugin_text_domain); // Open add_filter('omgf_detection_settings_content', [$this, 'do_title'], 10); add_filter('omgf_detection_settings_content', [$this, 'do_description'], 15); add_filter('omgf_detection_settings_content', [$this, 'do_before'], 20); // Settings add_filter('omgf_detection_settings_content', [$this, 'do_process_google_fonts'], 30); add_filter('omgf_detection_settings_content', [$this, 'do_promo_advanced_processing'], 40); add_filter('omgf_detection_settings_content', [$this, 'do_promo_safe_mode'], 50); add_filter('omgf_detection_settings_content', [$this, 'do_promo_fonts_processing'], 60); add_filter('omgf_detection_settings_content', [$this, 'do_promo_process_resource_hints'], 70); // Close add_filter('omgf_detection_settings_content', [$this, 'do_after'], 100); } /** * Description */ public function do_description() { ?>

Google Fonts Processing to Remove.', $this->plugin_text_domain); ?>

plugin_text_domain); ?>
fonts_processing_pro_options() as $name => $data) : ?>

promo; ?>

[ 'label' => __('Process External Stylesheets', $this->plugin_text_domain), 'description' => __('Process stylesheets loaded from fonts.googleapis.com or fonts.gstatic.com.', $this->plugin_text_domain) ], 'omgf_pro_process_stylesheet_imports' => [ 'label' => __('Process Stylesheet Imports', $this->plugin_text_domain), 'description' => __('Scan stylesheets loaded by your theme and plugins for @import statements loading Google Fonts and process them.', $this->plugin_text_domain) ], 'omgf_pro_process_stylesheet_font_faces' => [ 'label' => __('Process Stylesheet Font Faces', $this->plugin_text_domain), 'description' => __('Scan stylesheets loaded by your theme and plugins for @font-face statements loading Google Fonts and process them.', $this->plugin_text_domain) ], 'omgf_pro_process_inline_styles' => [ 'label' => __('Process Inline Styles', $this->plugin_text_domain), 'description' => __('Process all inline @font-face and @import rules loading Google Fonts.', $this->plugin_text_domain) ], 'omgf_pro_process_webfont_loader' => [ 'label' => __('Process Webfont Loader', $this->plugin_text_domain), 'description' => __('Process webfont.js libraries and the corresponding configuration defining which Google Fonts to load.', $this->plugin_text_domain) ], 'omgf_pro_process_early_access' => [ 'label' => __('Process Early Access', $this->plugin_text_domain), 'description' => __('Process stylesheets loaded from fonts.googleapis.com/earlyaccess or fonts.gstatic.com/ea.', $this->plugin_text_domain) ] ]; } /** * */ public function do_promo_advanced_processing() { $this->do_checkbox( __('Advanced Processing (Pro)', $this->plugin_text_domain), 'omgf_pro_advanced_processing', defined('OMGF_PRO_ADVANCED_PROCESSING') ? OMGF_PRO_ADVANCED_PROCESSING : false, __('By default, OMGF scans for Google Fonts which are registered/enqueued using the wp_enqueue_scripts() action in WordPress\' header (wp_head()). Enabling this option will process all Google Fonts throughout the entire document. This setting can be fine-tuned using the settings below.', $this->plugin_text_domain) . ' ' . $this->promo, true ); } /** * Add option for Safe Mode (Pro) * * @return void */ public function do_promo_safe_mode() { $this->do_checkbox( __('Safe Mode (Pro)', $this->plugin_text_domain), 'omgf_pro_safe_mode', defined('OMGF_PRO_SAFE_MODE') ? OMGF_PRO_SAFE_MODE : false, __('Enable Safe Mode if Advanced Processing (Pro) breaks styling of certain pages.', $this->plugin_text_domain) . ' ' . $this->promo, true ); } /** * Add promo options for Process Resource Hints */ public function do_promo_process_resource_hints() { $this->do_checkbox( __('Remove Resource Hints (Pro)', $this->plugin_text_domain), 'omgf_pro_process_resource_hints', defined('OMGF_PRO_PROCESS_RESOURCE_HINTS') ? OMGF_PRO_PROCESS_RESOURCE_HINTS : false, __('Remove all link elements with a rel attribute value of dns-prefetch, preload or preconnect pointing to fonts.googleapis.com or fonts.gstatic.com.', $this->plugin_text_domain) . ' ' . $this->promo, true ); } /** * */ public function do_process_google_fonts() { $this->do_select( __('Google Fonts Processing', $this->plugin_text_domain), OMGF_Admin_Settings::OMGF_DETECTION_SETTING_FONT_PROCESSING, OMGF_Admin_Settings::OMGF_FONT_PROCESSING_OPTIONS, OMGF_FONT_PROCESSING, sprintf(__("Choose whether OMGF should (find, download and) replace all Google Fonts, or just remove them. Choosing Remove will force WordPress to fallback to system fonts.", $this->plugin_text_domain), OMGF_Admin_Settings::FFWP_WORDPRESS_PLUGINS_OMGF_PRO) ); } }