angelleye / IfThenGive

Event based donations. If {event occurs} Then Give $x.
GNU General Public License v3.0
3 stars 0 forks source link

Large number of donations processing correctly? #78

Closed angelleye closed 6 years ago

angelleye commented 6 years ago

I want to make sure we've tested a large number of donations being processed at once. We need to make sure we don't run into timeout issues or anything like we have on other projects. This is EXTREMELY important!

tejasm-itpath commented 6 years ago

@angelleye I have tested with 500 records and It is working properly Still need to test on the shared hosting servers

tejasm-itpath commented 6 years ago
 for ($i=0; $i < 10; $i++) { 
            $userdata=array(
                    'user_pass' => md5('admin'),
                    'user_login' => 'tejasm+'.$i.'@itpathsolutions.co.in',
                    'user_email' => 'tejasm+'.$i.'@itpathsolutions.co.in',
                    'display_name' => 'Test Testerson',
                    'first_name' => 'Test',
                    'last_name' => 'Testerson',
                    'role' => 'giver'
            );
         $user_id = wp_insert_user($userdata);

        update_user_meta($user_id,'itg_gec_email', 'tejasm-buyer@itpathsolutions.co.in');
        update_user_meta($user_id,'itg_gec_payer_id','WKL7GGT96W7C8');
        update_user_meta($user_id,'itg_gec_first_name','test');
        update_user_meta($user_id,'itg_gec_last_name','buyer');
        update_user_meta($user_id,'itg_gec_country_code','US');
        update_user_meta($user_id,'itg_gec_currency_code','USD');
        update_user_meta($user_id,'itg_guest_user','no');
        update_user_meta($user_id,'itg_gec_billing_agreement_id','B-07839353X70285923');
        update_user_meta($user_id,'itg_signedup_goals','71');

         $post_id = wp_insert_post(array('post_title'=>'User ID : '.$user_id.'&amp; Goal ID : 71','post_name'=>'user-id-'.$user_id.'-goal-id-71','post_type'=>'give_when_sign_up','post_status'=>'publish','post_author'=>$user_id));
         $unique = true;
         add_post_meta($post_id, 'itg_signup_amount', '50.00', $unique);
         add_post_meta($post_id, 'itg_signup_wp_user_id', $user_id, $unique);
         add_post_meta($post_id, 'itg_signup_wp_goal_id', '71', $unique);
         add_post_meta($post_id, 'itg_signup_in_sandbox', 'yes');
         add_post_meta($post_id,'itg_transaction_status','0');
        }
tejasm-itpath commented 6 years ago

Above is the code that dynamic insert users and goals with n numbers of data.