pym-shortcode icon indicating copy to clipboard operation
pym-shortcode copied to clipboard

php error with latest version?

Open elisehu opened this issue 7 years ago • 6 comments

All my shortcodes are broken now that I'm unable to activate this plugin -- Here's the message I get:

Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /home/mattstiles/webapps/heyelise/wp-content/plugins/pym-shortcode/inc/shortcode.php on line 8

Halp?

elisehu avatar Dec 13 '18 15:12 elisehu

Hi Elise; thanks for reporting this issue. Can you tell us:

  • the version of PHP you're using
  • the version of WordPress you're using
  • the version of the plugin you're using

This is line 8 of the current version of the plugin: https://github.com/INN/pym-shortcode/blob/f08d558680623e31294fb1d728a734db2f18e440/inc/shortcode.php#L8

If you're getting a T_STRING there, I'm worried that you're using a version of PHP that may not be supported by this plugin. We've required at least PHP 5.3 since Pym.js Embeds version 1.3.2.1, and the current version of the plugin is 1.3.2.2.

The current versions of the PHP language that are supported by PHP's maintainers are:

  • 5.6 (active support until last year, security-only support until the end of this month)
  • 7.1 (active support until last month, security-only support until 1 Dec 2019)
  • 7.2 (active support until 30 Nov 2019)
  • 7.3 (active support until 6 Dec 2020)

benlk avatar Dec 13 '18 16:12 benlk

Hey team, yeah my theme was super old and they stopped updating it so in order to remove THAT variable, I updated to a new, supported theme. But when I tried to activate the plug-in, it still sent the same fatal error.

I'm running version 4.9.9 of WordPress. If the theme I'm now using is fresh, then I'm assuming the php version is much newer as well. Theoretically that would allow me to activate the plugin again, right?

elisehu avatar Dec 13 '18 18:12 elisehu

I'm running version 4.9.9 of WordPress. If the theme I'm now using is fresh, then I'm assuming the php version is much newer as well.

That's not necessarily the case; WordPress itself supports PHP versions back to PHP 5.2.

Assuming that /home/mattstiles/webapps/heyelise/ is the root of your WordPress site, if you put the following code in a file named "test-file.php" at /home/mattstiles/webapps/heyelise/test-file.php

<?php
phpinfo();

and then visit your-site/test-file.php in a browser, you should be able to see the output of the phpinfo function. It'll look something like this:

screen shot 2018-12-13 at 1 30 41 pm

What PHP version does phpinfo report?

If it's version 5.2 or prior:

  • you can get the 1.3.2 version of the Pym.js Embeds plugin, without Gutenberg support, from the wp-release.zip file at https://github.com/INN/pym-shortcode/releases/tag/v1.3.2 or from the dropdown at the bottom of https://wordpress.org/plugins/pym-shortcode/advanced/
  • you should contact your host about upgrading their version of PHP to PHP 5.6 or PHP 7.2/7.3

benlk avatar Dec 13 '18 18:12 benlk

Saving this snippet for inclusion in the plugin:

https://github.com/ampproject/amp-wp/blob/efd1d0759d000a82a48ae0a0dd1fca9bdbcf1d8d/amp.php#L16-L31

benlk avatar Dec 14 '18 20:12 benlk

  • [ ] provide message in admin, using that snippet, about PHP version dependency.

benlk avatar Nov 14 '19 23:11 benlk

Removing this from the 1.3.2.3 milestone because I don't have a way to test PHP < 7.3 at the moment, and also because PHP 5.6 has been EOL since 31 December 2018: https://www.php.net/eol.php

benlk avatar Mar 02 '20 17:03 benlk