Analysis error: syntax error, unexpected $ end of line 1


I'm writing a wordpress plugin that integrates with MailChimp's API to store email addresses in a MailChimp list.

I have a 'store-address.php' that run's via AJAX on the submission of a form.

The plugin works when AJAX'ing the url on a local, or GoDaddy WordPress install. But does not work on my staging site wich is hosted on ''.

When I make an ajax call to 'store-address.php' I receive this error...

Parse error: syntax error, unexpected { in /wp-content/plugins/plugin-name/mailchimp-api/inc/store-address.php on line 1

Here is my ajax function

$('#subscribe').submit(function(e) {

            url: $plugin_url '/plugin-name/mailchimp-api/inc/store-address.php',
            data: 'ajax=true&email=' + escape($('#email').val()),
            success: function(msg) {

        return false;

And my 'store-address.php' looks like this.

 function storeAddress(){

  * Validation
 if(!$_GET['email']){ return "No email address provided"; } 

 if(!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$/i", $_GET['email'])) {
    return "Email address is invalid";


  * get MailChimp API details from the plugin settings stored in the session.
  */     $mcKey = $_SESSION['mc_api_key'];
 $mcID = $_SESSION['mc_list_id'];

 $api = new MCAPI($mcKey);
 $list_id = $mcID;

 if($api->listSubscribe($list_id, $_GET['email'], '') === true) {
    return 'Success! Check your email to confirm sign up.';
    return 'Error: ' . $api->errorMessage;


   * If being called via ajax, autorun the function
  if($_GET['ajax']){ echo storeAddress(); }

phpVersion 5.5

As I mentioned before this code works on a local environment and a goDaddy hosted site. Just not on MediaTemple I have also swept the code for any PHP syntax errors and I can't find anything.

Any help or point in the right direction would be a godsend. Thanks

The error was caused due to FileZilla's transfer type being set to "Auto", which disrupted linebreaks.

After switching the transfer type to "Binary" and restarting FileZilla, I re-uploaded the plugin and everything works great.

Resource: Filezilla removes line breaks on php files