Changeset 3344089
- Timestamp:
- 08/13/2025 01:21:18 PM (8 months ago)
- Location:
- kb-sms-gateway
- Files:
-
- 31 added
- 13 edited
-
tags/1.5 (added)
-
tags/1.5/assets (added)
-
tags/1.5/assets/kb-admin (added)
-
tags/1.5/assets/kb-admin/kb-admin-settings.css (added)
-
tags/1.5/assets/kb-admin/kd-admin-settings.js (added)
-
tags/1.5/assets/kb-front (added)
-
tags/1.5/assets/kb-front/kb-front.css (added)
-
tags/1.5/includes (added)
-
tags/1.5/includes/kb-admin-settings.php (added)
-
tags/1.5/includes/kb-admin-tab (added)
-
tags/1.5/includes/kb-admin-tab/kb-admin-nav.php (added)
-
tags/1.5/includes/kb-admin-tab/kb-admin-tab-content.php (added)
-
tags/1.5/includes/kb-admin-tab/tab-section (added)
-
tags/1.5/includes/kb-admin-tab/tab-section/kb-bulk-sms.php (added)
-
tags/1.5/includes/kb-admin-tab/tab-section/kb-notify-sms.php (added)
-
tags/1.5/includes/kb-admin-tab/tab-section/kb-single-sms.php (added)
-
tags/1.5/includes/kb-admin-tab/tab-section/kb-sms-logs-template.php (added)
-
tags/1.5/includes/kb-api-settings.php (added)
-
tags/1.5/includes/kb-assets-file.php (added)
-
tags/1.5/includes/kb-otp-system (added)
-
tags/1.5/includes/kb-otp-system.php (added)
-
tags/1.5/includes/kb-otp-system/kb-otp-handler.php (added)
-
tags/1.5/includes/kb-otp-system/kb-otp-login-form.php (added)
-
tags/1.5/includes/kb-sms-logs.php (added)
-
tags/1.5/includes/kb-woow-settings.php (added)
-
tags/1.5/kb-sms-gateway.php (added)
-
tags/1.5/readme.txt (added)
-
trunk/includes/kb-admin-settings.php (modified) (2 diffs)
-
trunk/includes/kb-admin-tab/kb-admin-nav.php (modified) (1 diff)
-
trunk/includes/kb-admin-tab/kb-admin-tab-content.php (modified) (1 diff)
-
trunk/includes/kb-admin-tab/tab-section/kb-bulk-sms.php (modified) (1 diff)
-
trunk/includes/kb-admin-tab/tab-section/kb-notify-sms.php (modified) (1 diff)
-
trunk/includes/kb-admin-tab/tab-section/kb-single-sms.php (modified) (3 diffs)
-
trunk/includes/kb-admin-tab/tab-section/kb-sms-logs-template.php (modified) (1 diff)
-
trunk/includes/kb-api-settings.php (modified) (3 diffs)
-
trunk/includes/kb-assets-file.php (modified) (1 diff)
-
trunk/includes/kb-otp-system (added)
-
trunk/includes/kb-otp-system.php (added)
-
trunk/includes/kb-otp-system/kb-otp-handler.php (added)
-
trunk/includes/kb-otp-system/kb-otp-login-form.php (added)
-
trunk/includes/kb-sms-logs.php (modified) (1 diff)
-
trunk/includes/kb-woow-settings.php (modified) (1 diff)
-
trunk/kb-sms-gateway.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kb-sms-gateway/trunk/includes/kb-admin-settings.php
r3342403 r3344089 1 <?php 1 <?php 2 /** 3 * Admin Settings & Multiple Form 4 * 5 * @package Khudebarta SMS Gateway 6 * @version 1.0 7 * @author GrayWP 8 */ 2 9 3 10 // Admin Page Menu … … 96 103 <li><code>{order_id}</code> - <strong><?php esc_html_e('Order number', 'kb-sms-gateway'); ?></strong></li> 97 104 <li><code>{order_total}</code> - <strong><?php esc_html_e('Total amount of the order', 'kb-sms-gateway'); ?></strong></li> 105 <li><code>{product_list}</code> - <strong><?php esc_html_e('Product List & Quantity', 'kb-sms-gateway'); ?></strong></li> 106 <li><code>{site_url}</code> - <strong><?php esc_html_e('Show Website URL', 'kb-sms-gateway'); ?></strong></li> 98 107 </ul> 99 108 <p><?php esc_html_e('4. ', 'kb-sms-gateway'); ?><strong><?php esc_html_e('Save settings', 'kb-sms-gateway'); ?></strong><?php esc_html_e(' to activate SMS notifications.', 'kb-sms-gateway'); ?></p> 109 <p><?php esc_html_e('OTP Login Form: Use this Shortcode', 'kb-sms-gateway'); ?></p><b>[kb-custom-login-form]</b><p><?php esc_html_e('for secure OTP-based login.', 'kb-sms-gateway'); ?></p> 110 100 111 </div> 101 112 -
kb-sms-gateway/trunk/includes/kb-admin-tab/kb-admin-nav.php
r3342403 r3344089 1 <?php 1 <?php 2 /** 3 * Admin Nav Template 4 * 5 * @package Khudebarta SMS Gateway 6 * @version 1.0 7 * @author GrayWP 8 */ 9 2 10 //superglobal array variable for parameter 3 11 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -
kb-sms-gateway/trunk/includes/kb-admin-tab/kb-admin-tab-content.php
r3342403 r3344089 1 <?php 1 <?php 2 2 /** 3 * Khudebarta Admin Content Template 4 * Verison: 1.0 3 * Admin Content Template 4 * 5 * @package Khudebarta SMS Gateway 6 * @version 1.0 7 * @author GrayWP 5 8 */ 6 9 ?> 7 8 10 9 11 <!-- Main Settings --> -
kb-sms-gateway/trunk/includes/kb-admin-tab/tab-section/kb-bulk-sms.php
r3342403 r3344089 1 <?php if ( $nav_menu == 'bulk') : ?> 1 <?php 2 /** 3 * Bulk SMS Sections 4 * 5 * @package Khudebarta SMS Gateway 6 * @version 1.0 7 * @author GrayWP 8 */ 9 ?> 2 10 3 <?php 11 <?php if ( $nav_menu == 'bulk') : ?> 4 12 5 if(isset($_POST['kbsgp_bulk_sms_send']) && check_admin_referer('kb_bulk_sms_send_action', 'kb_bulk_sms_send_nonce')){ 13 <?php 14 15 if(isset($_POST['kbsgp_bulk_sms_send']) && check_admin_referer('kb_bulk_sms_send_action', 'kb_bulk_sms_send_nonce')){ 6 16 7 17 8 $message_area = isset($_POST['kbsgp_bulk_sms_text']) ? sanitize_text_field( wp_unslash( $_POST['kbsgp_bulk_sms_text'] ) ) : '';9 $checkbox_select = isset($_POST['kbsgp_bulk_all_customers']) && $_POST['kbsgp_bulk_all_customers'] === 'yes';18 $message_area = isset($_POST['kbsgp_bulk_sms_text']) ? sanitize_text_field( wp_unslash( $_POST['kbsgp_bulk_sms_text'] ) ) : ''; 19 $checkbox_select = isset($_POST['kbsgp_bulk_all_customers']) && $_POST['kbsgp_bulk_all_customers'] === 'yes'; 10 20 11 $customer_phones = [];21 $customer_phones = []; 12 22 13 if($checkbox_select){14 // Get all woocommercece customer phone numbers15 $customers = get_users(['role_in' => ['customer']]);23 if($checkbox_select){ 24 // Get all woocommercece customer phone numbers 25 $customers = get_users(['role_in' => ['customer']]); 16 26 17 foreach($customers as $customer){ 18 $phone_number = get_user_meta($customer->ID, 'billing_phone', true); 19 if(!empty($phone_number)){ 20 $customer_phones[] = $phone_number; 21 } 22 } 23 }else{ 24 $customer_bulk_phones = isset($_POST['kbsgp_bulk_sms_phones']) ? sanitize_text_field( wp_unslash( $_POST['kbsgp_bulk_sms_phones'] ) ) : ''; 25 $customer_phones = preg_split('/[\s,]+/', $customer_bulk_phones, -1, PREG_SPLIT_NO_EMPTY); 26 } 27 28 29 30 $total_count = 0; 31 32 foreach($customer_phones as $phone){ 33 $sms_sent = KBSGP_MAIN_SMS::send_sms(trim($phone),$message_area); 34 if($sms_sent){ 35 $total_count++; 36 // SMS Log send to Database 37 kbsgp_insert_sms_log( $phone, $message_area, 'Sent', 'Bulk SMS' ); 38 }else{ 39 // SMS Log send to Database 40 kbsgp_insert_sms_log( $phone, $message_area, 'Failed', 'Bulk SMS' ); 27 foreach($customers as $customer){ 28 $phone_number = get_user_meta($customer->ID, 'billing_phone', true); 29 if(!empty($phone_number)){ 30 $customer_phones[] = $phone_number; 41 31 } 42 32 } 33 }else{ 34 $customer_bulk_phones = isset($_POST['kbsgp_bulk_sms_phones']) ? sanitize_text_field( wp_unslash( $_POST['kbsgp_bulk_sms_phones'] ) ) : ''; 35 $customer_phones = preg_split('/[\s,]+/', $customer_bulk_phones, -1, PREG_SPLIT_NO_EMPTY); 36 } 37 38 43 39 44 if ($total_count > 0) { 45 echo '<div class="notice notice-success is-dismissible"><p>' 46 . esc_html( 47 sprintf( 48 /* translators: %d: number of SMS messages sent */ 49 _n( 50 'Sent %d SMS successfully.', 51 'Sent %d SMS successfully.', 52 $total_count, 53 'kb-sms-gateway' 54 ), 55 $total_count 56 ) 40 $total_count = 0; 41 42 foreach($customer_phones as $phone){ 43 $sms_sent = KBSGP_MAIN_SMS::send_sms(trim($phone),$message_area); 44 if($sms_sent){ 45 $total_count++; 46 // SMS Log send to Database 47 kbsgp_insert_sms_log( $phone, $message_area, 'Sent', 'Bulk SMS' ); 48 }else{ 49 // SMS Log send to Database 50 kbsgp_insert_sms_log( $phone, $message_area, 'Failed', 'Bulk SMS' ); 51 } 52 } 53 54 if ($total_count > 0) { 55 echo '<div class="notice notice-success is-dismissible"><p>' 56 . esc_html( 57 sprintf( 58 /* translators: %d: number of SMS messages sent */ 59 _n( 60 'Sent %d SMS successfully.', 61 'Sent %d SMS successfully.', 62 $total_count, 63 'kb-sms-gateway' 64 ), 65 $total_count 57 66 ) 58 . '</p></div>'; 59 } else { 60 echo '<div class="notice notice-error is-dismissible"><p>' 61 . esc_html('Failed to send SMS. Please try again.', 'kb-sms-gateway') 62 . '</p></div>'; 63 } 67 ) 68 . '</p></div>'; 69 } else { 70 echo '<div class="notice notice-error is-dismissible"><p>' 71 . esc_html('Failed to send SMS. Please try again.', 'kb-sms-gateway') 72 . '</p></div>'; 73 } 64 74 65 75 66 };?>76 };?> 67 77 68 <!-- Bulk SMS Settings -->69 <div class="kb-main__section-one">70 <div class="kb-main__form">71 <h2 class="kb-main__title"><?php esc_html_e('Bulk SMS', 'kb-sms-gateway');?></h2>78 <!-- Bulk SMS Settings --> 79 <div class="kb-main__section-one"> 80 <div class="kb-main__form"> 81 <h2 class="kb-main__title"><?php esc_html_e('Bulk SMS', 'kb-sms-gateway');?></h2> 72 82 73 <form method="post">74 75 <?php wp_nonce_field('kb_bulk_sms_send_action', 'kb_bulk_sms_send_nonce');?>83 <form method="post"> 84 85 <?php wp_nonce_field('kb_bulk_sms_send_action', 'kb_bulk_sms_send_nonce');?> 76 86 77 <table class="form-table">78 <tr>79 <th scope="row"><?php esc_html_e('Phone Numbers', 'kb-sms-gateway');?></th>80 <td>81 <textarea name="kbsgp_bulk_sms_phones" rows="5" cols="50" placeholder="<?php esc_attr_e('Type or paste numbers separated by comma, space, or newline', 'kb-sms-gateway');?>"></textarea>82 </td>83 </tr>84 <tr>85 <th scope="row"><?php esc_html_e('Message', 'kb-sms-gateway');?></th>86 <td>87 <textarea name="kbsgp_bulk_sms_text" rows="4" cols="50" placeholder="<?php esc_attr_e('Type your message here', 'kb-sms-gateway');?>"></textarea>88 </td>89 </tr>90 <tr>91 <th scope="row"><?php esc_html_e('Send to All Customers', 'kb-sms-gateway'); ?></th>92 <td>93 <label>94 <input type="checkbox" name="kbsgp_bulk_all_customers" value="yes">95 <?php esc_html_e('Yes, send this message to all WooCommerce customers', 'kb-sms-gateway'); ?>96 </label>97 </td>98 </tr>87 <table class="form-table"> 88 <tr> 89 <th scope="row"><?php esc_html_e('Phone Numbers', 'kb-sms-gateway');?></th> 90 <td> 91 <textarea name="kbsgp_bulk_sms_phones" rows="5" cols="50" placeholder="<?php esc_attr_e('Type or paste numbers separated by comma, space, or newline', 'kb-sms-gateway');?>"></textarea> 92 </td> 93 </tr> 94 <tr> 95 <th scope="row"><?php esc_html_e('Message', 'kb-sms-gateway');?></th> 96 <td> 97 <textarea name="kbsgp_bulk_sms_text" rows="4" cols="50" placeholder="<?php esc_attr_e('Type your message here', 'kb-sms-gateway');?>"></textarea> 98 </td> 99 </tr> 100 <tr> 101 <th scope="row"><?php esc_html_e('Send to All Customers', 'kb-sms-gateway'); ?></th> 102 <td> 103 <label> 104 <input type="checkbox" name="kbsgp_bulk_all_customers" value="yes"> 105 <?php esc_html_e('Yes, send this message to all WooCommerce customers', 'kb-sms-gateway'); ?> 106 </label> 107 </td> 108 </tr> 99 109 100 </table> 101 <input type="submit" name="kbsgp_bulk_sms_send" class="button-primary" value="Send Bulk Message"> 102 </form> 103 </div> 110 </table> 111 <input type="submit" name="kbsgp_bulk_sms_send" class="button-primary" value="Send Bulk Message"> 112 </form> 104 113 </div> 105 <!-- End Bulk SMS Settings --> 106 <?php endif;?> 114 </div> 115 <!-- End Bulk SMS Settings --> 116 <?php endif;?> -
kb-sms-gateway/trunk/includes/kb-admin-tab/tab-section/kb-notify-sms.php
r3342651 r3344089 1 <?php if ( $nav_menu == 'notify') : ?> 2 <!-- Main Settings --> 3 <div class="kb-main__section-one"> 4 <div class="kb-main__form"> 5 <h2 class="kb-main__title"><?php esc_html_e('Notifications', 'kb-sms-gateway');?></h2> 6 <!-- Main Form --> 7 <form action="options.php" method="post"> 8 <?php settings_fields('kbsgp_woow_settings');?> <!-- Security Field --> 9 <?php do_settings_sections('kbsgp_woow_settings');?> <!-- Register Settings Field --> 10 <table class="form-table"> 1 <?php 2 /** 3 * Notify SMS Sections 4 * 5 * @package Khudebarta SMS Gateway 6 * @version 1.0 7 * @author GrayWP 8 */ 9 ?> 11 10 12 <tr> 13 <th scope="row"><?php esc_html_e('Enable Admin Notifications?', 'kb-sms-gateway');?></th> 14 <td> <input type="checkbox" name="kbsgp_enable_admin_notify" value="1" <?php checked(get_option('kbsgp_enable_admin_notify'), '1');?> ></td> 15 </tr> 16 17 <tr> 18 <th scope="row"><?php esc_html_e('Enable Global Message?', 'kb-sms-gateway');?></th> 19 <td> <input type="checkbox" name="kbsgp_enable_woow_order" value="1" <?php checked(get_option('kbsgp_enable_woow_order'), '1');?> ></td> 20 </tr> 21 <tr> 22 <th scope="row"><?php esc_html_e('Order SMS Form', 'kb-sms-gateway');?></th> 23 <td> 24 <textarea name="kbsgp_woow_order_message" rows="4" cols="50"><?php echo esc_textarea(get_option('kbsgp_woow_order_message', 'Thank you {customer_name}, your order #{order_id} has been received.'));?></textarea> 25 <p class="description"> <?php esc_html_e('You can use tags', 'kb-sms-gateway'); ?> <code>{customer_name}</code> <code>{order_id}</code> <code>{order_total}</code> <code>{product_list}</code> <code>{site_url}</code> <?php esc_html_e('for sending specific notificaitons.', 'kb-sms-gateway'); ?></p> 26 27 </td> 28 </tr> 11 <?php if ( $nav_menu == 'notify') : ?> 12 <!-- Main Settings --> 13 <div class="kb-main__section-one"> 14 <div class="kb-main__form"> 15 <h2 class="kb-main__title"><?php esc_html_e('Notifications', 'kb-sms-gateway');?></h2> 16 <!-- Main Form --> 17 <form action="options.php" method="post"> 18 <?php settings_fields('kbsgp_woow_settings');?> <!-- Security Field --> 19 <?php do_settings_sections('kbsgp_woow_settings');?> <!-- Register Settings Field --> 20 <table class="form-table"> 29 21 30 <!-- SMS For Completed --> 31 <tr> 32 <th scope="row"><?php esc_html_e('Enable SMS for Completed?', 'kb-sms-gateway');?></th> 33 <td> <input type="checkbox" name="kbsgp_enable_woow_complete" value="1" <?php checked(get_option('kbsgp_enable_woow_complete'), '1');?> ></td> 34 </tr> 35 <tr> 36 <th scope="row"><?php esc_html_e('Message for Order Complete', 'kb-sms-gateway');?></th> 37 <td> 38 <textarea name="kbsgp_woow_complete_message" rows="4" cols="50"><?php echo esc_textarea(get_option('kbsgp_woow_complete_message', 'Hi {customer_name} your order #{order_id} is complete.'));?></textarea> 39 <p class="description"> <?php esc_html_e('You can use tags', 'kb-sms-gateway'); ?> <code>{customer_name}</code> <code>{order_id}</code> <code>{order_total}</code> <code>{product_list}</code> <code>{site_url}</code> <?php esc_html_e('for sending specific notificaitons.', 'kb-sms-gateway'); ?></p> 40 41 </td> 42 </tr> 22 <tr> 23 <th scope="row"><?php esc_html_e('Enable Admin Notifications?', 'kb-sms-gateway');?></th> 24 <td> <input type="checkbox" name="kbsgp_enable_admin_notify" value="1" <?php checked(get_option('kbsgp_enable_admin_notify'), '1');?> ></td> 25 </tr> 26 27 <tr> 28 <th scope="row"><?php esc_html_e('Enable Global Message?', 'kb-sms-gateway');?></th> 29 <td> <input type="checkbox" name="kbsgp_enable_woow_order" value="1" <?php checked(get_option('kbsgp_enable_woow_order'), '1');?> ></td> 30 </tr> 31 <tr> 32 <th scope="row"><?php esc_html_e('Order SMS Form', 'kb-sms-gateway');?></th> 33 <td> 34 <textarea name="kbsgp_woow_order_message" rows="4" cols="50"><?php echo esc_textarea(get_option('kbsgp_woow_order_message', 'Thank you {customer_name}, your order #{order_id} has been received.'));?></textarea> 35 <p class="description"> <?php esc_html_e('You can use tags', 'kb-sms-gateway'); ?> <code>{customer_name}</code> <code>{order_id}</code> <code>{order_total}</code> <code>{product_list}</code> <code>{site_url}</code> <?php esc_html_e('for sending specific notificaitons.', 'kb-sms-gateway'); ?></p> 36 37 </td> 38 </tr> 43 39 44 <!-- SMS For Process-->45 <tr>46 <th scope="row"><?php esc_html_e('Enable SMS for Process?', 'kb-sms-gateway');?></th>47 <td> <input type="checkbox" name="kbsgp_enable_woow_proccess" value="1" <?php checked(get_option('kbsgp_enable_woow_proccess'), '1');?> ></td>48 </tr>49 <tr>50 <th scope="row"><?php esc_html_e('Message for Order Process', 'kb-sms-gateway');?></th>51 <td>52 <textarea name="kbsgp_woow_process_message" rows="4" cols="50"><?php echo esc_textarea(get_option('kbsgp_woow_process_message', 'Hi {customer_name} your order #{order_id} is Processing.'));?></textarea>53 <p class="description"> <?php esc_html_e('You can use tags', 'kb-sms-gateway'); ?> <code>{customer_name}</code> <code>{order_id}</code> <code>{order_total}</code> <code>{product_list}</code> <code>{site_url}</code><?php esc_html_e('for sending specific notificaitons.', 'kb-sms-gateway'); ?></p>54 55 </td>56 </tr>40 <!-- SMS For Completed --> 41 <tr> 42 <th scope="row"><?php esc_html_e('Enable SMS for Completed?', 'kb-sms-gateway');?></th> 43 <td> <input type="checkbox" name="kbsgp_enable_woow_complete" value="1" <?php checked(get_option('kbsgp_enable_woow_complete'), '1');?> ></td> 44 </tr> 45 <tr> 46 <th scope="row"><?php esc_html_e('Message for Order Complete', 'kb-sms-gateway');?></th> 47 <td> 48 <textarea name="kbsgp_woow_complete_message" rows="4" cols="50"><?php echo esc_textarea(get_option('kbsgp_woow_complete_message', 'Hi {customer_name} your order #{order_id} is complete.'));?></textarea> 49 <p class="description"> <?php esc_html_e('You can use tags', 'kb-sms-gateway'); ?> <code>{customer_name}</code> <code>{order_id}</code> <code>{order_total}</code> <code>{product_list}</code> <code>{site_url}</code> <?php esc_html_e('for sending specific notificaitons.', 'kb-sms-gateway'); ?></p> 50 51 </td> 52 </tr> 57 53 58 <!-- SMS For Cancelled-->59 <tr>60 <th scope="row"><?php esc_html_e('Enable SMS for Cancelled?', 'kb-sms-gateway');?></th>61 <td> <input type="checkbox" name="kbsgp_enable_woow_cancel" value="1" <?php checked(get_option('kbsgp_enable_woow_cancel'), '1');?> ></td>62 </tr>63 <tr>64 <th scope="row"><?php esc_html_e('Message for Order Cancelled', 'kb-sms-gateway');?></th>65 <td>66 <textarea name="kbsgp_woow_cancel_message" rows="4" cols="50"><?php echo esc_textarea(get_option('kbsgp_woow_cancel_message', 'Hi {customer_name} your order #{order_id} is Cancelled.'));?></textarea>67 <p class="description"> <?php esc_html_e('You can use tags', 'kb-sms-gateway'); ?> <code>{customer_name}</code> <code>{order_id}</code> <code>{order_total}</code> <code>{product_list}</code> <code>{site_url}</code><?php esc_html_e('for sending specific notificaitons.', 'kb-sms-gateway'); ?></p>68 69 </td>70 </tr>54 <!-- SMS For Process --> 55 <tr> 56 <th scope="row"><?php esc_html_e('Enable SMS for Process?', 'kb-sms-gateway');?></th> 57 <td> <input type="checkbox" name="kbsgp_enable_woow_proccess" value="1" <?php checked(get_option('kbsgp_enable_woow_proccess'), '1');?> ></td> 58 </tr> 59 <tr> 60 <th scope="row"><?php esc_html_e('Message for Order Process', 'kb-sms-gateway');?></th> 61 <td> 62 <textarea name="kbsgp_woow_process_message" rows="4" cols="50"><?php echo esc_textarea(get_option('kbsgp_woow_process_message', 'Hi {customer_name} your order #{order_id} is Processing.'));?></textarea> 63 <p class="description"> <?php esc_html_e('You can use tags', 'kb-sms-gateway'); ?> <code>{customer_name}</code> <code>{order_id}</code> <code>{order_total}</code> <code>{product_list}</code> <code>{site_url}</code> <?php esc_html_e('for sending specific notificaitons.', 'kb-sms-gateway'); ?></p> 64 65 </td> 66 </tr> 71 67 72 <!-- SMS For Refunded -->73 <tr>74 <th scope="row"><?php esc_html_e('Enable SMS for Refunded?', 'kb-sms-gateway');?></th>75 <td> <input type="checkbox" name="kbsgp_enable_woow_refund" value="1" <?php checked(get_option('kbsgp_enable_woow_refund'), '1');?> ></td>76 </tr>77 <tr>78 <th scope="row"><?php esc_html_e('Message for Order Refunded', 'kb-sms-gateway');?></th>79 <td>80 <textarea name="kbsgp_woow_refund_message" rows="4" cols="50"><?php echo esc_textarea(get_option('kbsgp_woow_refund_message', 'Hi {customer_name} your order #{order_id} is Refunded.'));?></textarea>81 <p class="description"> <?php esc_html_e('You can use tags', 'kb-sms-gateway'); ?> <code>{customer_name}</code> <code>{order_id}</code> <code>{order_total}</code> <code>{product_list}</code> <code>{site_url}</code> <?php esc_html_e('for sending specific notificaitons.', 'kb-sms-gateway'); ?></p>82 83 </td>84 </tr>68 <!-- SMS For Cancelled --> 69 <tr> 70 <th scope="row"><?php esc_html_e('Enable SMS for Cancelled?', 'kb-sms-gateway');?></th> 71 <td> <input type="checkbox" name="kbsgp_enable_woow_cancel" value="1" <?php checked(get_option('kbsgp_enable_woow_cancel'), '1');?> ></td> 72 </tr> 73 <tr> 74 <th scope="row"><?php esc_html_e('Message for Order Cancelled', 'kb-sms-gateway');?></th> 75 <td> 76 <textarea name="kbsgp_woow_cancel_message" rows="4" cols="50"><?php echo esc_textarea(get_option('kbsgp_woow_cancel_message', 'Hi {customer_name} your order #{order_id} is Cancelled.'));?></textarea> 77 <p class="description"> <?php esc_html_e('You can use tags', 'kb-sms-gateway'); ?> <code>{customer_name}</code> <code>{order_id}</code> <code>{order_total}</code> <code>{product_list}</code> <code>{site_url}</code> <?php esc_html_e('for sending specific notificaitons.', 'kb-sms-gateway'); ?></p> 78 79 </td> 80 </tr> 85 81 86 <!-- SMS For On-Hold --> 87 <tr> 88 <th scope="row"><?php esc_html_e('Enable SMS for On-Hold?', 'kb-sms-gateway');?></th> 89 <td> <input type="checkbox" name="kbsgp_enable_woow_hold" value="1" <?php checked(get_option('kbsgp_enable_woow_hold'), '1');?> ></td> 90 </tr> 91 <tr> 92 <th scope="row"><?php esc_html_e('Message for Order On-Hold', 'kb-sms-gateway');?></th> 93 <td> 94 <textarea name="kbsgp_woow_hold_message" rows="4" cols="50"><?php echo esc_textarea(get_option('kbsgp_woow_hold_message', 'Hi {customer_name} your order #{order_id} is Refunded.'));?></textarea> 95 <p class="description"> <?php esc_html_e('You can use tags', 'kb-sms-gateway'); ?> <code>{customer_name}</code> <code>{order_id}</code> <code>{order_total}</code> <?php esc_html_e('for sending specific notificaitons.', 'kb-sms-gateway'); ?></p> 96 97 </td> 98 </tr> 82 <!-- SMS For Refunded --> 83 <tr> 84 <th scope="row"><?php esc_html_e('Enable SMS for Refunded?', 'kb-sms-gateway');?></th> 85 <td> <input type="checkbox" name="kbsgp_enable_woow_refund" value="1" <?php checked(get_option('kbsgp_enable_woow_refund'), '1');?> ></td> 86 </tr> 87 <tr> 88 <th scope="row"><?php esc_html_e('Message for Order Refunded', 'kb-sms-gateway');?></th> 89 <td> 90 <textarea name="kbsgp_woow_refund_message" rows="4" cols="50"><?php echo esc_textarea(get_option('kbsgp_woow_refund_message', 'Hi {customer_name} your order #{order_id} is Refunded.'));?></textarea> 91 <p class="description"> <?php esc_html_e('You can use tags', 'kb-sms-gateway'); ?> <code>{customer_name}</code> <code>{order_id}</code> <code>{order_total}</code> <code>{product_list}</code> <code>{site_url}</code> <?php esc_html_e('for sending specific notificaitons.', 'kb-sms-gateway'); ?></p> 92 93 </td> 94 </tr> 95 96 <!-- SMS For On-Hold --> 97 <tr> 98 <th scope="row"><?php esc_html_e('Enable SMS for On-Hold?', 'kb-sms-gateway');?></th> 99 <td> <input type="checkbox" name="kbsgp_enable_woow_hold" value="1" <?php checked(get_option('kbsgp_enable_woow_hold'), '1');?> ></td> 100 </tr> 101 <tr> 102 <th scope="row"><?php esc_html_e('Message for Order On-Hold', 'kb-sms-gateway');?></th> 103 <td> 104 <textarea name="kbsgp_woow_hold_message" rows="4" cols="50"><?php echo esc_textarea(get_option('kbsgp_woow_hold_message', 'Hi {customer_name} your order #{order_id} is Refunded.'));?></textarea> 105 <p class="description"> <?php esc_html_e('You can use tags', 'kb-sms-gateway'); ?> <code>{customer_name}</code> <code>{order_id}</code> <code>{order_total}</code> <?php esc_html_e('for sending specific notificaitons.', 'kb-sms-gateway'); ?></p> 106 107 </td> 108 </tr> 99 109 100 110 101 111 102 </table> 103 <?php submit_button();?> 104 </form> 105 <!-- End Main Form --> 106 </div> 112 </table> 113 <?php submit_button();?> 114 </form> 115 <!-- End Main Form --> 107 116 </div> 108 <!-- End Main Settings --> 109 <?php endif;?> 117 </div> 118 <!-- End Main Settings --> 119 <?php endif;?> -
kb-sms-gateway/trunk/includes/kb-admin-tab/tab-section/kb-single-sms.php
r3342403 r3344089 1 1 <?php 2 /** 3 * Single SMS Section 4 * 5 * @package Khudebarta SMS Gateway 6 * @version 1.0 7 * @author GrayWP 8 */ 9 ?> 2 10 3 <?php if ( $nav_menu == 'single') : ?>11 <?php if ( $nav_menu == 'single') : ?> 4 12 5 13 <?php … … 13 21 // Call the SMS send Method 14 22 $send_sms = KBSGP_MAIN_SMS::send_sms($phone_num, $sms_text); 15 23 16 24 if ($send_sms) { 17 kbsgp_insert_sms_log($phone_num, $sms_text, 'Sent', ' order');25 kbsgp_insert_sms_log($phone_num, $sms_text, 'Sent', 'Single SMS'); 18 26 echo '<div class="notice notice-success is-dismissible"><p>' . esc_html__("Your SMS has been sent to", 'kb-sms-gateway') . ' ' . esc_html($phone_num) . '</p></div>'; 19 27 }else{ 20 kbsgp_insert_sms_log($phone_num, $sms_text, 'Failed', ' order');28 kbsgp_insert_sms_log($phone_num, $sms_text, 'Failed', 'Single SMS'); 21 29 echo '<div class="notice notice-error is-dismissible"><p>'. esc_html__("Failed to send SMS. Please try again", 'kb-sms-gateway') . ' </p></div>'; 22 30 } … … 53 61 <!-- End Single SMS Settings --> 54 62 55 <?php endif;?>63 <?php endif;?> -
kb-sms-gateway/trunk/includes/kb-admin-tab/tab-section/kb-sms-logs-template.php
r3342403 r3344089 1 <?php 2 /** 3 * Show SMS Log Report 4 * 5 * @package Khudebarta SMS Gateway 6 * @version 1.0 7 * @author GrayWP 8 */ 9 ?> 10 11 <?php if ( $nav_menu == 'delivery') : ?> 12 <!-- Main Settings --> 13 <div class="kb-main__section-one"> 14 <div class="kb-main__form"> 15 <h2 class="kb-main__title"><?php esc_html_e('SMS Delivery Report', 'kb-sms-gateway');?></h2> 16 <p class="kb-main__text"><?php esc_html_e('Only Last 100 SMS will Show', 'kb-sms-gateway');?></h2> 17 <?php 18 global $wpdb; 19 20 $table_name = $wpdb->prefix. 'kbsgp_sms_logs_report'; 21 $query = "SELECT * FROM $table_name ORDER BY id DESC LIMIT 100"; 22 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared 23 $log_report = $wpdb->get_results($query); 24 25 26 ?> 27 28 <table class="kb_order_logs"> 29 <thead> 30 <tr> 31 <th><?php esc_html_e('ID', 'kb-sms-gateway');?></th> 32 <th><?php esc_html_e('Phone', 'kb-sms-gateway');?></th> 33 <th><?php esc_html_e('Message', 'kb-sms-gateway');?></th> 34 <th><?php esc_html_e('Status', 'kb-sms-gateway');?></th> 35 <th><?php esc_html_e('Type', 'kb-sms-gateway');?></th> 36 <th><?php esc_html_e('Time', 'kb-sms-gateway');?></th> 37 </tr> 38 </thead> 39 <tbody> 40 <?php foreach($log_report as $report) : ?> 41 <tr> 42 <td><?php echo esc_html($report->id);?></td> 43 <td><?php echo esc_html($report->phone);?></td> 44 <td><?php echo esc_html($report->message);?></td> 45 <td><?php echo esc_html($report->status);?></td> 46 <td><?php echo esc_html($report->type);?></td> 47 <td><?php echo esc_html($report->sent_at);?></td> 48 </tr> 49 <?php endforeach;?> 50 </tbody> 51 </table> 1 52 2 53 3 <?php if ( $nav_menu == 'delivery') : ?> 4 <!-- Main Settings --> 5 <div class="kb-main__section-one"> 6 <div class="kb-main__form"> 7 <h2 class="kb-main__title"><?php esc_html_e('SMS Delivery Report', 'kb-sms-gateway');?></h2> 8 <?php 9 global $wpdb; 10 11 $table_name = $wpdb->prefix. 'kbsgp_sms_logs_report'; 12 $query = "SELECT * FROM $table_name ORDER BY id DESC"; 13 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared 14 $log_report = $wpdb->get_results($query); 15 16 17 ?> 18 19 <table class="kb_order_logs"> 20 <thead> 21 <tr> 22 <th><?php esc_html_e('ID', 'kb-sms-gateway');?></th> 23 <th><?php esc_html_e('Phone', 'kb-sms-gateway');?></th> 24 <th><?php esc_html_e('Message', 'kb-sms-gateway');?></th> 25 <th><?php esc_html_e('Status', 'kb-sms-gateway');?></th> 26 <th><?php esc_html_e('Type', 'kb-sms-gateway');?></th> 27 <th><?php esc_html_e('Time', 'kb-sms-gateway');?></th> 28 </tr> 29 </thead> 30 <tbody> 31 <?php foreach($log_report as $report) : ?> 32 <tr> 33 <td><?php echo esc_html($report->id);?></td> 34 <td><?php echo esc_html($report->phone);?></td> 35 <td><?php echo esc_html($report->message);?></td> 36 <td><?php echo esc_html($report->status);?></td> 37 <td><?php echo esc_html($report->type);?></td> 38 <td><?php echo esc_html($report->sent_at);?></td> 39 </tr> 40 <?php endforeach;?> 41 </tbody> 42 </table> 43 44 45 </div> 46 </div> 47 <!-- End Main Settings --> 48 <?php endif;?> 54 </div> 55 </div> 56 <!-- End Main Settings --> 57 <?php endif;?> -
kb-sms-gateway/trunk/includes/kb-api-settings.php
r3342403 r3344089 1 1 <?php 2 /** 3 * Global API Settings 4 * 5 * @package Khudebarta SMS Gateway 6 * @version 1.0 7 * @author GrayWP 8 */ 2 9 3 10 if (!defined('ABSPATH')) exit; … … 7 14 8 15 $api_url = "http://portal.khudebarta.com:3775/sendtext"; 16 9 17 $user_id = get_option('kbsgp_user_id', 'Nogori'); 10 18 $api_key = get_option('kbsgp_api_key', '123456789'); … … 19 27 'messageContent' => $message, 20 28 ]; 21 22 29 23 30 $response = wp_remote_post($api_url, array( -
kb-sms-gateway/trunk/includes/kb-assets-file.php
r3342403 r3344089 1 <?php 1 <?php 2 /** 3 * Assets file for Admin Style & JS 4 * 5 * @package Khudebarta SMS Gateway 6 * @version 1.0 7 * @author GrayWP 8 */ 2 9 3 10 // Admin Assets -
kb-sms-gateway/trunk/includes/kb-sms-logs.php
r3342403 r3344089 1 <?php 1 <?php 2 /** 3 * SMS Log Report 4 * 5 * @package Khudebarta SMS Gateway 6 * @version 1.0 7 * @author GrayWP 8 */ 9 2 10 function kbsgp_create_sms_log_table() { 3 11 global $wpdb; -
kb-sms-gateway/trunk/includes/kb-woow-settings.php
r3342651 r3344089 1 <?php 1 <?php 2 /** 3 * Handle Order Notificaitons for Woocommerce 4 * 5 * Processing order notifications on multiple action hook. 6 * 7 * @package Khudebarta SMS Gateway 8 * @version 1.0 9 * @author GrayWP 10 */ 2 11 3 12 add_action('woocommerce_order_status_processing', 'kbsgp_woo_order_settings', 10, 1); -
kb-sms-gateway/trunk/kb-sms-gateway.php
r3342651 r3344089 1 1 <?php 2 2 /** 3 * Plugin Name: Khudebarta SMS Gateway – S end Bulk SMS,Order Notification for WooCommerce3 * Plugin Name: Khudebarta SMS Gateway – SMS Campaing, OTP Login & Order Notification for WooCommerce 4 4 * Plugin URI: https://graywp.com 5 5 * Description: A sms gateway plugin for khudebarta payment gateway. 6 6 * Author Name: GrayWP 7 * Version: 1. 47 * Version: 1.5 8 8 * tags: bangladesh sms gateway, wooocmmerce sms, sms plugin, bulk sms gateway, sms bangladesh 9 9 * Requires at least: 6.8 … … 24 24 require_once(KBSGP_FILE_PATH . 'includes/kb-admin-settings.php'); 25 25 require_once(KBSGP_FILE_PATH . 'includes/kb-woow-settings.php'); 26 require_once(KBSGP_FILE_PATH . 'includes/kb-otp-system.php'); 26 27 require_once(KBSGP_FILE_PATH . 'includes/kb-sms-logs.php'); 27 28 … … 29 30 register_activation_hook(__FILE__, 'kbsgp_create_sms_log_table'); 30 31 31 -
kb-sms-gateway/trunk/readme.txt
r3342651 r3344089 1 === Khudebarta SMS Gateway – S end Bulk SMS,Order Notification for WooCommerce ===1 === Khudebarta SMS Gateway – SMS Campaing, OTP Login & Order Notification for WooCommerce === 2 2 Contributors: graywp 3 3 tags: bangladesh sms gateway, wooocmmerce sms, sms plugin, bulk sms gateway, sms bangladesh … … 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 1. 47 Stable tag: 1.5 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 24 24 25 25 - 🔔 Send SMS notifications to customers on new WooCommerce orders 26 - 🧩 Fully customizable SMS template with dynamic tags like `{customer_name}`, `{order_total}`, `{order_id}` 26 - 🧩 Fully customizable SMS template with dynamic tags like `{customer_name}`, `{order_total}`, `{order_id}` `{product_list}` `{site_url}` 27 27 - ⚙️ Easy-to-use admin settings page for entering API credentials 28 28 - 🔐 API credentials are stored securely and used only when needed 29 - 📱 Single & Bulk SMS: Send individual SMS or run bulk SMS campaigns. 30 - 🔑 OTP Login System: Shortcode **[kb-custom-login-form]** for secure OTP-based login. 29 31 - 🇧🇩 Built specifically for Bangladeshi businesses using the Khudebarta SMS platform 30 32 - 🚀 Lightweight and developer-friendly code structure … … 46 48 47 49 = Can I customize the SMS message? = 48 Yes. You can use variables like `{customer_name}`, `{order_total}`, `{order_id}` and more to personalize the SMS content.50 Yes. You can use variables like `{customer_name}`, `{order_total}`, `{order_id}` `{product_list}` `{site_url}` and more to personalize the SMS content. 49 51 50 52 = Where do I get the API credentials? = … … 55 57 56 58 == Changelog == 59 60 = 1.5 = 61 * Integrated OTP Login System & Updated Plugin 57 62 58 63 = 1.4 =
Note: See TracChangeset
for help on using the changeset viewer.