Coder Social home page Coder Social logo

samperrow / pre-party-browser-hints Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 4.0 2.39 MB

Plugin for WordPress users to easily implement the latest W3C resource hints.

License: GNU General Public License v2.0

PHP 85.98% JavaScript 12.11% SCSS 1.85% Ruby 0.06%
wordpress wordpress-plugin resource-hints dns-prefetch preconnect prefetch prerender preload performance

pre-party-browser-hints's People

Contributors

prayagverma avatar samperrow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pre-party-browser-hints's Issues

Plugin generates invalid HTTP link headers

I've configured Pre* Party with 3 preconnects:

https://cdn.mydomain.com
https://img.mydomain.com
https://fonts.mydomain.com

And 1 preload:

https://cdn.mydomain.com/some.js

The resource hints are set in the HTTP header and automatic preconnect hints are disabled.

On loading my website, I see the HTTP link headers added, but they are invalid:

link:<https://cdn.mydomain.com>; rel=preconnect;;,<https://img.mydomain.com>; rel=preconnect;;,<https://fonts.mydomain.com>; rel=preconnect; crossorigin;,<https://cdn.mydomain.com/some.js>; rel=preload;; as="script"

Note the ;;, after each resource hint, the ;; between "rel" and "as" in the final resource hint, and the " around the script attribute.

Looking at section 3.2 of the W3C resource hint reference and an Akami discussion board, however, indicates the correct HTTP link header format would be:

link:<https://cdn.mydomain.com>; rel=preconnect;
link:<https://img.mydomain.com>; rel=preconnect;
link:<https://fonts.mydomain.com>; rel=preconnect; crossorigin;
link:<https://cdn.mydomain.com/some.js>; rel=preload; as=script;

Note that each resource hint has a separate link entry, only a single semicolon between each attribute in a resource hint, no quotation marks around the script attribute, and ends with a single semicolon.

https://www.w3.org/TR/resource-hints/#fetching-the-resource-hint-link
https://community.akamai.com/thread/4358-preconnect-request-header

Database errors in multisite installation

Debug log is full of messages like:

[27-Sep-2017 19:57:54 UTC] WordPress databasefout Table 'wordpress.wp_6_gktpp_table' doesn't exist bij query SELECT * FROM wp_6_gktpp_table WHERE status = 'Enabled' gemaakt door require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/plugins/woocommerce/templates/single-product.php'), get_header, locate_template, load_template, require_once('/themes/storefront/header.php'), wp_he$
[27-Sep-2017 19:58:02 UTC] WordPress databasefout Table 'wordpress.wp_6_gktpp_table' doesn't exist bij query SELECT * FROM wp_6_gktpp_table WHERE status = 'Enabled' gemaakt door require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/plugins/woocommerce/templates/taxonomy-product_tag.php'), wc_get_template, include('/plugins/woocommerce/templates/archive-product.php'), get_header$
[27-Sep-2017 19:58:06 UTC] WordPress errore sul database Table 'wordpress.wp_4_gktpp_table' doesn't exist per la query SELECT * FROM wp_4_gktpp_table WHERE status = 'Enabled' fatta da require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/plugins/woocommerce/templates/taxonomy-product_tag.php'), wc_get_template, include('/plugins/woocommerce/templates/archive-product.php'), get_$
[27-Sep-2017 19:58:06 UTC] WordPress-Datenbank-Fehler Table 'wordpress.wp_2_gktpp_table' doesn't exist für Abfrage SELECT * FROM wp_2_gktpp_table WHERE status = 'Enabled' von require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/plugins/woocommerce/templates/taxonomy-product_cat.php'), wc_get_template, include('/plugins/woocommerce/templates/archive-product.php'), get_header, l$
[27-Sep-2017 19:58:18 UTC] WordPress databasefout Table 'wordpress.wp_6_gktpp_table' doesn't exist bij query SELECT * FROM wp_6_gktpp_table WHERE status = 'Enabled' gemaakt door require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/plugins/woocommerce/templates/single-product.php'), get_header, locate_template, load_template, require_once('/themes/storefront/header.php'), wp_he$
[27-Sep-2017 19:58:26 UTC] WordPress databasefout Table 'wordpress.wp_6_gktpp_table' doesn't exist bij query SELECT * FROM wp_6_gktpp_table WHERE status = 'Enabled' gemaakt door require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/plugins/woocommerce/templates/single-product.php'), get_header, locate_template, load_template, require_once('/themes/storefront/header.php'), wp_he$
[27-Sep-2017 19:58:28 UTC] WordPress errore sul database Table 'wordpress.wp_4_gktpp_table' doesn't exist per la query SELECT * FROM wp_4_gktpp_table WHERE status = 'Enabled' fatta da require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/storefront/template-homepage.php'), get_header, locate_template, load_template, require_once('/themes/storefront/header.php'), wp_head,$
[27-Sep-2017 19:58:31 UTC] WordPress-Datenbank-Fehler Table 'wordpress.wp_2_gktpp_table' doesn't exist für Abfrage SELECT * FROM wp_2_gktpp_table WHERE status = 'Enabled' von require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/plugins/woocommerce/templates/single-product.php'), get_header, locate_template, load_template, require_once('/themes/storefront/header.php'), wp_head,$

Automatically set preconnect hints = yes, but no URLs are populated in settings

My settings are:

  • Automatically set preconnect hints = yes
  • Send resource hints in the header or head = HTTP header

On one installation, this results in URLs like https://fonts.googleapis.com being populated in the URL settings. On another installation with the same settings, however, the URL list remains empty and no preconnects are being sent in the HTTP header.

I checked the debug logs but there aren't any errors to help me troubleshoot. Any suggestions on what to do?

Per URL settings?

Any chance you can add per URL settings? It would be useful to preload certain resources only during checkout, for example.

Duplicate URL entries

Disabling and re-enabling the plugin generates duplicate URL entries. Do this a few times and one can easily end up with dozens of unneeded entries in the HTTP link header.

SQL Injection Issue Still Exists

The change made in version 1.8.19 to try to address the SQL injection issue doesn't resolve it. Among the issues with that attempt to resolve this, is that SQL code can be written without spaces. Implementing Anthony Thorne's suggestion to utilize the sanitize_sql_orderby() function to address this would be a good idea.

WordPress database error from latest update

WordPress database error: [Table 'wp_pprh_table' already exists]
RENAME TABLE wp_gktpp_table TO wp_pprh_table

WordPress database error: [Can't DROP 'header_string'; check that column/key exists]
ALTER TABLE wp_pprh_table ADD created_by varchar(55), DROP COLUMN header_string, DROP COLUMN head_string

Disable find-external-domains.js

I've configured "Automatically Set Preconnect Hints" to no, yet the script find-external-domains.js still loads on all pages. Is there a filter or hook I can use to completely disable find-external-domains.js?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.