• Resolved wppw

    (@wpuser2624)


    Issue: Compatibility problem between the Groups plugin and newer PHP versions (8.0.30 and above).

    Details:
    I am using the Astra theme with a child theme (via Child Theme Configurator), and the Groups plugin to manage download access based on user membership.

    After upgrading PHP from 7.4.33 to 8.0.30, and later to 8.3.21, the site began rendering incorrectly:

    • The main content frame was missing, while the navigation menus remained visible.
    • There was no fatal error — just an incomplete page display.
    • The failure was visible across different browsers: Chrome & Edge on Windows, Safari on IOS, IPadOS

    Downgrading PHP to 7.4.33 seemed to resolve the issue.

    I temporarily patched the plugin to avoid use of empty() on potentially undefined variables, which allowed the site to function under PHP 8.3.21.

    After the release of Groups 3.6.0, I tested the update, but re-enabling the plugin caused the same display issue. Restoring the previous /plugins/groups/ folder (with temporary patch) fixed the problem again.

    Question:

    Is this PHP compatibility issue known? If not, I am happy to provide additional details.

    Thank you for maintaining the plugin — I hope this helps with ongoing compatibility updates.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi there,

    Thanks for mentioning all the details involved with this issue and the steps you followed, but I would agree that if you could share additional details that would be very helpful, including and not limiting to:

    • Debug.log entries related to Groups plugin.
    • Necessary steps involved to reproduce the issue.

    Normally when there are PHP compatibility issues involved, you are expected to get related errors, warnings and notices in your debug.log, which is something not occurring on test installations used exactly for that purpose. Because of that, any additional indications you can share, are more than welcome.

    Last but not least, do you get the same results, if you disable all your plugins but Groups and also switch first to your parent theme and then another different theme? This recommendation is to rule out the possibility of conflicts, or other elements on your site not being compatible with PHP 8.x.x.

    Kind regards,

    George

    • This reply was modified 4 months, 4 weeks ago by gtsiokos.
    Plugin Author Kento

    (@proaktion)

    Is this still relevant with the latest Groups 3.8.0 or can we mark this as resolved?

    Thread Starter wppw

    (@wpuser2624)

    Sorry, haven’t had time to pursue this further, but I can share the diagnosis and workaround that is currently in place…

    To diagnose, the WordPress debug log was uploaded to ChatGPT, which identified the following issue (when using Groups 3.5.9):

    The site crashes due to this plugin:

    Groups plugin (groups/lib/access/class-groups-post-access.php)

    With this specific error:

    Fatal error: Uncaught Error: Attempt to assign property "count" on int

    This means the plugin is treating an integer as if it were an object — which was loosely tolerated in PHP 7.4 but throws a fatal error in PHP 8.

    The plugin contains code like this (or equivalent):

    $term->count = 5;

    …but $term is unexpectedly just an integer (not an object), so PHP 8 crashes with:

    Attempt to assign property "count" on int

    This is a common compatibility issue when plugin authors don’t properly validate variable types before accessing or assigning properties. ✅ Fix Options Option 1: Deactivate the “Groups” Plugin

    If you do not rely on Groups (or Ultimate Member’s Groups integration):

    • Deactivate the “Groups” plugin
    • Switch back to PHP 8.0.30
    • Site should now load

    You can always reactivate if you later downgrade PHP again.Option 2: Wait for (or Request) a PHP 8 Fix

    Check if there’s an updated version of the Groups plugin. If not:

    • Reach out to the plugin author or support forum
    • Point them to the line of failure (around line 1328 in class-groups-post-access.php)

    They need to patch the logic like this:

    if ( is_object( $term ) ) { $term->count = ...; }

    The problem did not occur when using PHP 7.x and only observed with 8.x. Implementing the suggested workaround resolved the issue for Groups 3.5.9 (with PHP 8.3.21).

    When I updated to Groups 3.6.0 the problem returned, presumably because the patch had been overwritten by the update – I haven’t had the time to re-implement the patch, so simply restored Groups 3.5.9 with the above patch as it continues to work without issue for me.

    Hope that helps clarify the issue.

    Kind regards,

    gtsiokos

    (@gtsiokos)

    Hi again wppw,

    As the plugin author indicated in one of the previous comments, please make sure to update your Groups plugin to version 3.8.0 and then

    • Disable all your plugins apart from Groups
    • Disable or comment out any custom code
    • Switch to a default theme, ie Twenty Twenty-Five, or if already in-use, install a fresh copy of it.

    If the issue persists, then make sure to share a copy of your debug.log, using ie pastebin.com. Otherwise start enabling your plugins one-by-one until you reach the one that changes the type of $term.

    Kind regards,

    George

    Plugin Author Kento

    (@proaktion)

    @wpuser2624 @gtsiokos I would be interested also in knowing whether this is still an issue with the latest 3.8.0; the AI-generated report you have provided doesn’t seem to include a reference to a specific line number in the code, it would be useful to know where this happened to see if that might still be an issue in the latest version. In any case, please make sure to use the latest version of Groups for your tests.

    Thread Starter wppw

    (@wpuser2624)

    Thank you for your follow-up. I will have a go at updating to 3.8 per your suggestion, as soon as I can. Sorry, this may take a while.

    In the meantime, the line number (for $term->count = count( $post_ids in class-groups-post-access.php); was 1328. According to WP, I am actively running Groups 3.5.0 (with patch).

    Before patch:

                        );

                        $post_ids = get_posts( $query_args );

                        $term->count = count( $post_ids );

                    }

    After patch:

         );

                        $post_ids = get_posts( $query_args );

                        if (is_object( $term ) ) {

                            $term->count = count( $post_ids );

                        }

    Kind regards,

    Plugin Author Kento

    (@proaktion)

    @wpuser2624 Thanks, that is very helpful! In 3.8.0 the related code section hasn’t changed so I would expect the same to happen. I think that the change you have there makes sense but I’d like to check if it should be done further up. Taking note to include the improvement in an update.

    Plugin Author Kento

    (@proaktion)

    FYI this has been addressed in the upcoming 3.9.0 release so I’m marking this as resolved

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.