{"id":29493,"date":"2014-05-16T06:54:10","date_gmt":"2014-05-16T06:54:10","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/zip-attachments\/"},"modified":"2015-10-21T19:31:37","modified_gmt":"2015-10-21T19:31:37","slug":"zip-attachments","status":"closed","type":"plugin","link":"https:\/\/oci.wordpress.org\/plugins\/zip-attachments\/","author":1440993,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.6","stable_tag":"1.6","tested":"4.4.34","requires":"4.2","requires_php":"","requires_plugins":"","header_name":"Zip Attachments","header_author":"Ricard Torres","header_description":"","assets_banners_color":"b6b8b6","last_updated":"2015-10-21 19:31:37","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/wordpress.org\/plugins\/zip-attachments\/","header_author_uri":"http:\/\/php.quicoto.com\/","rating":4.6,"author_block_rating":0,"active_installs":100,"downloads":8427,"num_ratings":9,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"1.6":"<ul>\n<li>Fix undefined notice. Nothing should break due this change.<\/li>\n<\/ul>","1.5.1":"<ul>\n<li>ATTENTION the plugin might not work! I&#039;ve tried to fix a vulnerability. Now the temporal zip files are generated in the \/wp-content\/uploads folder of the plugin. Hopefully there&#039;s not permission issues, since the directory should be writtable. If you encounter any problem, post in the forum: https:\/\/wordpress.org\/support\/plugin\/zip-attachments<\/li>\n<\/ul>","1.4":"<ul>\n<li>Code improvement to match WordPress best practices.<\/li>\n<\/ul>","1.3":"<ul>\n<li>Add a download counter (check out the Installation instructions).<\/li>\n<\/ul>","1.2":"<ul>\n<li>Fixed undefined variable.<\/li>\n<\/ul>","1.1":"<ul>\n<li>Sanatize the filename to avoid errors with some titles.<\/li>\n<\/ul>","1.0":"<ul>\n<li>Initial release, you&#039;ll love it.<\/li>\n<\/ul>"},"ratings":{"1":1,"2":0,"3":0,"4":0,"5":8},"assets_icons":{"icon-128x128.jpg":{"filename":"icon-128x128.jpg","revision":"1154401","resolution":"128x128","location":"assets"},"icon-256x256.jpg":{"filename":"icon-256x256.jpg","revision":"1154401","resolution":"256x256","location":"assets"},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"1020536","resolution":"256x256","location":"assets"}},"assets_banners":{"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":"915315","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.1","1.2","1.3","1.4","1.5","1.5.1","1.6"],"block_files":[],"assets_screenshots":{"screenshot-2.png":{"filename":"screenshot-2.png","revision":"1538998","resolution":"2","location":"plugin"},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"1538998","resolution":"3","location":"plugin"},"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1538998","resolution":"1","location":"plugin"}},"screenshots":{"1":"Using the Twenty Fourteen Theme.","2":"Using the Twenty Thirteen Theme.","3":"Using the Twenty Twelve Theme."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[2264,1346,485,568,7343],"plugin_category":[50],"plugin_contributors":[81258],"plugin_business_model":[],"class_list":["post-29493","plugin","type-plugin","status-closed","hentry","plugin_tags-attachment","plugin_tags-attachments","plugin_tags-button","plugin_tags-download","plugin_tags-zip","plugin_category-media","plugin_contributors-quicoto","plugin_committers-quicoto"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/zip-attachments_b6b8b6.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/zip-attachments\/trunk\/screenshot-1.png?rev=1538998","caption":"Using the Twenty Fourteen Theme."},{"src":"https:\/\/ps.w.org\/zip-attachments\/trunk\/screenshot-2.png?rev=1538998","caption":"Using the Twenty Thirteen Theme."},{"src":"https:\/\/ps.w.org\/zip-attachments\/trunk\/screenshot-3.png?rev=1538998","caption":"Using the Twenty Twelve Theme."}],"raw_content":"<!--section=description-->\n<p>Simple and lightweight plugin to add a \"Download\" button to your posts, pages or custom post types.<\/p>\n\n<p>This button will create a zip file of the post attachments on the fly and download it.<\/p>\n\n<p>The output is very basic, no images, no fonts, no CSS. Just a simple button element.<\/p>\n\n<h4>Features<\/h4>\n\n<ul>\n<li>No output by default (check the Installation tab).<\/li>\n<li>Easy to customizable with CSS.<\/li>\n<li>Shortcode available.<\/li>\n<li>Download counter stored per post.<\/li>\n<li>You chose the output text so no translation needed.<\/li>\n<li>Works with posts, pages and custom post types.<\/li>\n<\/ul>\n\n<h4>Known issues<\/h4>\n\n<ul>\n<li>If a download is cancelled, the file will not be deleted from the \/wp-content\/uploads folder.<\/li>\n<\/ul>\n\n<p>Patches are welcome!<\/p>\n\n<h4>Requests<\/h4>\n\n<p>Feel free to post a request but let's keep it simple and light.<\/p>\n\n<h4>Ping me \/ Blame me<\/h4>\n\n<p>Are you using the plugin? Do you like it? Do you hate it? Let me know!<\/p>\n\n<ul>\n<li>Twitter: <a href=\"http:\/\/twitter.com\/ricard_dev\">@ricard_dev<\/a><\/li>\n<li>Blog: <a href=\"http:\/\/php.quicoto.com\/\">Rick's code<\/a><\/li>\n<\/ul>\n\n<!--section=installation-->\n<p>First of all activate the Plugin, then you have three choices:<\/p>\n\n<h4>Functions.php<\/h4>\n\n<p>You can show the button after all your content (posts, pages, custom post types) by pasting this snippet at the end of your <strong>functions.php<\/strong> file of your theme:<\/p>\n\n<pre><code>function za_button_print($content)\n{\n    return $content.za_show_button('Download');\n}\nadd_filter('the_content', 'za_button_print');\n<\/code><\/pre>\n\n<h4>Single.php (or similar)<\/h4>\n\n<p>Alternatively you can print the button only in certain parts of your theme. Paste the following snippet wherever you want them to show.<\/p>\n\n<p>Be aware, it should be within <a href=\"http:\/\/codex.wordpress.org\/The_Loop\">the Loop<\/a>.<\/p>\n\n<pre><code>&lt;?=function_exists('za_show_button') ? za_show_button(\"Download\") : ''?&gt;\n<\/code><\/pre>\n\n<h4>Shortcode<\/h4>\n\n<p>Finally you can use the shortcode inside your post content like so:<\/p>\n\n<pre><code>[za_show_download_button text=\"Download the file\"]\n<\/code><\/pre>\n\n<p>As you can see you can use your own text, the default value is \"Download Attachments\".<\/p>\n\n<h4>Download Counter<\/h4>\n\n<p>Each method has a download counter, you need to add additional parameters:<\/p>\n\n<p>A)<\/p>\n\n<pre><code>function za_button_print($content)\n{\n    return $content.za_show_button('Download', 'true', '(% times)');\n}\nadd_filter('the_content', 'za_button_print');\n<\/code><\/pre>\n\n<p>B)<\/p>\n\n<pre><code>&lt;?=function_exists('za_show_button') ? za_show_button(\"Download\", \"true\", \"(% times)\") : ''?&gt;\n<\/code><\/pre>\n\n<p>C)<\/p>\n\n<pre><code>[za_show_download_button text=\"Download the file\" counter=\"true\" counter_format=\"(% times)\"]\n<\/code><\/pre>\n\n<p>NOTE: the default counter format is <code>(%)<\/code>, where <code>%<\/code> is actual number. The plugin will automatically replace this character with the download count.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt>I activated the plugin and I don't see the button<\/dt>\n<dd><p>You must specify where do you want to show the button your theme or post, <strong>check out the Installation instructions<\/strong>.<\/p><\/dd>\n<dt>Can I customize the colors?<\/dt>\n<dd><p>Absolutely. Use your theme CSS file to customize the appearnce of the button. The button comes with two CSS classes:<\/p>\n\n<pre><code>.za_download_button\n.za_download_button_loading\n<\/code><\/pre><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.6<\/h4>\n\n<ul>\n<li>Fix undefined notice. Nothing should break due this change.<\/li>\n<\/ul>\n\n<h4>1.5.1<\/h4>\n\n<ul>\n<li>ATTENTION the plugin might not work! I've tried to fix a vulnerability. Now the temporal zip files are generated in the \/wp-content\/uploads folder of the plugin. Hopefully there's not permission issues, since the directory should be writtable. If you encounter any problem, post in the forum: https:\/\/wordpress.org\/support\/plugin\/zip-attachments<\/li>\n<\/ul>\n\n<h4>1.4<\/h4>\n\n<ul>\n<li>Code improvement to match WordPress best practices.<\/li>\n<\/ul>\n\n<h4>1.3<\/h4>\n\n<ul>\n<li>Add a download counter.<\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<ul>\n<li>Fixed undefined variable for the plugin's path.<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>Sanatize the filename to avoid errors with some titles.<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial release, you'll love it.<\/li>\n<\/ul>","raw_excerpt":"Add a &quot;Download&quot; button to your posts, pages or custom post types. This button will then create a zip file of the post attachments.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/oci.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/29493","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oci.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/oci.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/oci.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=29493"}],"author":[{"embeddable":true,"href":"https:\/\/oci.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/quicoto"}],"wp:attachment":[{"href":"https:\/\/oci.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=29493"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/oci.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=29493"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/oci.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=29493"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/oci.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=29493"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/oci.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=29493"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/oci.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=29493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}