Font Organizer - Version 1.2.1

Version Description

  • Fixed elements rules sometimes not loading.
  • Fixed back to top button not appearing.
  • Fixed warnings when not setting Google API key.
  • Added Google API key indicator.
Download this release

Release Info

Developer hivewebstudios
Plugin Icon 128x128 Font Organizer
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.2.0 to 1.2.1

Files changed (5) hide show
  1. assets/css/settings.css +39 -7
  2. font-organizer.php +3 -3
  3. helpers.php +2 -2
  4. readme.txt +7 -1
  5. settings.php +12 -8
assets/css/settings.css CHANGED
@@ -4,6 +4,45 @@
4
  .wp-list-table .column-custom_elements { width: 73%; }
5
  .wp-list-table .column-important { width: 17%;}
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  /* Back to top styles */
8
  .go-top, .go-top:focus {
9
  position: fixed;
@@ -48,11 +87,4 @@
48
  color: green;
49
  text-decoration: none;
50
  box-shadow: none;
51
- }
52
-
53
- label.required:after {
54
- color: #d00;
55
- content: "*";
56
- margin: 0 5px;
57
- font-size: 17px;
58
  }
4
  .wp-list-table .column-custom_elements { width: 73%; }
5
  .wp-list-table .column-important { width: 17%;}
6
 
7
+
8
+ /* Validate inputs */
9
+ input.valid {
10
+ color: green;
11
+ }
12
+ input.error {
13
+ color: red;
14
+ }
15
+ .validate {
16
+ position: relative;
17
+ }
18
+
19
+ input.valid + span,
20
+ input.error + span {
21
+ font-weight: bold;
22
+ font-size: 18px;
23
+ display: block;
24
+ position: absolute;
25
+ right: 2%;
26
+ top: 10%;
27
+ }
28
+
29
+ input.valid + span:after {
30
+ content: "\2713";
31
+ color: green;
32
+ }
33
+
34
+ input.error + span:after {
35
+ content: "\2715";
36
+ color: red;
37
+ }
38
+
39
+ label.required:after {
40
+ color: #d00;
41
+ content: "*";
42
+ margin: 0 5px;
43
+ font-size: 17px;
44
+ }
45
+
46
  /* Back to top styles */
47
  .go-top, .go-top:focus {
48
  position: fixed;
87
  color: green;
88
  text-decoration: none;
89
  box-shadow: none;
 
 
 
 
 
 
 
90
  }
font-organizer.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
  /**
3
  * @package Font_Organizer
4
- * @version 1.2.0
5
  */
6
  /*
7
  Plugin Name: Font Organizer
8
  Plugin URI: https://wordpress.org/plugins/font-organizer/
9
  Description: Font Organizer is the complete solution for font implementation in WordPress websites.
10
  Author: Hive
11
- Version: 1.2.0
12
  Author URI: https://hivewebstudios.com
13
  Text Domain: font-organizer
14
  */
@@ -19,7 +19,7 @@ define( 'FO_ELEMENTS_DATABASE', 'fo_elements' );
19
  define( 'FO_DEFAULT_ROLE', 'administrator' );
20
 
21
  global $fo_db_version;
22
- $fo_db_version = '1.2.0';
23
 
24
  global $fo_css_directory_path;
25
  $fo_css_directory_path = wp_upload_dir()['basedir'] . '/font-organizer';
1
  <?php
2
  /**
3
  * @package Font_Organizer
4
+ * @version 1.2.1
5
  */
6
  /*
7
  Plugin Name: Font Organizer
8
  Plugin URI: https://wordpress.org/plugins/font-organizer/
9
  Description: Font Organizer is the complete solution for font implementation in WordPress websites.
10
  Author: Hive
11
+ Version: 1.2.1
12
  Author URI: https://hivewebstudios.com
13
  Text Domain: font-organizer
14
  */
19
  define( 'FO_DEFAULT_ROLE', 'administrator' );
20
 
21
  global $fo_db_version;
22
+ $fo_db_version = '1.2.1';
23
 
24
  global $fo_css_directory_path;
25
  $fo_css_directory_path = wp_upload_dir()['basedir'] . '/font-organizer';
helpers.php CHANGED
@@ -100,7 +100,7 @@
100
 
101
  $declartions_full_file_url = $fo_css_base_url_path . '/' . $fo_declarations_css_file_name;
102
  if(file_exists($fo_css_directory_path . '/' . $fo_declarations_css_file_name)){
103
- wp_enqueue_style('fo-fonts', $declartions_full_file_url);
104
  }
105
 
106
  if($only_declarations)
@@ -108,7 +108,7 @@
108
 
109
  $elements_full_file_url = $fo_css_base_url_path . '/' . $fo_elements_css_file_name;
110
  if(file_exists($fo_css_directory_path . '/' . $fo_elements_css_file_name)){
111
- wp_enqueue_style('fo-fonts', $elements_full_file_url);
112
  }
113
  }
114
 
100
 
101
  $declartions_full_file_url = $fo_css_base_url_path . '/' . $fo_declarations_css_file_name;
102
  if(file_exists($fo_css_directory_path . '/' . $fo_declarations_css_file_name)){
103
+ wp_enqueue_style('fo-fonts-declaration', $declartions_full_file_url);
104
  }
105
 
106
  if($only_declarations)
108
 
109
  $elements_full_file_url = $fo_css_base_url_path . '/' . $fo_elements_css_file_name;
110
  if(file_exists($fo_css_directory_path . '/' . $fo_elements_css_file_name)){
111
+ wp_enqueue_style('fo-fonts-elements', $elements_full_file_url);
112
  }
113
  }
114
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: hivewebstudios,basaar,yardensade
3
  Tags: fonts,google fonts,upload font,font,google
4
  Requires at least: 3.8
5
  Tested up to: 4.7
6
- Stable tag: 1.2.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -101,6 +101,12 @@ Example: "Arial Bold" or "Arial Italic", so you could easily use them later in t
101
 
102
  == Changelog ==
103
 
 
 
 
 
 
 
104
  = 1.2.0 =
105
  * Added fonts in your website and font sizes selection in the editor (tinyMCE & tinyMCE Advanced).
106
  * Added option to delete of fonts in your website in section 5.
3
  Tags: fonts,google fonts,upload font,font,google
4
  Requires at least: 3.8
5
  Tested up to: 4.7
6
+ Stable tag: 1.2.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
101
 
102
  == Changelog ==
103
 
104
+ = 1.2.1 =
105
+ * Fixed elements rules sometimes not loading.
106
+ * Fixed back to top button not appearing.
107
+ * Fixed warnings when not setting Google API key.
108
+ * Added Google API key indicator.
109
+
110
  = 1.2.0 =
111
  * Added fonts in your website and font sizes selection in the editor (tinyMCE & tinyMCE Advanced).
112
  * Added option to delete of fonts in your website in section 5.
settings.php CHANGED
@@ -342,10 +342,14 @@ class FoSettingsPage
342
  $this->earlyaccess_fonts = $this->get_early_access_fonts_array();
343
 
344
  // Merge (and sort) the early access google fonts list with the google fonts.
345
- $this->google_fonts = array_merge($this->google_fonts, $this->earlyaccess_fonts);
346
- fo_array_sort($this->google_fonts);
 
347
 
348
- $this->available_fonts = array_merge($this->available_fonts, $this->google_fonts, $this->known_fonts);
 
 
 
349
 
350
  // Get all usable fonts and add them to a list.
351
  $this->load_usable_fonts();
@@ -369,11 +373,9 @@ class FoSettingsPage
369
  // Load the google fonts if selected or if not specified. else load just whats usable.
370
  if($this->include_font_link)
371
  fo_print_links($this->google_fonts, $this->fonts_per_link);
372
- else
373
- fo_print_links($this->usable_fonts, $this->fonts_per_link);
374
 
375
  ?>
376
- <a href="#" class="go-top<?php echo is_rtl() ? ' rtl' : 'ltr'; ?>"></a>
377
  <div class="wrap">
378
  <h1><?php _e('Font Settings', 'font-organizer'); ?></h1>
379
 
@@ -1066,9 +1068,11 @@ class FoSettingsPage
1066
  echo sprintf( __( ' Need help? Click <a href="%s" target="_blank">here</a>', 'font-organizer' ), esc_url( $faq_url ) );
1067
  echo '</span> <br />';
1068
 
 
 
1069
  printf(
1070
- '<input type="text" id="google_key" name="fo_general_options[google_key]" value="%s" class="large-text" placeholder="Ex: AIzaSyB1I0couKSmsW1Nadr68IlJXXCaBi9wYwM" />',
1071
- isset( $this->general_options['google_key'] ) ? esc_attr( $this->general_options['google_key']) : ''
1072
  );
1073
  }
1074
 
342
  $this->earlyaccess_fonts = $this->get_early_access_fonts_array();
343
 
344
  // Merge (and sort) the early access google fonts list with the google fonts.
345
+ if(!empty($this->google_fonts)){
346
+ $this->google_fonts = array_merge($this->google_fonts, $this->earlyaccess_fonts);
347
+ fo_array_sort($this->google_fonts);
348
 
349
+ $this->available_fonts = array_merge($this->available_fonts, $this->google_fonts, $this->known_fonts);
350
+ }else{
351
+ $this->available_fonts = array_merge($this->available_fonts, $this->earlyaccess_fonts, $this->known_fonts);
352
+ }
353
 
354
  // Get all usable fonts and add them to a list.
355
  $this->load_usable_fonts();
373
  // Load the google fonts if selected or if not specified. else load just whats usable.
374
  if($this->include_font_link)
375
  fo_print_links($this->google_fonts, $this->fonts_per_link);
 
 
376
 
377
  ?>
378
+ <a href="#" class="go-top <?php echo is_rtl() ? ' rtl' : 'ltr'; ?>"></a>
379
  <div class="wrap">
380
  <h1><?php _e('Font Settings', 'font-organizer'); ?></h1>
381
 
1068
  echo sprintf( __( ' Need help? Click <a href="%s" target="_blank">here</a>', 'font-organizer' ), esc_url( $faq_url ) );
1069
  echo '</span> <br />';
1070
 
1071
+
1072
+ $value = isset( $this->general_options['google_key'] ) ? esc_attr( $this->general_options['google_key']) : '';
1073
  printf(
1074
+ '<div class="validate"><input type="text" id="google_key" name="fo_general_options[google_key]" value="%s" class="large-text %s" placeholder="Ex: AIzaSyB1I0couKSmsW1Nadr68IlJXXCaBi9wYwM" /><span></span></div>',$value , empty($this->google_fonts) ? 'error' : 'valid'
1075
+
1076
  );
1077
  }
1078