• Resolved Anas

    (@anashannoun)


    Hi There,

    Cool plugin, i really like it.

    One issue, i came across accidently is that if you have the notification component disabled, and any of the notifications options enabled, the plugin would through a Fatal error ever time you try to verify of unverify a member.

    I know it’s a bit far fetched and unlikely that someone would enable the verification notifications settings without enabling the BP or BB notification component. But still a fatal error crash is certainly not the way!

    Fatal error: Uncaught Error: Call to undefined function bp_notifications_add_notification()
    in wp-content\plugins\bp-verified-member\inc\class-bp-verified-member.php on line 1293

    Call stack:

    BP_Verified_Member::create_verified_status_updated_notification()
    wp-includes/class-wp-hook.php:324
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:348
    WP_Hook::do_action()
    wp-includes/plugin.php:517
    do_action()
    wp-content/plugins/bp-verified-member/admin/class-bp-verified-member-admin.php:433
    BP_Verified_Member_Admin::before_update_user_meta()
    wp-includes/class-wp-hook.php:324
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:348
    WP_Hook::do_action()
    wp-includes/plugin.php:517
    do_action()
    wp-includes/meta.php:290
    update_metadata()
    wp-includes/user.php:1199
    update_user_meta()
    wp-content/plugins/bp-verified-member/admin/class-bp-verified-member-admin.php:162
    BP_Verified_Member_Admin::toggle_verified_member()
    wp-includes/class-wp-hook.php:322
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:348
    WP_Hook::do_action()
    wp-includes/plugin.php:517
    do_action()
    wp-admin/admin-ajax.php:192

    That’s because in the function create_verified_status_updated_notification where bp_notifications_add_notification functions is used, there’s no check if the notifications component is enabled.

    I think the check here would be sufficient as opposed to checking when the Notifications options are changed just in case somebody have the notifications disabled and would change their minds in the future.

    Cheers!

    Anas

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Themosaurus

    (@themosaurus)

    Hi Anas,

    Thanks, glad you like the plugin ??

    It may be an edge case but you’re right, having a fatal error is certainly not a normal behavior!

    We have just pushed an update (v1.2.7) that should solve this error, thank you for reporting it.

    Best regards,

    Thread Starter Anas

    (@anashannoun)

    Hi there Themosaurus,

    I just checked the update and can confirm that everything works perfectly. Thank you so much for your time and effort!

    I’m curious if you accept code contributions? I’d love to contribute if you do. There are a couple of features that would be amazing additions to the plugin and would make my and a lot of people’s lives much easier ??

    Cheers!

    Plugin Author Themosaurus

    (@themosaurus)

    Hi Anas,

    Glad that you could confirm the issue is fixed ??

    Thank you, it’s very nice of you to offer your contribution, but unfortunately we have very little time to dedicate to this plugin anymore outside of fixing critical issues so we wouldn’t be able to review and publish your contributions ??

    If you wish to add features to this plugin my advice would be maybe to create a companion plugin to extend the functionality of this one. Another option would be to directly fork and modify this plugin, but as you are probably aware that means you won’t be able to benefit from potential future modifications if we push an update. However, considering my earlier statement about us not having much time to update this plugin, I think it can still be a valid option.

    Hope this helps !

    Best regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Checking if the BuddyPress component is available before using it.’ is closed to new replies.