Pre* Party Resource Hints

설명

This plugin allows users to automatically and easily embed resource hints to improve page load time.

DNS prefetch, prerender, preconnect, prefetch, and preload are all supported.

After installation, preconnect hints will automatically be created the next time your website is visited.

You have the choice to include these resource hints in the HTTP header or the website’s .

Installation Video

스크린샷

  • screenshot-1.png

  • screenshot-2.png

  • screenshot-3.png

  • screenshot-4.png

  • Support Forum

  • Send me an email at sam.perrow399@gmail.com

설치

  1. Upload the entire pre-party-browser-hints folder to the /wp-content/plugins/ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.

FAQ

How can I determine which URL’s to enter?
Go to https://www.webpagetest.org, enter your website’s URL, and click on the “waterfall” chart that appears.
a) For all resources that are loaded from external websites or domain names, I recommend inserting a preconnect link for that domain name (Preconnect is more powerful than DNS Prefetch, as it takes care of the DNS lookup, initial connection, and SSL negotiation).
b) If you have a very popular link on your site that you are confident a user would navigate towards, I recommend inserting a link for that URL with the “prerender” option set.
c) Prefetch and preload work similarly, which allows single resources to be loaded before they are requested by the user. Use this for loading images, videos, JavaScript files, etc.

How does the plugin automatically add preconnect hints?
After installing the plugin (or clicking the ‘Reset Links’ button), a JavaScript file will be loaded on your website (after a page is loaded) which captures the resources loaded from external domains and sends them via Ajax to your database six seconds after the page has been loaded. This script fires 6 seconds after the website has been loaded, to allow for all resources to be completely loaded.

Many websites have cache plugins that can interfere with this functionality. I have configured the JavaScript file to only function when it is in its original folder (not been merged/combined). This is to prevent it from triggering after every page load. To get this funtionality working properly, ensure that this file (/wp-content/plugins/pre-party-browser-hints/js/find-external-domains.js) is not effected by any cache plugins.

DNS Prefetch:
For all HTTP requests loaded from external sources on a page web, add the domain name of each in the “Add New Resource Hint” form, select the option for “DNS Prefetch”.

Prefetch:
Insert an absolute URL for a CSS, JavaScript, image, etc, that is hosted on an external domain, and select the option “Prefetch”.

Prerender:
Insert a valid URL that a visitor to your website is likely to visit, and select the option “Prerender”. The URL you entered will now be loaded by the browser after all requests have been loaded on the page.

Preconnect:
For all HTTP requests loaded from external sources on a page web, add the domain name of each in the “Add New Resource Hint” form, select the option for “Preconnect”. Preconnect is more powerful than DNS Prefetch, because it resolves three connections instead of one.

If you would like to have preconnect links automatically set, simply install this plugin and allow it do it the magic for you. If you would like this option disabled, just select the option to have these disabled near the bottom of the main plugin screen.

Preload:
Insert an absolute URL for a CSS, JavaScript, image, etc, and select the option “Preload”.

To activate the preloaded resource, you must call that file in HTML as you would any file. For example, if you preload ‘jquery.js’, you must insert a script tag with a src attribute set to ‘jquery.js’. Otherwise the preloaded link will be saved in the browser, but not activated in the DOM.

후기

2020년 6월 7일
The support the plugin author provides is fantastic. Willingless to help and get to the bottom of things is what makes it special. Thank you.
2020년 2월 7일
This is a very useful plugin, it save us a lot of time! Thanks! 🙂
2020년 1월 24일
Very useful and you do not have to manually test it and add it to the head. Auto function is perfect but I had difficulties with plugin cache (swift performance). for some websites. Doen't work even if we add an exception rule in swift performance.
모든 15 평가 읽기

기여자 & 개발자

“Pre* Party Resource Hints”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

자국어로 “Pre* Party Resource Hints”(을)를 번역하십시오.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록RSS로 구독하십시오.

변경이력

  1. Most recent update: September 27, 2020.
  2. Version 1.7.3.2

September 27, 2020:
1) Added more information about how the “auto-preconnect” feature works.
2) Cleaned up and added better management of hint creation/update/deletions.
3) Removed some unneeded code.

September 5, 2020:
1) Modified how auto-preconnect hints are sent by requiring that they be used within six hours of their initiation.
Sometimes that file gets cached, and its filename changes by other plugins, and constantly fires requests.
2) Made minor changes to HTML on pages and file paths.

August 3, 2020:
1) tested WP 5.5 compatbility
2) corrected bug with updating hints
3) simplified the sending of and creation of frontend hints
4) Adjusted translations

July 7, 2020:
1) Replaced hardcoded “wp-admin” URL’s with dynamic ones.

June 4, 2020:
1) Fixed plugin compatibility issue.

June 3, 2020:
1) added ability to edit existing hints inline asynchronously.
2) adding, updating, and deleting hints is now 100% ajax driven.
3) navigating between tabs will toggle that content’s display, instead of including each tab file.
4) various other improvements to code to improve functionality.

April 15, 2020:
1) fixed URL encoding issue.
2) plugin update issue.

February 2, 2020:
1) added warning when a cache plugin is active and users choose HTTP header option to let them know to clear cache.
2) Ensured compat w/ WP 5.3.2

December 8, 2019:
1) Re-added option to allow resource hints to be sent in the HTTP header.
2) Small bug fixes

November 4, 2019:
1) Ensured compatibility with WP 5.3
2) Removed debug console.log message on find-external-domains.js; other minor change to that file.

October 5, 2019:
1) Entered URL’s will no longer be converted to lower case. This is because some sites have case-sensitive URI’s.

September 28, 2019:
1) Fixed bug with preconnect-ajax hints.
2) fixed issue with upgrading db table from v 1.5.8

September 15, 2019:
1) Dramatically reconfigured plugin. Version 1.6.0 is basically a complete rewrite of all code used. It is more organized, concise, efficient, easy to understand, simple, and user friendly than previously.
2) The option to add hints in the HTTP header has been removed. This is necessary because that feature will not be compatible with future versions of the plugin.
3) Moved all plugin settings to the “Settings” tab for easier navigation.
4) Added ability for users to set the crossorigin, as, and type attributes for hints.
5) Transformed “Contact” box into a pop up modal.

February 16, 2019:
1) Ensured compatibility with WP 5.1
2) Removed legacy file
3) Made minor syntax changes.

October 19, 2018:
1) Tested compatibility with WP 5.0
2) Tested up to PHP 7.3.0.
3) Updated github URL.

August 9, 2018:
1) Added a warning indicator on the admin page to let users know that they should not load hints in the HTTP header if they have a cache plugin active, and to notify them to refresh their cache.
2) Removed the need for jQuery to be loaded dynamically in the “find-external-domains.js” script, and optimized the code. 100% vanilla JS now!
3) In the “Request New Feature or Report a Bug” feature, I added some info that gets sent to me to better diagnose potential plugin problems (WP version, PHP version, URL).

June 29, 2018:
1) updated a change in my GitHub username onto file paths that display HTML links on the info tab.
2) Created a plugin installation video and put it on the readme

April 27, 2018:
1) fixed bug preventing users from deleting or updating resource hint statuses.
2) fixed bug some users could notice upon installation/reactivation in the admin.php file.

April 14, 2018:
1) Fixed some UI issues on admin page (URL input field not taking up max space, jQuery sometimes not loading).
2) removed check to see if JS preconnect hint array had items before sending it to db (if it was empty, this caused the script to keep firing over and over).
3) changed some text in description.
4) cleaned up old variable’s on class-PPRH-display-items.php file.

April 2, 2018:
1) removed unneccessary call on admin side for creating table.
2) fixed some bugs relating to how URL’s are inserted and how the crossorigin attribute is created.
3) fixed bug in creating the header string.
4) fixed bug relating to how user options were saved on admin side.

March 31, 2018:
1) improved automatic discovery of external domains by using the Resource Timing API.
2) cleaned up UI by consolidating form elements and save buttons into one.
3) improved ability for preload hints ‘as’ attribute to be determined when user inputs data.
4) improved sanitization and overall URL entry process.
5) cleaned up the code which governs how hints are delivered from the db to the browser.
6) ‘crossorigin’ attribute is now determined on the back end.
7) added more detailed information to the Preload information section.
8) modified db table schema- added 5 columns: ‘as_attr’, ‘type_attr’, ‘crossorigin’, ‘header_string’, and ‘head_string’ for those respective attributes which browsers are getting more particular about. The last two columns are helpful for storing the specified links in the db, and delivering them very quickly to the browser.
9) the improvements above have been able to bring total PHP execution time on the front end down to around 0.07-0.1 milliseconds (that’s 0.00007 seconds). Essentially I am shifting more of the calculations/computations to the back end when the user inputs data rather than the front end.

Feb 26, 2018:
1) modified call order of admin.php functions
2) fixed SQL bug that occurred while deleting previous ajax hints

Feb 19, 2018:
1) Added ability for multisite install’s to create a plugin table for each site upon creation.
2) Added ability for multisite install’s to delete the plugin table(s) for each site upon deletion.

Feb 4, 2018:
1) Optimize performance by forcing the PHP files that are needed only on the FE to be loaded only on the FE and same for BE PHP files. Doing this allowed code execution to be reduced from ~6 milliseconds to ~1 millisecond!
2) Cleaned up some code to reduce amount of code.
3) Tested compatibility with WP 4.9.2

Dec 22, 2017:
1) fixed small issue with setting the ‘crossorigin’ attribute.

Nov 17, 2017:
1) fixed bug preventing resource hints from appearing in the WP admin HTTP header

Nov 14, 2017:
1) Tested compatibility with WP 4.9
2) Fixed some issues with the resource hint output for the HTTP Header option
3) Fixed bug that threw an error when inserting hints
4) fixed bug that prevented plugin from being deleted properly
5) Changed how the “as” attribute was being set for preload hints.

Oct 7, 2017:
1) Improved code, changed some variable names
2) renamed class names to be consistent with WP coding standards.
3) added option to remove auto generated WP resource hints.
4) segmented each

<

form> to have its own method.
5) updated HTTP Header string to make it compatible with the most recent Chrome version and incorporate the ‘as’ attribute.

Sept 20, 2017:
1) fixed bugs due to WP 4.8.2 changes.

Sept 13, 2017:
1) improved code on class-PPRH_Send_Entered_Hints.php
2) added two more screenshots of the before and after effects of implementing this plugin.

July 13, 2017:
1) added a form on plugin admin screen to contact author about feature requests or bug reporting;
2) fixed minor issue with the preconnect JS script not firing;
3) fixed minor UI issues/CSS;

July 6, 2017:
1) added ability to choose to add links to the Header or ;
2) cleaned up UI;
3) fixed bugs on find-external-domains.js/ improved functionality;
4) removed option to select which pages/posts the links went to- this was unwanted feature and removing it improved performance
5) condensed the info tab links into one;
6) modified schema for PPRH_table; and removed the other table;
7) improved security;

June 11, 2017:
1) tested compat with wp 4.8

Mar 27, 2017:
1) changed db table schema which caused problems for sites with lots of posts.

Dec 9, 2016:
1) Ensured compatibility with WP v 4.7

Nov 11, 2016:
1) added plugin icon and banner image. 2) added tip info

Nov 6, 2016:
1) updated screenshot image on wp plugin page.
2) a) added screenshot images on plugin page. b) removed ‘console.log’ in the front end JS file.

Nov 4, 2016:
1) Fixed some images that were not loading properly.

Nov 3, 2016:
1) initial commit.