Local Google Fonts - Version 0.2

Version Description

Download this release

Release Info

Developer everpress
Plugin Icon 128x128 Local Google Fonts
Version 0.2
Comparing to
See all releases

Code changes from version 0.1 to 0.2

README.md CHANGED
@@ -4,7 +4,7 @@ Contributors: everpress
4
  Tags: googlefonts, google, fonts, gdpr
5
  Requires at least: 4.2
6
  Tested up to: 5.9
7
- Stable tag: 0.1
8
  Requires PHP: 5.6+
9
  License: GPLv2 or later
10
  Author: EverPress
@@ -14,7 +14,7 @@ Author URI: https://everpress.co
14
 
15
  Host your used Google fonts on your server and make your site more GDPR compliant.
16
 
17
- About 50 mio [\*](https://trends.builtwith.com/websitelist/Google-Font-API) sites use Google Fonts and in January 2022 a German court as ruled that using Google Fonts is a violation of Europe’s GDPR (General Data Protection Regulation).
18
 
19
  more on [wptavern.com](https://wptavern.com/german-court-fines-website-owner-for-violating-the-gdpr-by-using-google-hosted-fonts)
20
 
@@ -22,7 +22,7 @@ more on [wptavern.com](https://wptavern.com/german-court-fines-website-owner-for
22
 
23
  ### 1. Option Interface.
24
 
25
- ![Option Interface.](screenshot-1.png)
26
 
27
  ### Features
28
 
@@ -39,6 +39,11 @@ more on [wptavern.com](https://wptavern.com/german-court-fines-website-owner-for
39
 
40
  ## Changelog
41
 
 
 
 
 
 
42
  ### 0.1
43
 
44
  - initial release
4
  Tags: googlefonts, google, fonts, gdpr
5
  Requires at least: 4.2
6
  Tested up to: 5.9
7
+ Stable tag: 0.2
8
  Requires PHP: 5.6+
9
  License: GPLv2 or later
10
  Author: EverPress
14
 
15
  Host your used Google fonts on your server and make your site more GDPR compliant.
16
 
17
+ About 50 mio[\*](https://trends.builtwith.com/websitelist/Google-Font-API) sites use Google Fonts and in January 2022 a German court as ruled that using Google Fonts is a violation of Europe’s GDPR (General Data Protection Regulation).
18
 
19
  more on [wptavern.com](https://wptavern.com/german-court-fines-website-owner-for-violating-the-gdpr-by-using-google-hosted-fonts)
20
 
22
 
23
  ### 1. Option Interface.
24
 
25
+ ![Option Interface.](.wordpress-org/screenshot-1.png)
26
 
27
  ### Features
28
 
39
 
40
  ## Changelog
41
 
42
+ ### 0.2
43
+
44
+ - show info when no font is found
45
+ - better handling of translated strings
46
+
47
  ### 0.1
48
 
49
  - initial release
banner.png DELETED
Binary file
includes/class-local-google-fonts-admin.php CHANGED
@@ -106,18 +106,19 @@ class LGF_Admin {
106
 
107
  public function render_settings() {
108
 
109
- $buffer = get_option( 'local_google_fonts_buffer' );
110
-
111
- if ( empty( $buffer ) ) {
112
- return;
113
- }
114
 
115
  $folder = WP_CONTENT_DIR . '/uploads/fonts';
116
  $folder_url = WP_CONTENT_URL . '/uploads/fonts';
 
117
 
118
  ?>
119
  <div class="wrap">
120
- <h1><?php printf( __( '%d Google font sources found on your site.', 'local-google-fonts' ), count( $buffer ) ); ?></h1>
 
 
 
 
121
  <form action="options.php" method="post">
122
  <?php
123
  settings_fields( 'local_google_fonts' );
@@ -128,7 +129,6 @@ class LGF_Admin {
128
 
129
  <h2><?php esc_html_e( 'Handle', 'local-google-fonts' ); ?>: <code><?php esc_html_e( $handle ); ?></code></h2>
130
 
131
-
132
  <table class="wp-list-table widefat fixed striped table-view-list ">
133
  <thead>
134
  <tr>
@@ -148,7 +148,6 @@ class LGF_Admin {
148
  <td>
149
  <p class="code">
150
  <?php foreach ( $set->variants as $variant ) : ?>
151
-
152
  <?php printf( '%s %s', $variant->fontStyle, $variant->fontWeight ); ?>,
153
  <?php endforeach ?>
154
  </p>
106
 
107
  public function render_settings() {
108
 
109
+ $buffer = get_option( 'local_google_fonts_buffer', array() );
 
 
 
 
110
 
111
  $folder = WP_CONTENT_DIR . '/uploads/fonts';
112
  $folder_url = WP_CONTENT_URL . '/uploads/fonts';
113
+ $count = count( $buffer );
114
 
115
  ?>
116
  <div class="wrap">
117
+ <h1><?php printf( esc_html__( _n( '%d Google font source found on your site.', '%d Google font sources found on your site.', $count, 'mailster' ) ), $count ); ?></h1>
118
+
119
+ <?php if ( ! $count ) : ?>
120
+ <p><?php esc_html_e( 'You have currently no Google fonts in use on your site.', 'local-google-fonts' ); ?></p>
121
+ <?php endif; ?>
122
  <form action="options.php" method="post">
123
  <?php
124
  settings_fields( 'local_google_fonts' );
129
 
130
  <h2><?php esc_html_e( 'Handle', 'local-google-fonts' ); ?>: <code><?php esc_html_e( $handle ); ?></code></h2>
131
 
 
132
  <table class="wp-list-table widefat fixed striped table-view-list ">
133
  <thead>
134
  <tr>
148
  <td>
149
  <p class="code">
150
  <?php foreach ( $set->variants as $variant ) : ?>
 
151
  <?php printf( '%s %s', $variant->fontStyle, $variant->fontWeight ); ?>,
152
  <?php endforeach ?>
153
  </p>
local-google-fonts.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Local Google Fonts
4
  Description: Host your used Google fonts on your server and make your site GDPR compliant.
5
- Version: 0.1
6
  Author: EverPress
7
  Author URI: https://everpress.co
8
  Text Domain: local-google-fonts
2
  /*
3
  Plugin Name: Local Google Fonts
4
  Description: Host your used Google fonts on your server and make your site GDPR compliant.
5
+ Version: 0.2
6
  Author: EverPress
7
  Author URI: https://everpress.co
8
  Text Domain: local-google-fonts