• Resolved malkafly

    (@malkafly)


    Hi!

    I just install, and when trying to activate its shows this:

    Parse error: syntax error, unexpected '[' in /var/www/html/wp-content/plugins/blue-storage/blue-storage.php on line 616

    I used your plugin on another site months ago and it worked perfectly, thank you!
    But today on a new website, i got this.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author derekheld

    (@derekheld)

    What version of PHP is used?

    Can you also just verify that the line in that file is unchanged? You can compare it against the file stored in SVN.

    Thread Starter malkafly

    (@malkafly)

    php 5.3.3, maybe it’s. I will try to move entire website this weekend to a Azure Web App with php 5.6.

    and the line/function (ln 610 to 622) are:

    function windows_azure_storage_srcset($sources)
    {
        $azure_metadata = get_metadata('post',get_the_ID(),'windows_azure_storage_info');
        if( !empty($azure_metadata) )
        {
            foreach ($sources as &$source) {
    [line 616 -->]  $source['url'] = str_replace(wp_upload_dir()['baseurl'], WindowsAzureStorageUtil::getStorageUrlPrefix(), $source['url']);
            }
        }
    
        return $sources;
    }
    add_filter('wp_calculate_image_srcset', 'windows_azure_storage_srcset');
    Plugin Author derekheld

    (@derekheld)

    Yeah, that looks right.

    I think it’s the PHP version. I think it doesn’t like this:
    wp_upload_dir()['baseurl']

    Which we can easily split up to make it work, but that causes other problems. I think the best option is definitely moving to PHP 5.6 like you are planning.

    Thread Starter malkafly

    (@malkafly)

    yes, well i will remove, then try again after migrate, thanks derek!

    Plugin Author derekheld

    (@derekheld)

    You’re welcome!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Parser error when trying to Activate Plugin’ is closed to new replies.