PHP 7 Compatibility Issues
I ran the PHP Compatibility Checker Plugin, expected to pass, got the following errors:
FILE: /wp-content/plugins/jetpack/_inc/lib/markdown/extra.php
--------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------------------------
1739 | ERROR | Using a call-time pass-by-reference is prohibited since php 5.4
2329 | ERROR | Using a call-time pass-by-reference is prohibited since php 5.4
2439 | ERROR | Using a call-time pass-by-reference is prohibited since php 5.4
2499 | ERROR | Using a call-time pass-by-reference is prohibited since php 5.4
2505 | ERROR | Using a call-time pass-by-reference is prohibited since php 5.4
--------------------------------------------------------------------------------------------------
FILE: /wp-content/plugins/jetpack/class.jetpack.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
30 | ERROR | Global variable 'HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0 - use php://input instead.
------------------------------------------------------------------------------------------------------------------------------------
The Markdown errors might be false positives. See this issue in the original Markdown Extra library to find out more: https://github.com/michelf/php-markdown/issues/163
We could probably switch to php://input though. We already use it in on other places in that file.
@lezama What's your take on this?
We could probably switch to php://input though. We already use it in on other places in that file.
@lezama What's your take on this?
Probably a good idea, I don't understand how we didn't get complaints from users running PHP7
I don't understand how we didn't get complaints from users running PHP7
I'm not sure. This never generated any warnings or errors for me.
FYI - HTTP_RAW_POST_DATA is also used in Jetpack_Signature, which seems like it could be a problem.
3056104-t going to have him downgrade to see what happens
Downgrading did fix the problem for the user in 3056104-t
I'm the user in 3056104-t. I still use PHP7.0.x now because 7.0.x gives no error. Even if I use PHP7.1.x, there is no error when I disabled OPCache. The information about a few incompatibilities on servers using OPCache was brought to me by jeherve.
But, disabling OPCache is not good for my server. Have anyone had any progress on this particular error?
The information about a few incompatibilities on servers using OPCache was brought to me by jeherve.
This should be fixed with #6565. @o6asan Would you mind giving that patch a try and let us know there if it works?
Thanks!
Master issue: #6106
@jeherve Unfortunately, #6565 did not work well for me. I had the same error on the log of PHP7.1.3 with Jetpack4.7.1 and new jetpack-related-posts.php.
@o6asan Thanks for giving it a try. We'll get back to you via email to run some more tests!
@jeherve Today, I updated PHP to 7.1.4 which includes the fixes of https://bugs.php.net/bug.php?id=74213. I already have Jetpack4.8.2 which merged #6565. Under them, I don't have the error anymore. I enabled the feature Related Posts and it works well. Thanks so much.
PHP Compatibility plugin is again showing following errors regarding PHP 7 Compatibility.
FILE: /var/www/html/wp-content/plugins/jetpack/modules/markdown/easy-markdown.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------------------
654 | ERROR | Global variable '$HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead
655 | ERROR | Global variable '$HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead
656 | ERROR | Global variable '$HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead
660 | ERROR | Global variable '$HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead
------------------------------------------------------------------------------------------------------------------------------------
Closing this to focus on #9818 as a final task for general PHP 7 compat.
@navjotjsingh thanks for the report! Just for the record: these are false positives. We can not remove every HTTP_RAW_POST_DATA entry from our code because we need to make sure it's PHP 5.2 compatible. Instead we are making sure we are using it in a way that is backwards compatible. This is why compatibility plugins that do not analyze code, but instead match by substrings will always report these. It's fine, you can ignore these matches.
Edit: actually, disregard the above, #9818 looks valid.
@o6asan . Sorry to bother you! I couldn't find any other way to reach you, not even through your BBS contact (NetOwl security blocked me from commenting there). Your website is down. I can't access your translation for Hyohaku anymore. Or for any domains titled o6asan. It says ERR_ADDRESS_UNREACHABLE. I didn't save your email address either, and since it was on said website, I couldn't email you either, hence I am contacting you here.
At first I thought the issue was with my server, but I realized it would happen regardless of device, browser of computers. I had a bunch of classmates try it with their respective servers, internet, and devices too-issue's with your website. Would you mind fixing it so I can read Hyohaku please?
Again, sorry for hijacking this forum, I couldn't find any other way of contacting you since BBS and your website is down.
@angelatwin333 , Thank you for informing me about my sites down. I had not noticed my web server down until my reading your letter. I fixed it. I think you can reach my sites now.
I apologize to everyone on this forum for our bothering.
Thank you so, so much!