Hi @szpansky,
As you have discovered, if you modify the database directly, you will have problems. There might be other problems caused by this in addition to the ranks not being updated, even though they aren’t apparent (yet).
I’d suggest when you need to manually update a user’s points, that you do it on their user profile screen in the admin. That will trigger the code that is necessary to update the ranks.
If you’d rather not use that screen in this case, would you mind explaining why not? What is your use-case?
If nothing else, I would suggest at least using the wordpoints_alter_points()
function, which will call the correct triggers.
If you feel that you must alter the points directly in the database, you could call the wordpoints_alter_points
action:
do_action( 'wordpoints_points_altered', $user_id, $points, $points_type, $log_type, $meta, $log_id );
But I strongly recommend against this, it is better to use the function that WordPoints provides.