diff --git a/.distignore b/.distignore
index 6059fac..e5ba0c8 100644
--- a/.distignore
+++ b/.distignore
@@ -6,7 +6,7 @@
/vendor
/hookdocs
-
+nightingale-companion.zip
.distignore
.gitignore
composer.json
diff --git a/README.md b/README.md
index b186a94..35d2255 100644
--- a/README.md
+++ b/README.md
@@ -17,9 +17,6 @@ Download the `nightingale-companion.zip` from this repository. Install this to y
## Additional Features this Plugin provides ##
### Display Options ###
- - Retina Images - this enables your site to serve double quality images for retina display devices, and makes multiple
- sizes for each of the sizes configured on your site. This all happens automatically in the background and will improve
- the look of your thumbnails, images and banners across your site for retina capable screens.
- Disable Emojis - this disables the default emoji packages that ship with WordPress, which load on every single page
of your site and impact performance and speed. This is a tiny tweak that has an incremental benefit.
- Style login page - Modified the login page to use the theme design and layout
@@ -34,9 +31,7 @@ Download the `nightingale-companion.zip` from this repository. Install this to y
excerpt (or you can manually add your own per page/post). This modification uses this excerpt to populate the meta
description tag. If you have an alternative method of generating this meta tag, you should disable this option.
- Cleanup meta - removes lots of WP native tags included in the header region.
- - Update jQuery - USE WITH CAUTION. This updates the jQuery for your WordPress to 3.4.1. The admin side is
- unaffected. If enabling this, test ALL functionality of your site, as some plugin functionality for other plugins
- on your site may cease to work as expected.
+
### Performance ###
- [LoadCSS](https://github.com/filamentgroup/loadCSS) - this uses the loadcss javascript library which defers loading of
@@ -44,15 +39,14 @@ Download the `nightingale-companion.zip` from this repository. Install this to y
- [InstantPage](https://github.com/instantpage/instant.page) - this uses the instantpage javascript library to trigger
pages preloading when a user hovers their mouse over links. This does not, in fact increase load times but does appear perception of load times as those few partial
seconds pre click are actually being used to start loading the next page.
- - DeferJS - adds a defer tag to all javascript (excluding jQuery and loadcss) to defer loading of js resources until
+ - Javascript Loading - Defaultss to native WP loading, but you can choose to instead:
+ - adds a defer tag to all javascript (excluding jQuery and loadcss) to defer loading of js resources until
after HTML has loaded in.
+ - Move Scripts to Footer - move the javascript and stylesheet files to the footer. This enables visible display of the page quicker.
+ - Both the above.
- Browser Cache - this is a setting to tell users' browser to cache locally the content. The value is number of
seconds that this local cache should be stored, defaulting to 43200 (12 hours)
- - LazyLoading - adds a tag to all media resources to use native lazyloading. This will work on all modern
- browsers (except FireFox)
- - Compress HTML output - very basic minification of output HTML. This does not combine or minify included files. Will
- reduce size of output HTML by around 3-5%
- - Move Scripts to Footer - move the javascript and stylesheet files to the footer. This enables visible display of the page quicker.
+
### Blog Settings ###
diff --git a/composer.json b/composer.json
index feaa25a..6878f03 100644
--- a/composer.json
+++ b/composer.json
@@ -1,6 +1,6 @@
{
"name": "nhsleadership/nightingale-companion",
- "version": "1.0.5",
+ "version": "1.1.0",
"dist": {
"url": "https://github.com/NHSLeadership/nightingale-companion/archive/master.zip",
"type": "zip"
diff --git a/display/css/socialfloating.css b/display/css/socialfloating.css
index 472f133..0e5c9f3 100644
--- a/display/css/socialfloating.css
+++ b/display/css/socialfloating.css
@@ -14,10 +14,10 @@
z-index: 10;
}
.contact-bar.left {
- left: -40px;
+ left: -50px;
}
.contact-bar.right {
- right: -40px;
+ right: -50px;
}
.contact-bar.slide-on-scroll {
@@ -26,13 +26,13 @@
.cb-link {
display: block;
- width: 40px;
- height: 40px;
+ width: 50px;
+ height: 50px;
padding: 0;
margin-bottom: 0.1em;
text-align: center;
- line-height: 40px;
- font-size: 17px;
+ line-height: 50px;
+ font-size: 20px;
background: #8e8e93;
color: #fff;
position: relative;
@@ -47,12 +47,12 @@
}
.left .cb-link {
left: 0;
- border-radius: 0 0.4em 0.4em 0;
+ border-radius: 0;
border: 1px solid #425563;
}
.right .cb-link {
right: 0;
- border-radius: 0.4em 0 0 0.4em;
+ border-radius: 0;
border: 1px solid #425563;
}
.cb-link .icon {
@@ -62,21 +62,18 @@
.left .cb-link:focus,
.left .cb-link:active {
color: #fff;
- padding-left: 10px;
- width: 50px;
+
}
.right .cb-link:hover,
.right .cb-link:focus,
.right .cb-link:active {
color: #fff;
- padding-right: 10px;
- width: 50px;
}
.left .cb-link.cb-hidden {
- left: -40px;
+ left: -50px;
}
.right .cb-link.cb-hidden {
- right: -40px;
+ right: -50px;
}
.cb-link.separated {
@@ -92,5 +89,5 @@
border: 0;
outline: 0;
padding: 0;
- width: 40px;
+ width: 50px;
}
diff --git a/display/display-enhancements.php b/display/display-enhancements.php
index 432290f..6e060a7 100644
--- a/display/display-enhancements.php
+++ b/display/display-enhancements.php
@@ -6,9 +6,7 @@
* @copyright NHS Leadership Academy, Tony Blacker
* @version 1.0 25th June 2020
*/
-if ( ( isset( $nightingale_companion_options[ 'retina_images' ] ) ) && ( $nightingale_companion_options[ 'retina_images' ] === 'on' ) ) {
- require_once( plugin_dir_path( __FILE__ ) . 'retina-images.php' );
-}
+
if ( ( isset( $nightingale_companion_options[ 'style_login_page' ] ) ) && ( $nightingale_companion_options[ 'style_login_page' ] === 'on' ) ) {
require_once( plugin_dir_path( __FILE__ ) . 'login.php' );
@@ -56,7 +54,7 @@ function nightingale_companion_emergency_header( $content ) {
}
/**
- * jQuery routine to take the output emergency alert and insert it into the corret area of the output html
+ * jQuery routine to take the output emergency alert and insert it into the correct area of the output html
*
* @since 1.0.0
* @hook nhsblocks_emergency_footer
diff --git a/display/js/retina.js b/display/js/retina.js
deleted file mode 100644
index 34aa84d..0000000
--- a/display/js/retina.js
+++ /dev/null
@@ -1,100 +0,0 @@
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- (global.retinajs = factory());
-}(this, (function () { 'use strict';
-
- var hasWindow = typeof window !== 'undefined';
- var environment = Math.round(hasWindow ? window.devicePixelRatio || 1 : 1);
- var srcReplace = /(\.[A-z]{3,4}\/?(\?.*)?)$/;
- var inlineReplace = /url\(('|")?([^)'"]+)('|")?\)/i;
- var selector = '[data-rjs]';
- var processedAttr = 'data-rjs-processed';
- function arrayify(object) {
- return Array.prototype.slice.call(object);
- }
- function chooseCap(cap) {
- var numericCap = parseInt(cap, 10);
- if (environment < numericCap) {
- return environment;
- } else {
- return numericCap;
- }
- }
- function forceOriginalDimensions(image) {
- if (!image.hasAttribute('data-no-resize')) {
- if (image.offsetWidth === 0 && image.offsetHeight === 0) {
- image.setAttribute('width', image.naturalWidth);
- image.setAttribute('height', image.naturalHeight);
- } else {
- image.setAttribute('width', image.offsetWidth);
- image.setAttribute('height', image.offsetHeight);
- }
- }
- return image;
- }
- function setSourceIfAvailable(image, retinaURL) {
- var imgType = image.nodeName.toLowerCase();
- var testImage = document.createElement('img');
- testImage.addEventListener('load', function () {
- if (imgType === 'img') {
- forceOriginalDimensions(image).setAttribute('src', retinaURL);
- } else {
- image.style.backgroundImage = 'url(' + retinaURL + ')';
- }
- });
- testImage.setAttribute('src', retinaURL);
- image.setAttribute(processedAttr, true);
- }
- function dynamicSwapImage(image, src) {
- var rjs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
- var cap = chooseCap(rjs);
- if (src && cap > 1) {
- var newSrc = src.replace(srcReplace, '@' + cap + 'x$1');
- setSourceIfAvailable(image, newSrc);
- }
- }
- function manualSwapImage(image, src, hdsrc) {
- if (environment > 1) {
- setSourceIfAvailable(image, hdsrc);
- }
- }
- function getImages(images) {
- if (!images) {
- return typeof document !== 'undefined' ? arrayify(document.querySelectorAll(selector)) : [];
- } else {
- return typeof images.forEach === 'function' ? images : arrayify(images);
- }
- }
- function cleanBgImg(img) {
- return img.style.backgroundImage.replace(inlineReplace, '$2');
- }
- function retina(images) {
- getImages(images).forEach(function (img) {
- if (!img.getAttribute(processedAttr)) {
- var isImg = img.nodeName.toLowerCase() === 'img';
- var src = isImg ? img.getAttribute('src') : cleanBgImg(img);
- var rjs = img.getAttribute('data-rjs');
- var rjsIsNumber = !isNaN(parseInt(rjs, 10));
- if (rjs === null) {
- return;
- }
- if (rjsIsNumber) {
- dynamicSwapImage(img, src, rjs);
- } else {
- manualSwapImage(img, src, rjs);
- }
- }
- });
- }
- if (hasWindow) {
- window.addEventListener('load', function () {
- retina();
- });
- window.retinajs = retina;
- }
-
- return retina;
-
-})));
-//# sourceMappingURL=retina.js.map
\ No newline at end of file
diff --git a/display/posts-by-author.php b/display/posts-by-author.php
index fe0d9f2..546cf58 100644
--- a/display/posts-by-author.php
+++ b/display/posts-by-author.php
@@ -67,8 +67,8 @@ function nightingale_companion_postsby_author( $content ) {
$content = $content . $output;
}
- return $content;
wp_reset_postdata();
+ return $content;
}
add_action( 'the_content', 'nightingale_companion_postsby_author' );
diff --git a/display/retina-images.php b/display/retina-images.php
deleted file mode 100644
index aa43383..0000000
--- a/display/retina-images.php
+++ /dev/null
@@ -1,104 +0,0 @@
- $value ) {
- if ( is_array( $value ) ) {
- foreach ( $value as $image => $attr ) {
- if ( is_array( $attr ) ) {
- nightingale_companion_retina_support_create_images( get_attached_file( $attachment_id ), $attr['width'], $attr['height'], true );
- }
- }
- }
- }
-
- return $metadata;
-}
-
-/**
- * Create retina-ready images
- *
- * Referenced via retina_support_attachment_meta().
- *
- * @param array $file The raw file being uploaded.
- * @param integer $width How wide should the image be cropped.
- * @param integer $height How high should the image be cropped.
- * @param bool $crop Are we cropping the image.
- */
-function nightingale_companion_retina_support_create_images( $file, $width, $height, $crop = false ) {
- if ( $width || $height ) {
- $resized_file = wp_get_image_editor( $file );
- if ( ! is_wp_error( $resized_file ) ) {
- $filename = $resized_file->generate_filename( $width . 'x' . $height . '@2x' );
-
- $resized_file->resize( $width * 2, $height * 2, $crop );
- $resized_file->save( $filename );
-
- $info = $resized_file->get_size();
-
- return array(
- 'file' => wp_basename( $filename ),
- 'width' => $info['width'],
- 'height' => $info['height'],
- );
- }
- }
-
- return false;
-}
-
-add_filter( 'delete_attachment', 'nightingale_companion_delete_retina_support_images' );
-
-/**
- * Delete retina-ready images
- *
- * This function is attached to the 'delete_attachment' filter hook.
- *
- * @param integer $attachment_id The image id as generated by WP.
- */
-function nightingale_companion_delete_retina_support_images( $attachment_id ) {
- $meta = wp_get_attachment_metadata( $attachment_id );
- $upload_dir = wp_upload_dir();
- $path = pathinfo( $meta['file'] );
- if ( ! empty( $meta ) ) {
- foreach ( $meta as $key => $value ) {
- if ( 'sizes' === $key ) {
- foreach ( $value as $sizes => $size ) {
- $original_filename = $upload_dir['basedir'] . '/' . $path['dirname'] . '/' . $size['file'];
- $retina_filename = substr_replace( $original_filename, '@2x.', strrpos( $original_filename, '.' ), strlen( '.' ) );
- if ( file_exists( $retina_filename ) ) {
- unlink( $retina_filename );
- }
- }
- }
- }
- }
-}
diff --git a/functionality/jquery-update.php b/functionality/jquery-update.php
deleted file mode 100644
index 237e198..0000000
--- a/functionality/jquery-update.php
+++ /dev/null
@@ -1,14 +0,0 @@
- 'on', // EnableRetina Images
'loadcss' => 'on', // Enable Load CSS
'instantpage' => 'on', // Enable InstantPage
- 'defer_js' => 'on', // Enable Defer JS
+ 'javascript_loading' => 'none', // Enable Defer JS
'browser_cache' => '43200', // Set Browser Cache to 12 hours
- 'lazy_loading' => 'on', // Enable LazyLoading
'disable_emojis' => 'on', // Disable Emojis
'cleanup_meta' => 'on', // Cleanup WP meta tags
- 'compress_html' => 'on', // Basic Minification of Output
'excerpts_as_meta_description' => 'on', // Simple Meta Description Population
- 'move_scripts_to_footer' => 'on', // Sending Scripts to the Footer
'style_login_page' => 'on', // Add styling to login page to match rest of theme
'enable_emergency_alert' => 'on', // Add functionality to show emergency alert (options get added to theme customiser)
'show_author_bio' => 'off', // show an author bio section below posts
'show_author_posts' => 'off', // show other posts by author below posts
'hide_featured_images' => 'off', // suppress featured images on individual pages
- 'update_jquery' => 'off', // update jQuery to 3.4.1
'sharing_buttons' => 'none', // enable sharing buttons on posts
'sharing_title' => 'Share this:', // set title of sharing buttons region
);
@@ -108,9 +103,6 @@ function nightingale_companion_default_values() {
require_once( plugin_dir_path( __FILE__ ) . 'functionality/simple-meta.php' );
}
-if ( ( isset( $nightingale_companion_options[ 'update_jquery' ] ) ) && ( $nightingale_companion_options[ 'update_jquery' ] === 'on' ) ) {
- require_once( plugin_dir_path( __FILE__ ) . 'functionality/jquery-update.php' );
-}
/**
* Add the plugin settings link to the plugins screen for quick access.
diff --git a/package-lock.json b/package-lock.json
index 9c967d7..cfc63dd 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,13 +1,13 @@
{
"name": "nightingale-companion",
- "version": "1.0.0",
+ "version": "1.0.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@babel/parser": {
- "version": "7.10.2",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz",
- "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ==",
+ "version": "7.11.3",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.3.tgz",
+ "integrity": "sha512-REo8xv7+sDxkKvoxEywIdsNFiZLybwdI7hcT5uEPyQrSMB4YQ973BfC9OOrD/81MaIjh6UxdulIQXkjmiH3PcA==",
"dev": true
},
"argparse": {
@@ -62,9 +62,9 @@
}
},
"jsdoc": {
- "version": "3.6.4",
- "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.4.tgz",
- "integrity": "sha512-3G9d37VHv7MFdheviDCjUfQoIjdv4TC5zTTf5G9VODLtOnVS6La1eoYBDlbWfsRT3/Xo+j2MIqki2EV12BZfwA==",
+ "version": "3.6.5",
+ "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.5.tgz",
+ "integrity": "sha512-SbY+i9ONuxSK35cgVHaI8O9senTE4CDYAmGSDJ5l3+sfe62Ff4gy96osy6OW84t4K4A8iGnMrlRrsSItSNp3RQ==",
"dev": true,
"requires": {
"@babel/parser": "^7.9.4",
@@ -102,9 +102,9 @@
}
},
"lodash": {
- "version": "4.17.15",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
- "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
+ "version": "4.17.19",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
+ "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
"dev": true
},
"markdown-it": {
@@ -160,9 +160,9 @@
"dev": true
},
"strip-json-comments": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz",
- "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
"dev": true
},
"taffydb": {
diff --git a/package.json b/package.json
index d897fe6..e7afbbf 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,7 @@
"build:docs": "rm -rf hookdocs/ && jsdoc -c hookdoc-conf.json"
},
"devDependencies": {
- "jsdoc": "~3.6.3",
+ "jsdoc": "^3.6.5",
"wp-hookdoc": "^0.2.0"
}
}
diff --git a/performance/basic-minify.php b/performance/basic-minify.php
deleted file mode 100644
index 65b6d6a..0000000
--- a/performance/basic-minify.php
+++ /dev/null
@@ -1,178 +0,0 @@
-parseHTML( $html );
- }
- }
-
- public function __toString() {
- return $this->html;
- }
-
- /**
- * Generate content for the bottom of the output HTML to demonstrate what savings were created.
- * @since 1.0.0
- * @hook bottomComment
- * @param {string} $raw - the raw html before compression.
- * @param {string} $compressed - the compressed html after compression.
- */
- protected function bottomComment( $raw, $compressed ) {
- $raw = strlen( $raw );
- $compressed = strlen( $compressed );
-
- $savings = ( $raw - $compressed ) / $raw * 100;
-
- $savings = round( $savings, 2 );
-
- }
-
- /**
- * minifyHTML - the actual clever bit which reduces whitespace from output HTML.
- * @since 1.0.0
- * @hook minifyHTML
- * @param {string} $html - the raw HTML pre compression.
- *
- * @return {string} - the compressed HTML with whitespace stripped out.
- */
- protected function minifyHTML( $html ) {
- $pattern = '/<(?';
}
- return "$url' defer='defer";
+ return $tag;
}
-add_filter( 'clean_url', 'nightingale_companion_defer_parsing_js', 11, 1 );
+add_filter( 'script_loader_tag', 'nightingale_companion_defer_parsing_js', 10, 3 );
diff --git a/performance/lazy-loading.php b/performance/lazy-loading.php
deleted file mode 100644
index 873fec9..0000000
--- a/performance/lazy-loading.php
+++ /dev/null
@@ -1,268 +0,0 @@
-]+>/', $content, $matches ) ) {
- return $content;
- }
-
- // List of the unique `img` tags found in $content.
- $images = array();
-
- foreach ( $matches[0] as $image ) {
- if ( preg_match( '/wp-image-([0-9]+)/i', $image, $class_id ) ) {
- $attachment_id = absint( $class_id[1] );
-
- if ( $attachment_id ) {
- /*
- * If exactly the same image tag is used more than once, overwrite it.
- * All identical tags will be replaced later with 'str_replace()'.
- */
- $images[ $image ] = $attachment_id;
- continue;
- }
- }
-
- $images[ $image ] = 0;
- }
-
- // Reduce the array to unique attachment IDs.
- $attachment_ids = array_unique( array_filter( array_values( $images ) ) );
-
- if ( count( $attachment_ids ) > 1 ) {
- /*
- * Warm the object cache with post and meta information for all found
- * images to avoid making individual database calls.
- */
- _prime_post_caches( $attachment_ids, false, true );
- }
-
- foreach ( $images as $image => $attachment_id ) {
- $filtered_image = $image;
-
- // Add 'srcset' and 'sizes' attributes if applicable.
- if ( $attachment_id > 0 && false === strpos( $filtered_image, ' srcset=' ) ) {
- $filtered_image = nightingale_companion_wp_img_tag_add_srcset_and_sizes_attr( $filtered_image, $context, $attachment_id );
- }
-
- // Add 'loading' attribute if applicable.
- if ( $add_loading_attr && false === strpos( $filtered_image, ' loading=' ) ) {
- $filtered_image = nightingale_companion_wp_img_tag_add_loading_attr( $filtered_image, $context );
- }
-
- if ( $filtered_image !== $image ) {
- $content = str_replace( $image, $filtered_image, $content );
- }
- }
-
- return $content;
-}
-
-/**
- * Adds `loading` attribute to an existing `img` HTML tag.
- *
- * @param string $image The HTML `img` tag where the attribute should be added.
- * @param string $context Additional context to pass to the filters.
- *
- * @return string Converted `img` tag with `loading` attribute added.
- * @since (TBD)
- *
- */
-function nightingale_companion_wp_img_tag_add_loading_attr( $image, $context ) {
- /**
- * Filters the `loading` attribute value. Default `lazy`.
- *
- * Returning `false` or an empty string will not add the attribute.
- * Returning `true` will add the default value.
- *
- * @param string $value The 'loading' attribute value, defaults to `lazy`.
- * @param string $image The HTML 'img' element to be filtered.
- * @param string $context Additional context about how the function was called or where the img tag is.
- *
- * @since (TBD)
- *
- */
- $value = apply_filters( 'nightingale_companion_wp_img_tag_add_loading_attr', 'lazy', $image, $context );
-
- if ( $value ) {
- if ( ! in_array( $value, array( 'lazy', 'eager' ), true ) ) {
- $value = 'lazy';
- }
-
- return str_replace( ' 0 ) ) {
+if ( ( isset( $nightingale_companion_options[ 'browser_cache' ] ) ) && ( $nightingale_companion_options[ 'browser_cache' ] > 0 ) ) {
require_once( plugin_dir_path( __FILE__ ) . 'cache-headers.php' );
}
-//lazy loading - this will eventually be part of core WP
-if ( ( ! is_admin() ) && ( isset( $nightingale_companion_options[ 'lazy_loading' ] ) ) && ( $nightingale_companion_options[ 'lazy_loading' ] === 'on' ) ) {
- if (
- ! function_exists( 'wp_lazy_loading_enabled' ) &&
- ! function_exists( 'wp_filter_content_tags' ) &&
- ! function_exists( 'wp_img_tag_add_loading_attr' ) &&
- ! function_exists( 'wp_img_tag_add_srcset_and_sizes_attr' )
- ) {
- require_once( plugin_dir_path( __FILE__ ) . 'lazy-loading.php' );
- }
-}
-
// disableemojis.
if ( ( isset( $nightingale_companion_options[ 'disable_emojis' ] ) ) && ( $nightingale_companion_options[ 'disable_emojis' ] === 'on' ) ) {
require_once( plugin_dir_path( __FILE__ ) . 'disable-emojis.php' );
@@ -48,11 +41,5 @@
require_once( plugin_dir_path( __FILE__ ) . 'clean-wp-headers.php' );
}
-if ( ( ! is_admin() ) && ( isset( $nightingale_companion_options[ 'compress_html' ] ) ) && ( $nightingale_companion_options[ 'compress_html' ] === 'on' ) ) {
- require_once( plugin_dir_path( __FILE__ ) . 'basic-minify.php' );
-}
-if ( ( ! is_admin() ) && ( isset( $nightingale_companion_options[ 'move_scripts_to_footer' ] ) ) && ( $nightingale_companion_options[ 'move_scripts_to_footer' ] === 'on' ) ) {
- require_once( plugin_dir_path( __FILE__ ) . 'script-to-footer.php' );
-}
diff --git a/readme.txt b/readme.txt
index 52e3661..0dfcf9a 100644
--- a/readme.txt
+++ b/readme.txt
@@ -2,9 +2,9 @@
Contributors: Nick-Summerfield, tblacker7
Tags: theme, nightingale, nhs
Plugin Name:: Nightingale Companion
-Requires at least: 5.3
-Tested up to: 5.4.1
-Stable tag: 1.0.5
+Requires at least: 5.0
+Tested up to: 5.5
+Stable tag: 1.1.0
Requires PHP: 5.6
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -19,9 +19,6 @@ This plugin is a companion to the Nightingale theme. It is aimed at improving pe
that uses the Nightingale theme. The plugin adds additional functionality to the theme, each component of which is
enabled by default on installation but can be switched off easily via the admin panel > Settings > Nightingale Companion
- - Retina Images - this enables your site to serve double quality images for retina display devices, and makes multiple
- sizes for each of the sizes configured on your site. This all happens automatically in the background and will improve
- the look of your thumbnails, images and banners across your site for retina capable screens.
- Disable Emojis - this disables the default emoji packages that ship with WordPress, which load on every single page
of your site and impact performance and speed. This is a tiny tweak that has an incremental benefit.
- LoadCSS - this uses the loadcss javascript library (https://github.com/filamentgroup/loadCSS) which defers loading of
@@ -30,14 +27,10 @@ enabled by default on installation but can be switched off easily via the admin
pages preloading when a user hovers their mouse over links. This does not, in fact increase load times but does appear perception of load times as those few partial
seconds pre click are actually being used to start loading the next page.
- DeferJS - adds a defer tag to all javascript (excluding jQuery and loadcss) to defer loading of js resources until
- after HTML has loaded in.
+ after HTML has loaded in. Alternatively, you can simply move your scripts to the footer, or you can do both.
- Set Browser Cache - this is a setting to tell users' browser to cache locally the content. The value is number of
seconds that this local cache should be stored, defaulting to 43200 (12 hours)
- - Enable LazyLoading - adds a tag to all media resources to use native lazyloading. This will work on all modern
- browsers (except FireFox)
- Cleanup WordPress meta tags - removes lots of WP native tags included in the header region.
- - Compress HTML output - very basic minification of output HTML. This does not combine or minify included files. Will
- reduce size of output HTML by around 3-5%
- Use Excerpts as Meta Description - WordPress automatically takes the first 55 words of a post or page to create an
excerpt (or you can manually add your own per page/post). This modification uses this excerpt to populate the meta
description tag. If you have an alternative method of generating this meta tag, you should disable this option.
@@ -77,6 +70,23 @@ with sample content on a site running the Nightingale theme, this plgin and the
== Changelog ==
+= 1.1.0 =
+Security and stability update:
+Thank you to all users submitting feedback.
+ - Javascript loading has been combined, with a simplified control. Now you have the option of deferring JS to after
+pageload, moving scripts to the footer, or both, or neither.
+ - Cache control has been improved to bust the cache for logged in users, so people adding content or editing can see
+ their changes reflected without doing a hard refresh.
+ - This release sees the removal of:
+ - Retina Images - the theme instead uses WordPress native multiimage display.
+ - Update jQuery - WP core is updating jQuery through the next few releases, this feature is no longer required.
+ - LazyLoading - as of WP 5.5. this is a native function so does not need to be in a plugin.
+ - Compress HTML - this was breaking data reporting from Google Tag Manager and also impacted some javascript triggers
+ .
+
+= 1.0.5.1 =
+Maintenance release
+
= 1.0.5 =
Bugfixes:
- corrected install routine to add correct default settings to plugin
diff --git a/settings.php b/settings.php
index ec99301..cd2c151 100644
--- a/settings.php
+++ b/settings.php
@@ -24,12 +24,6 @@
'display-options' => array(
'title' => __( 'Display Options', 'nightingale' ),
'fields' => array(
- 'retina_images' => array(
- 'title' => 'Retina Images',
- 'type' => 'checkbox',
- 'checked' => 'true',
- 'text' => 'Enable retina display using retina.js?',
- ),
'disable_emojis' => array(
'title' => 'Disable Emojis',
'type' => 'checkbox',
@@ -82,12 +76,6 @@
'checked' => 'true',
'text' => 'Cleanup the WP meta tags added by default to remove unused items',
),
- 'update_jquery' => array(
- 'title' => 'Update jQuery',
- 'type' => 'checkbox',
- 'checked' => '',
- 'text' => 'Update the core jQuery to 3.4.1. Use with caution, this may break certain features with other plugins. Enable at your own risk.',
- ),
),
),
'performance-options' => array(
@@ -106,10 +94,15 @@
'text' => 'Enable instantpage library - this starts a page loading when a mouse hovers over it which improves User Experience',
),
'defer_js' => array(
- 'title' => 'Defer JS',
- 'type' => 'checkbox',
- 'checked' => 'true',
+ 'title' => 'Javascript Loading',
'text' => 'Defer loading of JS to increase speed of visible page load. (Note this does not actually improve overall speed, just the speed of loading for users to be able to interact with the screen)',
+ 'type' => 'select',
+ 'choices' => array(
+ 'none' => 'Leave as standard',
+ 'defer_js' => 'Defer JS',
+ 'footer' => 'Move to Footer',
+ 'both' => 'Both',
+ ),
),
'browser_cache' => array(
'title' => 'Browser Cache',
@@ -117,24 +110,6 @@
'value' => '43200',
'text' => 'Set Browser Cache duration in seconds. 300 = 5 minutes, 43200 = 12 hours. Think very carefully before setting to a higher value than 12 hours!',
),
- 'lazyloading' => array(
- 'title' => 'Lazy Loading',
- 'type' => 'checkbox',
- 'checked' => 'true',
- 'text' => ' Lazy Loading delays resources loading until the point they are in display. This improves performance on pages with images and videos.',
- ),
- 'compress_html' => array(
- 'title' => 'Compress HTML',
- 'type' => 'checkbox',
- 'checked' => 'true',
- 'text' => 'Basic compression of output html (removes white space in the raw html that is sent to the browser)',
- ),
- 'move_scripts' => array(
- 'title' => 'Move Scripts to Footer',
- 'type' => 'checkbox',
- 'checked' => 'true',
- 'text' => 'Send scripts and styles to the footer. This may cause issues with other plugins. If this occurs, please disable.',
- ),
),
),
'blog-options' => array(