Google Fonts for WordPress - Version 2.2.4

Version Description

Download this release

Release Info

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

Code changes from version 2.2.3 to 2.2.4

admin/class-ogf-welcome-screen.php CHANGED
@@ -14,7 +14,7 @@ class OGF_Admin_Welcome_Screen {
14
  * Start up
15
  */
16
  public function __construct() {
17
- add_action( 'admin_menu', array( $this, 'add_plugin_page' ) );
18
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
19
  }
20
 
@@ -38,7 +38,8 @@ class OGF_Admin_Welcome_Screen {
38
  __( 'Customize Fonts', 'olympus-google-fonts' ),
39
  __( 'Customize Fonts', 'olympus-google-fonts' ),
40
  'manage_options',
41
- esc_url( admin_url( '/customize.php?autofocus[panel]=ogf_google_fonts' ) )
 
42
  );
43
 
44
  }
14
  * Start up
15
  */
16
  public function __construct() {
17
+ add_action( 'admin_menu', array( $this, 'add_plugin_page' ), 1 );
18
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
19
  }
20
 
38
  __( 'Customize Fonts', 'olympus-google-fonts' ),
39
  __( 'Customize Fonts', 'olympus-google-fonts' ),
40
  'manage_options',
41
+ esc_url( admin_url( '/customize.php?autofocus[panel]=ogf_google_fonts' ) ),
42
+ 5
43
  );
44
 
45
  }
changelog.txt CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  = 2.2.3 =
2
 
3
  * Update fonts list
1
+ = 2.2.4 =
2
+
3
+ * Add failsafe to protect against fonts getting removed
4
+
5
  = 2.2.3 =
6
 
7
  * Update fonts list
class-olympus-google-fonts.php CHANGED
@@ -160,10 +160,14 @@ class Olympus_Google_Fonts {
160
 
161
  array_push( $links, $settings_link );
162
 
163
- // Upgrade Link.
164
- $pro_link = '<a href="https://fontsplugin.com/pro-upgrade/?utm_source=plugin&utm_medium=wpadmin&utm_campaign=upsell">' . esc_html__( 'Upgrade to Pro', 'olympus-google-fonts' ) . '</a>';
 
 
165
 
166
- array_push( $links, $pro_link );
 
 
167
 
168
  return $links;
169
 
160
 
161
  array_push( $links, $settings_link );
162
 
163
+ if ( ! defined( 'OGF_PRO' ) ) {
164
+
165
+ // Upgrade Link.
166
+ $pro_link = '<a href="https://fontsplugin.com/pro-upgrade/?utm_source=plugin&utm_medium=wpadmin&utm_campaign=upsell">' . esc_html__( 'Upgrade to Pro', 'olympus-google-fonts' ) . '</a>';
167
 
168
+ array_push( $links, $pro_link );
169
+
170
+ }
171
 
172
  return $links;
173
 
includes/class-ogf-fonts.php CHANGED
@@ -108,7 +108,11 @@ class OGF_Fonts {
108
  */
109
  public function get_font_name( $font_id ) {
110
 
111
- return self::$google_fonts[ $font_id ]['f'];
 
 
 
 
112
 
113
  }
114
 
108
  */
109
  public function get_font_name( $font_id ) {
110
 
111
+ if ( array_key_exists( $font_id, self::$google_fonts ) ) {
112
+ return self::$google_fonts[ $font_id ]['f'];
113
+ } else {
114
+ return __( 'Font Missing', 'olympus-google-fonts' );
115
+ }
116
 
117
  }
118
 
includes/customizer/controls/class-ogf-customize-typography-control.php CHANGED
@@ -258,7 +258,7 @@ class OGF_Customize_Typography_Control extends WP_Customize_Control {
258
  return $all_variants;
259
  }
260
 
261
- if ( ogf_is_system_font( $font ) || ogf_is_custom_font( $font ) ) {
262
  return array(
263
  '0' => esc_html__( '- Default -', 'olympus-google-fonts' ),
264
  '400' => esc_html__( 'Normal', 'olympus-google-fonts' ),
258
  return $all_variants;
259
  }
260
 
261
+ if ( ogf_is_system_font( $font ) || ogf_is_custom_font( $font ) || ! ogf_is_google_font( $font ) ) {
262
  return array(
263
  '0' => esc_html__( '- Default -', 'olympus-google-fonts' ),
264
  '400' => esc_html__( 'Normal', 'olympus-google-fonts' ),
includes/customizer/settings.php CHANGED
@@ -187,7 +187,9 @@ function ogf_customize_register( $wp_customize ) {
187
  // Build the selective font loading controls.
188
  foreach ( $choices as $font_id ) {
189
 
190
- if ( ogf_is_system_font( $font_id ) || ogf_is_custom_font( $font_id ) ) {
 
 
191
  return;
192
  }
193
 
187
  // Build the selective font loading controls.
188
  foreach ( $choices as $font_id ) {
189
 
190
+ if ( ogf_is_system_font( $font_id )
191
+ || ogf_is_custom_font( $font_id )
192
+ || ! ogf_is_google_font( $font_id ) ) {
193
  return;
194
  }
195
 
includes/functions.php CHANGED
@@ -338,3 +338,16 @@ function ogf_is_custom_font( $font_id ) {
338
  }
339
  return false;
340
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
338
  }
339
  return false;
340
  }
341
+
342
+ /**
343
+ * Check if a font is a Google font.
344
+ *
345
+ * @param string $font_id The ID of the font to check.
346
+ */
347
+ function ogf_is_google_font( $font_id ) {
348
+ if ( array_key_exists( $font_id, OGF_Fonts::$google_fonts ) ) {
349
+ return true;
350
+ }
351
+
352
+ return false;
353
+ }
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.2.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,7 +18,7 @@
18
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
19
  */
20
 
21
- define( 'OGF_VERSION', '2.2.3' );
22
  define( 'OGF_DIR_PATH', plugin_dir_path( __FILE__ ) );
23
  define( 'OGF_DIR_URL', plugin_dir_url( __FILE__ ) );
24
 
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.2.4
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
+ define( 'OGF_VERSION', '2.2.4' );
22
  define( 'OGF_DIR_PATH', plugin_dir_path( __FILE__ ) );
23
  define( 'OGF_DIR_URL', plugin_dir_url( __FILE__ ) );
24
 
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.2.3
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.2.4
9
 
10
  The easiest to use Google Fonts Typography Plugin. No coding required. 900+ font choices.
11