Title: plugins and php 7.x compatibility
Last modified: September 10, 2020

---

# plugins and php 7.x compatibility

 *  [edwardsmark](https://wordpress.org/support/users/edwardsmark/)
 * (@edwardsmark)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/plugins-and-php-7-x/)
 * hello –
 * i am running a php 7.2 lint-test on all my scripts and i see wp-commerce has 
   some compatibility issues with the newer version of php.
 * is it recommended just to manually edit the scripts to fix the issue? all i need
   to do is to remove an ampersand in a few places, or just remove the word “new”,
   stuff like that.
 * my concern is that if i start making manual changes to php code and then a future
   plugin update is done, the older deprecated code might be reintroduced into our
   site causing issues.
 * i referenced the [issue here](https://wordpress.org/support/topic/lint-test-errors-with-3-15-1-and-php-7-2/)
   with e-commerce but have yet to hear back.
    -  This topic was modified 5 years, 9 months ago by [edwardsmark](https://wordpress.org/support/users/edwardsmark/).

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

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [5 years, 9 months ago](https://wordpress.org/support/topic/plugins-and-php-7-x/#post-13388410)
 * Lint tests can be tricky because some plugins code around various incompatibilities.
   You’ve already posted in the plugin’s support area; they’re best equipped to 
   answer your questions. I suggest you continue there. Also, look at [https://wordpress.org/plugins/wp-e-commerce/#developers](https://wordpress.org/plugins/wp-e-commerce/#developers)
   to see their changelog.
 *  Thread Starter [edwardsmark](https://wordpress.org/support/users/edwardsmark/)
 * (@edwardsmark)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/plugins-and-php-7-x/#post-13388492)
 * thanks steven, but the plugin authors have not yet responded and i need to move
   forward on this.
 * and i believe if you get a fatal error during a lint-test, the code will not 
   run anyways. also i am seeing lint-test failures in other places as well.
 * i should have been a bit clearer though, i apologize. i am seeing code like this:
 * `$test = &new TestSuite('blah blah blah');`
 * where it appears any use of “**EQUAL-AMPERSAND**” is a holdover from the php4
   days and wont work on php7.x.
    -  This reply was modified 5 years, 9 months ago by [edwardsmark](https://wordpress.org/support/users/edwardsmark/).
    -  This reply was modified 5 years, 9 months ago by [edwardsmark](https://wordpress.org/support/users/edwardsmark/).
    -  This reply was modified 5 years, 9 months ago by [edwardsmark](https://wordpress.org/support/users/edwardsmark/).
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [5 years, 9 months ago](https://wordpress.org/support/topic/plugins-and-php-7-x/#post-13388512)
 * I’m not expert. You can try the plugin and see if it works or find another or
   edit it and re-fix each time there’s an update. Those are the choices.
 * >> and i believe if you get a fatal error during a lint-test, the code will not
   run anyways <<
 * Test your belief. It should be a 30 second test.
 *  Thread Starter [edwardsmark](https://wordpress.org/support/users/edwardsmark/)
 * (@edwardsmark)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/plugins-and-php-7-x/#post-13388532)
 * it appears the code is indeed a holdover from php4
 * [https://stackoverflow.com/questions/47606645/php-code-error-parse-error-syntax-error-unexpected-new-t-new-in-var-www-h](https://stackoverflow.com/questions/47606645/php-code-error-parse-error-syntax-error-unexpected-new-t-new-in-var-www-h)
   
   [https://stackoverflow.com/questions/1086539/assigning-the-return-value-of-new-by-reference-is-deprecated](https://stackoverflow.com/questions/1086539/assigning-the-return-value-of-new-by-reference-is-deprecated)
 * it appears that it is recommended just to remove the ampersand manually.
    -  This reply was modified 5 years, 9 months ago by [edwardsmark](https://wordpress.org/support/users/edwardsmark/).
 *  Thread Starter [edwardsmark](https://wordpress.org/support/users/edwardsmark/)
 * (@edwardsmark)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/plugins-and-php-7-x/#post-13388576)
 * >>> I’m not expert. You can try the plugin and see if it works
    >>> or find another
   or edit it and re-fix each time there’s an update. >>> Those are the choices.
 * hmmm good idea; having a simple:
 * `sed --in-place --expression="s/= &/=/;" *.php;` might be the answer.
 * NOTE: more and more plugins are refusing to update unless php is updated to php-
   7. i take this as a bit of a warning not to put this update off any longer.
 * EDIT:
 * `find . -name '*.php' -type f -exec sed -ie "s/= &;/=/;" {} \;`
    -  This reply was modified 5 years, 9 months ago by [edwardsmark](https://wordpress.org/support/users/edwardsmark/).
    -  This reply was modified 5 years, 9 months ago by [edwardsmark](https://wordpress.org/support/users/edwardsmark/).
    -  This reply was modified 5 years, 9 months ago by [edwardsmark](https://wordpress.org/support/users/edwardsmark/).
    -  This reply was modified 5 years, 9 months ago by [edwardsmark](https://wordpress.org/support/users/edwardsmark/).
    -  This reply was modified 5 years, 9 months ago by [edwardsmark](https://wordpress.org/support/users/edwardsmark/).
    -  This reply was modified 5 years, 9 months ago by [edwardsmark](https://wordpress.org/support/users/edwardsmark/).
    -  This reply was modified 5 years, 9 months ago by [edwardsmark](https://wordpress.org/support/users/edwardsmark/).
    -  This reply was modified 5 years, 9 months ago by [edwardsmark](https://wordpress.org/support/users/edwardsmark/).
 *  Thread Starter [edwardsmark](https://wordpress.org/support/users/edwardsmark/)
 * (@edwardsmark)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/plugins-and-php-7-x/#post-13389117)
 * we have close to 29k php scripts that have been lint-tested. that little find
   script seemed to fix 90% of my issues, although i still do not feel comfortable
   modifying code.
 * upon looking at the scripts, it is probably part of some testing area that is
   obsolete anyway.
 *  [edwardyves2](https://wordpress.org/support/users/edwardyves2/)
 * (@edwardyves2)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/plugins-and-php-7-x/#post-13389929)
 * Hi,
 * I think your question about testing plugins/theme to the current version of php
   7.x is not good because majority of the theme/plugins on wordpress here are not
   up to date. Adding modifying theme and plugins from other Author, it’s best send
   them a note asking them to Q&A to test to see whether it work with the current
   php version.
 * I would used this Q&A instead:
 * [https://github.com/PHPCompatibility/PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility)
 *  Thread Starter [edwardsmark](https://wordpress.org/support/users/edwardsmark/)
 * (@edwardsmark)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/plugins-and-php-7-x/#post-13390447)
 * thank you. i would think that something like wp-commerce would be reasonably 
   current, and they would at least answer questions on their own forum.
 * but out of nearly 30k PHP scripts, i am surprised there are so few that need 
   anything. and that little find-sed script fixes most of them. the last couple
   of them i can probably safely ignore.
 * it is reassuring to see the lint tests passing. over the past couple of years,
   i had already moved all the old(er) mysql interfaces “mysqli” to the new(er) 
   PDO interface.
 * thanks again.
    -  This reply was modified 5 years, 9 months ago by [edwardsmark](https://wordpress.org/support/users/edwardsmark/).
    -  This reply was modified 5 years, 9 months ago by [edwardsmark](https://wordpress.org/support/users/edwardsmark/).

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

The topic ‘plugins and php 7.x compatibility’ is closed to new replies.

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 8 replies
 * 3 participants
 * Last reply from: [edwardsmark](https://wordpress.org/support/users/edwardsmark/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/plugins-and-php-7-x/#post-13390447)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
