{"id":37626,"date":"2015-07-15T23:17:41","date_gmt":"2015-07-15T23:17:41","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/resource-versioning\/"},"modified":"2018-07-21T15:15:50","modified_gmt":"2018-07-21T15:15:50","slug":"resource-versioning","status":"publish","type":"plugin","link":"https:\/\/pcd.wordpress.org\/plugins\/resource-versioning\/","author":8544055,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.3.0","stable_tag":"0.3.0","tested":"4.9.29","requires":"4.0","requires_php":"","requires_plugins":"","header_name":"Resource Versioning","header_author":"Viktor Sz\u00e9pe","header_description":"","assets_banners_color":"ffffff","last_updated":"2018-07-21 15:15:50","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/szepe.net\/wp-donate\/","header_plugin_uri":"","header_author_uri":"","rating":5,"author_block_rating":0,"active_installs":10,"downloads":2143,"num_ratings":1,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"1"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"1199655","resolution":"128x128","location":"assets"},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"1199655","resolution":"256x256","location":"assets"}},"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":"1199655","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1.0","0.1.1","0.1.2","0.1.3","0.2.0","0.3.0"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[2436,260,2437,16716,3886],"plugin_category":[52,54],"plugin_contributors":[78038],"plugin_business_model":[],"class_list":["post-37626","plugin","type-plugin","status-publish","hentry","plugin_tags-apache","plugin_tags-file","plugin_tags-nginx","plugin_tags-resource","plugin_tags-varnish","plugin_category-performance","plugin_category-security-and-spam-protection","plugin_contributors-szepeviktor","plugin_committers-szepeviktor"],"banners":{"banner":"https:\/\/ps.w.org\/resource-versioning\/assets\/banner-772x250.png?rev=1199655","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/resource-versioning\/assets\/icon-128x128.png?rev=1199655","icon_2x":"https:\/\/ps.w.org\/resource-versioning\/assets\/icon-256x256.png?rev=1199655","generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>\"It\u2019s important to make resources (images, scripts, stylesheets, etc.) cacheable.\"<\/p>\n\n<p><a href=\"http:\/\/www.stevesouders.com\/blog\/2008\/08\/23\/revving-filenames-dont-use-querystring\/\">Steve Souders<\/a><\/p>\n\n<p>It is much easier to use a CDN without Query String Parameters.\nThis plugins alters only local resources' URL-s.\nThe <code>ver<\/code> Query String Parameter will be inserted into the filename.<\/p>\n\n<p>For example <code>jquery.min.js?ver=1.10<\/code> becomes <code>jquery.min.110.js<\/code>.<\/p>\n\n<p>To reverse this in the web server add this line to your nginx config:<\/p>\n\n<pre><code>server {\n    location ~ ^(.+)\\.\\d\\d+\\.(js|css|png|jpg|jpeg|gif|ico)$ {\n        #try_files $uri $1.$2 \/index.php?$args;\n        try_files $uri $1.$2 =404;\n    }\n}\n<\/code><\/pre>\n\n<p>Or to your Apache configuration or <code>.htaccess<\/code> file.<\/p>\n\n<pre><code>RewriteEngine On\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule ^(.+)\\.\\d\\d+\\.(js|css|png|jpg|jpeg|gif|ico)$ $1.$2 [NC,L]\n<\/code><\/pre>\n\n<h4>Testing the plugin before live usage<\/h4>\n\n<p>You can test the plugin by replacing the two <code>add_filter()<\/code> calls with this<\/p>\n\n<pre><code>require_once( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '\/wp-load.php' );\nwp();\necho o1_revving_src( $argv[1] ) . PHP_EOL;\n<\/code><\/pre>\n\n<p>Then start it from CLI: <code>php revving.php &lt;TEST-URL&gt;<\/code><\/p>\n\n<h4>Links<\/h4>\n\n<p>Development of this plugin goes on on <a href=\"https:\/\/github.com\/szepeviktor\/resource-versioning\">GitHub<\/a>.<\/p>\n\n<!--section=installation-->\n<p>This section describes how to install the plugin and get it working.<\/p>\n\n<ol>\n<li>Upload <code>revving.php<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>How to remove all Query String Parameters from resources?<\/dt>\n<dd><p>Poorly written plugins and themes may add unwanted Query String Parameters.\nFor example <code>?rev=4.10<\/code>.<\/p>\n\n<p>To drop all these parameters copy this into your <code>wp-config.php<\/code>:<\/p>\n\n<pre><code>define( 'O1_REMOVE_ALL_QARGS', true );\n<\/code><\/pre><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>0.3.0<\/h4>\n\n<ul>\n<li>Support cdn-ified URL-s without protocol schema.<\/li>\n<li>More structured code.<\/li>\n<\/ul>\n\n<h4>0.2.0<\/h4>\n\n<ul>\n<li>Strengthen stability.<\/li>\n<li>Support cdn-ified URL-s.<\/li>\n<\/ul>\n\n<h4>0.1.3<\/h4>\n\n<ul>\n<li>FIX: Use proper WordPress function for content URL.<\/li>\n<\/ul>\n\n<h4>0.1.2<\/h4>\n\n<ul>\n<li>FIX: Don't run on admin.<\/li>\n<\/ul>\n\n<h4>0.1.1<\/h4>\n\n<ul>\n<li>FIX: External URL detection.<\/li>\n<\/ul>\n\n<h4>0.1.0<\/h4>\n\n<ul>\n<li>Initial relase without multisite support.<\/li>\n<\/ul>","raw_excerpt":"Turn Query String Parameters into file revision numbers.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/37626","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=37626"}],"author":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/szepeviktor"}],"wp:attachment":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=37626"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=37626"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=37626"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=37626"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=37626"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=37626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}