• Resolved Chad Hayton

    (@chadhayton)


    Thanks for the great plugin. We are implementing the premium DA Reactions plugin on on a site and need to be able to allow users to “un-react” to a post. Currently, however, when a user attempts to unreact they get a pop-up message that states “Cannot remove reaction”.

    By reviewing the plugin code, I can see there is supposed to be a checkbox in admin that allows me to enable and disable this functionality by setting a “user_can_remove_reaction” option within the “da-reactions_general” option in wp_options. I am unable to locate the setting checkbox in the admin, so I went ahead and manually added into the serialized array in the “da-reactions_general” option (not ideal, I know) so the associative array has an element named “user_can_remove_reaction” with a value of “on” (see below):

    Array
    (
    [page_type_single] => off
    [id_method_cookie] => on
    [user_can_change_reaction] => on
    [enable_internal_cache] => off
    [post_type_page] => off
    [post_type_page_comments] => off
    [post_type_attachment] => off
    [post_type_attachment_comments] => off
    [post_type_designate] => off
    [post_type_event] => off
    [post_type_event_comments] => off
    [page_type_archive] => off
    [page_type_blog] => off
    [chart_colors] => icons
    [post_type_social_like_content_disable_5456] => off
    [post_type_social_like_content_disable_5464] => off
    [post_type_homepage_content] => off
    [post_type_homepage_content_enable_52] => off
    [post_type_post] => off
    [post_type_post_comments] => off
    [post_type_post_enable_5322] => off
    [post_type_post_enable_comments_5322] => off
    [post_type_social_like_content_disable_5466] => off
    [post_type_social_like_content_disable_5463] => off
    [post_type_social_like_content_disable_5468] => off
    [post_type_social_like_content] => on
    [post_type_social_like_content_disable_5455] => off
    [user_can_remove_reaction] => on
    )

    When I make this change I see the following behaviors:

    • If “user_can_remove_reaction” is set to “on”, I am able to remove reactions from the first 2 of the 4 available reactions. The 3rd and 4th reactions do not allow me to remove the reaction.
    • If I change “user_can_remove_reaction” to “off” again, I notice that the “Cannot remove reaction” also only appears on the first two elements.

    The second two reactions are custom reactions, and the first two are presets from the plugin. Could that be contributing to this behavior somhow?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Daniele Alessandra

    (@danielealessandra)

    Hi Chad,

    Thank you for using DA Reactions, and for taking the time to provide such detailed feedback—it’s greatly appreciated.

    To enable or disable the ability for users to “un-react” to a post, you already found the correct place in your database, however you should find the relevant option in the plugin settings under Reactions > General Settings > User:

    [Your Site's Domain]/wp-admin/admin.php?page=da-reactions_general_settings&tab=user

    Regarding the issue you’re experiencing: the reactions are not designed to behave differently based on whether they are presets or custom ones, so this behavior is unexpected. While I haven’t encountered this issue before, I’ll attempt to reproduce your use case on my end to better understand the problem.

    In the past, we’ve had a similar issue that was related to Unicode characters in reaction labels, but this was resolved in a prior release. Based on your description, this doesn’t immediately seem to be the same issue, but I’ll investigate further.

    It would also be helpful to take a closer look at your specific site setup or receive additional details about your reactions. If possible, feel free to send a screenshot of the reactions setup or any other relevant information to [email protected].

    If this turns out to be a bug, we hope to identify and resolve it in time for the next plugin release, scheduled for the next couple of weeks.

    Thank you again for bringing this to our attention! Let me know if you need further assistance in the meantime.

    Best regards,
    Daniele Alessandra

    Thread Starter Chad Hayton

    (@chadhayton)

    Daniele,

    Thank you for your quick reply. When I go to the users tab I only see one checkbox option: “Restrict reactions usage for user roles”. When I click on “Enable restrictions” the page displays the following PHP error message:

    Fatal error: Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class DaReactions\Pages\GeneralSettings does not have a method "renderUserRoleSelector__premium_only" in /app/wp-admin/includes/template.php:1836 Stack trace: #0 /app/wp-admin/includes/template.php(1790): do_settings_fields('da-reactions_ge...', 'user_section') #1 /app/wp-content/plugins/da-reactions-premium/classes/DaReactions/Pages/SettingsPage.php(67): do_settings_sections('da-reactions_ge...') #2 /app/wp-includes/class-wp-hook.php(324): DaReactions\Pages\SettingsPage->displayPage('') #3 /app/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #4 /app/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #5 /app/wp-admin/admin.php(259): do_action('reactions_page_...') #6 {main} thrown in /app/wp-admin/includes/template.php on line 1836

    I do see the renderUserRoleSelector__premium_only callback invoked in an add_settings_field function, but I’m not finding it anywhere else in the plugin code.

    Best,
    Chad–

    • This reply was modified 1 month, 3 weeks ago by Chad Hayton.
    Plugin Author Daniele Alessandra

    (@danielealessandra)

    Hello Chad, the error is weird, something is missing here.

    It looks like you are running the free version of the plugin along with the premium version (all functions with suffix __premium_only are stripped out from free version).

    Please download latest zip file from your Freemius dashboard: https://users.freemius.com/

    If you experience difficulties logging to your Freemius panel I could send you the zip file directly, but on a private mail.

    Thread Starter Chad Hayton

    (@chadhayton)

    Thanks, Deniele. We re-downloaded the plugin at freemius.com and replaced the plugin (v5.2.1), but continue to get the same error:
    PHP Fatal error:? Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class DaReactions\\Pages\\GeneralSettings does not have a method "renderUserRoleSelector__premium_only".

    When I do a search for renderUserRoleSelector__premium_only I only find the that method referenced in classes/DaReactions/Pages/GeneralSettings.php (see below):

    grep -R renderUserRoleSelector__premium_only * classes/DaReactions/Pages/GeneralSettings.php: array( $this, 'renderUserRoleSelector__premium_only' )

    When I look in that file, it is just the add_settings_field call that references the missing function. I can’t find it anywhere else:

            add_settings_field(
                'da_r_user_types',
                __( 'Enable reactions for this kind of users', 'da-reactions' ),
                array( $this, 'renderUserRoleSelector__premium_only' ),
                $this->options_page,
                $section,
                array(
                    'class' => 'user_type_selector'
                )
            );

    Is there a more recent release version than 5.2.1 we should be using? I will email directly if you want to send us a fresh plugin to try. Thank you for all of your help.

    Thread Starter Chad Hayton

    (@chadhayton)

    Thanks for sending the corrected plugin. Everything is working as expected now. We appreciate your quick help.

    Plugin Author Daniele Alessandra

    (@danielealessandra)

    Thank you for reporting the bug, feel free to contact me anytime.

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