strangerstudios / paid-memberships-pro

The Trusted Membership Platform That Grows with You: Restrict access to content and charge recurring subscriptions using Stripe, PayPal, and more. Fully open source. 100% GPL.
https://www.paidmembershipspro.com
Other
465 stars 359 forks source link

PHP 7 Support #408

Closed Vad1mo closed 7 years ago

Vad1mo commented 7 years ago

I have made an report on my site about the plugins that aren't php 7.0 compatible.

Out of the 47 Plugin paid-memberships-pro is the only one that will not work with PHP 7.

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/adminpages/emailsettings.php
-------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
 46 | ERROR | Function split() is deprecated since PHP 5.3 and removed since PHP 7.0; use preg_split instead
-------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/adminpages/updates.php
----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
----------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/adminpages/pagesettings.php
---------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
---------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/adminpages/reports.php
----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
----------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/adminpages/membershiplevels.php
-------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
-------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/adminpages/templates/orders-print.php
-------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
-------------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/adminpages/templates/orders-email.php
-------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
-------------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/preheaders/levels.php
---------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
---------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/updates.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
--------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/functions.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------
 81 | ERROR | Extension 'ereg' is deprecated since PHP 5.3 and removed since PHP 7.0 - use pcre instead.
 81 | ERROR | Function eregi_replace() is deprecated since PHP 5.3 and removed since PHP 7.0; use preg_replace instead
 82 | ERROR | Extension 'ereg' is deprecated since PHP 5.3 and removed since PHP 7.0 - use pcre instead.
 82 | ERROR | Function eregi_replace() is deprecated since PHP 5.3 and removed since PHP 7.0; use preg_replace instead
-----------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/license.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
--------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/lib/Braintree/Braintree/Util.php
-----------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------
 139 | ERROR | preg_replace() - /e modifier is deprecated since PHP 5.5 and removed since PHP 7.0
 164 | ERROR | preg_replace() - /e modifier is deprecated since PHP 5.5 and removed since PHP 7.0
-----------------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/lib/Stripe/Stripe/Object.php
---------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------------------------------------------
 232 | WARNING | Method name "Stripe_Object::__toJSON" is discouraged; PHP has reserved all method names with a double underscore prefix for future use
 245 | WARNING | Method name "Stripe_Object::__toArray" is discouraged; PHP has reserved all method names with a double underscore prefix for future use
---------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/updates/upgrade_1_5_9.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
----------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/updates/upgrade_1_3_18.php
-----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
-----------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/updates/upgrade_1_4.php
--------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
--------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/updates/upgrade_1_8_6_9.php
------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
------------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/updates/upgrade_1_2_3.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
----------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/updates/upgrade_1_5.php
--------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
--------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/updates/upgrade_1_4_8.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
----------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/updates/upgrade_1_7.php
--------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
--------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/updates/upgrade_1_6.php
--------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
--------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/updates/upgrade_1_1_15.php
-----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
-----------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/updates/upgrade_1_8_8.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
----------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/updates/upgrade_1_8_7.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
----------------------------------------------------------------------------------------------

FILE: /var/www/html/wp-content/plugins/paid-memberships-pro/includes/updates/upgrade_1_4_2.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect results
----------------------------------------------------------------------------------------------
jbruggeling commented 7 years ago

The mixed line endings sjow as warnings under 5.6 too.

The split and ergp errors were meant to be addressed in the latest version. Which version did you run the compatability check against?

jbruggeling commented 7 years ago

Also php 5.6 lifetime has been extended with security patches as its the last php 5.x version.

Also wordpress still hasnt lifted its min version requirements to php 7 and wont do so until the next major release as the discussion goes.

ttshivers commented 7 years ago

I actually had the same problem with Braintree payments specifically not working with PHP7 and wrote a fix for it: https://github.com/strangerstudios/paid-memberships-pro/pull/417

strangerstudios commented 7 years ago

Thanks for all of the heads up here. It is my intention to have some more PHP7 related fixes out to PMPro this week. Specifically I plan to upgrade the Stripe and Braintree APIs and make sure we work with the latest versions. This will break PHP 5.2 support in favor of PHP 7... a good trade off, but since PHP 5.2 is technically supported by WP we'll need to also implement a way to bug those users nicely to upgrade/etc.

strangerstudios commented 7 years ago

I believe we've fixed all of these and others we've found. We're running PMPro on PHP7 on a number of sites. If you run into any other problems, please open a new issue. Thanks.