{"id":3246,"date":"2008-06-18T17:27:42","date_gmt":"2008-06-18T17:27:42","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wp-js\/"},"modified":"2009-03-08T10:26:27","modified_gmt":"2009-03-08T10:26:27","slug":"wp-js","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/wp-js\/","author":121318,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"2.0.6","stable_tag":"2.0.6","tested":"2.6.2","requires":"2.5.1","requires_php":"","requires_plugins":"","header_name":"WP JS","header_author":"Halmat Ferello","header_description":"","assets_banners_color":"","last_updated":"2009-03-08 10:26:27","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/www.halmatferello.com\/lab\/wp-js\/","header_author_uri":"http:\/\/www.halmatferello.com","rating":0,"author_block_rating":0,"active_installs":30,"downloads":13817,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["2.0.6"],"block_files":[],"assets_screenshots":{"screenshot-5.png":{"filename":"screenshot-5.png","revision":"1538982","resolution":"5","location":"plugin","width":700,"height":621},"screenshot-4.png":{"filename":"screenshot-4.png","revision":"1538982","resolution":"4","location":"plugin","width":700,"height":621},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"1538982","resolution":"2","location":"plugin","width":700,"height":608},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"1538982","resolution":"3","location":"plugin","width":700,"height":538},"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1538982","resolution":"1","location":"plugin","width":700,"height":508}},"screenshots":{"1":"Tests were measured using a Firefox plugin called Firebug. Firefox was run a Mac Pro (2008) using OS X 10.5.3. Eight files were included in this test: builder.js, controls.js, dragdrop.js, effects.js, prototype.js, scriptaculous.js, slider.js and sound.js - all taken from the script.aculo.us website.","2":"The default behaviour is to specify one file for WP JS to JSMIN and GZIP. <code>&lt;script src=\"&lt;?php wp_js('\/javascript\/global.js') ?&gt;\" type=\"text\/javascript\" charset=\"utf-8\"&gt;&lt;\/script&gt;<\/code>","3":"However it is also possible to combine several files together. It is very easy and only requires that you comma separate files inside the string parameter. <code>&lt;script src=\"&lt;?php wp_js('\/javascript\/sifr-addons.js,\/javascript\/sifr.js') ?&gt;\" type=\"text\/javascript\" charset=\"utf-8\"&gt;&lt;\/script&gt;<\/code>","4":"The admin section","5":"Adding a JavaScript file to a specifc post"}},"plugin_section":[],"plugin_tags":[144,3861,229,187,86],"plugin_category":[52,59],"plugin_contributors":[],"plugin_business_model":[],"class_list":["post-3246","plugin","type-plugin","status-closed","hentry","plugin_tags-caching","plugin_tags-gzip","plugin_tags-javascript","plugin_tags-optimization","plugin_tags-post","plugin_category-performance","plugin_category-utilities-and-tools","plugin_committers-halmat"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wp-js.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/wp-js\/trunk\/screenshot-1.png?rev=1538982","caption":"Tests were measured using a Firefox plugin called Firebug. Firefox was run a Mac Pro (2008) using OS X 10.5.3. Eight files were included in this test: builder.js, controls.js, dragdrop.js, effects.js, prototype.js, scriptaculous.js, slider.js and sound.js - all taken from the script.aculo.us website."},{"src":"https:\/\/ps.w.org\/wp-js\/trunk\/screenshot-2.png?rev=1538982","caption":"The default behaviour is to specify one file for WP JS to JSMIN and GZIP. <code>&lt;script src=\"&lt;?php wp_js('\/javascript\/global.js') ?&gt;\" type=\"text\/javascript\" charset=\"utf-8\"&gt;&lt;\/script&gt;<\/code>"},{"src":"https:\/\/ps.w.org\/wp-js\/trunk\/screenshot-3.png?rev=1538982","caption":"However it is also possible to combine several files together. It is very easy and only requires that you comma separate files inside the string parameter. <code>&lt;script src=\"&lt;?php wp_js('\/javascript\/sifr-addons.js,\/javascript\/sifr.js') ?&gt;\" type=\"text\/javascript\" charset=\"utf-8\"&gt;&lt;\/script&gt;<\/code>"},{"src":"https:\/\/ps.w.org\/wp-js\/trunk\/screenshot-4.png?rev=1538982","caption":"The admin section"},{"src":"https:\/\/ps.w.org\/wp-js\/trunk\/screenshot-5.png?rev=1538982","caption":"Adding a JavaScript file to a specifc post"}],"raw_content":"<!--section=description-->\n<p>This plugin will GZIP and JSMIN your JavaScript files as well as allowing the ability to put JavaScript files into a single file at the client's end. Cache expiry time can also be set in the admin page.<\/p>\n\n<p>NEW:\n* SECURITY PATCH - please update the plugin. (Thanks to Dario Caregnato)\n* Will now work with Child Themes (Thanks to Wupperpirat)<\/p>\n\n<p>Now in version 2.0 you can add JavaScript files to a specific page or post and putting all of them into one file.<\/p>\n\n<p>Version 2.0<\/p>\n\n<ul>\n<li>Ability to add JavaScript files to specific page\/post<\/li>\n<li>Improved security<\/li>\n<li>Reduced URL outputted<\/li>\n<\/ul>\n\n<p>Example<\/p>\n\n<pre><code>&lt;script src=\"&lt;?php wp_js('path\/to\/js\/file.js'); ?&gt;\" type=\"text\/javascript\"&gt;&lt;\/script&gt;\n<\/code><\/pre>\n\n<p>OR you can also concatenate the JavaScript files (comma separated)<\/p>\n\n<pre><code>&lt;script src=\"&lt;?php wp_js('path\/to\/js\/file.js, path\/to\/js\/file2.js, path\/to\/js\/file3.js'); ?&gt;\" type=\"text\/javascript\"&gt;&lt;\/script&gt;\n<\/code><\/pre>\n\n<p>Visit the WP JS site for more information: http:\/\/www.halmatferello.com\/lab\/wp-js\/<\/p>\n\n<p>Try the CSS version of the this plugin: http:\/\/wordpress.org\/extend\/plugins\/wp-css\/<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload <code>wp-js<\/code> folder to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Set the permissions for <code>\/wp-js\/<\/code> folder to <code>777<\/code><\/li>\n<li>Go to Settings &gt; WP JS in the admin site. This setup the plugin.<\/li>\n<li>Use <code>&lt;?php wp_js('path\/to\/js\/file.js'); ?&gt;<\/code> to link to your JavaScript file. <\/li>\n<\/ol>\n\n<p>i.e. <code>&lt;script src=\"&lt;?php wp_js('path\/to\/js\/file.js'); ?&gt;\" type=\"text\/javascript\"&gt;&lt;\/script&gt;<\/code><\/p>\n\n<!--section=faq-->\n<dl>\n<dt>How should I code the URL inside the wp_js() function<\/dt>\n<dd><p>All the URLs must be relative to the current theme.<\/p>\n\n<p>For example if your theme is default and you have javascript file called file.js inside this theme.<\/p>\n\n<pre><code>&lt;script src=\"&lt;?php wp_js('file.js'); ?&gt;\" type=\"text\/javascript\"&gt;&lt;\/script&gt;\n<\/code><\/pre>\n\n<p>If you had a file inside another folder within the current theme folder. For example, <code>theme\/default\/javascript<\/code><\/p>\n\n<pre><code>&lt;script src=\"&lt;?php wp_js('javascript\/file.js'); ?&gt;\" type=\"text\/javascript\"&gt;&lt;\/script&gt;\n<\/code><\/pre><\/dd>\n<dt>Can I suggest an feature for the plugin?<\/dt>\n<dd><p>Of course, visit <a href=\"http:\/\/www.halmatferello.com\/lab\/wp-js\/\">WP JS Home Page<\/a><\/p><\/dd>\n<dt>Are you available for hire?<\/dt>\n<dd><p>Yes I am, visit my <a href=\"http:\/\/www.halmatferello.com\/services\/\">services<\/a> page to find out more.<\/p><\/dd>\n\n<\/dl>","raw_excerpt":"Allows developers to compress (GZIP &amp; JSMIN) JavaScript files as well as concatenate them into one single file.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/3246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=3246"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/halmat"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=3246"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=3246"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=3246"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=3246"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=3246"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=3246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}