PluginProbe
EasyFonts – Host Google Fonts Locally, Fast & Auto-Optimize, GDPR Compliant / 1.3
EasyFonts – Host Google Fonts Locally, Fast & Auto-Optimize, GDPR Compliant v1.3
2.0.4 2.0.3 2.0.2 2.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2 1.3 2.0.0
easyfonts / inc / notices.php

notices.php in EasyFonts – Host Google Fonts Locally, Fast & Auto-Optimize, GDPR Compliant 1.3, at inc/notices.php

55 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * EasyFonts Notices
4 *
5 * Handles admin notices for the EasyFonts plugin.
6 *
7 * @package EasyFonts
8 * @since 1.2.0
9 */
10
11 if ( ! defined( 'WPINC' ) ) {
12 die;
13 }
14
15 class EasyFonts_Notices {
16
17 public function __construct() {
18 add_action( 'admin_notices', [ $this, 'check_incompatible_plugins' ] );
19 }
20
21 /**
22 * Check for incompatible plugins and display notices if active.
23 */
24 public function check_incompatible_plugins() {
25 /* Only show on the EasyFonts settings page to avoid cluttering other admin areas.
26 if ( 'settings_page_easyfonts' !== get_current_screen()->id ) {
27 return;
28 }*/
29
30 // Check for 'Local Google Fonts'.
31 if ( is_plugin_active( 'local-google-fonts/local-google-fonts.php' ) ) {
32 $this->display_notice( __( 'The "Local Google Fonts" plugin is active and may cause conflicts with EasyFonts. Please deactivate it to avoid issues.', 'easyfonts' ) );
33 }
34
35 // Check for 'OMGF | Host Google Fonts Locally'.
36 if ( is_plugin_active( 'host-webfonts-local/host-webfonts-local.php' ) ) {
37 $this->display_notice( __( 'The "OMGF | Host Google Fonts Locally" plugin is active and may cause conflicts with EasyFonts. Please deactivate it to avoid issues.', 'easyfonts' ) );
38 }
39 }
40
41 /**
42 * Display an error notice.
43 *
44 * @param string $message The notice message.
45 */
46 private function display_notice( $message ) {
47 ?>
48 <div class="notice notice-error is-dismissible">
49 <p><?php echo esc_html( $message ); ?></p>
50 </div>
51 <?php
52 }
53 }
54
55 new EasyFonts_Notices();