Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter roly151

    (@roly151)

    Hi @kimmyx I don’t have the time to go through all our plugin’s, so I downgraded WP Data Access to 5.4.0 and it now works again.

    Thread Starter roly151

    (@roly151)

    Hi @kimmyx

    Thanks of the reply. We have version 5.5.16 installed. I’ll work through plugin’s and then come back to you, but we have quite a few so it will take some time.

    Not sure if it’s relevant, but we have a multisite, with the plugin activated on the individual site – not network activated.

    Cheers

    I have ultimate member installed and used this plugin to import 1400 users. I am getting a lot of reports of the ‘too many redirects’ error. Given I’ve already done the import, I have set the acui_force_reset_password usermeta key to 0. Will this help solve the redirect issue? Or should I delete the acui_force_reset_password usermeta key all together?

    Thread Starter roly151

    (@roly151)

    Hi,

    I made the change as outlined, activated v9.0.0 of the plugin and it seems to have fixed the problem. We no longer get a fatal error. Thanks for your quick resolution

    Thread Starter roly151

    (@roly151)

    If anyone comes across this issue and needs a solution, here is some code you need to add to your site functions.php or your site plugin. This will register the user earnings when using the import tool to import user points.

    //Gamipress - Register user points when importing points from CSV
    function ofc_insert_user_earning_on_import_points_tool( $user_id, $points, $points_type, $args ) {
    
        if( ! defined( 'DOING_AJAX' ) ) return;
        if( ! DOING_AJAX ) return;
        if( ! isset( $_REQUEST['action'] ) ) return;
        if( $_REQUEST['action'] !== 'gamipress_import_export_points_tool_import' ) return;
    
        $points_type_obj = gamipress_get_points_type( $points_type );
        $award = ( current_filter() === 'gamipress_award_points_to_user' );
    
        //if we are deducting points, then make the points negative
        if( ! $award ) {
            $points *= -1;
        }
    
        $current_total_points = gamipress_get_user_points( $user_id, $points_type);
    
        gamipress_insert_user_earning( $user_id, array(
            'title'         => ( isset( $args['reason'] ) ? $args['reason'] : '' ),
            'post_id'       => $points_type_obj['ID'],
            'post_type'     => 'points-type',
            'points'        => $points - $current_total_points,
            'points_type'   => $points_type,
            'date'          => date( 'Y-m-d H:i:s', current_time( 'timestamp' ) ),
        ) );
    
    }
    add_action( 'gamipress_award_points_to_user', 'ofc_insert_user_earning_on_import_points_tool', 10, 4 );
    add_action( 'gamipress_deduct_points_to_user', 'ofc_insert_user_earning_on_import_points_tool', 10, 4 );
    Thread Starter roly151

    (@roly151)

    Hi @pacogon

    Thankyou for your reply. I have used the template, and the points are imported – but they are not registered on user earnings. In your first picture, in the User Earnings metabox, there is no indication that the user has been awarded points?

    I can use the bulk award tool, which has the option to “Register on User Earnings”. But this option is not available in the import tool. I would also need to type in each user to use this tool, so it’s not ideal for large numbers of users

    It seems strange that I can add points manually and register on the users earnings, I can bulk award and register on user earnings, but the import tool does not provide this option.

Viewing 6 replies - 1 through 6 (of 6 total)