Google Fonts for WordPress - Version 2.0.6

Version Description

Download this release

Release Info

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

Code changes from version 2.0.5 to 2.0.6

admin/fonts-plugin-quickstart-guide.png ADDED
Binary file
admin/style.css ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .eb-wrap {
2
+ margin: 50px 35px;
3
+ max-width: 960px;
4
+ }
5
+
6
+ .eb-wrap * {
7
+ font-size: 16px;
8
+ margin-top: 0;
9
+ font-family: 'Source Sans Pro', 'Helvetica Neue', sans-serif;
10
+ }
11
+
12
+ .eb-wrap p {
13
+ line-height: 1.6;
14
+ }
15
+
16
+ .eb-wrap ul {
17
+ list-style: disc;
18
+ margin-left: 32px
19
+ }
20
+
21
+ .eb-wrap ul li {
22
+ margin-bottom: 8px
23
+ }
24
+
25
+
26
+ .eb-content {
27
+ background: #fff;
28
+ border-radius: 3px;
29
+ box-sizing: border-box;
30
+ }
31
+
32
+ .eb-content {
33
+ margin: 0 auto;
34
+ max-width: 740px;
35
+ box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
36
+ }
37
+
38
+
39
+ .eb-content__header {
40
+ border-top: 5px solid #b43534;
41
+ border-radius: 5px 5px 0 0;
42
+ }
43
+ .eb-content__header h1 {
44
+ font-size: 24px;
45
+ padding: 50px 50px 0 50px;
46
+ margin: 0
47
+ }
48
+ .eb-content__inner {
49
+ background-color: #fff;
50
+ padding: 25px 50px 50px 50px;
51
+ }
52
+
53
+ .eb-sidebar__inner {
54
+ background-color: white;
55
+ }
56
+ .eb-sidebar__header {
57
+ background-color: #0d72a7
58
+ }
59
+ .eb-sidebar__plugin {
60
+ padding: 30px 30px;
61
+ }
62
+ .eb-sidebar__header h2 {
63
+ color: #fff;
64
+ font-size: 16px;
65
+ padding: 20px 30px;
66
+ margin: 0
67
+ }
68
+
69
+ .appearance_page_olympus-google-fonts .notice {
70
+ display: none
71
+ }
72
+
73
+ .eb-wrap .button {
74
+ color: #fff;
75
+ border-color: #a10000;
76
+ background: #a10000;
77
+ padding: 4px 16px;
78
+ font-size: 16px;
79
+ font-weight: 600;
80
+ margin-left: 8px;
81
+ height: auto
82
+ }
83
+ #mce-EMAIL {
84
+ padding: 5px 12px;
85
+ min-height: 27px
86
+ }
87
+ .ebook-cover {
88
+ float: right;
89
+ max-width: 30%;
90
+ margin-left: 10%;
91
+ margin-top: -25px;
92
+ }
93
+
94
+ @media only screen and (max-width: 960px) {
95
+ .eb-content {
96
+ max-width: 98%;
97
+ float: none;
98
+ }
99
+ .eb-wrap {
100
+ margin: 1%;
101
+ }
102
+ }
103
+ @media only screen and (max-width: 480px) {
104
+ .ebook-cover {
105
+ display: none
106
+ }
107
+ #mce-EMAIL {
108
+ padding: 5px 12px;
109
+ width: 100%;
110
+ margin-bottom: 10px;
111
+ }
112
+ .eb-wrap .button {
113
+ width: 100%;
114
+ margin-left: 0;
115
+ }
116
+ }
admin/welcome.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Olympus Google Fonts Welcome Page.
4
+ *
5
+ * @package olympus-google-fonts
6
+ */
7
+
8
+ /**
9
+ * Create the editor blocks welcome page.
10
+ */
11
+ class Olympus_Google_Fonts_Welcome {
12
+
13
+ /**
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
+
21
+ /**
22
+ * Add options page
23
+ */
24
+ public function add_plugin_page() {
25
+ // This page will be under "Settings".
26
+ add_submenu_page(
27
+ 'themes.php',
28
+ esc_attr__( 'Google Fonts', 'olympus-google-fonts' ),
29
+ esc_attr__( 'Google Fonts', 'olympus-google-fonts' ),
30
+ 'manage_options',
31
+ 'olympus-google-fonts',
32
+ array( $this, 'create_admin_page' )
33
+ );
34
+ }
35
+
36
+ /**
37
+ * Add options page
38
+ */
39
+ public function enqueue() {
40
+ wp_enqueue_style( 'olympus-google-fonts-welcome', plugins_url( 'admin/style.css', dirname( __FILE__ ) ), false, '1.0.0' );
41
+ }
42
+
43
+ /**
44
+ * Options page callback
45
+ */
46
+ public function create_admin_page() {
47
+ $current_user = wp_get_current_user();
48
+ $email = (string) $current_user->user_email;
49
+ ?>
50
+ <div class="eb-wrap">
51
+ <div class="eb-content">
52
+ <div class="eb-content__header">
53
+ <h1>Your Quickstart Guide</h1>
54
+ </div>
55
+ <div class="eb-content__inner">
56
+ <img class="ebook-cover" src="<?php echo plugins_url( 'admin/fonts-plugin-quickstart-guide.png', dirname( __FILE__ ) ); ?>">
57
+ <p>To help you get the most out of the Google Fonts plugin we’ve put together a free quickstart guide.</p>
58
+ <p>In this beautifully-formatted, easy-to-read PDF you will learn:
59
+ <ul>
60
+ <li>How to <strong>easily</strong> customize your typography.</li>
61
+ <li>How to host fonts <strong>locally</strong> for speed, GDPR & DSGVO.</li>
62
+ <li>How to use Google Fonts without <strong>slowing down</strong> your website.</li>
63
+ </ul>
64
+ <p>Download your free copy today.</p>
65
+ <!-- Begin Mailchimp Signup Form -->
66
+ <form action="https://fontsplugin.us9.list-manage.com/subscribe/post?u=1ed15f4383eb532a1a1034fb9&amp;id=2ed49283a0" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
67
+ <input type="email" value="<?php echo $email; ?>" placeholder="Your email address..." name="EMAIL" class="required email" id="mce-EMAIL">
68
+ <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_1ed15f4383eb532a1a1034fb9_2ed49283a0" tabindex="-1" value=""></div>
69
+ <input type="submit" value="Send My Guide!" name="subscribe" id="mc-embedded-subscribe" class="button">
70
+ </form>
71
+ <!--End mc_embed_signup-->
72
+ </div>
73
+ </div>
74
+ </div>
75
+ <?php
76
+ }
77
+ }
78
+
79
+ if ( is_admin() ) {
80
+ $my_settings_page = new Olympus_Google_Fonts_Welcome();
81
+ }
assets/css/deactivation.css DELETED
@@ -1,144 +0,0 @@
1
- #ogf-deactivation-form {
2
- display: none
3
- }
4
-
5
- #ogf-deactivation-form textarea {
6
- display: block;
7
- padding: 10px;
8
- margin: 16px 25px 8px;
9
- width: 75%;
10
- }
11
-
12
- #ogf-deactivation-form h1 {
13
- margin-top: 0;
14
- font-size: 1.5em
15
- }
16
-
17
- #ogf-deactivation-form .bottom-row {
18
- border-top: 1px solid #f1f1f1;
19
- padding-top: 2em;
20
- margin-top: 2em;
21
- }
22
-
23
- #ogf-deactivation-form .buttons {
24
- display: inline-block;
25
- float: right;
26
- }
27
-
28
- #ogf-deactivation-form .button-deactivate {
29
- margin-left: 1em
30
- }
31
-
32
- html.with-featherlight {
33
- overflow: hidden;
34
- }
35
-
36
- .featherlight {
37
- display: none;
38
- position:fixed;
39
- top: 0; right: 0; bottom: 0; left: 0;
40
- z-index: 2147483647; /* z-index needs to be >= elements on the site. */
41
- text-align: center;
42
- white-space: nowrap;
43
- cursor: pointer;
44
- background: #333;
45
- background: rgba(0, 0, 0, 0);
46
- }
47
-
48
- .featherlight:last-of-type {
49
- background: rgba(0, 0, 0, 0.8);
50
- }
51
-
52
- .featherlight:before {
53
- content: '';
54
- display: inline-block;
55
- height: 100%;
56
- vertical-align: middle;
57
- }
58
-
59
- .featherlight .featherlight-content {
60
- position: relative;
61
- text-align: left;
62
- vertical-align: middle;
63
- display: inline-block;
64
- overflow: auto;
65
- padding: 50px;
66
- margin-left: 5%;
67
- margin-right: 5%;
68
- max-height: 95%;
69
- max-width: 600px;
70
- background: #fff;
71
- cursor: auto;
72
- white-space: normal;
73
-
74
- }
75
-
76
- .featherlight .featherlight-inner {
77
- display: block !important;
78
- }
79
-
80
- .featherlight script.featherlight-inner,
81
- .featherlight link.featherlight-inner,
82
- .featherlight style.featherlight-inner {
83
- display: none;
84
- }
85
-
86
- .featherlight .featherlight-close-icon {
87
- position: absolute;
88
- z-index: 9999;
89
- top: 0;
90
- right: 0;
91
- line-height: 25px;
92
- width: 25px;
93
- cursor: pointer;
94
- text-align: center;
95
- font-family: Arial, sans-serif;
96
- background: #fff; /* Set the background in case it overlaps the content */
97
- background: rgba(255, 255, 255, 0.3);
98
- color: #000;
99
- border: none;
100
- padding: 0;
101
- }
102
-
103
- .featherlight .featherlight-close-icon::-moz-focus-inner {
104
- border: 0;
105
- padding: 0;
106
- }
107
-
108
- .featherlight .featherlight-image {
109
- /* styling */
110
- width: 100%;
111
- }
112
-
113
-
114
- .featherlight-iframe .featherlight-content {
115
- border-bottom: 0;
116
- padding: 0;
117
- -webkit-overflow-scrolling: touch;
118
- }
119
-
120
- .featherlight iframe {
121
- border: none;
122
- }
123
-
124
- .featherlight * {
125
- -webkit-box-sizing: border-box;
126
- -moz-box-sizing: border-box;
127
- box-sizing: border-box;
128
- }
129
-
130
- @media only screen and (max-width: 1024px) {
131
- .featherlight .featherlight-content {
132
- margin-left: 0;
133
- margin-right: 0;
134
- max-height: 98%;
135
- padding: 10px 10px 0;
136
- border-bottom: 10px solid transparent;
137
- }
138
- }
139
-
140
- @media print {
141
- html.with-featherlight > * > :not(.featherlight) {
142
- display: none;
143
- }
144
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/deactivation.js DELETED
@@ -1,74 +0,0 @@
1
-
2
-
3
- /* global ajaxurl */
4
- jQuery( document ).ready(
5
- function() {
6
- const form =
7
- '<form id="ogf-deactivation-form" method="post">' +
8
- '<h1>Help Us Do Better</h1>' +
9
- '<p>We\'re sorry our Google Fonts plugin didn\'t work for you. Would you mind letting us know where we went wrong so we can fix it?</p>' +
10
- '<ul class="reasons" style="padding: 0">' +
11
- '<p><strong>Why you are deactivating this plugin?</strong></p>' +
12
- ' <li><label class="reason expand"><input type="radio" name="reason" value="missing-font" /> The font I need is missing</label><textarea placeholder="Which font do you need?"></textarea></li>' +
13
- ' <li><label class="reason expand"><input type="radio" name="reason" value="missing-feature" /> The plugin is great, but I need specific feature that you don\'t support</label><textarea placeholder="Which feature do you need?"></textarea></li>' +
14
- '<li><label class="reason expand"><input type="radio" name="reason" value="not-working"> The plugin is not working</label><textarea placeholder="Please clarify which part of the plugin isn\'t working so we can try and fix it..."></textarea></li>' +
15
- '<li><label class="reason expand"><input type="radio" name="reason" value="other-plugin"> I found a better plugin</label><textarea placeholder="What\'s the plugin name?"></textarea></li>' +
16
- '<li><label class="reason expand"><input type="radio" name="reason" value="user-stuck"> I couldn\'t understand how to make it work</label><textarea placeholder="Where did you get stuck?"></textarea></li>' +
17
- '<li><label class="reason"><input type="radio" name="reason" value="debugging"> It\'s a temporary deactivation. I\'m just debugging an issue.</label></li>' +
18
- '<li><label class="reason expand"><input type="radio" name="reason" value="other"> Other</label><textarea placeholder="Please explain your reason for deactivation..."></textarea></li></ul>' +
19
- '<div class="bottom-row">' +
20
- '<label><input type="checkbox" name="anon" class="anonymous-feedback" value="1"> Submit feedback annoymously</label>' +
21
- '<div class="buttons"><input type="button" class="button button-secondary button-close" value="Cancel" /><input type="button" name="deactivate" class="button button-primary button-deactivate allow-deactivate" value="Skip and Deactivate" /></div>' +
22
- '</div>' +
23
- '</form>';
24
-
25
- jQuery( form ).appendTo( jQuery( 'body' ) );
26
- const deactivateLink = jQuery( '#the-list [data-slug="olympus-google-fonts"] .deactivate a' );
27
-
28
- jQuery( '#ogf-deactivation-form .reason' ).click(
29
- function() {
30
- jQuery( '#ogf-deactivation-form .reasons textarea' ).hide();
31
- jQuery( this ).next( 'textarea' ).css( 'display', 'block' );
32
- jQuery( '#ogf-deactivation-form .button-deactivate' ).val( 'Submit & Deactivate' );
33
- }
34
- );
35
-
36
- deactivateLink.click(
37
- function( e ) {
38
- e.preventDefault();
39
- jQuery( '#ogf-deactivation-form .reasons textarea' ).hide();
40
- jQuery.featherlight( '#ogf-deactivation-form' );
41
- }
42
- );
43
-
44
- jQuery( '#ogf-deactivation-form .button-close' ).click(
45
- function( e ) {
46
- e.preventDefault();
47
- jQuery.featherlight.current().close();
48
- }
49
- );
50
-
51
- jQuery( '#ogf-deactivation-form .button-deactivate' ).click(
52
- function() {
53
- const anon = jQuery( '#deactivation-form .anonymous-feedback' ).is( ':checked' );
54
- const reason = jQuery( '.reason input[type=radio]:checked' ).first();
55
- const explanation = reason.parent().next( 'textarea' );
56
-
57
- const data = {
58
- action: 'ogf_submit_feedback',
59
- reason: reason.val(),
60
- explanation: explanation.val(),
61
- anon: anon,
62
- };
63
-
64
- jQuery.post(
65
- ajaxurl,
66
- data,
67
- function() {
68
- window.location = jQuery( deactivateLink ).attr( 'href' );
69
- }
70
- );
71
- }
72
- );
73
- }
74
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/featherlight.min.js DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * Featherlight - ultra slim jQuery lightbox
3
- * Version 1.7.13 - http://noelboss.github.io/featherlight/
4
- *
5
- * Copyright 2018, Noël Raoul Bossart (http://www.noelboss.com)
6
- * MIT Licensed.
7
- **/
8
- !function(a){"use strict";function b(a,c){if(!(this instanceof b)){var d=new b(a,c);return d.open(),d}this.id=b.id++,this.setup(a,c),this.chainCallbacks(b._callbackChain)}function c(a,b){var c={};for(var d in a)d in b&&(c[d]=a[d],delete a[d]);return c}function d(a,b){var c={},d=new RegExp("^"+b+"([A-Z])(.*)");for(var e in a){var f=e.match(d);if(f){var g=(f[1]+f[2].replace(/([A-Z])/g,"-$1")).toLowerCase();c[g]=a[e]}}return c}if("undefined"==typeof a)return void("console"in window&&window.console.info("Too much lightness, Featherlight needs jQuery."));if(a.fn.jquery.match(/-ajax/))return void("console"in window&&window.console.info("Featherlight needs regular jQuery, not the slim version."));var e=[],f=function(b){return e=a.grep(e,function(a){return a!==b&&a.$instance.closest("body").length>0})},g={allow:1,allowfullscreen:1,frameborder:1,height:1,longdesc:1,marginheight:1,marginwidth:1,mozallowfullscreen:1,name:1,referrerpolicy:1,sandbox:1,scrolling:1,src:1,srcdoc:1,style:1,webkitallowfullscreen:1,width:1},h={keyup:"onKeyUp",resize:"onResize"},i=function(c){a.each(b.opened().reverse(),function(){return c.isDefaultPrevented()||!1!==this[h[c.type]](c)?void 0:(c.preventDefault(),c.stopPropagation(),!1)})},j=function(c){if(c!==b._globalHandlerInstalled){b._globalHandlerInstalled=c;var d=a.map(h,function(a,c){return c+"."+b.prototype.namespace}).join(" ");a(window)[c?"on":"off"](d,i)}};b.prototype={constructor:b,namespace:"featherlight",targetAttr:"data-featherlight",variant:null,resetCss:!1,background:null,openTrigger:"click",closeTrigger:"click",filter:null,root:"body",openSpeed:250,closeSpeed:250,closeOnClick:"background",closeOnEsc:!0,closeIcon:"&#10005;",loading:"",persist:!1,otherClose:null,beforeOpen:a.noop,beforeContent:a.noop,beforeClose:a.noop,afterOpen:a.noop,afterContent:a.noop,afterClose:a.noop,onKeyUp:a.noop,onResize:a.noop,type:null,contentFilters:["jquery","image","html","ajax","iframe","text"],setup:function(b,c){"object"!=typeof b||b instanceof a!=!1||c||(c=b,b=void 0);var d=a.extend(this,c,{target:b}),e=d.resetCss?d.namespace+"-reset":d.namespace,f=a(d.background||['<div class="'+e+"-loading "+e+'">','<div class="'+e+'-content">','<button class="'+e+"-close-icon "+d.namespace+'-close" aria-label="Close">',d.closeIcon,"</button>",'<div class="'+d.namespace+'-inner">'+d.loading+"</div>","</div>","</div>"].join("")),g="."+d.namespace+"-close"+(d.otherClose?","+d.otherClose:"");return d.$instance=f.clone().addClass(d.variant),d.$instance.on(d.closeTrigger+"."+d.namespace,function(b){if(!b.isDefaultPrevented()){var c=a(b.target);("background"===d.closeOnClick&&c.is("."+d.namespace)||"anywhere"===d.closeOnClick||c.closest(g).length)&&(d.close(b),b.preventDefault())}}),this},getContent:function(){if(this.persist!==!1&&this.$content)return this.$content;var b=this,c=this.constructor.contentFilters,d=function(a){return b.$currentTarget&&b.$currentTarget.attr(a)},e=d(b.targetAttr),f=b.target||e||"",g=c[b.type];if(!g&&f in c&&(g=c[f],f=b.target&&e),f=f||d("href")||"",!g)for(var h in c)b[h]&&(g=c[h],f=b[h]);if(!g){var i=f;if(f=null,a.each(b.contentFilters,function(){return g=c[this],g.test&&(f=g.test(i)),!f&&g.regex&&i.match&&i.match(g.regex)&&(f=i),!f}),!f)return"console"in window&&window.console.error("Featherlight: no content filter found "+(i?' for "'+i+'"':" (no target specified)")),!1}return g.process.call(b,f)},setContent:function(b){return this.$instance.removeClass(this.namespace+"-loading"),this.$instance.toggleClass(this.namespace+"-iframe",b.is("iframe")),this.$instance.find("."+this.namespace+"-inner").not(b).slice(1).remove().end().replaceWith(a.contains(this.$instance[0],b[0])?"":b),this.$content=b.addClass(this.namespace+"-inner"),this},open:function(b){var c=this;if(c.$instance.hide().appendTo(c.root),!(b&&b.isDefaultPrevented()||c.beforeOpen(b)===!1)){b&&b.preventDefault();var d=c.getContent();if(d)return e.push(c),j(!0),c.$instance.fadeIn(c.openSpeed),c.beforeContent(b),a.when(d).always(function(a){c.setContent(a),c.afterContent(b)}).then(c.$instance.promise()).done(function(){c.afterOpen(b)})}return c.$instance.detach(),a.Deferred().reject().promise()},close:function(b){var c=this,d=a.Deferred();return c.beforeClose(b)===!1?d.reject():(0===f(c).length&&j(!1),c.$instance.fadeOut(c.closeSpeed,function(){c.$instance.detach(),c.afterClose(b),d.resolve()})),d.promise()},resize:function(a,b){if(a&&b){this.$content.css("width","").css("height","");var c=Math.max(a/(this.$content.parent().width()-1),b/(this.$content.parent().height()-1));c>1&&(c=b/Math.floor(b/c),this.$content.css("width",""+a/c+"px").css("height",""+b/c+"px"))}},chainCallbacks:function(b){for(var c in b)this[c]=a.proxy(b[c],this,a.proxy(this[c],this))}},a.extend(b,{id:0,autoBind:"[data-featherlight]",defaults:b.prototype,contentFilters:{jquery:{regex:/^[#.]\w/,test:function(b){return b instanceof a&&b},process:function(b){return this.persist!==!1?a(b):a(b).clone(!0)}},image:{regex:/\.(png|jpg|jpeg|gif|tiff?|bmp|svg)(\?\S*)?$/i,process:function(b){var c=this,d=a.Deferred(),e=new Image,f=a('<img src="'+b+'" alt="" class="'+c.namespace+'-image" />');return e.onload=function(){f.naturalWidth=e.width,f.naturalHeight=e.height,d.resolve(f)},e.onerror=function(){d.reject(f)},e.src=b,d.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(b){return a(b)}},ajax:{regex:/./,process:function(b){var c=a.Deferred(),d=a("<div></div>").load(b,function(a,b){"error"!==b&&c.resolve(d.contents()),c.fail()});return c.promise()}},iframe:{process:function(b){var e=new a.Deferred,f=a("<iframe/>"),h=d(this,"iframe"),i=c(h,g);return f.hide().attr("src",b).attr(i).css(h).on("load",function(){e.resolve(f.show())}).appendTo(this.$instance.find("."+this.namespace+"-content")),e.promise()}},text:{process:function(b){return a("<div>",{text:b})}}},functionAttributes:["beforeOpen","afterOpen","beforeContent","afterContent","beforeClose","afterClose"],readElementConfig:function(b,c){var d=this,e=new RegExp("^data-"+c+"-(.*)"),f={};return b&&b.attributes&&a.each(b.attributes,function(){var b=this.name.match(e);if(b){var c=this.value,g=a.camelCase(b[1]);if(a.inArray(g,d.functionAttributes)>=0)c=new Function(c);else try{c=JSON.parse(c)}catch(h){}f[g]=c}}),f},extend:function(b,c){var d=function(){this.constructor=b};return d.prototype=this.prototype,b.prototype=new d,b.__super__=this.prototype,a.extend(b,this,c),b.defaults=b.prototype,b},attach:function(b,c,d){var e=this;"object"!=typeof c||c instanceof a!=!1||d||(d=c,c=void 0),d=a.extend({},d);var f,g=d.namespace||e.defaults.namespace,h=a.extend({},e.defaults,e.readElementConfig(b[0],g),d),i=function(g){var i=a(g.currentTarget),j=a.extend({$source:b,$currentTarget:i},e.readElementConfig(b[0],h.namespace),e.readElementConfig(g.currentTarget,h.namespace),d),k=f||i.data("featherlight-persisted")||new e(c,j);"shared"===k.persist?f=k:k.persist!==!1&&i.data("featherlight-persisted",k),j.$currentTarget.blur&&j.$currentTarget.blur(),k.open(g)};return b.on(h.openTrigger+"."+h.namespace,h.filter,i),{filter:h.filter,handler:i}},current:function(){var a=this.opened();return a[a.length-1]||null},opened:function(){var b=this;return f(),a.grep(e,function(a){return a instanceof b})},close:function(a){var b=this.current();return b?b.close(a):void 0},_onReady:function(){var b=this;if(b.autoBind){var c=a(b.autoBind);c.each(function(){b.attach(a(this))}),a(document).on("click",b.autoBind,function(d){if(!d.isDefaultPrevented()){var e=a(d.currentTarget),f=c.length;if(c=c.add(e),f!==c.length){var g=b.attach(e);(!g.filter||a(d.target).parentsUntil(e,g.filter).length>0)&&g.handler(d)}}})}},_callbackChain:{onKeyUp:function(b,c){return 27===c.keyCode?(this.closeOnEsc&&a.featherlight.close(c),!1):b(c)},beforeOpen:function(b,c){return a(document.documentElement).addClass("with-featherlight"),this._previouslyActive=document.activeElement,this._$previouslyTabbable=a("a, input, select, textarea, iframe, button, iframe, [contentEditable=true]").not("[tabindex]").not(this.$instance.find("button")),this._$previouslyWithTabIndex=a("[tabindex]").not('[tabindex="-1"]'),this._previousWithTabIndices=this._$previouslyWithTabIndex.map(function(b,c){return a(c).attr("tabindex")}),this._$previouslyWithTabIndex.add(this._$previouslyTabbable).attr("tabindex",-1),document.activeElement.blur&&document.activeElement.blur(),b(c)},afterClose:function(c,d){var e=c(d),f=this;return this._$previouslyTabbable.removeAttr("tabindex"),this._$previouslyWithTabIndex.each(function(b,c){a(c).attr("tabindex",f._previousWithTabIndices[b])}),this._previouslyActive.focus(),0===b.opened().length&&a(document.documentElement).removeClass("with-featherlight"),e},onResize:function(a,b){return this.resize(this.$content.naturalWidth,this.$content.naturalHeight),a(b)},afterContent:function(a,b){var c=a(b);return this.$instance.find("[autofocus]:not([disabled])").focus(),this.onResize(b),c}}}),a.featherlight=b,a.fn.featherlight=function(a,c){return b.attach(this,a,c),this},a(document).ready(function(){b._onReady()})}(jQuery);
 
 
 
 
 
 
 
 
changelog.txt CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  = 2.0.5 =
2
 
3
  * Fix error notice in customizer.
1
+ = 2.0.6 =
2
+
3
+ * Output the 'Basic Setting' choices as CSS variables. props @helgatheviking
4
+ * Fix issue where important wasn't being applied to some system fonts.
5
+ * Add welcome page.
6
+
7
  = 2.0.5 =
8
 
9
  * Fix error notice in customizer.
class-olympus-google-fonts.php CHANGED
@@ -57,9 +57,6 @@ class Olympus_Google_Fonts {
57
  // Welcome notice class.
58
  include OGF_DIR_PATH . 'includes/class-ogf-welcome.php';
59
 
60
- // Deactivation class.
61
- require OGF_DIR_PATH . 'includes/class-ogf-deactivation.php';
62
-
63
  // Reset class.
64
  require OGF_DIR_PATH . 'includes/class-ogf-reset.php';
65
 
@@ -90,6 +87,10 @@ class Olympus_Google_Fonts {
90
  if ( $fonts->has_custom_fonts() ) {
91
  $url = $fonts->build_url();
92
  wp_enqueue_style( 'olympus-google-fonts', $url, array(), OGF_VERSION );
 
 
 
 
93
  }
94
 
95
  }
57
  // Welcome notice class.
58
  include OGF_DIR_PATH . 'includes/class-ogf-welcome.php';
59
 
 
 
 
60
  // Reset class.
61
  require OGF_DIR_PATH . 'includes/class-ogf-reset.php';
62
 
87
  if ( $fonts->has_custom_fonts() ) {
88
  $url = $fonts->build_url();
89
  wp_enqueue_style( 'olympus-google-fonts', $url, array(), OGF_VERSION );
90
+
91
+ $css = ogf_generate_css_variables();
92
+ wp_add_inline_style( 'olympus-google-fonts', $css );
93
+
94
  }
95
 
96
  }
includes/class-ogf-deactivation.php DELETED
@@ -1,110 +0,0 @@
1
- <?php
2
- /**
3
- * Deactivation Feedback Class.
4
- *
5
- * @package olympus-google-fonts
6
- * @copyright Copyright (c) 2020, Fonts Plugin
7
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
8
- */
9
-
10
- /**
11
- * The feedback.
12
- */
13
- class OGF_Deactivation {
14
-
15
- /**
16
- * Class constructor.
17
- */
18
- public function __construct() {
19
- // Add actions.
20
- add_action( 'wp_ajax_ogf_submit_feedback', array( $this, 'ogf_submit_feedback' ) );
21
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
22
- }
23
-
24
- /**
25
- * Enqeue the styles and scripts.
26
- *
27
- * @param string $hook The hook tells us which page of wp-admin we are on.
28
- */
29
- public function enqueue( $hook ) {
30
-
31
- if ( 'plugins.php' !== $hook ) {
32
- return;
33
- }
34
-
35
- wp_enqueue_script( 'featherlight', esc_url( OGF_DIR_URL . 'assets/js/featherlight.min.js' ), 'jquery', OGF_VERSION, true );
36
- wp_enqueue_script( 'ogf-admin-modal', esc_url( OGF_DIR_URL . 'assets/js/deactivation.js' ), 'jquery', OGF_VERSION, false );
37
-
38
- wp_enqueue_style( 'ogf-deactivation', esc_url( OGF_DIR_URL . 'assets/css/deactivation.css' ), '', OGF_VERSION );
39
-
40
- }
41
-
42
- /**
43
- * Remove WordPress email so annonymity is kept.
44
- *
45
- * @param $string $email WordPress email address.
46
- */
47
- public function ogf_mail_from_email( $email ) {
48
- return 'team@fontsplugin.com';
49
- }
50
-
51
- /**
52
- * Remove WordPress name so annonymity is kept.
53
- *
54
- * @param $string $name WordPress install name.
55
- */
56
- public function ogf_mail_from_name( $name ) {
57
- return 'Deactivation Survey [OGF]';
58
- }
59
-
60
- /**
61
- * Send user feedback regarding plugin deactivation.
62
- */
63
- public function ogf_submit_feedback() {
64
-
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'] ) : '' );
72
-
73
- if ( ! $explanation ) {
74
- return;
75
- }
76
-
77
- add_filter( 'wp_mail_from_name', array( $this, 'ogf_mail_from_name' ) );
78
- add_filter( 'wp_mail_from', array( $this, 'ogf_mail_from_email' ) );
79
-
80
- if ( 'true' === $anon ) {
81
- $url = 'https://google.com';
82
- $user = 'anon@anonymous.com';
83
- }
84
-
85
- $to = 'hello@fontsplugin.com';
86
- $subject = 'Deactivation Survey';
87
- $headers = array( 'Content-Type: text/html; charset=UTF-8' );
88
-
89
- $body = '<html><body>' .
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>';
97
-
98
- wp_mail( $to, $subject, $body, $headers );
99
-
100
- remove_filter( 'wp_mail_from_name', array( $this, 'ogf_mail_from_name' ) );
101
- remove_filter( 'wp_mail_from', array( $this, 'ogf_mail_from_email' ) );
102
-
103
- wp_die();
104
- }
105
- }
106
-
107
- /*
108
- * Instantiate the OGF_Deactivation class.
109
- */
110
- new OGF_Deactivation();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/functions.php CHANGED
@@ -207,12 +207,12 @@ function ogf_system_fonts() {
207
  'calibri' => array(
208
  'id' => 'calibri',
209
  'label' => esc_html__( 'Calibri', 'olympus-google-fonts' ),
210
- 'stack' => 'Calibri, Candara, Segoe, Segoe UI, Optima, Arial, sans-serif;',
211
  ),
212
  'century-gothic' => array(
213
  'id' => 'century-gothic',
214
  'label' => esc_html__( 'Century Gothic', 'olympus-google-fonts' ),
215
- 'stack' => 'Century Gothic, CenturyGothic, AppleGothic, sans-serif;',
216
  ),
217
  'consolas' => array(
218
  'id' => 'consolas',
@@ -272,7 +272,7 @@ function ogf_system_fonts() {
272
  'verdana' => array(
273
  'id' => 'verdana',
274
  'label' => esc_html__( 'Verdana', 'olympus-google-fonts' ),
275
- 'stack' => 'Verdana, Geneva, sans-serif;',
276
  ),
277
  );
278
 
207
  'calibri' => array(
208
  'id' => 'calibri',
209
  'label' => esc_html__( 'Calibri', 'olympus-google-fonts' ),
210
+ 'stack' => 'Calibri, Candara, Segoe, Segoe UI, Optima, Arial, sans-serif',
211
  ),
212
  'century-gothic' => array(
213
  'id' => 'century-gothic',
214
  'label' => esc_html__( 'Century Gothic', 'olympus-google-fonts' ),
215
+ 'stack' => 'Century Gothic, CenturyGothic, AppleGothic, sans-serif',
216
  ),
217
  'consolas' => array(
218
  'id' => 'consolas',
272
  'verdana' => array(
273
  'id' => 'verdana',
274
  'label' => esc_html__( 'Verdana', 'olympus-google-fonts' ),
275
+ 'stack' => 'Verdana, Geneva, sans-serif',
276
  ),
277
  );
278
 
includes/gutenberg/output-css.php CHANGED
@@ -17,6 +17,9 @@ function ogf_gutenberg_enqueue_fonts() {
17
  if ( $fonts->has_custom_fonts() ) {
18
  $url = $fonts->build_url();
19
  wp_enqueue_style( 'olympus-google-fonts', $url, array(), OGF_VERSION );
 
 
 
20
  }
21
 
22
  }
@@ -171,3 +174,27 @@ function ogf_generate_css_gutenberg( $selector, $option_name ) {
171
  }
172
 
173
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  if ( $fonts->has_custom_fonts() ) {
18
  $url = $fonts->build_url();
19
  wp_enqueue_style( 'olympus-google-fonts', $url, array(), OGF_VERSION );
20
+
21
+ $css = ogf_generate_css_variables();
22
+ wp_add_inline_style( 'olympus-google-fonts', $css );
23
  }
24
 
25
  }
174
  }
175
 
176
  }
177
+
178
+
179
+ /**
180
+ * Helper function to build the CSS variables.
181
+ */
182
+ function ogf_generate_css_variables() {
183
+
184
+ // Fonts.
185
+ $body_font = str_replace('"', '', ogf_build_font_stack( get_theme_mod( 'ogf_body_font' ) ) );
186
+ $heading_font = str_replace('"', '', ogf_build_font_stack( get_theme_mod( 'ogf_headings_font' ) ) );
187
+ $input_font = str_replace('"', '', ogf_build_font_stack( get_theme_mod( 'ogf_inputs_font' ) ) );
188
+
189
+ $css =
190
+ '
191
+ :root {
192
+ --font-body: ' . esc_attr( $body_font ) . ';
193
+ --font-heading: ' . esc_attr( $heading_font ) . ';
194
+ --font-input: ' . esc_attr( $input_font ) . ';
195
+ }
196
+ ';
197
+
198
+ return wp_strip_all_tags( $css );
199
+
200
+ }
olympus-google-fonts.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin Name: 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.0.5
9
  * Author: Fonts Plugin
10
  * Author URI: https://fontsplugin.com/?utm_source=wporg&utm_campaign=heading
11
  * Text Domain: olympus-google-fonts
@@ -18,12 +18,13 @@
18
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
19
  */
20
 
21
- define( 'OGF_VERSION', '2.0.5' );
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
 
28
  $gfwp = new Olympus_Google_Fonts();
29
 
@@ -34,3 +35,32 @@ $author_compat_path = OGF_DIR_PATH . '/compatibility/' . $theme_author . '.php';
34
  if ( file_exists( $author_compat_path ) ) {
35
  require $author_compat_path;
36
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  * Plugin Name: 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.0.6
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', '2.0.6' );
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/welcome.php';
28
 
29
  $gfwp = new Olympus_Google_Fonts();
30
 
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=olympus-google-fonts' );
62
+ exit;
63
+ }
64
+ }
65
+ }
66
+ add_action( 'admin_init', 'ogf_redirect' );
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://fontsplugin.com/#pricing
5
  Requires at least: 4.0
6
  Tested up to: 5.4
7
  License: GPLv2 or later
8
- Stable tag: 2.0.5
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.4
7
  License: GPLv2 or later
8
+ Stable tag: 2.0.6
9
 
10
  The easiest to use Google Fonts Typography Plugin. No coding required. 900+ font choices.
11