• Resolved Ov3rfly

    (@ov3rfly)


    PHP Fatal Error occurs when updating a user in WordPress below 5.8:

    [25-Nov-2024 08:11:48 UTC] PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function SimpleWpMembership::sync_with_wp_profile(), 2 passed in /xx/wp-includes/class-wp-hook.php on line 287 and exactly 3 expected in /xx/wp-content/plugins/simple-membership/classes/class.simple-wp-membership.php:538
    Stack trace:
    #0 /xx/wp-includes/class-wp-hook.php(287): SimpleWpMembership->sync_with_wp_profile(106, Object(WP_User))
    #1 /xx/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)
    #2 /xx/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
    #3 /xx/wp-includes/user.php(2087): do_action('profile_update', 106, Object(WP_User))
    #4 /xx/wp-includes/user.php(2206): wp_insert_user(Array)
    #5 /xx/wp-content/plugins/simple-membership/classes/class.swpm-utils.php(278): wp_update_user(Array)
    #6 /xx/wp-content/plugins/simple-membership/classes/class.swpm-front-registration.php(583): SwpmUtils::update_wp_user('username', Array)
    ...

    Reason is this change in WordPress 5.8 at profile_update action:

     * @since 5.8.0 The $userdata parameter was added.

    Possible fix in file classes/class.simple-wp-membership.php line 538:

    old:
    public function sync_with_wp_profile($wp_user_id, $old_user_data, $userdata) {

    new:
    public function sync_with_wp_profile($wp_user_id, $old_user_data, $userdata = array()) {

    Plugin data states compatibility “WordPress version 5.0 or higher”, this includes WordPress below 5.8.

    Simple Membership 4.5.7, WordPress 5.6.14

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support mbrsolution

    (@mbrsolution)

    Thank you for reaching out to us. I have submitted a message to the developers to investigate further your issue.

    Kind regards.

    Thread Starter Ov3rfly

    (@ov3rfly)

    The problem is there since Simple Membership 4.4.7.

    Plugin Author wp.insider

    (@wpinsider-1)

    Hi, The WordPress version you are using is too outdated. We do not support old versions unfortunately.

    The best option is to upgrade everything to latest. If you cannot upgrade your WordPress to latest version for some reason, then you cannot upgrade our plugin to latest either (the newer versions won’t be compatible with super old version of WordPress).

    Thread Starter Ov3rfly

    (@ov3rfly)

    Plugin data states compatibility “WordPress version 5.0 or higher”, this includes WordPress below 5.8.

    === Simple Membership ===
    Contributors: smp7, wp.insider
    Donate link: https://simple-membership-plugin.com/
    Tags: member, members, …
    Requires at least: 5.0
    Requires PHP: 7.4
    Tested up to: 6.7
    Stable tag: 4.5.7

    readme.txt

    Plugin description:

    View post on imgur.com

    Please fix the issue or the plugin compatibility data.

    Plugin Author mra13

    (@mra13)

    We’ll update the compatibility information. We hadn’t encountered this situation before, as we didn’t have users on such an old version of WordPress. This was an oversight on our part, and we will update the readme file.

    Thread Starter Ov3rfly

    (@ov3rfly)

    Thanks. But also note that about 46% of your active userbase is still back in older Simple Membership 4.4.x and earlier branches and probably also older WordPress. Breaking changes in plugin updates without small backwards compatibility adjustments (e.g. as suggested in the possible fix above in this case) might keep people from updating anything after they were once “burned” by a non functioning site after a WordPress and/or plugin update. No reply expected, just letting you know our observations.

    Plugin Author wp.insider

    (@wpinsider-1)

    Yes, the requested change is minor and won’t cause any other issues, so I will include it in our plugin’s next release. However, please note that we still cannot guarantee compatibility with very old versions of WordPress.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.