Hi Milan!
Cool plugin!
I am wondering why you are using a hard-coded URL in:
\inc\Rewrite.php on line 153
return 'https://cdn.jsdelivr.net' . $path;
instead of:
return $jsdelivr_url;
(of course that won’t work as it is).
It seems inconsistent.
Seems to me it would be better to set all of the static paths in commonwp.php.
Thanks!
-Brian
CommonWP helps a lot in my website. Thanks!
Does it magically adopt with (Redis) object cache? Or Do I have to change the plugin’s code? …if I have to, which ones ??
I have done almost all things clearing cache, cloudflare cache disabling cache plugin but the plugin is not changing the URLs of eligible files.
Using WP Rocket
Cloudflare and OpenLiteSpeed.
Is this working with the latest version of WP?
]]>Hi There,
Great plugin. I am having an issue with a lot of the admin styles. For example, on the login page there are ten errors, all sharing the same message:
Refused to apply style from ‘<URL>’ because its MIME type (‘text/plain’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.
Are you able to provide direction on how to fix this?
Thanks in advance.
]]>Instead off messing with the theme files is there a way to add a settings page where we tell the plugin where the original and jsdelivr files are so that they can be compared?
and then replaced?
and also would be usefull to see what files the compare failed. (so that we can check for the diff and resolve.)
Good day,
We installed your plugin today and we are going to perform some tests and check the changes in our website response time and other variables. It installed well without showing any issues.
Right now we are using the plugin autoptimize and there is a section where it asks for the Base CDN URL:
“Enter your CDN root URL to enable CDN for Autoptimized files. The URL can be http, https or protocol-relative (e.g. //cdn.example.com/)”
Which would be the URL value in this case if we are using your plugin?
Also, how long it would take for our website to integrate fully with the CDN network?
In advance, thank you for your help and interest.
]]>Hi,
I activated CommonWP and it worked fluently on my website. But I wanted to learn something before activating it permenantly.
Is CommonWP going to alter my “existing settings” and only use jsdelivr?
Or is there a kind of fallback function in the plugin which allows us to continue using our current settings?
I’m currently using;
– Pagespeed’s filters for combining JavaScript and CSS. Plus canonicalize_javascript_libraries is activated (Google Hosted Libraries)
– Cloudflare’s DNS minifies HTML, JavaScript, CSS files
– It’s a WP multisite environment, currently Jetpack is serving static assets over its CDN (u know, WP core assets and etc)
Thanks in advance
]]>Hey @dimadin – hope you are well?
This may be a weird question – but is there a way to restrict this to only run for specified assets? So if I only wanted to pull say… wp-emoji (and related emoji SVG/PNG’s), wp-embed etc. as opposed to “all or nothing”?
No worries if not – just wondering! I rewrite most stuff to jsDelivr anyway, except for a few things that I keep serving from local (specific plugins, files, images)
]]>Undefined index: themes in /xxxx/yyyyyyy/zzzz/public_html/wp-content/plugins/commonwp/inc/Clean.php on line 160
Hi.
I like your plugin and wanted to use it on my page. I’m using required PHP version (5.4.9), but version_compare returns 0, because the function considers these versions “equal”. I’ve submitted a patch.
---
wp-content/plugins/commonwp/commonwp.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/wp-content/plugins/commonwp/commonwp.php b/wp-content/plugins/commonwp/commonwp.php
index 3299a36..fb57e5a 100644
--- a/wp-content/plugins/commonwp/commonwp.php
+++ b/wp-content/plugins/commonwp/commonwp.php
@@ -13,7 +13,7 @@
*/
// Check minimum required PHP version.
-if ( version_compare( phpversion(), '5.4.0', '<' ) ) {
+if ( version_compare( phpversion(), '5.4.0', '<=' ) ) {
return;
}
--
]]>
I already use Cloudflare CDN for many of my WordPress website , what impact will your plugin have on my websites. Will it improve my loadtime, create any conflict or will have no impact at all . Would appreciate if you can share your views on it.
]]>The speed boost from the CDN loading of so many scripts is really nice.
It would be great if this could play nicely with Autoptmize and Async Javascript. Using those in combo with commonWP result in many scripts breaking, I assume because commonWP changes the order that the other plugins are loading the js files in. I know I have jQuery set to be render blocking since so many other things depend on it, but loading it via commonWP doesn’t seem to render block. I don’t have this issue when I use the Version Control for jQuery plugin to load my jquery scripts from a CDN.
There’s many other scripts that can’t run properly either. I tried adding a mountainload of defers to all the scripts in Async Javascript, but that doesn’t resolve everything.
I don’t know if it’s possible to make the scripts execute in the same order they would after Autoptimize/Async Javascript run through them, but that would probably fix it. I know that’s kind of hard especially if you have Autoptimize aggregate all the JS. Maybe commonWP could just load nonaggregated scripts if matching order of execution is a tall order?
]]>jsdelivr also provides a feature called Combine Multiple Files.
How to do that?
]]>Hi, when I activate the plugin my backend menu expands all items and it looks like the css is gone.
]]>Plugins does not rewrite Genesis Sample Theme urls on site even though it exists on cdn.
https://cdn.jsdelivr.net/gh/studiopress/[email protected]/style.css
]]>How can we remove WordPress Version from https://cdn.jsdelivr.net/gh/wordpress/wordpress@4.9.8/wp-includes/js/comment-reply.min.js
Above URL also works without version
https://cdn.jsdelivr.net/gh/wordpress/wordpress/wp-includes/js/comment-reply.min.js
Hi Milan,
I’m hoping you might be able to shed some insight, we are getting the following errors on one site.
[09-Oct-2018 07:09:57 UTC] PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, class ‘dimadin\WP\Plugin\commonWP\Queue’ not found in /home/xx/xx/wp-content/plugins/mainwp-child/class/class-mainwp-child-updraft-plus-backups.php on line 1973
[09-Oct-2018 07:09:57 UTC] PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, class ‘dimadin\WP\Plugin\commonWP\Queue’ not found in /home/xx/xx/wp-content/plugins/mainwp-child/class/class-mainwp-child-updraft-plus-backups.php on line 1973
[09-Oct-2018 23:00:19 UTC] PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, class ‘dimadin\WP\Plugin\commonWP\Queue’ not found in /home/xx/xx/wp-content/themes/Divi/includes/builder/class-et-builder-element.php on line 6623
[09-Oct-2018 23:00:19 UTC] PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, class ‘dimadin\WP\Plugin\commonWP\Queue’ not found in /home/xx/xx/wp-content/themes/Divi/includes/builder/class-et-builder-element.php on line 6623
Active plugins are:
Advanced Custom Fields PRO
commonWP
Divi Booster
Divi Timeline Module
Duplicate Post
GP Conditional Logic Dates
GP Limit Dates
Gravity Forms
Gravity Perks
Imagify
MainWP Child
Really Simple SSL
Redirection
TinyMCE Advanced
UpdraftPlus
Wordfence Security
WP Mail SMTP
WP Rocket
WP Simple Booking Calendar
Yoast SEO
Themes:
Divi (Including Divi Builder)
A child theme of Divi
Thanks.
]]>Hi Milan,
First off, I’d like to say, good job on this plugin!
I’ve dabbled with this kind of thing myself, although at a much more basic level.
function enqueue_jsdelivr( $src, $handle ) {
if ( strpos( $src, includes_url() ) !== false ) {
global $wp_version;
return explode( '?', str_replace( includes_url(),'https://cdn.jsdelivr.net/gh/wordpress/wordpress@'.$wp_version.'/wp-includes/', $src ))[0];
}
return $src;
}
add_filter( 'script_loader_src', 'enqueue_jsdelivr', 10, 2 );
add_filter( 'style_loader_src', 'enqueue_jsdelivr', 10, 2 );
Having a flick through the code, I can see references to getting the minified file from npm.
I know its early in the release of the plugin, but have you or would you consider taking advantage of jsdelivr’s ability to generate minified files if none exist.
https://cdn.jsdelivr.net/wp/plugins/wordfence/tags/7.1.12/css/wordfenceBox.1536768948.css
and
https://cdn.jsdelivr.net/wp/plugins/wordfence/tags/7.1.12/css/wordfenceBox.1536768948.min.css
as an example?
I understand that this might not be something everyone would want, but perhaps adding something like define(‘commonwp_minify_all’, true); to wp-config.php could be a way for those who wish to toggle it on?
Thanks ??
]]>Interesting concept and thank you for releasing the plugin. Should the improvements occur straight away as soon as the plugin is installed? I installed it on one site to test and the WebPageTest result went from First Byte Time of 2.969s (A) (without commonWP) to 4.854s (F) (with commonWP). I’m wondering if it might take some time to propagate?
The site is hosted in the US and was tested from Dulles, VA.
I also tested on Pingdom from Australia and load time went from 3.63s (before) to 4.35s (after).
Many thanks,
Benz1
The concept of this plugin is great! It has always surprised me that core doesn’t make use of CDN’s for things like jQuery or Twemoji, especially considering WP makes up 30% of the internet now!
Will you open up the CDN options in the future? Say, to include CDNJS: https://w3techs.com/technologies/comparison/cd-cdnjs,cd-jquerycdn,cd-jsdelivr which is fairly widely used – roughly 6 – 7x more than jsDeliver (https://w3techs.com/technologies/overview/content_delivery/all)
]]>