Jetpack: PHP 7.2 Compatibility

Created on 14 Nov 2017  ·  6Comments  ·  Source: Automattic/jetpack

PHP 7.2 has been released. Let's make sure Jetpack is compatible.

Related: #6106

_If you want to help with a PR, please edit this description and add the PR number between parens at the end of the line_

PHP Fatal errors

  • [x] - Running a full Sync is totally broken when initiated from Calypso. Reported in #8186.
  • [x] - Make sure that $output is an array before treating it as an array. #8850

PHP deprecated

  • [X] - Function create_function() is deprecated in stats code. Reported in #8010.
  • [x] - Function create_function() is deprecated in sync tests code. #8478.
  • [x] - create_function() use in _inc/lib/markdown/extra.php. #8868.
  • [x] - create_function() use in modules/wordads/php/widgets.php. #8870.

Unit Tests

  • [x] - Adding PHP 7.2 testing with Travis #8212

PHP warnings

  • [x] - Parameter must be an array or an object that implements Countable - #8420
  • [x] - Parameter must be an array or an object that implements Countable in Brightcove Shortcode - #8479.

Other

  • [x] - General PHP 7 Compatibility Issues - #4346

/jetpack/modules/custom-css/csstidy/class.csstidy.php -- Idea, just update to newer version https://github.com/Cerdic/CSSTidy ?

  • [x] Function each() is deprecated since PHP 7.2; Use a foreach loop instead

/jetpack/modules/module-headings.php

  • [x] File has mixed line endings; this may cause incorrect results

/jetpack/modules/post-by-email.php

  • [x] Method name “Jetpack_Post_By_Email::__process_ajax_proxy_request” is discouraged; PHP has reserved all method names with a double underscore prefix for future use.
General Primary Issue [Pri] High [Type] Task

All 6 comments

Report from the forums of create_function() use in _inc/lib/markdown/extra.php and modules/wordads/php/widgets.php

Thanks for the report @pmciano . These are going to be addresed by #8870 and ( #8868 ~or #8869~ )

Closing this as we are 7.2 compat with an outstanding 7.0-compat issue that is being tracked in #9818.

Reopening for a couple of more:

/jetpack/modules/custom-css/csstidy/class.csstidy.php -- Idea, just update to newer version https://github.com/Cerdic/CSSTidy ?

  • [x] Function each() is deprecated since PHP 7.2; Use a foreach loop instead

/jetpack/modules/module-headings.php

  • [x] File has mixed line endings; this may cause incorrect results

/jetpack/modules/post-by-email.php

  • [x] Method name “Jetpack_Post_By_Email::__process_ajax_proxy_request” is discouraged; PHP has reserved all method names with a double underscore prefix for future use.

Warnings for compatibility with PHP 7.2 reported in this thread.

/modules/custom-css/csstidy/class.csstidy.php
/jetpack/modules/photon-cdn/jetpack-manifest.php
/jetpack/modules/post-by-email.php

  • No each() calls were found
  • Method Jetpack_Post_By_Email::__process_ajax_proxy_request() is deprecated and throws an error (PR #15139)
Was this page helpful?
0 / 5 - 0 ratings