Skip to content

Commit d4a1573

Browse files
committed
Fix small UI bugs and typos.
1 parent eb4250a commit d4a1573

File tree

8 files changed

+54
-12
lines changed

8 files changed

+54
-12
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
# WordPress Coding Standards
5+
# https://make.wordpress.org/core/handbook/coding-standards/
6+
7+
root = true
8+
9+
[*]
10+
charset = utf-8
11+
end_of_line = lf
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
indent_style = tab
15+
16+
[{package.json,*.yml}]
17+
indent_style = space
18+
indent_size = 2
19+
20+
[{*.txt,wp-config-sample.php}]
21+
end_of_line = crlf

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ As mentioned, the techniques used here are largely supported by modern browsers,
108108
* Improve user interface.
109109
* Improve documentation.
110110

111+
#### 1.1.1
112+
* Append plugin version to admin assets to ensure they're not cached after updates.
113+
* Fix miscellaneous UI-related bugs appearing in the admin.
114+
111115
## Feedback
112116
You like it? [Email](mailto:alex@macarthur.me) or [tweet](http://www.twitter.com/amacarthur) me. You hate it? [Email](mailto:alex@macarthur.me) or [tweet](http://www.twitter.com/amacarthur) me.
113117

better-resource-hints.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Plugin Name: Better Resource Hints
44
* Description: Easy preloading, prefetching, HTTP/2 server pushing, and more for your CSS and JavaScript.
5-
* Version: 1.1.0
5+
* Version: 1.1.1
66
* Author: Alex MacArthur
77
* Author URI: http://macarthur.me
88
* License: GPLv2 or later
@@ -11,6 +11,8 @@
1111

1212
namespace BetterResourceHints;
1313

14+
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
15+
1416
require_once 'src/Settings.php';
1517
require_once 'src/Filters.php';
1618
require_once 'src/Preconnector.php';
@@ -26,6 +28,7 @@ class App {
2628

2729
private static $instance;
2830

31+
protected static $plugin_data = null;
2932
protected static $options_prefix = 'better_resource_hints';
3033
protected static $admin_settings_page_slug = 'better_resource_hints';
3134
protected static $copy = array(
@@ -39,6 +42,8 @@ public static function init() {
3942
}
4043

4144
public function __construct() {
45+
self::$plugin_data = get_plugin_data(__DIR__ . '/better-resource-hints.php');
46+
4247
new Filters;
4348
new Settings;
4449
new Preloader;
@@ -54,8 +59,8 @@ public function __construct() {
5459
* @return void
5560
*/
5661
public function enqueue_styles_and_scripts() {
57-
wp_enqueue_style( 'better-resource-hints', plugin_dir_url( __FILE__ ) . 'src/assets/css/style.css', array(), null);
58-
wp_enqueue_script( 'better-resource-hints', plugin_dir_url( __FILE__ ) . 'src/assets/js/scripts.min.js', array(), false, true);
62+
wp_enqueue_style( 'better-resource-hints', plugin_dir_url( __FILE__ ) . 'src/assets/css/style.css', array(), self::$plugin_data['Version']);
63+
wp_enqueue_script( 'better-resource-hints', plugin_dir_url( __FILE__ ) . 'src/assets/js/scripts.min.js', array(), self::$plugin_data['Version'], true);
5964
}
6065

6166
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "wordpress-plugin",
55
"minimum-stability": "stable",
66
"license": "GPL-2.0",
7-
"version": "1.1.0",
7+
"version": "1.1.1",
88
"authors": [
99
{
1010
"name": "Alex MacArthur",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"email": "alex@macarthur.me",
55
"url": "https://macarthur.me",
66
"description": "Easy preloading, prefetching, HTTP/2 server pushing, and more for your CSS and JavaScript.",
7-
"version": "1.1.0",
7+
"version": "1.1.1",
88
"license": "GPL-2.0",
99
"main": "better-resource-hints.php",
1010
"repository": "https://github.com/alexmacarthur/wp-better-resource-hints",

readme.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Contributors: alexmacarthur
44
Donate link: paypal.me/alexmacarthur
55
Tags: performance, resource hints, prefetch, preload, server push, HTTP/2
66
Requires at least: 4.0
7-
Tested up to: 4.9.5
8-
Stable tag: 1.1.0
7+
Tested up to: 4.9.6
8+
Stable tag: 1.1.1
99
License: GPLv2 or later
1010
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1111

@@ -137,6 +137,10 @@ First, ensure your server is configured to support server push. Then, you can us
137137
* Improve user interface.
138138
* Improve documentation.
139139

140+
= 1.1.1 =
141+
* Append plugin version to admin assets to ensure they're not cached after updates.
142+
* Fix miscellaneous UI-related bugs appearing in the admin.
143+
140144
== Feedback ==
141145

142146
You like it? [Email](mailto:alex@macarthur.me) or [tweet](http://www.twitter.com/amacarthur) me. You hate it? [Email](mailto:alex@macarthur.me) or [tweet](http://www.twitter.com/amacarthur) me.

src/inc/preloaded-server-push.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<div class="InputBlock">
1010
<div class="InputBlock-row">
11-
<label for="preload_assets_enable_server_push">Yes, Server Push Preloaded Styles</label>
11+
<label for="preload_assets_enable_server_push">Yes, Server Push Preloaded Assets</label>
1212
<input type="checkbox"
1313
<?php checked($value, 'on'); ?>
1414
id="preload_assets_enable_server_push"

src/inc/promo.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,27 @@
99

1010
<ul class="FeedbackList">
1111
<li class="FeedbackList-item FeedbackItem">
12-
<a class="FeedbackItem-link FeedbackItem-link--github" href="https://github.com/alexmacarthur/wp-better-resource-hints" target="_blank"><?php echo file_get_contents(plugin_dir_url( __FILE__ ) . '../assets/img/github.svg'); ?></a>
12+
<a class="FeedbackItem-link FeedbackItem-link--github" href="https://github.com/alexmacarthur/wp-better-resource-hints" target="_blank">
13+
<?php echo file_get_contents(plugin_dir_path( __FILE__ ) . '../assets/img/github.svg'); ?>
14+
</a>
1315
<span class="FeedbackItem-text"><p><a href="https://github.com/alexmacarthur/wp-better-resource-hints">Star</a> it.</p></span>
1416
</li>
1517
<li class="FeedbackList-item FeedbackItem">
16-
<a class="FeedbackItem-link" href="https://wordpress.org/plugins/better-resource-hints/?rate=5#new-post" target="_blank"><?php echo file_get_contents(plugin_dir_url( __FILE__ ) . '../assets/img/wordpress.svg'); ?></a>
18+
<a class="FeedbackItem-link" href="https://wordpress.org/plugins/better-resource-hints/?rate=5#new-post" target="_blank">
19+
<?php echo file_get_contents(plugin_dir_path( __FILE__ ) . '../assets/img/wordpress.svg'); ?>
20+
</a>
1721
<span class="FeedbackItem-text"><p><a href="https://wordpress.org/plugins/better-resource-hints/?rate=5#new-post">Review</a> it.</p></span>
1822
</li>
1923
<li class="FeedbackList-item FeedbackItem">
20-
<a class="FeedbackItem-link" href="https://twitter.com/home?status=I've%20seen%20some%20serious%20performance%20improvements%20after%20installing%20%40amacarthur's%20Better%20Resource%20Hints%20plugin%20for%20%23WordPress!%20https%3A//wordpress.org/plugins/better-resource-hints/" target="_blank"><?php echo file_get_contents(plugin_dir_url( __FILE__ ) . '../assets/img/twitter.svg'); ?></a>
24+
<a class="FeedbackItem-link" href="https://twitter.com/home?status=I've%20seen%20some%20serious%20performance%20improvements%20after%20installing%20%40amacarthur's%20Better%20Resource%20Hints%20plugin%20for%20%23WordPress!%20https%3A//wordpress.org/plugins/better-resource-hints/" target="_blank">
25+
<?php echo file_get_contents(plugin_dir_path( __FILE__ ) . '../assets/img/twitter.svg'); ?>
26+
</a>
2127
<span class="FeedbackItem-text"><p><a href="https://twitter.com/home?status=I've%20seen%20some%20serious%20performance%20improvements%20after%20installing%20%40amacarthur's%20Better%20Resource%20Hints%20plugin%20for%20%23WordPress!%20https%3A//wordpress.org/plugins/better-resource-hints/">Tweet</a> about it.</p></span>
2228
</li>
2329
<li class="FeedbackList-item FeedbackItem">
24-
<a class="FeedbackItem-link FeedbackItem-link--mail" href="https://macarthur.me/contact" target="_blank"><?php echo file_get_contents(plugin_dir_url( __FILE__ ) . '../assets/img/envelope.svg'); ?></a>
30+
<a class="FeedbackItem-link FeedbackItem-link--mail" href="https://macarthur.me/contact" target="_blank">
31+
<?php echo file_get_contents(plugin_dir_path( __FILE__ ) . '../assets/img/envelope.svg'); ?>
32+
</a>
2533
<span class="FeedbackItem-text"><p><a href="https://macarthur.me/contact">Email</a> me.</p></span>
2634
</li>
2735
</ul>

0 commit comments

Comments
 (0)