Minified wp/gh files
-
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 ??
- The topic ‘Minified wp/gh files’ is closed to new replies.