Hustle Doesn't Work with PHP 7.1.3

I just tried to upgrade my site from PHP 7.0.17 to PHP 7.1.3, but when I do this, Hustle stops working. The email popup I use is not displayed, and I cannot edit any of the popups settings. When I go to the Email Opt-in screen, all I see is the EDIT YOUR OPT-IN header, and none of the settings are available below this. I reverted my site back to PHP 7.0.17 and the popup is displayed again, and I can see and edit settings.

I don't have a staging server, so I can't provide you access to take a look for yourself, but if you have the same setup, I'm sure you'll see the same issue. Note that I'm also using nginx, not apache.

    Nithin

    Hi Martin,

    Hop you are doing good today.

    I have PHP 7.1.3 installed in Apache, and Hustle does work fine in my system without any issue. Most probably, maybe another plugin which isn't compatible with latest PHP is causing this issue, but not sure. To make the troubleshooting process easier, is it possible for you to switch to 7.1.3, and then enable debug mode, so that we could have a better idea regarding this. If you could provide us with debug logs it would be much helpful.

    To enable debug mode, open your wp-config.php file located in your root directory, and look for define(‘WP_DEBUG’, false);. Change it to:

    define('WP_DEBUG', true);

    In order to enable the error logging to a file on the server you need to add:

    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );

    After making the above changes, please try to replicate the issue, the related errors will be saved to a debug.log log file inside the /wp-content/ directory.

    Please attach these in your next reply in txt format file, so that we could give a closer look. You can find more details about debugging here.

    Please let us know how that goes, have a nice day.

    Kind Regards,
    Nithin

    Martin

    Hi Nithin,

    Thanks for your help with this.

    I turned on debugging, and when I go to the Hustle Email Opt-in settings screen, the following error is logged:

    [01-Apr-2017 05:28:41 UTC] PHP Fatal error: Uncaught Error: Cannot re-assign $this in /var/www/vhosts/martinbaileyphotography.com/httpdocs/wp-content/plugins/hustle/opt-in.php:315
    Stack trace:
    #0 /var/www/vhosts/martinbaileyphotography.com/httpdocs/wp-content/plugins/hustle/opt-in.php(315): extract(Array, 0)
    #1 /var/www/vhosts/martinbaileyphotography.com/httpdocs/wp-content/plugins/hustle/views/admin/wpoi-wizard-services.php(264): Opt_In->render('admin/provider/...', Array)
    #2 /var/www/vhosts/martinbaileyphotography.com/httpdocs/wp-content/plugins/hustle/opt-in.php(324): include('/var/www/vhosts...')
    #3 /var/www/vhosts/martinbaileyphotography.com/httpdocs/wp-content/plugins/hustle/views/admin/wpoi-wizard.php(43): Opt_In->render('admin/wpoi-wiza...', Array)
    #4 /var/www/vhosts/martinbaileyphotography.com/httpdocs/wp-content/plugins/hustle/opt-in.php(324): include('/var/www/vhosts...')
    #5 /var/www/vhosts/martinbaileyphotography.com/httpdocs/wp-content/plugins/hustle/inc/opt-in-admin.php(503): Opt_In->render('/admin/wpoi-wiz...', Array)
    #6 /var/www/vhosts/ in /var/www/vhosts/martinbaileyphotography.com/httpdocs/wp-content/plugins/hustle/opt-in.php on line 315

    As far as I can tell, all other plugins are working fine, so I don't want to mess around disabling other plugins etc. I'm hoping that this will help without doing that.

    I also just found though that the pop-ups do seem to be displayed now that I flushed my cache, so I will try leaving my server on PHP 7.1.3 and continue to test for now.

    Regards,
    Martin.

    Nithin

    Hi Martin,

    I also just found though that the pop-ups do seem to be displayed now that I flushed my cache, so I will try leaving my server on PHP 7.1.3 and continue to test for now.

    Glad to know that it's working fine now.

    However, that fatal error in your log does seems to be odd, please do let us know how your test goes, and check whether you are still able to replicate the issue, so that we could give a closer look, if needed. Have a nice day.

    Best Regards,
    Nithin

    Martin

    Hi Nithin,

    Sorry for not being clear. Only the popup on the front end is working. The Email Opt-in Settings screen still do not work when using PHP 7.1.3.

    I've just tested everything I can think of on my site, and everything else seems fine. I need to be able to adjust the Hustle Email Opt-in settings or else I'll have to revert to PHP 7.0 again, so your help is still needed.

    Regards,
    Martin.

    Nithin

    Hi Martin,

    Thanks for clearing that out for me, I tried to create a new Popup optin, and it works fine in my setup. Maybe I'm missing something here, could you please enable support access, so that I could give a closer look at this, and see what's being missed here.

    You can grant access from WPMU DEV > Support > Support Access > Grant Access, or check this manual: http://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Please let us know once you enable access, so that we could get this sorted. Have a nice weekend.

    Kind Regards,
    Nithin

    Martin

    I am not trying to create a new pop-up. I am simply trying to edit the existing one, and it shows up like this image, with no settings after the header.

    I did try to create a new pop-up, and it mostly worked, except that I cannot add my MailChimp newsletter groups, as I did with my original pop-up. I could see the groups name, but it was marked as (Hidden), yet the groups are not actually hidden.

    I saved the new pop-up though, and went back in to check the settings, and the newsletter groups settings had been lost. I clicked to try to set them up again, and they were still marked as (Hidden). Needless to say, the list's groups are not hidden in MailChimp. I've attached a screenshot of this for your reference.

    You can see the test pop-up on this page, although it doesn't really show you anything, except that the groups are missing.
    https://www.martinbaileyphotography.com/test-page/

    I can grant you access to our site to look at these settings, but I need your word that you won't start deactivating plugins or delete my original pop-up or anything. The site is still live so you can't change anything. Just look. Is that OK?

    Regards,
    Martin.

    Nithin

    Hey Martin,

    I can grant you access to our site to look at these settings, but I need your word that you won't start deactivating plugins or delete my original pop-up or anything. The site is still live so you can't change anything. Just look. Is that OK?

    Thank you for passing the screenshot. Yes, I understand it's a live site, and I always make sure to ask permission when it comes to making any changes in a live site.

    What I would like to do is create a new test opt-in, and see whether there is any conflicts in your dashboard. I would also like to enable enable debug mode while I perform these, so that I could have a better understanding of this issue, because I'm not able to replicate the exact problem in my PHP 7.1.3, and I would like to see what's being missed here.

    Other than what is mentioned here, I won't be making any other changes in your system without checking with you. If you think I could make these changes, could you please send me your website credentials so that, I could give a closer look, so that I could report this to the developer.

    You can send credentials by using our secure contact form: https://premium.wpmudev.org/contact/#i-have-a-different-question

    - To Mark to my attention, the subject line should contain only: ATTN: Nithin Ramdas
    -WordPress admin username
    -WordPress admin password
    -login url
    -FTP credentials (host/username/password)
    -link back to this thread for reference
    -any other relevant urls

    Have a nice day.

    Kind Regards,
    Nithin

    Martin

    Hi Nithin,

    I just noticed that trying to create the new pop-up broke the MailChimp Group settings in my live pop-up, so once again I've had to revert my site back to PHP 7.0.17. This means that unfortunately, there is no longer any point in providing you access.

    I would really like to move to PHP 7.1 for the performance benefits, but this is now holding me back.

    I don't really have time to set up a staging site so that you can reproduce this. At the moment, the only other thing that I can think of, is that you are using PHP 7.1.3 on Apache, and I'm running it on nginx. If you could try nginx and it still works fine, then it might be something specific to my site. Does no one on the team have nginx and PHP 7.1.3 to give this a try?

    Regards,
    Martin.

    Kasia Swiderska

    Hello Martin,

    At the moment we are not able to test that on nginx, but we are looking for this specific setup to test Hustle.
    But in the meantime could you enable support access to your site? I would like to double check opt-ins there if there is maybe specific setting that could trigger that error and we don't use it on our lab sites. Just to be sure we are not missing anything.

    kind regards,
    Kasia

    Martin

    Hi Kasia, Team,

    Sorry for the delayed reply. Things got a bit crazy here for a few days.

    I've enabled support access for you to take a look, but please only look. The site is live, so you can't make any changes or deactivate plugins etc.

    My gut feeling regarding this issue is that something to do with the MailChimp groups isn't working with PHP 7.1. These break in the sign up form that I have already set up, and I could not select groups etc. when I tried to create a new sign up form when using PHP 7.1.

    Maybe if you replicate something like my MailChimp setup, with multiple groups, you might be able to reproduce this issue.

    Regards,
    Martin.

    Kasia Swiderska

    Hello Martin,

    Thanks for the hint and support access. That was it! It is problem with groups. They show only with PHP lower than 7.1.3 and when they are setup in lower version then email opt-in can't be edited when switched to PHP 7.1.3. I was able to replicate the same issue on my testing site.

    That is bug and I'm reporting this to developers right now. We will let you know if there will be hot patch - otherwise it will be fixed in future version of plugin.

    kind regards,
    Kasia

    Martin

    That's great Kasia, I'm pleased you were able to reproduce this issue.

    I'll stay at PHP 7.0.x until I see a fix come through for this, or until I hear back about a possible hot patch, but next update is fine. Do you have a way to track this and come back to update this thread once it is fixed in the public release?

    I generally check the changeling for updates, but it would be great if you could let me know.

    Regards,
    Martin.