Viewing 15 replies - 1 through 15 (of 19 total)
  • Yep, I experienced that too… the error is:

    Parse error: syntax error, unexpected ‘[‘ in /home/aihorg/public_html/wp-content/plugins/optimizely/edit.php on line 14

    Plugin Author bradtaylorsf

    (@bradtaylorsf)

    Hello @codegeek and @marcoakis Can you please give me some more information? I am trying to recreate the issue and I am unable to. What version of wordpress are you using? Also, is this happening anytime the plugin is activated and on all wp-admin pages? Or is this only happening when trying to create multiple headlines? Any other info is appreciated

    @bradtaylorsf

    I’m running the latest 4.1.2.

    I upgraded and everything looked good, however when I went back to my admin area the error I above appeared, effectively locking me out of the admin area.

    I manually deleted the plugin folder and the problem went away. When I went back to reinstall it from the admin area the installation failed due to the same error in line 14, so wordpress wouldn’t install it again.

    @bradaylorsf : I’ve updated to 4.2.1 and 3.6.0 of the plugin and upon plugin activation I get Parse error: syntax error, unexpected '[' in .../wp-content/plugins/optimizely/edit.php on line 14

    Didn’t get the error locally when testing, so you might need to try on a host for replication – for reference: Hosted with WP Engine.

    Ping me on Slack if you need more info @tareiking

    I am getting this
    Parse error: syntax error, unexpected ‘[‘ in /home/panayotis/public_html/wp-content/plugins/optimizely/edit.php on line 14

    and your plugin isnt up to date with newest WordPress version ??

    I am also getting this same error, we are hosted on WP Engine as well. I had no problem updating locally.

    Simple fix.

    Replace the first function in edit.php with this.

    function get_full_permalink() {
    	$permalinkArray = get_sample_permalink( $post->ID );
    	$permalinkTemplate = array_values( $permalinkArray );
    	$permalinkSlug = array_values( $permalinkArray );
    
    	return str_replace( '%postname%', $permalinkSlug[1], $permalinkTemplate[0] );
    }
    Plugin Author bradtaylorsf

    (@bradtaylorsf)

    Thank you for the update @danieliser ! We were trying to reproduce it and was unable to on AWS and locally. Can someone confirm this fixed it for them and I can update the plugin?

    I’m using it on WPEngine as well as several other users mentioned here. Depending on the version of PHP and strict standards applied you can’t access an array key directly from the function. You have to assign the function to a variable then access the array key.

    IE

    array_values( $permalinkArray )[0] won’t work on all versions of PHP.

    But this will.

    $permalinkTemplate = array_values( $permalinkArray );
    $permalinkTemplate[0];

    @bradtaylorsf

    I think the issue has to do with the PHP version. My WP Engine site is running 5.3.2 – apparently array dereferencing is PHP 5.4+, which I believe is what is happening there in your code.

    Do you for see patching this up as danieliser recommends or should I look into getting WP Engine to upgrade PHP?

    @danieliser you beat me to it!

    Plugin Author bradtaylorsf

    (@bradtaylorsf)

    Ah thanks for the info! Thanks for the help guys! I will push an update out today!

    @mndewitt – Lol, may have to do with 100MB connection im currently on :).

    I see there is a new update coming, but this error is preventing me accessing the admin section. How can I clear the error and regain access to fix it?

    Plugin Author bradtaylorsf

    (@bradtaylorsf)

    3.6.1 has been updated with the fix above. Thanks everyone for the help!

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Update is breaking WP Admin Area’ is closed to new replies.