Google Fonts for WordPress - Version 1.7.5

Version Description

Download this release

Release Info

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

Code changes from version 1.7.4 to 1.7.5

blocks/init.php CHANGED
@@ -80,7 +80,7 @@ add_action( 'init', 'olympus_google_fonts_register_block' );
80
  */
81
  function olympus_google_fonts_block_render( $attributes ) {
82
 
83
- $blockType = isset( $attributes['blockType'] ) ? esc_attr( $attributes['blockType'] ) : 'p';
84
  $font_id = isset( $attributes['fontID'] ) ? sanitize_text_field( $attributes['fontID'] ) : '';
85
  $variant = isset( $attributes['variant'] ) ? sanitize_text_field( $attributes['variant'] ) : '';
86
  $font_size = isset( $attributes['fontSize'] ) ? intval( $attributes['fontSize'] ) : '';
@@ -93,15 +93,15 @@ function olympus_google_fonts_block_render( $attributes ) {
93
 
94
  if ( $font_id ) {
95
 
96
- $font_family = str_replace( '+', ' ', $font_id );
97
  $font_id = str_replace( '+', '-', strtolower( $font_id ) );
98
 
99
  $fonts = ogf_fonts_array();
100
  $variants = $fonts[ $font_id ]['variants'];
101
  unset( $variants[0] );
102
- $variants_for_url = join( array_keys( $variants ), ',' );
103
 
104
- wp_enqueue_style( 'google-font-' . $font_id, esc_url( 'https://fonts.googleapis.com/css?display=swap&family=' . $font_family . ':' . $variants_for_url ), array(), OGF_VERSION );
105
 
106
  $style = "font-family: {$font_family};";
107
  }
@@ -126,9 +126,9 @@ function olympus_google_fonts_block_render( $attributes ) {
126
  $style .= "color: {$color};";
127
  }
128
 
129
- $output .= '<' . $blockType . ' class="google-fonts-blocks" style="' . $style . '">';
130
  $output .= $content;
131
- $output .= '</' . $blockType . '>';
132
 
133
  return $output;
134
  }
80
  */
81
  function olympus_google_fonts_block_render( $attributes ) {
82
 
83
+ $block_type = isset( $attributes['blockType'] ) ? esc_attr( $attributes['blockType'] ) : 'p';
84
  $font_id = isset( $attributes['fontID'] ) ? sanitize_text_field( $attributes['fontID'] ) : '';
85
  $variant = isset( $attributes['variant'] ) ? sanitize_text_field( $attributes['variant'] ) : '';
86
  $font_size = isset( $attributes['fontSize'] ) ? intval( $attributes['fontSize'] ) : '';
93
 
94
  if ( $font_id ) {
95
 
96
+ $font_family = esc_attr( str_replace( '+', ' ', $font_id ) );
97
  $font_id = str_replace( '+', '-', strtolower( $font_id ) );
98
 
99
  $fonts = ogf_fonts_array();
100
  $variants = $fonts[ $font_id ]['variants'];
101
  unset( $variants[0] );
102
+ $variants_for_url = join( array_keys( esc_attr( $variants ) ), ',' );
103
 
104
+ wp_enqueue_style( 'google-font-' . $font_id, 'https://fonts.googleapis.com/css?family=' . $font_family . ':' . $variants_for_url . '&display=swap', array(), OGF_VERSION );
105
 
106
  $style = "font-family: {$font_family};";
107
  }
126
  $style .= "color: {$color};";
127
  }
128
 
129
+ $output .= '<' . $block_type . ' class="google-fonts-blocks" style="' . $style . '">';
130
  $output .= $content;
131
+ $output .= '</' . $block_type . '>';
132
 
133
  return $output;
134
  }
changelog.txt CHANGED
@@ -1,5 +1,10 @@
1
  = 1.7.4 =
2
 
 
 
 
 
 
3
  * Transform core paragraph and heading blocks into "Google Fonts Blocks".
4
  * Add color option to "Google Fonts Block".
5
  * Add Block Type option to "Google Fonts Block".
1
  = 1.7.4 =
2
 
3
+ * Fix font-display: swap in Gutenberg Block.
4
+ * Improve compatibility with MailOptin.
5
+
6
+ = 1.7.4 =
7
+
8
  * Transform core paragraph and heading blocks into "Google Fonts Blocks".
9
  * Add color option to "Google Fonts Block".
10
  * Add Block Type option to "Google Fonts Block".
includes/class-ogf-deactivation.php CHANGED
@@ -45,7 +45,7 @@ class OGF_Deactivation {
45
  * @param $string $email WordPress email address.
46
  */
47
  public function ogf_mail_from_email( $email ) {
48
- return 'hello@fontsplugin.com';
49
  }
50
 
51
  /**
@@ -65,6 +65,7 @@ class OGF_Deactivation {
65
  $current_user = wp_get_current_user();
66
  $url = site_url();
67
  $user = $current_user->user_email;
 
68
  $reason = ( isset( $_POST['reason'] ) ? wp_unslash( $_POST['reason'] ) : '' );
69
  $explanation = ( isset( $_POST['explanation'] ) ? wp_unslash( $_POST['explanation'] ) : '' );
70
  $anon = ( isset( $_POST['anon'] ) ? wp_unslash( $_POST['anon'] ) : '' );
@@ -89,6 +90,7 @@ class OGF_Deactivation {
89
  '<p>Version: ' . OGF_VERSION . '</p>' .
90
  '<p>URL: ' . esc_url( $url ) . '</p>' .
91
  '<p>User: ' . sanitize_email( $user ) . '</p>' .
 
92
  '<p>Reason: ' . esc_html( $reason ) . '</p>' .
93
  '<p>Explanation: ' . esc_html( $explanation ) . '</p>' .
94
  '</html></body>';
45
  * @param $string $email WordPress email address.
46
  */
47
  public function ogf_mail_from_email( $email ) {
48
+ return 'team@fontsplugin.com';
49
  }
50
 
51
  /**
65
  $current_user = wp_get_current_user();
66
  $url = site_url();
67
  $user = $current_user->user_email;
68
+ $theme = wp_get_theme();
69
  $reason = ( isset( $_POST['reason'] ) ? wp_unslash( $_POST['reason'] ) : '' );
70
  $explanation = ( isset( $_POST['explanation'] ) ? wp_unslash( $_POST['explanation'] ) : '' );
71
  $anon = ( isset( $_POST['anon'] ) ? wp_unslash( $_POST['anon'] ) : '' );
90
  '<p>Version: ' . OGF_VERSION . '</p>' .
91
  '<p>URL: ' . esc_url( $url ) . '</p>' .
92
  '<p>User: ' . sanitize_email( $user ) . '</p>' .
93
+ '<p>Theme: ' . esc_attr( $theme->get( 'Name' ) ) . '</p>' .
94
  '<p>Reason: ' . esc_html( $reason ) . '</p>' .
95
  '<p>Explanation: ' . esc_html( $explanation ) . '</p>' .
96
  '</html></body>';
includes/class-ogf-fonts.php CHANGED
@@ -180,8 +180,8 @@ class OGF_Fonts {
180
  }
181
 
182
  $query_args = array(
183
- 'family' => implode( '|', $families ),
184
- 'subset' => implode( ',', $subsets ),
185
  'display' => 'swap',
186
  );
187
 
180
  }
181
 
182
  $query_args = array(
183
+ 'family' => implode( '|', $families ),
184
+ 'subset' => implode( ',', $subsets ),
185
  'display' => 'swap',
186
  );
187
 
includes/customizer/controls/class-ogf-customize-typography-control.php CHANGED
@@ -96,7 +96,7 @@ class OGF_Customize_Typography_Control extends WP_Customize_Control {
96
 
97
  <ul>
98
 
99
- <# if ( data.family && ogf_font_array ) { #>
100
 
101
  <li class="typography-font-family">
102
 
96
 
97
  <ul>
98
 
99
+ <# if ( data.family && typeof ogf_font_array != 'undefined' ) { #>
100
 
101
  <li class="typography-font-family">
102
 
olympus-google-fonts.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin Name: Google Fonts for WordPress
6
  * Plugin URI: https://wordpress.org/plugins/olympus-google-fonts/
7
  * Description: The easiest to use Google Fonts plugin. No coding required. 870+ font choices.
8
- * Version: 1.7.4
9
  * Author: Fonts Plugin
10
  * Author URI: https://fontsplugin.com/?utm_source=wporg&utm_campaign=heading
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', '1.7.4' );
22
  define( 'OGF_DIR_PATH', plugin_dir_path( __FILE__ ) );
23
  define( 'OGF_DIR_URL', plugin_dir_url( __FILE__ ) );
24
 
5
  * Plugin Name: Google Fonts for WordPress
6
  * Plugin URI: https://wordpress.org/plugins/olympus-google-fonts/
7
  * Description: The easiest to use Google Fonts plugin. No coding required. 870+ font choices.
8
+ * Version: 1.7.5
9
  * Author: Fonts Plugin
10
  * Author URI: https://fontsplugin.com/?utm_source=wporg&utm_campaign=heading
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', '1.7.5' );
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.2
7
  License: GPLv2 or later
8
- Stable tag: 1.7.4
9
 
10
  The easiest to use Google Fonts Plugin. No coding required. 870+ font choices.
11
 
5
  Requires at least: 4.0
6
  Tested up to: 5.2
7
  License: GPLv2 or later
8
+ Stable tag: 1.7.5
9
 
10
  The easiest to use Google Fonts Plugin. No coding required. 870+ font choices.
11