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

fix: review Liquid Web's PHP 7.2 compatibility report #3919

Closed
kevinwhoffman opened this Issue Jan 3, 2019 · 7 comments

Comments

Projects
None yet
3 participants
@kevinwhoffman
Copy link
Member

kevinwhoffman commented Jan 3, 2019

Bug Report

User Story

As a user, I want to know whether Give is compatible with PHP 7.2 so that I am confident in using the plugin.

Current Behavior

Liquid Web report mentions several errors and warnings related to PHP 7.2. That does not meant that Give necessarily is incompatible, but we should investigate further to know whether the reported code is there for backwards compatibility or whether it needs addressed.

Expected Behavior

The only errors and warnings visible should be those related to backwards compatibility.

Bug Type

  • This bug describes functionality that once worked as expected in version X.X.X.
  • This bug describes functionality that never worked as expected.
  • I am not sure whether this functionality ever worked as expected.

Steps to Reproduce

  1. Investigate each warning/error in the report and examine the context of the code to determine whether it needs attention.

Related

Acceptance Criteria

  • Each error or warning has been investigated and code has been updated if necessary for PHP 7.2.
@kevinwhoffman

This comment has been minimized.

Copy link
Member

kevinwhoffman commented Jan 3, 2019

Here is an abridged version of the report that excludes the warnings related to double underscores:

Name: Give - Donation Plugin

FILE: /home/s2/html/wp-content/plugins/give/includes/class-give-background-updater.php
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
233 | ERROR | Indirect access to variables, properties and methods will be evaluated strictly in left-to-right order since PHP 7.0. Use curly braces to remove ambiguity.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /home/s2/html/wp-content/plugins/give/includes/misc-functions.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
1678 | WARNING | INI directive 'safe_mode' is deprecated since PHP 5.3 and removed since PHP 5.4
-------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /home/s2/html/wp-content/plugins/give/includes/admin/tools/export/give-export-donations-functions.php
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
193 | WARNING | The "result" parameter for function parse_str() is missing. Passing this parameter is no longer optional. The optional nature of the parameter is deprecated since PHP 7.2
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /home/s2/html/wp-content/plugins/give/includes/admin/tools/views/html-admin-page-system-info.php
------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------
286 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 and removed since PHP 7.0; Use mysqli instead
------------------------------------------------------------------------------------------------------------

FILE: /home/s2/html/wp-content/plugins/give/includes/libraries/tcpdf/tcpdf.php
---------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------------------
10872 | ERROR | Function mcrypt_get_cipher_name() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
10872 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
10872 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
---------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /home/s2/html/wp-content/plugins/give/includes/libraries/tcpdf/include/tcpdf_static.php
----------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 24 ERRORS AND 1 WARNING AFFECTING 7 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------
143 | ERROR | Function set_magic_quotes_runtime() is deprecated since PHP 5.3 and removed since PHP 7.0
453 | ERROR | Function mcrypt_create_iv() is deprecated since PHP 7.1 and removed since PHP 7.2; Use random_bytes() or OpenSSL instead
453 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
453 | ERROR | Function mcrypt_get_iv_size() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
453 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
453 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
453 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2
453 | ERROR | The constant "MCRYPT_RAND" is deprecated since PHP 7.1 and removed since PHP 7.2
454 | ERROR | Function mcrypt_encrypt() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
454 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
454 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
454 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2
475 | ERROR | Function mcrypt_get_iv_size() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
475 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
475 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
475 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2
476 | ERROR | Function mcrypt_encrypt() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
476 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
476 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
476 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2
493 | ERROR | Function mcrypt_encrypt() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
493 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
493 | ERROR | The constant "MCRYPT_ARCFOUR" is deprecated since PHP 7.1 and removed since PHP 7.2
493 | ERROR | The constant "MCRYPT_MODE_STREAM" is deprecated since PHP 7.1 and removed since PHP 7.2
1934 | WARNING | INI directive 'safe_mode' is deprecated since PHP 5.3 and removed since PHP 5.4
----------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /home/s2/html/wp-content/plugins/give/includes/libraries/browser.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
219 | WARNING | Use of deprecated PHP4 style class constructor is not supported since PHP 7.
----------------------------------------------------------------------------------------------

FILE: /home/s2/html/wp-content/plugins/give/vendor/tecnickcom/tcpdf/tcpdf.php
---------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------------------
10872 | ERROR | Function mcrypt_get_cipher_name() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
10872 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
10872 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
---------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /home/s2/html/wp-content/plugins/give/vendor/tecnickcom/tcpdf/include/tcpdf_static.php
----------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 24 ERRORS AND 1 WARNING AFFECTING 7 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------
143 | ERROR | Function set_magic_quotes_runtime() is deprecated since PHP 5.3 and removed since PHP 7.0
453 | ERROR | Function mcrypt_create_iv() is deprecated since PHP 7.1 and removed since PHP 7.2; Use random_bytes() or OpenSSL instead
453 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
453 | ERROR | Function mcrypt_get_iv_size() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
453 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
453 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
453 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2
453 | ERROR | The constant "MCRYPT_RAND" is deprecated since PHP 7.1 and removed since PHP 7.2
454 | ERROR | Function mcrypt_encrypt() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
454 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
454 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
454 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2
475 | ERROR | Function mcrypt_get_iv_size() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
475 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
475 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
475 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2
476 | ERROR | Function mcrypt_encrypt() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
476 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
476 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
476 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2
493 | ERROR | Function mcrypt_encrypt() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
493 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
493 | ERROR | The constant "MCRYPT_ARCFOUR" is deprecated since PHP 7.1 and removed since PHP 7.2
493 | ERROR | The constant "MCRYPT_MODE_STREAM" is deprecated since PHP 7.1 and removed since PHP 7.2
1934 | WARNING | INI directive 'safe_mode' is deprecated since PHP 5.3 and removed since PHP 5.4
----------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /home/s2/html/wp-content/plugins/give/templates/receipt/placeholder.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | WARNING | No PHP code was found in this file and short open tags are not allowed by this install of PHP. This file may be using short open tags but PHP does not allow them.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@kevinwhoffman

This comment has been minimized.

Copy link
Member

kevinwhoffman commented Jan 8, 2019

@mehul0810 Please test Give 2.4.0 with PHP 7.2 and investigate the errors and warnings listed in the report above. Some of this is due to backwards compatible code that does not run in PHP 7.2, but we should still investigate.

Report back with any of the errors/warnings that actually cause Give to malfunction with PHP 7.2. If they are minor fixes then go ahead and address them in a single PR.

@mehul0810

This comment has been minimized.

Copy link
Contributor

mehul0810 commented Jan 8, 2019

@DevinWalker @kevinwhoffman I've investigated on this issue and noticed that there are more of false positives as shown here: https://github.com/wpengine/phpcompat/wiki/Results

Check PR for some minor changes: #3926

However, here are the details for each of the errors based on my findings:

FILE: /home/s2/html/wp-content/plugins/give/includes/class-give-background-updater.php
FOUND 1 ERROR AFFECTING 1 LINE
233 | ERROR | Indirect access to variables, properties and methods will be evaluated strictly in left-to-right order since PHP 7.0. Use curly braces to remove ambiguity.

I've fixed this error by applying a change which is forward as well as backward compatible.


FILE: /home/s2/html/wp-content/plugins/give/includes/misc-functions.php
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
1678 | WARNING | INI directive 'safe_mode' is deprecated since PHP 5.3 and removed since PHP 5.4

This error is false positive. Click here for more info.


FILE: /home/s2/html/wp-content/plugins/give/includes/admin/tools/export/give-export-donations-functions.php
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
193 | WARNING | The "result" parameter for function parse_str() is missing. Passing this parameter is no longer optional. The optional nature of the parameter is deprecated since PHP 7.2

I've fixed this error. But, I believe that this piece of code is used in exporting donation forms which is no longer in use. Click here to see the related issue.


FILE: /home/s2/html/wp-content/plugins/give/includes/admin/tools/views/html-admin-page-system-info.php
FOUND 1 ERROR AFFECTING 1 LINE
286 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 and removed since PHP 7.0; Use mysqli instead

This is false positive. Click here for more info.


FILE: /home/s2/html/wp-content/plugins/give/includes/libraries/tcpdf/tcpdf.php
FOUND 3 ERRORS AFFECTING 1 LINE
10872 | ERROR | Function mcrypt_get_cipher_name() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
10872 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
10872 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2

I've noticed that PDF generation is working fine. However, Fixing this error will require editing TCPDF library. Do we need to work on this?


FILE: /home/s2/html/wp-content/plugins/give/includes/libraries/tcpdf/include/tcpdf_static.php
FOUND 24 ERRORS AND 1 WARNING AFFECTING 7 LINES
143 | ERROR | Function set_magic_quotes_runtime() is deprecated since PHP 5.3 and removed since PHP 7.0
453 | ERROR | Function mcrypt_create_iv() is deprecated since PHP 7.1 and removed since PHP 7.2; Use random_bytes() or OpenSSL instead
453 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
453 | ERROR | Function mcrypt_get_iv_size() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
453 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
453 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
453 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2
453 | ERROR | The constant "MCRYPT_RAND" is deprecated since PHP 7.1 and removed since PHP 7.2
454 | ERROR | Function mcrypt_encrypt() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
454 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
454 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
454 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2
475 | ERROR | Function mcrypt_get_iv_size() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
475 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
475 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
475 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2
476 | ERROR | Function mcrypt_encrypt() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
476 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
476 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
476 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2
493 | ERROR | Function mcrypt_encrypt() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
493 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
493 | ERROR | The constant "MCRYPT_ARCFOUR" is deprecated since PHP 7.1 and removed since PHP 7.2
493 | ERROR | The constant "MCRYPT_MODE_STREAM" is deprecated since PHP 7.1 and removed since PHP 7.2
1934 | WARNING | INI directive 'safe_mode' is deprecated since PHP 5.3 and removed since PHP 5.4

I've noticed that PDF generation is working fine. However, Fixing this error will require editing TCPDF library. Do we need to work on this?


FILE: /home/s2/html/wp-content/plugins/give/includes/libraries/browser.php
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
219 | WARNING | Use of deprecated PHP4 style class constructor is not supported since PHP 7.

This error is false positive. I've searched for the usage of browser.php file and unable to find usage of the same in Give Core.


FILE: /home/s2/html/wp-content/plugins/give/vendor/tecnickcom/tcpdf/tcpdf.php
FOUND 3 ERRORS AFFECTING 1 LINE
10872 | ERROR | Function mcrypt_get_cipher_name() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
10872 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
10872 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2

I've noticed that PDF generation is working fine. However, Fixing this error will require editing TCPDF library. Do we need to work on this?


FILE: /home/s2/html/wp-content/plugins/give/vendor/tecnickcom/tcpdf/include/tcpdf_static.php
FOUND 24 ERRORS AND 1 WARNING AFFECTING 7 LINES
143 | ERROR | Function set_magic_quotes_runtime() is deprecated since PHP 5.3 and removed since PHP 7.0
453 | ERROR | Function mcrypt_create_iv() is deprecated since PHP 7.1 and removed since PHP 7.2; Use random_bytes() or OpenSSL instead
453 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
453 | ERROR | Function mcrypt_get_iv_size() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
453 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
453 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
453 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2
453 | ERROR | The constant "MCRYPT_RAND" is deprecated since PHP 7.1 and removed since PHP 7.2
454 | ERROR | Function mcrypt_encrypt() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
454 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
454 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
454 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2
475 | ERROR | Function mcrypt_get_iv_size() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
475 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
475 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
475 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2
476 | ERROR | Function mcrypt_encrypt() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
476 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
476 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2
476 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2
493 | ERROR | Function mcrypt_encrypt() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
493 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
493 | ERROR | The constant "MCRYPT_ARCFOUR" is deprecated since PHP 7.1 and removed since PHP 7.2
493 | ERROR | The constant "MCRYPT_MODE_STREAM" is deprecated since PHP 7.1 and removed since PHP 7.2
1934 | WARNING | INI directive 'safe_mode' is deprecated since PHP 5.3 and removed since PHP 5.4

I've noticed that PDF generation is working fine. However, Fixing this error will require editing TCPDF library. Do we need to work on this?


FILE: /home/s2/html/wp-content/plugins/give/templates/receipt/placeholder.php
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
1 | WARNING | No PHP code was found in this file and short open tags are not allowed by this install of PHP. This file may be using short open tags but PHP does not allow them.

This warning is false positive. I think the warning generated as we are using HTML only in PHP file. Also, the functionality works as expected.

@DevinWalker

This comment has been minimized.

Copy link
Member

DevinWalker commented Jan 8, 2019

I've noticed that PDF generation is working fine. However, Fixing this error will require editing TCPDF library. Do we need to work on this?

No we don't. We should educate our customers on why the code is in there and how it doesn't mean it's not PHP 7.2 compatible.

@mehul0810

This comment has been minimized.

Copy link
Contributor

mehul0810 commented Jan 9, 2019

@DevinWalker I can see that the errors showing for TCPDF regarding the encryption process. I can see in the code that it is backward compatible. If a customer is using PHP 7.2+ and having issues in generating PDF then he just need to ask the hosting provider to enable OpenSSL module because the issue in generating PDF can only be reproduced in PHP 7.2+ when OpenSSL is disabled.

Check the code in below screenshot which shows backward compatible code:
image

I think 99% of our users won't be having any kind of issues with TCPDF with PHP 7.2 or higher due to backward compatible code. Hence, the errors shown are false positive.

@mehul0810

This comment has been minimized.

Copy link
Contributor

mehul0810 commented Jan 9, 2019

Slack Call Summary

Participants: @mehul0810 @ravinderk
Topic: Discussion on the requested changes by Ravinder
Result: Ravinder explained to me how we can use the callback as an array with upgrade routine and then trying to run upgrade routine will generate that specific scenario. I'll test that specific scenario and update.

@mehul0810

This comment has been minimized.

Copy link
Contributor

mehul0810 commented Jan 9, 2019

Slack Call Summary

Participants: @mehul0810 @ravinderk
Topic: Discussion on the requested changes by Ravinder
Result: I've shown the way how I've fixed that to Ravinder which looks good now. I'll be adding the commit and update on PR.

DevinWalker added a commit that referenced this issue Jan 10, 2019

Merge pull request #3926 from impress-org/issue/3919
fix: review Liquid Web's PHP 7.2 compatibility report #3919
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment