Forum Replies Created

Viewing 15 replies - 166 through 180 (of 628 total)
  • Forum: Plugins
    In reply to: [Helpful] Error Message
    Plugin Author Pixelbart

    (@pixelbart)

    @locker17

    Hi! Thank you for your feedback.

    Should be fixed with 4.4.42.

    Stay healthy!

    Forum: Plugins
    In reply to: [Helpful] debug.log warning
    Plugin Author Pixelbart

    (@pixelbart)

    @behzadg

    If you want to translate Helpful, you can do it here on WordPress.org. The folders will not exist, because Helpful makes use of WordPress.org.

    Thank you!

    https://translate.wordpress.org/projects/wp-plugins/helpful

    Forum: Plugins
    In reply to: [Helpful] debug.log warning
    Plugin Author Pixelbart

    (@pixelbart)

    @behzadg

    With the latest version, I cleaned the ouput buffer before starting the session. Maybe this solves your problem.

    Forum: Plugins
    In reply to: [Helpful] debug.log warning
    Plugin Author Pixelbart

    (@pixelbart)

    @behzadg

    The problem here is not Helpful, but something else. Helpful does not start any code beforehand. The error message is always shown when something is improperly executed and output before the session is started.

    Solving the problem with Helpful is a bit difficult for me, since not all plugins/themes that use sessions use sessions properly. I’ll see if I can tweak something there anyway.

    Plugin Author Pixelbart

    (@pixelbart)

    @theart8

    Great, glad to hear it! Thank you for your feedback, without your help I might not have made it.

    Have a great day and stay healthy!

    Plugin Author Pixelbart

    (@pixelbart)

    @theart8

    I have now added something in version 4.4.40. You can now set under Helpful > Settings > Details > General whether the user ID should be saved when the user is logged in while voting.

    If you enable this option, you can use the following filter to manipulate the output in the table:

    add_filter('helpful/logs/user_string', function ($user_string, $row) {
        $user = get_user_by('ID', $row->user);
    
        if ( $user ) {
            $user_string = $user->user_login . ' (' . $user->ID . ')';
        }
    
        return $user_string;
    }, PHP_INT_MAX, 2);
    Plugin Author Pixelbart

    (@pixelbart)

    @theart8

    That may be, I can’t tell you for sure. I definitely don’t see any error here. It has to work like this. So the problem here is no longer with Helpful.

    Edit: You can still test if it works with another initialization. Otherwise I can’t think of anything else.

    add_action('init', function () {
        add_filter('helpful_user_string', function ($userstring) {
    
            if (is_user_logged_in()) {
                $user = wp_get_current_user();
                $userstring = $user->user_login . ' (' . $user->ID . ')';
            }
    
            return $userstring;
        }, PHP_INT_MAX, 1);
    
        add_filter('helpful/logs/user_string', function ($user_string, $row) {
            $user_string = $row->user;
            return $user_string;
        }, PHP_INT_MAX, 2);
    });
    • This reply was modified 4 years, 10 months ago by Pixelbart.
    Plugin Author Pixelbart

    (@pixelbart)

    @theart8

    Since there was a problem with prioritization in the previous filter, the problem probably exists with the other filter as well. Therefore here again with an increased prioritization.

    In my tests I have always installed only Helpful and use default themes. There are then no problems here.

    add_filter('helpful_user_string', function ($userstring) {
    
        if (is_user_logged_in()) {
            $user = wp_get_current_user();
            $userstring = $user->user_login . ' (' . $user->ID . ')';
        }
    
       return $userstring; 
    }, PHP_INT_MAX, 1);
    Plugin Author Pixelbart

    (@pixelbart)

    @theart8

    You can’t. This is a random string, no user information is stored there. You see the user only after the last change. Old entries still have the old identifier.

    Plugin Author Pixelbart

    (@pixelbart)

    @theart8

    This is how it has to work. In my tests, it worked flawlessly this way. The logs then showed me what was in the database. I can’t see any error in the code here. It is important that you use the latest version of Helpful.

    You don’t have to do a maintenance, because the change only affects the table for the logs.

    If the logs still say 1, then the filter has a too low priority or another plugin takes effect first.

    The priority would be so to change:

    add_filter('helpful/logs/user_string', function( $user_string, $row ) {
        $user_string = $row->user;
        return $user_string;
    }, PHP_INT_MAX, 2);
    Plugin Author Pixelbart

    (@pixelbart)

    @theart8

    You are right! With version 4.4.39 you can additionally put the following in functions.php to show the string from the database:

    add_filter('helpful/logs/user_string', function( $user_string, $row ) {
        $user_string = $row->user;
        return $user_string;
    }, 10, 2);
    Plugin Author Pixelbart

    (@pixelbart)

    @theart8

    Helpful itself doesn’t offer you a way to do this, you have to build your own. But Helpful offers you a few functions with which you can change the Helpful user. But then you only see in the Helpful logs who has done what.

    Helpful does not store any personal data, so there are no problems with data protection.

    (functions.php):

    /**
     * @param string $userstring
     */
    add_filter('helpful_user_string', function ($userstring) {
    
        if (is_user_logged_in()) {
            $user = wp_get_current_user();
            $userstring = $user->user_login . ' (' . $user->ID . ')';
        }
    
       return $userstring; 
    });
    Plugin Author Pixelbart

    (@pixelbart)

    @umairrazzaq-1

    Perfect. Here’s a little WordPress tip to save you another loop one there:

    $ids = wp_list_pluck(helpful_get_most_helpful(5, 'post'), 'ID');

    • This reply was modified 4 years, 10 months ago by Pixelbart.
    Plugin Author Pixelbart

    (@pixelbart)

    @umairrazzaq-1

    Thanks for your feedback!

    I just ran an update. You can now use two functions in PHP that will give you the necessary content in an array. This function is also used by the widget in the dashboard. Maybe this will help you.

    5 most helpful posts from post type post
    helpful_get_most_helpful(5, 'post');

    5 least helpful posts from post type post
    helpful_get_least_helpful(5, 'post');

    https://github.com/pixelbart/helpful/releases/tag/4.4.37

    Plugin Author Pixelbart

    (@pixelbart)

    @thomascheah

    This was not possible until now. Now you can use the following shortcodes:

    For the current post: [helpful-feedback]
    For any post (ID): [helpful-feedback post=”12345″]
    With gravatars: [helpful-feedback gravatar=”1″]

    Thank you for your feedback!

Viewing 15 replies - 166 through 180 (of 628 total)