Pixelbart
Forum Replies Created
-
Forum: Plugins
In reply to: [Helpful] Error MessageForum: Plugins
In reply to: [Helpful] debug.log warningIf 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!
Forum: Plugins
In reply to: [Helpful] debug.log warningWith 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 warningThe 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.
Forum: Plugins
In reply to: [Helpful] Find out who voted whatGreat, 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!
Forum: Plugins
In reply to: [Helpful] Find out who voted whatI 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);Forum: Plugins
In reply to: [Helpful] Find out who voted whatThat 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.
Forum: Plugins
In reply to: [Helpful] Find out who voted whatSince 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);Forum: Plugins
In reply to: [Helpful] Find out who voted whatYou 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.
Forum: Plugins
In reply to: [Helpful] Find out who voted whatThis 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);Forum: Plugins
In reply to: [Helpful] Find out who voted whatYou 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);Forum: Plugins
In reply to: [Helpful] Find out who voted whatHelpful 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; });Forum: Plugins
In reply to: [Helpful] Show posts based on top pros (yes)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.
Forum: Plugins
In reply to: [Helpful] Show posts based on top pros (yes)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');Forum: Plugins
In reply to: [Helpful] How to display feedback in a pageThis 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!