Google Fonts for WordPress - Version 2.3.3

Version Description

Download this release

Release Info

Developer DannyCooper
Plugin Icon 128x128 Google Fonts for WordPress
Version 2.3.3
Comparing to
See all releases

Code changes from version 2.3.2 to 2.3.3

changelog.txt CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  = 2.3.2 =
2
 
3
  * Fix join() error in PHP7.4
1
+ = 2.3.3 =
2
+
3
+ * Classic Editor bug fix
4
+
5
  = 2.3.2 =
6
 
7
  * Fix join() error in PHP7.4
class-olympus-google-fonts.php CHANGED
@@ -40,35 +40,35 @@ class Olympus_Google_Fonts {
40
  public function includes() {
41
 
42
  // Custom uploads functionality.
43
- require OGF_DIR_PATH . 'includes/class-ogf-fonts-taxonomy.php';
44
- require OGF_DIR_PATH . 'admin/class-ogf-upload-fonts-screen.php';
45
 
46
  // Required files for building the Google Fonts URL.
47
- include OGF_DIR_PATH . 'includes/functions.php';
48
- include OGF_DIR_PATH . 'includes/class-ogf-fonts.php';
49
 
50
  // Required files for the customizer settings.
51
- require OGF_DIR_PATH . 'includes/customizer/panels.php';
52
- include OGF_DIR_PATH . 'includes/customizer/settings.php';
53
- include OGF_DIR_PATH . 'includes/customizer/output-css.php';
54
 
55
  // Required files for the Gutenberg editor.
56
- include OGF_DIR_PATH . 'includes/gutenberg/output-css.php';
57
 
58
  // Notifications class.
59
- include OGF_DIR_PATH . 'includes/class-ogf-notifications.php';
60
 
61
  // Welcome notice class.
62
- include OGF_DIR_PATH . 'includes/class-ogf-welcome.php';
63
 
64
  // Reset class.
65
- require OGF_DIR_PATH . 'includes/class-ogf-reset.php';
66
 
67
  // Classic Editor class.
68
- require OGF_DIR_PATH . 'includes/class-ogf-classic-editor.php';
69
 
70
  // News widget.
71
- require OGF_DIR_PATH . 'includes/class-ogf-dashboard-widget.php';
72
 
73
  }
74
 
40
  public function includes() {
41
 
42
  // Custom uploads functionality.
43
+ require_once OGF_DIR_PATH . 'includes/class-ogf-fonts-taxonomy.php';
44
+ require_once OGF_DIR_PATH . 'admin/class-ogf-upload-fonts-screen.php';
45
 
46
  // Required files for building the Google Fonts URL.
47
+ require_once OGF_DIR_PATH . 'includes/functions.php';
48
+ require_once OGF_DIR_PATH . 'includes/class-ogf-fonts.php';
49
 
50
  // Required files for the customizer settings.
51
+ require_once OGF_DIR_PATH . 'includes/customizer/panels.php';
52
+ require_once OGF_DIR_PATH . 'includes/customizer/settings.php';
53
+ require_once OGF_DIR_PATH . 'includes/customizer/output-css.php';
54
 
55
  // Required files for the Gutenberg editor.
56
+ require_once OGF_DIR_PATH . 'includes/gutenberg/output-css.php';
57
 
58
  // Notifications class.
59
+ require_once OGF_DIR_PATH . 'includes/class-ogf-notifications.php';
60
 
61
  // Welcome notice class.
62
+ require_once OGF_DIR_PATH . 'includes/class-ogf-welcome.php';
63
 
64
  // Reset class.
65
+ require_once OGF_DIR_PATH . 'includes/class-ogf-reset.php';
66
 
67
  // Classic Editor class.
68
+ require_once OGF_DIR_PATH . 'includes/class-ogf-classic-editor.php';
69
 
70
  // News widget.
71
+ require_once OGF_DIR_PATH . 'includes/class-ogf-dashboard-widget.php';
72
 
73
  }
74
 
includes/class-ogf-classic-editor.php CHANGED
@@ -28,12 +28,20 @@ if ( ! class_exists( 'OGF_Classic_Editor' ) ) :
28
  */
29
  private $ogf_fonts;
30
 
 
 
 
 
 
 
 
31
  /**
32
  * Class constructor.
33
  */
34
  public function __construct() {
35
 
36
  $this->ogf_fonts = new OGF_Fonts();
 
37
 
38
  add_filter( 'mce_buttons', array( $this, 'tinymce_add_buttons' ), 1 );
39
  add_filter( 'tiny_mce_before_init', array( $this, 'tinymce_custom_options' ) );
@@ -71,10 +79,19 @@ if ( ! class_exists( 'OGF_Classic_Editor' ) ) :
71
  }
72
 
73
  if ( ogf_is_system_font( $base_type ) ) {
74
- $base_type = str_replace( 'cf-', '', $base_type );
 
75
  }
76
  if ( ogf_is_system_font( $headings_type ) ) {
77
- $headings_type = str_replace( 'cf-', '', $headings_type );
 
 
 
 
 
 
 
 
78
  }
79
 
80
  $opt['font_formats'] = apply_filters( 'ogf_classic_font_formats', 'Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;' );
28
  */
29
  private $ogf_fonts;
30
 
31
+ /**
32
+ * Array of system fonts.
33
+ *
34
+ * @var array
35
+ */
36
+ private $system_fonts;
37
+
38
  /**
39
  * Class constructor.
40
  */
41
  public function __construct() {
42
 
43
  $this->ogf_fonts = new OGF_Fonts();
44
+ $this->system_fonts = ogf_system_fonts();
45
 
46
  add_filter( 'mce_buttons', array( $this, 'tinymce_add_buttons' ), 1 );
47
  add_filter( 'tiny_mce_before_init', array( $this, 'tinymce_custom_options' ) );
79
  }
80
 
81
  if ( ogf_is_system_font( $base_type ) ) {
82
+ $base_type = str_replace( 'sf-', '', $base_type );
83
+ $base_type = $this->system_fonts[ $base_type ]['stack'];
84
  }
85
  if ( ogf_is_system_font( $headings_type ) ) {
86
+ $headings_type = str_replace( 'sf-', '', $headings_type );
87
+ $headings_type = $this->system_fonts[ $headings_type ]['stack'];
88
+ }
89
+
90
+ if ( ogf_is_google_font( $base_type ) ) {
91
+ $base_type = $this->ogf_fonts->get_font_name( $base_type );
92
+ }
93
+ if ( ogf_is_google_font( $headings_type ) ) {
94
+ $headings_type = $this->ogf_fonts->get_font_name( $headings_type );
95
  }
96
 
97
  $opt['font_formats'] = apply_filters( 'ogf_classic_font_formats', 'Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;' );
includes/customizer/panels.php CHANGED
@@ -22,7 +22,7 @@ add_action( 'customize_controls_enqueue_scripts', 'ogf_panels_customize_controls
22
  */
23
  function ogf_panels_customize_register( $wp_customize ) {
24
 
25
- require OGF_DIR_PATH . 'includes/customizer/controls/class-ogf-customize-panel.php';
26
  $wp_customize->register_panel_type( 'OGF_Customize_Panel' );
27
 
28
  $ogf_panel = new OGF_Customize_Panel(
22
  */
23
  function ogf_panels_customize_register( $wp_customize ) {
24
 
25
+ require_once OGF_DIR_PATH . 'includes/customizer/controls/class-ogf-customize-panel.php';
26
  $wp_customize->register_panel_type( 'OGF_Customize_Panel' );
27
 
28
  $ogf_panel = new OGF_Customize_Panel(
includes/customizer/settings.php CHANGED
@@ -13,11 +13,11 @@
13
  * @param object $wp_customize Access to the $wp_customize object.
14
  */
15
  function ogf_customize_register( $wp_customize ) {
16
- require OGF_DIR_PATH . 'includes/customizer/controls/class-ogf-customize-multiple-fonts-control.php';
17
- require OGF_DIR_PATH . 'includes/customizer/controls/class-ogf-customize-typography-control.php';
18
- require OGF_DIR_PATH . 'includes/customizer/controls/class-ogf-customize-repeater-control.php';
19
- require OGF_DIR_PATH . 'includes/customizer/controls/class-ogf-customize-upsell-control.php';
20
- require OGF_DIR_PATH . 'includes/customizer/controls/class-ogf-customize-multiple-checkbox-control.php';
21
 
22
  $wp_customize->register_control_type( 'OGF_Customize_Multiple_Fonts_Control' );
23
  $wp_customize->register_control_type( 'OGF_Customize_Multiple_Checkbox_Control' );
13
  * @param object $wp_customize Access to the $wp_customize object.
14
  */
15
  function ogf_customize_register( $wp_customize ) {
16
+ require_once OGF_DIR_PATH . 'includes/customizer/controls/class-ogf-customize-multiple-fonts-control.php';
17
+ require_once OGF_DIR_PATH . 'includes/customizer/controls/class-ogf-customize-typography-control.php';
18
+ require_once OGF_DIR_PATH . 'includes/customizer/controls/class-ogf-customize-repeater-control.php';
19
+ require_once OGF_DIR_PATH . 'includes/customizer/controls/class-ogf-customize-upsell-control.php';
20
+ require_once OGF_DIR_PATH . 'includes/customizer/controls/class-ogf-customize-multiple-checkbox-control.php';
21
 
22
  $wp_customize->register_control_type( 'OGF_Customize_Multiple_Fonts_Control' );
23
  $wp_customize->register_control_type( 'OGF_Customize_Multiple_Checkbox_Control' );
includes/functions.php CHANGED
@@ -50,7 +50,7 @@ function ogf_get_elements() {
50
  'label' => esc_html__( 'Buttons and Inputs Typography', 'olympus-google-fonts' ),
51
  'description' => esc_html__( 'Select and configure the font for your input fields and buttons.', 'olympus-google-fonts' ),
52
  'section' => 'ogf_basic',
53
- 'selectors' => 'button, input, select, textarea',
54
  ),
55
  'ogf_site_title' => array(
56
  'label' => esc_html__( 'Site Title Typography', 'olympus-google-fonts' ),
50
  'label' => esc_html__( 'Buttons and Inputs Typography', 'olympus-google-fonts' ),
51
  'description' => esc_html__( 'Select and configure the font for your input fields and buttons.', 'olympus-google-fonts' ),
52
  'section' => 'ogf_basic',
53
+ 'selectors' => 'button, .button, input, select, textarea, .wp-block-button, .wp-block-button__link',
54
  ),
55
  'ogf_site_title' => array(
56
  'label' => esc_html__( 'Site Title Typography', 'olympus-google-fonts' ),
olympus-google-fonts.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin Name: Fonts Plugin | Google Fonts Typography
6
  * Plugin URI: https://wordpress.org/plugins/olympus-google-fonts/
7
  * Description: The easiest to use Google Fonts typography plugin. No coding required. 900+ font choices.
8
- * Version: 2.3.2
9
  * Author: Fonts Plugin
10
  * Author URI: https://fontsplugin.com/?utm_source=wporg&utm_medium=readme&utm_campaign=description
11
  * Text Domain: olympus-google-fonts
@@ -18,13 +18,21 @@
18
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
19
  */
20
 
21
- define( 'OGF_VERSION', '2.3.2' );
22
- define( 'OGF_DIR_PATH', plugin_dir_path( __FILE__ ) );
23
- define( 'OGF_DIR_URL', plugin_dir_url( __FILE__ ) );
 
 
 
 
24
 
25
- require OGF_DIR_PATH . 'class-olympus-google-fonts.php';
26
- require OGF_DIR_PATH . 'blocks/init.php';
27
- require OGF_DIR_PATH . 'admin/class-ogf-welcome-screen.php';
 
 
 
 
28
 
29
  $gfwp = new Olympus_Google_Fonts();
30
 
@@ -33,33 +41,32 @@ $theme_author = strtolower( esc_attr( $current_theme->get( 'Author' ) ) );
33
  $theme_author = str_replace( ' ', '', $theme_author );
34
  $author_compat_path = OGF_DIR_PATH . '/compatibility/' . $theme_author . '.php';
35
  if ( file_exists( $author_compat_path ) ) {
36
- require $author_compat_path;
37
  }
38
 
39
- /**
40
- * Add a redirection check on activation.
41
- */
42
- function ogf_activate() {
43
- add_option( 'ogf_do_activation_redirect', true );
 
 
 
44
  }
45
- register_activation_hook( __FILE__, 'ogf_activate' );
46
-
47
 
48
- /**
49
- * Redirect to the Google Fonts Welcome page.
50
- */
51
- function ogf_redirect() {
52
 
53
- // don't show the welcome message to users before v2.0.6.
54
- if ( get_site_option( 'ogf_activation_date' ) < 1593090943 ) {
55
- return;
56
- }
 
57
 
58
- if ( get_option( 'ogf_do_activation_redirect', false ) ) {
59
- delete_option( 'ogf_do_activation_redirect' );
60
- if ( ! isset( $_GET['activate-multi'] ) ) {
61
- wp_redirect( 'admin.php?page=fonts-plugin' );
62
- exit;
 
63
  }
64
  }
65
  }
5
  * Plugin Name: Fonts Plugin | Google Fonts Typography
6
  * Plugin URI: https://wordpress.org/plugins/olympus-google-fonts/
7
  * Description: The easiest to use Google Fonts typography plugin. No coding required. 900+ font choices.
8
+ * Version: 2.3.3
9
  * Author: Fonts Plugin
10
  * Author URI: https://fontsplugin.com/?utm_source=wporg&utm_medium=readme&utm_campaign=description
11
  * Text Domain: olympus-google-fonts
18
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
19
  */
20
 
21
+ if ( ! defined( 'OGF_VERSION' ) ) {
22
+ define( 'OGF_VERSION', '2.3.3' );
23
+ }
24
+
25
+ if ( ! defined( 'OGF_DIR_PATH' ) ) {
26
+ define( 'OGF_DIR_PATH', plugin_dir_path( __FILE__ ) );
27
+ }
28
 
29
+ if ( ! defined( 'OGF_DIR_URL' ) ) {
30
+ define( 'OGF_DIR_URL', plugin_dir_url( __FILE__ ) );
31
+ }
32
+
33
+ require_once OGF_DIR_PATH . 'class-olympus-google-fonts.php';
34
+ require_once OGF_DIR_PATH . 'blocks/init.php';
35
+ require_once OGF_DIR_PATH . 'admin/class-ogf-welcome-screen.php';
36
 
37
  $gfwp = new Olympus_Google_Fonts();
38
 
41
  $theme_author = str_replace( ' ', '', $theme_author );
42
  $author_compat_path = OGF_DIR_PATH . '/compatibility/' . $theme_author . '.php';
43
  if ( file_exists( $author_compat_path ) ) {
44
+ require_once $author_compat_path;
45
  }
46
 
47
+ if ( ! function_exists( 'ogf_activate' ) ) {
48
+ /**
49
+ * Add a redirection check on activation.
50
+ */
51
+ function ogf_activate() {
52
+ add_option( 'ogf_do_activation_redirect', true );
53
+ }
54
+ register_activation_hook( __FILE__, 'ogf_activate' );
55
  }
 
 
56
 
 
 
 
 
57
 
58
+ if ( ! function_exists( 'ogf_redirect' ) ) {
59
+ /**
60
+ * Redirect to the Google Fonts Welcome page.
61
+ */
62
+ function ogf_redirect() {
63
 
64
+ if ( get_option( 'ogf_do_activation_redirect', false ) ) {
65
+ delete_option( 'ogf_do_activation_redirect' );
66
+ if ( ! isset( $_GET['activate-multi'] ) ) {
67
+ wp_redirect( 'admin.php?page=fonts-plugin' );
68
+ exit;
69
+ }
70
  }
71
  }
72
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://fontsplugin.com/#pricing
5
  Requires at least: 4.0
6
  Tested up to: 5.5
7
  License: GPLv2 or later
8
- Stable tag: 2.3.2
9
 
10
  The easiest to use Google Fonts Typography Plugin. No coding required. 900+ font choices.
11
 
5
  Requires at least: 4.0
6
  Tested up to: 5.5
7
  License: GPLv2 or later
8
+ Stable tag: 2.3.3
9
 
10
  The easiest to use Google Fonts Typography Plugin. No coding required. 900+ font choices.
11