Plugin Directory

Changeset 3344089


Ignore:
Timestamp:
08/13/2025 01:21:18 PM (8 months ago)
Author:
graywp
Message:

OTP login Added & Updated plugin

Location:
kb-sms-gateway
Files:
31 added
13 edited

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 */
    29
    310// Admin Page Menu
     
    96103                <li><code>{order_id}</code> - <strong><?php esc_html_e('Order number', 'kb-sms-gateway'); ?></strong></li>
    97104                <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>
    98107            </ul>
    99108            <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       
    100111        </div>
    101112
  • 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
    210//superglobal array variable for parameter
    311// 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
    22/**
    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
    58 */
    69?>
    7 
    810
    911<!-- 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?>
    210
    3         <?php
     11<?php if ( $nav_menu == 'bulk') : ?>
    412
    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')){
    616
    717
    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';
    1020
    11             $customer_phones = [];
     21        $customer_phones = [];
    1222
    13             if($checkbox_select){
    14                 // Get all woocommercece customer phone numbers
    15                 $customers = get_users(['role_in' => ['customer']]);
     23        if($checkbox_select){
     24            // Get all woocommercece customer phone numbers
     25            $customers = get_users(['role_in' => ['customer']]);
    1626
    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;
    4131                }
    4232            }
     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       
    4339
    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
    5766                    )
    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        }
    6474
    6575
    66         };?>
     76    };?>
    6777
    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>
    7282
    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');?>
    7686
    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>
    99109
    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>
    104113        </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?>
    1110
    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">
    2921
    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>
    4339
    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>
    5753
    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>
    7167
    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>
    8581
    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>
    99109
    100110
    101111
    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 -->
    107116        </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?>
    210       
    3         <?php if ( $nav_menu == 'single') : ?>
     11    <?php if ( $nav_menu == 'single') : ?>
    412
    513        <?php
     
    1321            // Call the SMS send Method
    1422            $send_sms = KBSGP_MAIN_SMS::send_sms($phone_num, $sms_text);
    15 
     23           
    1624            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');
    1826                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>';
    1927            }else{
    20                 kbsgp_insert_sms_log($phone_num, $sms_text, 'Failed', 'order');
     28                kbsgp_insert_sms_log($phone_num, $sms_text, 'Failed', 'Single SMS');
    2129                echo '<div class="notice notice-error is-dismissible"><p>'. esc_html__("Failed to send SMS. Please try again", 'kb-sms-gateway') . ' </p></div>';
    2230            }
     
    5361        <!-- End Single SMS Settings -->
    5462
    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>
    152
    253
    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  
    11<?php
     2/**
     3 * Global API Settings
     4 *
     5 * @package Khudebarta SMS Gateway
     6 * @version 1.0
     7 * @author GrayWP
     8 */
    29
    310if (!defined('ABSPATH')) exit;
     
    714       
    815        $api_url  = "http://portal.khudebarta.com:3775/sendtext";
     16       
    917        $user_id  = get_option('kbsgp_user_id', 'Nogori');
    1018        $api_key  = get_option('kbsgp_api_key', '123456789');
     
    1927            'messageContent' => $message,
    2028        ];
    21 
    2229
    2330        $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 */
    29
    310// 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
    210function kbsgp_create_sms_log_table() {
    311    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 */
    211
    312add_action('woocommerce_order_status_processing', 'kbsgp_woo_order_settings', 10, 1);
  • kb-sms-gateway/trunk/kb-sms-gateway.php

    r3342651 r3344089  
    11<?php
    22/**
    3  * Plugin Name: Khudebarta SMS Gateway – Send Bulk SMS, Order Notification for WooCommerce
     3 * Plugin Name: Khudebarta SMS Gateway – SMS Campaing, OTP Login & Order Notification for WooCommerce
    44 * Plugin URI: https://graywp.com
    55 * Description: A sms gateway plugin for khudebarta payment gateway.
    66 * Author Name: GrayWP
    7  * Version: 1.4
     7 * Version: 1.5
    88 * tags: bangladesh sms gateway, wooocmmerce sms, sms plugin, bulk sms gateway, sms bangladesh
    99 * Requires at least: 6.8
     
    2424require_once(KBSGP_FILE_PATH . 'includes/kb-admin-settings.php');
    2525require_once(KBSGP_FILE_PATH . 'includes/kb-woow-settings.php');
     26require_once(KBSGP_FILE_PATH . 'includes/kb-otp-system.php');
    2627require_once(KBSGP_FILE_PATH . 'includes/kb-sms-logs.php');
    2728
     
    2930register_activation_hook(__FILE__, 'kbsgp_create_sms_log_table');
    3031
    31 
  • kb-sms-gateway/trunk/readme.txt

    r3342651 r3344089  
    1 === Khudebarta SMS Gateway – Send Bulk SMS, Order Notification for WooCommerce ===
     1=== Khudebarta SMS Gateway – SMS Campaing, OTP Login & Order Notification for WooCommerce ===
    22Contributors: graywp
    33tags: bangladesh sms gateway, wooocmmerce sms, sms plugin, bulk sms gateway, sms bangladesh
     
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 1.4
     7Stable tag: 1.5
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2424
    2525- 🔔 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}` 
    2727- ⚙️ Easy-to-use admin settings page for entering API credentials 
    2828- 🔐 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.
    2931- 🇧🇩 Built specifically for Bangladeshi businesses using the Khudebarta SMS platform 
    3032- 🚀 Lightweight and developer-friendly code structure 
     
    4648
    4749= 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.
     50Yes. You can use variables like `{customer_name}`, `{order_total}`, `{order_id}` `{product_list}`  `{site_url}`    and more to personalize the SMS content.
    4951
    5052= Where do I get the API credentials? = 
     
    5557
    5658== Changelog ==
     59
     60= 1.5 = 
     61* Integrated OTP Login System & Updated Plugin
    5762
    5863= 1.4 = 
Note: See TracChangeset for help on using the changeset viewer.