Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php version 5.x compatibility issue with version 1.3.0 #25

Closed
Bhoft opened this issue Nov 30, 2017 · 3 comments
Closed

php version 5.x compatibility issue with version 1.3.0 #25

Bhoft opened this issue Nov 30, 2017 · 3 comments
Labels

Comments

@Bhoft
Copy link

Bhoft commented Nov 30, 2017

Hi,
We are using your plugin on a site which still uses php 5.x and have an issue with the php code in the latest version.

PHP Parse error: syntax error, unexpected '[', expecting ',' or ';' in /wp-content/plugins/advanced-custom-fields-recaptcha-field/includes/settings-page.php on line 158

<strong><?php echo __('Plugin Version'); ?></ echo get_plugin_data(ACF_RECAPTCHA_ABSPATH['Version'];

Fix something like this (set to a variable first):

<strong><?php echo __('Plugin Version'); ?></strong>: <?php
$RECAPTCHA_ABSPATH = get_plugin_data(ACF_RECAPTCHA_ABSPATH);
echo $RECAPTCHA_ABSPATH['Version'];
?>

Another issue which isn't related to the php version.
I cannot access the settings page which is linked on the plugins page.
it shows "Sorry, you are not allowed to access this page." even if i am adminstrator.

Url:
/wp-admin/options-general.php?page=acf-recaptcha

The acf field settings page is working as expected.
Url:
/wp-admin/edit.php?post_type=acf-field-group&page=acf-recaptcha

thanks in advance

@irvinlim irvinlim added the bug label Nov 30, 2017
@irvinlim
Copy link
Owner

irvinlim commented Nov 30, 2017

Thanks for reporting. I have confirmed the bug that Plugins settings link is incorrect.

For the record, can I check the exact version of PHP that you are using? It works fine for me on PHP 5.6.

@Bhoft
Copy link
Author

Bhoft commented Nov 30, 2017

We still have one server which runs php version 5.3.
With php 5.4. Array dereferencing was introduced
http://php.net/manual/en/language.types.array.php#example-62

So your code doesn't run on older php versions.

@irvinlim
Copy link
Owner

Noted with thanks! Version 1.3.1 should fix this problem, which should be up on the plugins repository soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants