Changeset 2939430
- Timestamp:
- 07/17/2023 12:52:32 PM (3 years ago)
- Location:
- alpha-sms
- Files:
-
- 47 added
- 4 edited
-
tags/1.0.7 (added)
-
tags/1.0.7/LICENSE.txt (added)
-
tags/1.0.7/README.txt (added)
-
tags/1.0.7/admin (added)
-
tags/1.0.7/admin/class-alpha_sms-admin.php (added)
-
tags/1.0.7/admin/css (added)
-
tags/1.0.7/admin/css/alpha_sms-admin.css (added)
-
tags/1.0.7/admin/index.php (added)
-
tags/1.0.7/admin/js (added)
-
tags/1.0.7/admin/js/alpha_sms-admin.js (added)
-
tags/1.0.7/admin/partials (added)
-
tags/1.0.7/admin/partials/alpha_sms-admin-display_campaign.php (added)
-
tags/1.0.7/admin/partials/alpha_sms-admin-display_settings.php (added)
-
tags/1.0.7/alpha_sms.php (added)
-
tags/1.0.7/assets (added)
-
tags/1.0.7/assets/banner-1544x500.png (added)
-
tags/1.0.7/assets/banner-772x250.png (added)
-
tags/1.0.7/assets/icon-128x128.png (added)
-
tags/1.0.7/assets/icon-256x256.png (added)
-
tags/1.0.7/assets/screenshot-1.jpg (added)
-
tags/1.0.7/assets/screenshot-2.jpg (added)
-
tags/1.0.7/assets/smsBanner.ai (added)
-
tags/1.0.7/includes (added)
-
tags/1.0.7/includes/class-alpha_sms-activator.php (added)
-
tags/1.0.7/includes/class-alpha_sms-deactivator.php (added)
-
tags/1.0.7/includes/class-alpha_sms-i18n.php (added)
-
tags/1.0.7/includes/class-alpha_sms-loader.php (added)
-
tags/1.0.7/includes/class-alpha_sms.php (added)
-
tags/1.0.7/includes/index.php (added)
-
tags/1.0.7/includes/sms.class.php (added)
-
tags/1.0.7/index.php (added)
-
tags/1.0.7/languages (added)
-
tags/1.0.7/languages/alpha_sms.pot (added)
-
tags/1.0.7/public (added)
-
tags/1.0.7/public/class-alpha_sms-public.php (added)
-
tags/1.0.7/public/css (added)
-
tags/1.0.7/public/css/alpha_sms-public.css (added)
-
tags/1.0.7/public/css/otp-login-form.css (added)
-
tags/1.0.7/public/index.php (added)
-
tags/1.0.7/public/js (added)
-
tags/1.0.7/public/js/alpha_sms-public.js (added)
-
tags/1.0.7/public/js/otp-login-form.js (added)
-
tags/1.0.7/public/partials (added)
-
tags/1.0.7/public/partials/add-otp-checkout-form.php (added)
-
tags/1.0.7/public/partials/add-otp-on-login-form.php (added)
-
tags/1.0.7/public/partials/add-otp-on-wc-reg-form.php (added)
-
tags/1.0.7/uninstall.php (added)
-
trunk/README.txt (modified) (1 diff)
-
trunk/admin/partials/alpha_sms-admin-display_settings.php (modified) (8 diffs)
-
trunk/alpha_sms.php (modified) (2 diffs)
-
trunk/public/class-alpha_sms-public.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
alpha-sms/trunk/README.txt
r2874897 r2939430 5 5 Tested up to: 6.1 6 6 Requires PHP: 5.6 7 Stable tag: 1.0. 67 Stable tag: 1.0.7 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
alpha-sms/trunk/admin/partials/alpha_sms-admin-display_settings.php
r2867587 r2939430 30 30 <?php settings_errors(); ?> 31 31 32 <form method="post" name="<?php echo esc_attr($this->plugin_name); ?>" action="options.php" 33 id="<?php echo esc_attr($this->plugin_name); ?>"> 32 <form method="post" name="<?php echo esc_attr($this->plugin_name); ?>" action="options.php" id="<?php echo esc_attr($this->plugin_name); ?>"> 34 33 <?php 35 34 $order_alerts = 36 [37 "DEFAULT_ORDER_STATUS_PENDING_SMS" => __(38 "[store_name] - Payment required for Order #[order_id]\nYour order #[order_id] at [store_name] is currently pending payment. Please complete payment as soon as possible.",39 $this->plugin_name40 ),41 "DEFAULT_ORDER_STATUS_PROCESSING_SMS" => __(42 "[store_name] - Order #[order_id] is being processed\nYour order #[order_id] at [store_name] is currently being processed.",43 $this->plugin_name44 ),45 "DEFAULT_ORDER_STATUS_ON_HOLD_SMS" => __(46 "[store_name] - Order #[order_id] is on hold\nYour order #[order_id] at [store_name] is currently on hold. Our customer service team will be reaching out to you shortly.",47 $this->plugin_name48 ),49 "DEFAULT_ORDER_STATUS_COMPLETED_SMS" => __(50 "[store_name] - Order #[order_id] has been completed\nYour order #[order_id] at [store_name] has been completed and is on its way to you.",51 $this->plugin_name52 ),53 "DEFAULT_ORDER_STATUS_CANCELLED_SMS" => __(54 "[store_name] - Order #[order_id] has been cancelled\nYour order #[order_id] at [store_name] has been cancelled. Please contact our customer service team for any questions or concerns.",55 $this->plugin_name56 ),57 "DEFAULT_ORDER_STATUS_REFUNDED_SMS" => __(58 "[store_name] - Order #[order_id] has been refunded\nYour order #[order_id] at [store_name] has been refunded. Please contact our customer service team for any questions or concerns.",59 $this->plugin_name60 ),61 "DEFAULT_ORDER_STATUS_FAILED_SMS" => __(62 "[store_name] - Order #[order_id] has failed\nYour order #[order_id] at [store_name] has failed. Please contact our customer service team for any questions or concerns.",63 $this->plugin_name64 ),65 "DEFAULT_ADMIN_STATUS_SMS" => __(66 "[store_name] - A new order #[order_id] for value [order_currency] [order_amount] has just been placed. Please check your admin dashboard for complete details.",67 $this->plugin_name68 )69 70 ];35 [ 36 "DEFAULT_ORDER_STATUS_PENDING_SMS" => __( 37 "[store_name] - Payment required for Order #[order_id]\nYour order #[order_id] at [store_name] is currently pending payment. Please complete payment as soon as possible.", 38 $this->plugin_name 39 ), 40 "DEFAULT_ORDER_STATUS_PROCESSING_SMS" => __( 41 "[store_name] - Order #[order_id] is being processed\nYour order #[order_id] at [store_name] is currently being processed.", 42 $this->plugin_name 43 ), 44 "DEFAULT_ORDER_STATUS_ON_HOLD_SMS" => __( 45 "[store_name] - Order #[order_id] is on hold\nYour order #[order_id] at [store_name] is currently on hold. Our customer service team will be reaching out to you shortly.", 46 $this->plugin_name 47 ), 48 "DEFAULT_ORDER_STATUS_COMPLETED_SMS" => __( 49 "[store_name] - Order #[order_id] has been completed\nYour order #[order_id] at [store_name] has been completed and is on its way to you.", 50 $this->plugin_name 51 ), 52 "DEFAULT_ORDER_STATUS_CANCELLED_SMS" => __( 53 "[store_name] - Order #[order_id] has been cancelled\nYour order #[order_id] at [store_name] has been cancelled. Please contact our customer service team for any questions or concerns.", 54 $this->plugin_name 55 ), 56 "DEFAULT_ORDER_STATUS_REFUNDED_SMS" => __( 57 "[store_name] - Order #[order_id] has been refunded\nYour order #[order_id] at [store_name] has been refunded. Please contact our customer service team for any questions or concerns.", 58 $this->plugin_name 59 ), 60 "DEFAULT_ORDER_STATUS_FAILED_SMS" => __( 61 "[store_name] - Order #[order_id] has failed\nYour order #[order_id] at [store_name] has failed. Please contact our customer service team for any questions or concerns.", 62 $this->plugin_name 63 ), 64 "DEFAULT_ADMIN_STATUS_SMS" => __( 65 "[store_name] - A new order #[order_id] for value [order_currency] [order_amount] has just been placed. Please check your admin dashboard for complete details.", 66 $this->plugin_name 67 ) 68 69 ]; 71 70 72 71 //Grab all options … … 109 108 if (!empty($api_key)) { 110 109 111 require_once ALPHA_SMS_PATH . 'includes/sms.class.php';110 require_once ALPHA_SMS_PATH . 'includes/sms.class.php'; 112 111 113 112 $smsPortal = new AlphaSMS($options['api_key']); … … 139 138 </th> 140 139 <td> 141 <input id="<?php echo esc_attr( $this->plugin_name . '-api_key' ); ?>" 142 name="<?php echo esc_attr( $this->plugin_name . '[api_key]' ); ?>" type="text" size="55" 143 placeholder="Enter API Key" 144 value="<?php if ( !empty($api_key) ) { echo esc_attr($api_key); } ?>" /> 140 <input id="<?php echo esc_attr($this->plugin_name . '-api_key'); ?>" name="<?php echo esc_attr($this->plugin_name . '[api_key]'); ?>" type="text" size="55" placeholder="Enter API Key" value="<?php if (!empty($api_key)) { 141 echo esc_attr($api_key); 142 } ?>" /> 145 143 </td> 146 144 </tr> … … 148 146 <tr> 149 147 <th scope="row"> 150 <label for="<?php echo esc_attr( $this->plugin_name . '-sender_id'); ?>">151 <?php esc_attr_e( 'Sender ID (Optional)', $this->plugin_name); ?>148 <label for="<?php echo esc_attr($this->plugin_name . '-sender_id'); ?>"> 149 <?php esc_attr_e('Sender ID (Optional)', $this->plugin_name); ?> 152 150 </label> 153 151 </th> 154 152 <td> 155 <input id="<?php echo esc_attr( $this->plugin_name . '-sender_id' ); ?>" 156 name="<?php echo esc_attr( $this->plugin_name . '[sender_id]' ); ?>" type="text" size="55" 157 value="<?php esc_attr_e( $sender_id, $this->plugin_name ); ?>" /> 153 <input id="<?php echo esc_attr($this->plugin_name . '-sender_id'); ?>" name="<?php echo esc_attr($this->plugin_name . '[sender_id]'); ?>" type="text" size="55" value="<?php esc_attr_e($sender_id, $this->plugin_name); ?>" /> 158 154 </td> 159 155 </tr> … … 161 157 <tr> 162 158 <th scope="row"> 163 <label for="<?php echo esc_attr( $this->plugin_name . '-balance'); ?>"></label>159 <label for="<?php echo esc_attr($this->plugin_name . '-balance'); ?>"></label> 164 160 </th> 165 161 <td> 166 <span id="<?php echo esc_attr( $this->plugin_name . '-balance'); ?>">162 <span id="<?php echo esc_attr($this->plugin_name . '-balance'); ?>"> 167 163 <?php if ($balance === 'empty') : ?> 168 <strong>Don't have an account? <a href='https://alpha.net.bd/SMS/SignUp/'>Register Now</a> (Free169 SMS Credit after Sign-up).</strong>164 <strong>Don't have an account? <a href='https://alpha.net.bd/SMS/SignUp/'>Register Now</a> (Free 165 SMS Credit after Sign-up).</strong> 170 166 <?php elseif (is_numeric($balance)) : ?> 171 <strong>Balance:</strong> BDT172 <?php echo esc_html( number_format((float)$balance, 2, '.', ',')) ?>167 <strong>Balance:</strong> BDT 168 <?php echo esc_html(number_format((float)$balance, 2, '.', ',')) ?> 173 169 <?php else : ?> 174 <strong class="text-danger"><?php echo esc_html($balance); ?></strong>170 <strong class="text-danger"><?php echo esc_html($balance); ?></strong> 175 171 <?php endif; ?> 176 172 </span> … … 184 180 <ol class="switches"> 185 181 <li> 186 <input type="checkbox" id="<?php echo esc_attr( $this->plugin_name . '-wp_reg' ); ?>" 187 name="<?php echo esc_attr( $this->plugin_name . '[wp_reg]' ); ?>" <?php checked($wp_reg, 1); ?> /> 188 <label for="<?php echo esc_attr( $this->plugin_name . '-wp_reg' ); ?>"> 182 <input type="checkbox" id="<?php echo esc_attr($this->plugin_name . '-wp_reg'); ?>" name="<?php echo esc_attr($this->plugin_name . '[wp_reg]'); ?>" <?php checked($wp_reg, 1); ?> /> 183 <label for="<?php echo esc_attr($this->plugin_name . '-wp_reg'); ?>"> 189 184 <span class="toggle_btn"></span> 190 185 <span><?php esc_attr_e('Two Factor OTP Verification For WordPress Register Form', $this->plugin_name); ?></span> … … 193 188 194 189 <li> 195 <input type="checkbox" id="<?php echo esc_attr( $this->plugin_name . '-wp_login' ); ?>" 196 name="<?php echo esc_attr( $this->plugin_name . '[wp_login]' ); ?>" 197 <?php checked($wp_login, 1); ?> /> 198 <label for="<?php echo esc_attr( $this->plugin_name . '-wp_login' ); ?>"> 190 <input type="checkbox" id="<?php echo esc_attr($this->plugin_name . '-wp_login'); ?>" name="<?php echo esc_attr($this->plugin_name . '[wp_login]'); ?>" <?php checked($wp_login, 1); ?> /> 191 <label for="<?php echo esc_attr($this->plugin_name . '-wp_login'); ?>"> 199 192 <span class="toggle_btn"></span> 200 193 <span><?php esc_attr_e('Two Factor OTP Verification For WordPress Login Form', $this->plugin_name); ?></span> … … 207 200 <?php 208 201 if ($has_woocommerce) { ?> 209 <h3><?php esc_attr_e('Woocommerce', $this->plugin_name); ?></h3> 210 211 <ol class="switches"> 212 <li> 213 <input type="checkbox" id="<?php echo esc_attr( $this->plugin_name . '-wc_reg' ); ?>" 214 name="<?php echo esc_attr( $this->plugin_name . '[wc_reg]' ); ?>" <?php checked($wc_reg, 1); ?> /> 215 <label for="<?php echo esc_attr( $this->plugin_name . '-wc_reg' ); ?>"> 216 <span class="toggle_btn"></span> 217 <span><?php esc_attr_e('Two Factor OTP Verification For Woocommerce Register Form', $this->plugin_name); ?></span> 218 </label> 219 </li> 220 221 <li> 222 <input type="checkbox" id="<?php echo esc_attr( $this->plugin_name . '-wc_login' ); ?>" 223 name="<?php echo esc_attr( $this->plugin_name . '[wc_login]' ); ?>" 224 <?php checked($wc_login, 1); ?> /> 225 <label for="<?php echo esc_attr( $this->plugin_name . '-wc_login' ); ?>"> 226 <span class="toggle_btn"></span> 227 <span><?php esc_attr_e('Two Factor OTP Verification For Woocommerce Login Form', $this->plugin_name); ?></span> 228 </label> 229 </li> 230 231 <li> 232 <input type="checkbox" id="<?php echo esc_attr( $this->plugin_name . '-otp_checkout' ); ?>" 233 name="<?php echo esc_attr( $this->plugin_name . '[otp_checkout]'); ?>" 234 <?php checked($otp_checkout, 1); ?> /> 235 <label for="<?php echo esc_attr( $this->plugin_name . '-otp_checkout' ); ?>"> 236 <span class="toggle_btn"></span> 237 <span><?php esc_attr_e('OTP Verification For Guest Customer Checkout', $this->plugin_name); ?></span> 238 </label> 239 </li> 240 241 <li> 242 <input class="alpha-collapse" type="checkbox" 243 id="<?php echo esc_attr( $this->plugin_name . '-order_status_admin' ); ?>" 244 name="<?php echo esc_attr( $this->plugin_name . '[order_status_admin]' ); ?>" <?php checked($order_status_admin, 245 1); ?> /> 246 <label for="<?php echo esc_attr( $this->plugin_name . '-order_status_admin' ); ?>"> 247 <span class="toggle_btn"></span> 248 <span><?php esc_attr_e( 'Notify Admin on New Order', $this->plugin_name ); ?></span> 249 </label> 250 <div class="alpha-collapsable" id="order_status_admin"> 251 <fieldset class="notify_template"> 252 <legend> 253 <h4 class="mb-2"> 254 <label for="<?php echo esc_attr( $this->plugin_name . '-admin_phones' ); ?>"> 255 <?php esc_attr_e('Admin Phone Numbers (comma separated)', 256 $this->plugin_name); ?> 257 </label> 258 </h4> 259 <input id="<?php echo esc_attr( $this->plugin_name . '-admin_phones' ); ?>" 260 name="<?php echo esc_attr( $this->plugin_name . '[admin_phones]' ) ; ?>" type="text" 261 size="82" class="mb-2" value="<?php echo esc_attr( $admin_phones ); ?>" /> 262 <span class="my-2 d-block sms_tokens"><span>[store_name]</span> | 263 <span>[billing_first_name]</span> | 264 <span>[order_id]</span> | 265 <span>[order_status]</span> | 266 <span>[order_currency]</span> | <span>[order_amount]</span> 267 </span> 268 </legend> 269 <textarea id="<<?php echo esc_attr( $this->plugin_name . '-admin_status_sms' ); ?>" 270 name="<?php echo esc_attr( $this->plugin_name . '[ADMIN_STATUS_SMS]' ) ; ?>" rows="3" 271 cols="85"><?php echo esc_html__( $admin_status_sms ); ?></textarea> 272 </fieldset> 273 274 </div> 275 </li> 276 277 278 <!-- working start --> 279 280 281 <h3>Notify Customer</h3> 282 283 284 <li> 285 <input class="alpha-collapse" type="checkbox" 286 id="<?php echo esc_attr( $this->plugin_name . '-order_status_pending' ); ?>" 287 name="<?php echo esc_attr( $this->plugin_name . '[order_status_pending]' ); ?>" 288 <?php checked($order_status_pending, 1); ?> /> 289 <label for="<?php echo esc_attr( $this->plugin_name . '-order_status_pending' ); ?>"> 290 <span class="toggle_btn"></span> 291 <span><?php esc_attr_e('On Order Pending payment', $this->plugin_name); ?></span> 292 </label> 293 <div class="alpha-collapsable" id="order_status_pending"> 294 295 <fieldset class="notify_template"> 296 <legend> 297 <span class="sms_tokens my-2 d-block"><span>[store_name]</span> | 298 <span>[billing_first_name]</span> | 299 <span>[order_id]</span> | 300 <span>[order_status_pending]</span> | 301 <span>[order_currency]</span> | <span>[order_amount]</span> 302 </span> 303 </legend> 304 305 <textarea id="<?php echo esc_attr( $this->plugin_name . '-order_status_pending_sms' ); ?>" 306 name="<?php echo esc_attr( $this->plugin_name . '[ORDER_STATUS_PENDING_SMS]' ); ?>" rows="4" 307 cols="85"><?php echo esc_html__($order_status_pending_sms); ?></textarea> 308 </fieldset> 309 310 </div> 311 </li> 312 313 314 <li> 315 <input class="alpha-collapse" type="checkbox" 316 id="<?php echo esc_attr( $this->plugin_name . '-order_status_processing' ); ?>" 317 name="<?php echo esc_attr( $this->plugin_name . '[order_status_processing]' ); ?>" 318 <?php checked($order_status_processing, 1); ?> /> 319 <label for="<?php echo esc_attr( $this->plugin_name . '-order_status_processing' ); ?>"> 320 <span class="toggle_btn"></span> 321 <span><?php esc_attr_e('On Order Processing', $this->plugin_name); ?></span> 322 </label> 323 <div class="alpha-collapsable" id="order_status_processing"> 324 325 <fieldset class="notify_template"> 326 <legend> 327 <span class="sms_tokens my-2 d-block"><span>[store_name]</span> | 328 <span>[billing_first_name]</span> | 329 <span>[order_id]</span> | 330 <span>[order_status]</span> | 331 <span>[order_currency]</span> | <span>[order_amount]</span> 332 </span> 333 </legend> 334 335 <textarea id="<?php echo esc_attr( $this->plugin_name . '-order_status_processing_sms' ); ?>" 336 name="<?php echo esc_attr( $this->plugin_name . '[ORDER_STATUS_PROCESSING_SMS]' ); ?>" 337 rows="4" cols="85"><?php echo esc_html__($order_status_processing_sms); ?></textarea> 338 </fieldset> 339 340 </div> 341 </li> 342 343 <li> 344 <input class="alpha-collapse" type="checkbox" 345 id="<?php echo esc_attr( $this->plugin_name . '-order_status_on_hold' ); ?>" 346 name="<?php echo esc_attr( $this->plugin_name . '[order_status_on_hold]' ); ?>" 347 <?php checked($order_status_on_hold, 1); ?> /> 348 <label for="<?php echo esc_attr( $this->plugin_name . '-order_status_on_hold' ); ?>"> 349 <span class="toggle_btn"></span> 350 <span><?php esc_attr_e('On Order On hold', $this->plugin_name); ?></span> 351 </label> 352 <div class="alpha-collapsable" id="order_status_on_hold"> 353 354 <fieldset class="notify_template"> 355 <legend> 356 <span class="sms_tokens my-2 d-block"><span>[store_name]</span> | 357 <span>[billing_first_name]</span> | 358 <span>[order_id]</span> | 359 <span>[order_status]</span> | 360 <span>[order_currency]</span> | <span>[order_amount]</span> 361 </span> 362 </legend> 363 364 <textarea id="<?php echo esc_attr( $this->plugin_name . '-order_status_on_hold_sms' ); ?>" 365 name="<?php echo esc_attr( $this->plugin_name . '[ORDER_STATUS_ON_HOLD_SMS]' ); ?>" rows="4" 366 cols="85"><?php echo esc_html__($order_status_on_hold_sms); ?></textarea> 367 </fieldset> 368 369 </div> 370 </li> 371 372 373 374 <li> 375 <input class="alpha-collapse" type="checkbox" 376 id="<?php echo esc_attr( $this->plugin_name . '-order_status_completed' ); ?>" 377 name="<?php echo esc_attr( $this->plugin_name . '[order_status_completed]' ); ?>" 378 <?php checked($order_status_completed, 1); ?> /> 379 <label for="<?php echo esc_attr( $this->plugin_name . '-order_status_completed' ); ?>"> 380 <span class="toggle_btn"></span> 381 <span><?php esc_attr_e('On Order Completed', $this->plugin_name); ?></span> 382 </label> 383 <div class="alpha-collapsable" id="order_status_completed"> 384 385 <fieldset class="notify_template"> 386 <legend> 387 <span class="sms_tokens my-2 d-block"><span>[store_name]</span> | 388 <span>[billing_first_name]</span> | 389 <span>[order_id]</span> | 390 <span>[order_status]</span> | 391 <span>[order_currency]</span> | <span>[order_amount]</span> 392 </span> 393 </legend> 394 395 <textarea id="<?php echo esc_attr( $this->plugin_name . '-order_status_completed_sms' ); ?>" 396 name="<?php echo esc_attr( $this->plugin_name . '[ORDER_STATUS_COMPLETED_SMS]' ); ?>" 397 rows="4" cols="85"><?php echo esc_html__($order_status_completed_sms); ?></textarea> 398 </fieldset> 399 400 </div> 401 </li> 402 403 404 <li> 405 <input class="alpha-collapse" type="checkbox" 406 id="<?php echo esc_attr( $this->plugin_name . '-order_status_cancelled' ); ?>" 407 name="<?php echo esc_attr( $this->plugin_name . '[order_status_cancelled]' ); ?>" 408 <?php checked($order_status_cancelled, 1); ?> /> 409 <label for="<?php echo esc_attr( $this->plugin_name . '-order_status_cancelled' ); ?>"> 410 <span class="toggle_btn"></span> 411 <span><?php esc_attr_e('On Order Cancelled', $this->plugin_name); ?></span> 412 </label> 413 <div class="alpha-collapsable" id="order_status_cancelled"> 414 415 <fieldset class="notify_template"> 416 <legend> 417 <span class="sms_tokens my-2 d-block"><span>[store_name]</span> | 418 <span>[billing_first_name]</span> | 419 <span>[order_id]</span> | 420 <span>[order_status]</span> | 421 <span>[order_currency]</span> | <span>[order_amount]</span> 422 </span> 423 </legend> 424 425 <textarea id="<?php echo esc_attr( $this->plugin_name . '-order_status_cancelled_sms' ); ?>" 426 name="<?php echo esc_attr( $this->plugin_name . '[ORDER_STATUS_CANCELLED_SMS]' ); ?>" 427 rows="4" cols="85"><?php echo esc_html__($order_status_cancelled_sms); ?></textarea> 428 </fieldset> 429 430 </div> 431 </li> 432 433 434 <li> 435 <input class="alpha-collapse" type="checkbox" 436 id="<?php echo esc_attr( $this->plugin_name . '-order_status_refunded' ); ?>" 437 name="<?php echo esc_attr( $this->plugin_name . '[order_status_refunded]' ); ?>" 438 <?php checked($order_status_refunded, 1); ?> /> 439 <label for="<?php echo esc_attr( $this->plugin_name . '-order_status_refunded' ); ?>"> 440 <span class="toggle_btn"></span> 441 <span><?php esc_attr_e('On Order Refunded', $this->plugin_name); ?></span> 442 </label> 443 <div class="alpha-collapsable" id="order_status_refunded"> 444 445 <fieldset class="notify_template"> 446 <legend> 447 <span class="sms_tokens my-2 d-block"><span>[store_name]</span> | 448 <span>[billing_first_name]</span> | 449 <span>[order_id]</span> | 450 <span>[order_status]</span> | 451 <span>[order_currency]</span> | <span>[order_amount]</span> 452 </span> 453 </legend> 454 455 <textarea id="<?php echo esc_attr( $this->plugin_name . '-order_status_refunded_sms' ); ?>" 456 name="<?php echo esc_attr( $this->plugin_name . '[ORDER_STATUS_REFUNDED_SMS]' ); ?>" 457 rows="4" cols="85"><?php echo esc_html__($order_status_refunded_sms); ?></textarea> 458 </fieldset> 459 460 </div> 461 </li> 462 463 464 465 <li> 466 <input class="alpha-collapse" type="checkbox" 467 id="<?php echo esc_attr( $this->plugin_name . '-order_status_failed' ); ?>" 468 name="<?php echo esc_attr( $this->plugin_name . '[order_status_failed]' ); ?>" 469 <?php checked($order_status_failed, 1); ?> /> 470 <label for="<?php echo esc_attr( $this->plugin_name . '-order_status_failed' ); ?>"> 471 <span class="toggle_btn"></span> 472 <span><?php esc_attr_e('On Order Failed', $this->plugin_name); ?></span> 473 </label> 474 <div class="alpha-collapsable" id="order_status_failed"> 475 476 <fieldset class="notify_template"> 477 <legend> 478 <span class="sms_tokens my-2 d-block"><span>[store_name]</span> | 479 <span>[billing_first_name]</span> | 480 <span>[order_id]</span> | 481 <span>[order_status]</span> | 482 <span>[order_currency]</span> | <span>[order_amount]</span> 483 </span> 484 </legend> 485 486 <textarea id="<?php echo esc_attr( $this->plugin_name . '-order_status_failed_sms' ); ?>" 487 name="<?php echo esc_attr( $this->plugin_name . '[ORDER_STATUS_FAILED_SMS]' ); ?>" rows="4" 488 cols="85"><?php echo esc_html__($order_status_failed_sms); ?></textarea> 489 </fieldset> 490 491 </div> 492 </li> 493 494 495 496 <!-- working end --> 497 498 499 500 </ol> 202 <h3><?php esc_attr_e('Woocommerce', $this->plugin_name); ?></h3> 203 204 <ol class="switches"> 205 <li> 206 <input type="checkbox" id="<?php echo esc_attr($this->plugin_name . '-wc_reg'); ?>" name="<?php echo esc_attr($this->plugin_name . '[wc_reg]'); ?>" <?php checked($wc_reg, 1); ?> /> 207 <label for="<?php echo esc_attr($this->plugin_name . '-wc_reg'); ?>"> 208 <span class="toggle_btn"></span> 209 <span><?php esc_attr_e('Two Factor OTP Verification For Woocommerce Register Form', $this->plugin_name); ?></span> 210 </label> 211 </li> 212 213 <li> 214 <input type="checkbox" id="<?php echo esc_attr($this->plugin_name . '-wc_login'); ?>" name="<?php echo esc_attr($this->plugin_name . '[wc_login]'); ?>" <?php checked($wc_login, 1); ?> /> 215 <label for="<?php echo esc_attr($this->plugin_name . '-wc_login'); ?>"> 216 <span class="toggle_btn"></span> 217 <span><?php esc_attr_e('Two Factor OTP Verification For Woocommerce Login Form', $this->plugin_name); ?></span> 218 </label> 219 </li> 220 221 <li> 222 <input type="checkbox" id="<?php echo esc_attr($this->plugin_name . '-otp_checkout'); ?>" name="<?php echo esc_attr($this->plugin_name . '[otp_checkout]'); ?>" <?php checked($otp_checkout, 1); ?> /> 223 <label for="<?php echo esc_attr($this->plugin_name . '-otp_checkout'); ?>"> 224 <span class="toggle_btn"></span> 225 <span><?php esc_attr_e('OTP Verification For Guest Customer Checkout', $this->plugin_name); ?></span> 226 </label> 227 </li> 228 229 <li> 230 <input class="alpha-collapse" type="checkbox" id="<?php echo esc_attr($this->plugin_name . '-order_status_admin'); ?>" name="<?php echo esc_attr($this->plugin_name . '[order_status_admin]'); ?>" <?php checked( 231 $order_status_admin, 232 1 233 ); ?> /> 234 <label for="<?php echo esc_attr($this->plugin_name . '-order_status_admin'); ?>"> 235 <span class="toggle_btn"></span> 236 <span><?php esc_attr_e('Notify Admin on New Order', $this->plugin_name); ?></span> 237 </label> 238 <div class="alpha-collapsable" id="order_status_admin"> 239 <fieldset class="notify_template"> 240 <legend> 241 <h4 class="mb-2"> 242 <label for="<?php echo esc_attr($this->plugin_name . '-admin_phones'); ?>"> 243 <?php esc_attr_e( 244 'Admin Phone Numbers (comma separated)', 245 $this->plugin_name 246 ); ?> 247 </label> 248 </h4> 249 <input id="<?php echo esc_attr($this->plugin_name . '-admin_phones'); ?>" name="<?php echo esc_attr($this->plugin_name . '[admin_phones]'); ?>" type="text" size="82" class="mb-2" value="<?php echo esc_attr($admin_phones); ?>" /> 250 <span class="my-2 d-block sms_tokens"><span>[store_name]</span> | 251 <span>[billing_first_name]</span> | 252 <span>[order_id]</span> | 253 <span>[order_status]</span> | <span>[order_date_created]</span> </span> 254 <span>[order_currency]</span> | <span>[order_amount]</span> 255 </span> 256 </legend> 257 <textarea id="<<?php echo esc_attr($this->plugin_name . '-admin_status_sms'); ?>" name="<?php echo esc_attr($this->plugin_name . '[ADMIN_STATUS_SMS]'); ?>" rows="3" cols="85"><?php echo esc_html__($admin_status_sms); ?></textarea> 258 </fieldset> 259 260 </div> 261 </li> 262 263 264 <!-- working start --> 265 266 267 <h3>Notify Customer</h3> 268 269 270 <li> 271 <input class="alpha-collapse" type="checkbox" id="<?php echo esc_attr($this->plugin_name . '-order_status_pending'); ?>" name="<?php echo esc_attr($this->plugin_name . '[order_status_pending]'); ?>" <?php checked($order_status_pending, 1); ?> /> 272 <label for="<?php echo esc_attr($this->plugin_name . '-order_status_pending'); ?>"> 273 <span class="toggle_btn"></span> 274 <span><?php esc_attr_e('On Order Pending', $this->plugin_name); ?></span> 275 </label> 276 <div class="alpha-collapsable" id="order_status_pending"> 277 278 <fieldset class="notify_template"> 279 <legend> 280 <span class="sms_tokens my-2 d-block"><span>[store_name]</span> | 281 <span>[billing_first_name]</span> | 282 <span>[order_id]</span> | 283 <span>[order_status]</span> | <span>[order_date_created]</span></span> 284 <span>[order_currency]</span> | <span>[order_amount]</span> 285 </span> 286 </legend> 287 288 <textarea id="<?php echo esc_attr($this->plugin_name . '-order_status_pending_sms'); ?>" name="<?php echo esc_attr($this->plugin_name . '[ORDER_STATUS_PENDING_SMS]'); ?>" rows="4" cols="85"><?php echo esc_html__($order_status_pending_sms); ?></textarea> 289 </fieldset> 290 291 </div> 292 </li> 293 294 295 <li> 296 <input class="alpha-collapse" type="checkbox" id="<?php echo esc_attr($this->plugin_name . '-order_status_processing'); ?>" name="<?php echo esc_attr($this->plugin_name . '[order_status_processing]'); ?>" <?php checked($order_status_processing, 1); ?> /> 297 <label for="<?php echo esc_attr($this->plugin_name . '-order_status_processing'); ?>"> 298 <span class="toggle_btn"></span> 299 <span><?php esc_attr_e('On Order Processing', $this->plugin_name); ?></span> 300 </label> 301 <div class="alpha-collapsable" id="order_status_processing"> 302 303 <fieldset class="notify_template"> 304 <legend> 305 <span class="sms_tokens my-2 d-block"><span>[store_name]</span> | 306 <span>[billing_first_name]</span> | 307 <span>[order_id]</span> | 308 <span>[order_status]</span> | <span>[order_date_created]</span></span> 309 <span>[order_currency]</span> | <span>[order_amount]</span> 310 </span> 311 </legend> 312 313 <textarea id="<?php echo esc_attr($this->plugin_name . '-order_status_processing_sms'); ?>" name="<?php echo esc_attr($this->plugin_name . '[ORDER_STATUS_PROCESSING_SMS]'); ?>" rows="4" cols="85"><?php echo esc_html__($order_status_processing_sms); ?></textarea> 314 </fieldset> 315 316 </div> 317 </li> 318 319 <li> 320 <input class="alpha-collapse" type="checkbox" id="<?php echo esc_attr($this->plugin_name . '-order_status_on_hold'); ?>" name="<?php echo esc_attr($this->plugin_name . '[order_status_on_hold]'); ?>" <?php checked($order_status_on_hold, 1); ?> /> 321 <label for="<?php echo esc_attr($this->plugin_name . '-order_status_on_hold'); ?>"> 322 <span class="toggle_btn"></span> 323 <span><?php esc_attr_e('On Order On hold', $this->plugin_name); ?></span> 324 </label> 325 <div class="alpha-collapsable" id="order_status_on_hold"> 326 327 <fieldset class="notify_template"> 328 <legend> 329 <span class="sms_tokens my-2 d-block"><span>[store_name]</span> | 330 <span>[billing_first_name]</span> | 331 <span>[order_id]</span> | 332 <span>[order_status]</span> | <span>[order_date_created]</span></span> 333 <span>[order_currency]</span> | <span>[order_amount]</span> 334 </span> 335 </legend> 336 337 <textarea id="<?php echo esc_attr($this->plugin_name . '-order_status_on_hold_sms'); ?>" name="<?php echo esc_attr($this->plugin_name . '[ORDER_STATUS_ON_HOLD_SMS]'); ?>" rows="4" cols="85"><?php echo esc_html__($order_status_on_hold_sms); ?></textarea> 338 </fieldset> 339 340 </div> 341 </li> 342 343 344 345 <li> 346 <input class="alpha-collapse" type="checkbox" id="<?php echo esc_attr($this->plugin_name . '-order_status_completed'); ?>" name="<?php echo esc_attr($this->plugin_name . '[order_status_completed]'); ?>" <?php checked($order_status_completed, 1); ?> /> 347 <label for="<?php echo esc_attr($this->plugin_name . '-order_status_completed'); ?>"> 348 <span class="toggle_btn"></span> 349 <span><?php esc_attr_e('On Order Completed', $this->plugin_name); ?></span> 350 </label> 351 <div class="alpha-collapsable" id="order_status_completed"> 352 353 <fieldset class="notify_template"> 354 <legend> 355 <span class="sms_tokens my-2 d-block"><span>[store_name]</span> | 356 <span>[billing_first_name]</span> | 357 <span>[order_id]</span> | 358 <span>[order_status]</span> | <span>[order_date_created]</span> | <span>[order_date_completed]</span> 359 <span>[order_currency]</span> | <span>[order_amount]</span> 360 </span> 361 </legend> 362 363 <textarea id="<?php echo esc_attr($this->plugin_name . '-order_status_completed_sms'); ?>" name="<?php echo esc_attr($this->plugin_name . '[ORDER_STATUS_COMPLETED_SMS]'); ?>" rows="4" cols="85"><?php echo esc_html__($order_status_completed_sms); ?></textarea> 364 </fieldset> 365 366 </div> 367 </li> 368 369 370 <li> 371 <input class="alpha-collapse" type="checkbox" id="<?php echo esc_attr($this->plugin_name . '-order_status_cancelled'); ?>" name="<?php echo esc_attr($this->plugin_name . '[order_status_cancelled]'); ?>" <?php checked($order_status_cancelled, 1); ?> /> 372 <label for="<?php echo esc_attr($this->plugin_name . '-order_status_cancelled'); ?>"> 373 <span class="toggle_btn"></span> 374 <span><?php esc_attr_e('On Order Cancelled', $this->plugin_name); ?></span> 375 </label> 376 <div class="alpha-collapsable" id="order_status_cancelled"> 377 378 <fieldset class="notify_template"> 379 <legend> 380 <span class="sms_tokens my-2 d-block"><span>[store_name]</span> | 381 <span>[billing_first_name]</span> | 382 <span>[order_id]</span> | 383 <span>[order_status]</span> | <span>[order_date_created]</span></span> 384 <span>[order_currency]</span> | <span>[order_amount]</span> 385 </span> 386 </legend> 387 388 <textarea id="<?php echo esc_attr($this->plugin_name . '-order_status_cancelled_sms'); ?>" name="<?php echo esc_attr($this->plugin_name . '[ORDER_STATUS_CANCELLED_SMS]'); ?>" rows="4" cols="85"><?php echo esc_html__($order_status_cancelled_sms); ?></textarea> 389 </fieldset> 390 391 </div> 392 </li> 393 394 395 <li> 396 <input class="alpha-collapse" type="checkbox" id="<?php echo esc_attr($this->plugin_name . '-order_status_refunded'); ?>" name="<?php echo esc_attr($this->plugin_name . '[order_status_refunded]'); ?>" <?php checked($order_status_refunded, 1); ?> /> 397 <label for="<?php echo esc_attr($this->plugin_name . '-order_status_refunded'); ?>"> 398 <span class="toggle_btn"></span> 399 <span><?php esc_attr_e('On Order Refunded', $this->plugin_name); ?></span> 400 </label> 401 <div class="alpha-collapsable" id="order_status_refunded"> 402 403 <fieldset class="notify_template"> 404 <legend> 405 <span class="sms_tokens my-2 d-block"><span>[store_name]</span> | 406 <span>[billing_first_name]</span> | 407 <span>[order_id]</span> | 408 <span>[order_status]</span> | <span>[order_date_created]</span></span> 409 <span>[order_currency]</span> | <span>[order_amount]</span> 410 </span> 411 </legend> 412 413 <textarea id="<?php echo esc_attr($this->plugin_name . '-order_status_refunded_sms'); ?>" name="<?php echo esc_attr($this->plugin_name . '[ORDER_STATUS_REFUNDED_SMS]'); ?>" rows="4" cols="85"><?php echo esc_html__($order_status_refunded_sms); ?></textarea> 414 </fieldset> 415 416 </div> 417 </li> 418 419 420 421 <li> 422 <input class="alpha-collapse" type="checkbox" id="<?php echo esc_attr($this->plugin_name . '-order_status_failed'); ?>" name="<?php echo esc_attr($this->plugin_name . '[order_status_failed]'); ?>" <?php checked($order_status_failed, 1); ?> /> 423 <label for="<?php echo esc_attr($this->plugin_name . '-order_status_failed'); ?>"> 424 <span class="toggle_btn"></span> 425 <span><?php esc_attr_e('On Order Failed', $this->plugin_name); ?></span> 426 </label> 427 <div class="alpha-collapsable" id="order_status_failed"> 428 429 <fieldset class="notify_template"> 430 <legend> 431 <span class="sms_tokens my-2 d-block"><span>[store_name]</span> | 432 <span>[billing_first_name]</span> | 433 <span>[order_id]</span> | 434 <span>[order_status]</span> | <span>[order_date_created]</span> | <span>[order_date_completed]</span> 435 <span>[order_currency]</span> | <span>[order_amount]</span> 436 </span> 437 </legend> 438 439 <textarea id="<?php echo esc_attr($this->plugin_name . '-order_status_failed_sms'); ?>" name="<?php echo esc_attr($this->plugin_name . '[ORDER_STATUS_FAILED_SMS]'); ?>" rows="4" cols="85"><?php echo esc_html__($order_status_failed_sms); ?></textarea> 440 </fieldset> 441 442 </div> 443 </li> 444 445 446 447 <!-- working end --> 448 449 450 451 </ol> 501 452 <?php } 502 453 ?> -
alpha-sms/trunk/alpha_sms.php
r2874897 r2939430 17 17 * Plugin URI: https://sms.net.bd/plugins/wordpress 18 18 * Description: WP 2FA Login. SMS OTP Verification for Registration and Login forms, WooCommerce SMS Notification for your shop orders. 19 * Version: 1.0. 619 * Version: 1.0.7 20 20 * Author: Alpha Net 21 21 * Author URI: https://sms.net.bd/ … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define('ALPHA_SMS_VERSION', '1.0. 6');38 define('ALPHA_SMS_VERSION', '1.0.7'); 39 39 40 40 // plugin constants -
alpha-sms/trunk/public/class-alpha_sms-public.php
r2874897 r2939430 570 570 } 571 571 572 // new order status pending notification for customer 573 $this->wc_order_status_change_alert($order_id, 'pending', 'pending'); 574 572 575 // option not enabled 573 576 if (!$this->pluginActive || !isset($this->options['order_status_admin']) || !$this->options['order_status_admin']) { … … 575 578 } 576 579 577 // $this->wc_order_status_change_alert($order_id, 'pending', 'pending');578 580 579 581 // send sms to all admins if enabled … … 589 591 '[order_currency]', 590 592 '[order_amount]', 593 '[order_date_created]', 594 '[order_date_completed]' 591 595 ]; 592 596 593 $replace = [ 594 get_bloginfo(), 595 $order->get_billing_first_name(), 596 $order_id, 597 'pending', 598 $order->get_currency(), 599 $order->get_total(), 600 ]; 597 $order_created = date( 'd M Y', strtotime( $order->get_date_created() )); 598 $order_completed = !empty($order->get_date_completed()) ? date( 'd M Y', strtotime( $order->get_date_completed() )) : ''; 599 600 $replace = [ 601 get_bloginfo(), 602 $order->get_billing_first_name(), 603 $order_id, 604 'pending', 605 $order->get_currency(), 606 $order->get_total(), 607 $order_created, 608 $order_completed 609 ]; 601 610 602 611 $admin_msg = str_replace($search, $replace, $admin_msg); … … 653 662 '[order_currency]', 654 663 '[order_amount]', 664 '[order_date_created]', 665 '[order_date_completed]' 655 666 ]; 667 668 $order_created = date( 'd M Y', strtotime( $order->get_date_created() )); 669 $order_completed = !empty($order->get_date_completed()) ? date( 'd M Y', strtotime( $order->get_date_completed() )) : ''; 656 670 657 671 $replace = [ … … 662 676 $order->get_currency(), 663 677 $order->get_total(), 678 $order_created, 679 $order_completed 664 680 ]; 665 681
Note: See TracChangeset
for help on using the changeset viewer.