title: code works well in localhost but not on live site
body: <p>I use wordpress as a cms. I need to offer a zip file download [to registered users] on every post, containing all the images attached to the post. Given is the code only from the main file "gallery-zip.php" ( <a href="https://github.com/RalfAlbert/gallery-zip/blob/master/gallery-zip.php" rel="nofollow">original code and rest of the files here</a> ). The issue is it works only in localhost and NOT in the live server.</p>
  
  <p><em>PLUGIN CODE</em> :</p>
  
  <pre><code>&lt;?php
  
  namespace GalleryZip;
  
  add_action( 'plugins_loaded', __NAMESPACE__ . '\gallery_zip_start', 10, 0 );
  
  /**
  * Invoke the plugin and load the needed classes
  */
  function gallery_zip_start() {
  // simple autoloader
  $classes = glob( dirname( __FILE__ ) . '/classes/*.php' );
  
  if ( ! empty( $classes ) ) {
  foreach ( $classes as $class )
  require_once $class;
  
  
  add_action( 'init', __NAMESPACE__ . '\add_hooks', 10, 0 );
  add_action( 'init', __NAMESPACE__ . '\enqueue_scripts', 10, 0 );
  
  if ( is_admin() )
  return;
  
  // this is only needed on the frontend
  GalleryZip::get_instance( new GalleryZip_DataContainer() );
  
  }
  }
  
  /**
  * Adding the needed hooks
  */
  function add_hooks() {
  add_action( 'wp_ajax_get_galleryzip', __NAMESPACE__ . '\get_gallery_zip', 10, 0 );
  add_action( 'wp_ajax_nopriv_get_galleryzip', __NAMESPACE__ . '\get_gallery_zip', 10, 0 );
  }
  
  /**
  * Enqueu the JavaScript
  */
  function enqueue_scripts() {
  // load minified version if SCRIPT_DEBUG is true
  $min = ( defined( 'SCRIPT_DEBUG' ) &amp;&amp; true == SCRIPT_DEBUG ) ? '' : '.min';
  wp_enqueue_script(
  'gallery-zip',
  plugins_url(
  sprintf( 'js/gallery_zip%s.js', $min ),
  __FILE__
  ),
  array( 'jquery' ),
  false,
  true
  );
  
  // set JS object with params
  wp_localize_script( 'gallery-zip', 'GalleryZip', array( 'ajaxurl' =&gt; admin_url( 'admin-ajax.php' ) ) );
  }
  
  /**
  * Ajax callback for creating the zip-file and sending the url to zip-file
  */
  function get_gallery_zip() {
  $send_result = function( $result = '' ) {
  if ( is_array( $result ) )
  $result = var_export( $result, true );
  
  header( 'Content-type: application/json' );
  die( json_encode( array( 'result' =&gt; $result ) ) );
  };
  
  $post_id = (int) filter_input( INPUT_POST, 'post_id', FILTER_SANITIZE_NUMBER_INT );
  $gallery_id = (int) filter_input( INPUT_POST, 'gallery_id', FILTER_SANITIZE_NUMBER_INT );
  
  if ( 0 &gt;= $post_id )
  $send_result( var_export( $_POST, true ) );
  
  $images = GalleryZip::get_images_ajax_callback( $post_id, $gallery_id );
  $send_result( $images );
  }
  </code></pre>
  
  <p><em>TESTING ENVIRONMENTS</em> :  </p>
  
  <ol>
  <li>LOCALHOST : Runs on PHP 5.3.10 and with latest wordpress 3.6.1.</li>
  <li>LIVE SITE : Runs on PHP 5.3.27 and again with latest wordpress 3.6.1.</li>
  </ol>
  
  <p><strong>Things I tried and did</strong>.
  I tested the plugin on my localhost with latest wordpress 3.6.1 and PHP version 5.3.10 and used this line of code in single.php template <code>&lt;?php echo do_shortcode('[gallery]'); ?&gt;</code>. It offered a nice zip-download link 'Get as Zip' on click and everything was flawless.</p>
  
  <p>As soon as I installed the plugin on my live site it threw an error as the site was using an old version of PHP 5.2 and specifically due to a namespace syntax in the first line of the plugin code - <code>namespace GalleryZip;</code>, hence first of all I upgraded the PHP version.</p>
  
  <p>Now, that I have it running on live site, it displays a link "GalleryZip" as expected on but the link does not prompt a zip-download and when clicked and just refreshes the page.</p>
  
  <p>In order to rule out basic things I have tested in latest firefox, chrome and safari browsers, works as expected on localhost and not on live site. Wordpress related : I changed the theme into default twenty-thirteen ( tried it inside and outside the loop ) and also disabled all the other plugins, no change in result. </p>
  
  <p>Firebug console displays <code>http://website.com/wp-admin/admin-ajax.php 200 OK</code> on clicking the link, even on live site. I also asked for help a few weeks back from the original developer but have not received any response yet. So, if you may, kindly take a look at the code and let me know if this could be solved or correct me if I am wrong anywhere. Also please let me know if I should be definitely asking it somewhere else. Although I am continuously testing and in every way I can, a little helping hand is always appreciated.</p>