Changeset 2327333
- Timestamp:
- 06/19/2020 09:18:11 AM (6 years ago)
- Location:
- joy-of-text/trunk
- Files:
-
- 2 added
- 4 deleted
- 5 edited
-
classes/class-jot-plugin-messenger.php (modified) (1 diff)
-
classes/class-jot-plugin-settings.php (modified) (2 diffs)
-
classes/smsproviders/class-jot-provider-twilio.php (modified) (2 diffs)
-
css/jot-2-2-4.css (deleted)
-
css/jot-2-2-5.css (deleted)
-
css/jot-2-2-6.css (added)
-
joy-of-text.php (modified) (3 diffs)
-
js/jot-messenger-2-2-4.js (deleted)
-
js/jot-messenger-2-2-5.js (deleted)
-
js/jot-messenger-2-2-6.js (added)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
joy-of-text/trunk/classes/class-jot-plugin-messenger.php
r1966987 r2327333 523 523 } 524 524 525 526 527 /* 528 * 529 * Count number of messages still to be processed in the given batch 530 * 531 */ 532 public function count_queue_batch($batchid, $status) { 533 534 global $wpdb; 535 536 $table = $wpdb->prefix."jot_messagequeue"; 537 538 $sql = " SELECT count(*) as messcount" . 539 " FROM " . $table . 540 " WHERE jot_messqstatus <> %s " . 541 " AND jot_messqbatchid = %s"; 542 543 544 $sqlprep = $wpdb->prepare($sql, $status, $batchid); 545 546 $batchcount = $wpdb->get_row( $sqlprep ); 547 548 $remaining_count = isset($batchcount->messcount) ? $batchcount->messcount : -1; 549 550 return apply_filters('jot_count_queue_batch',$remaining_count); 551 552 } 553 554 555 /* 556 * 557 * Update status of processed message 558 * 559 */ 560 public function update_queue_status($queueid, $status) { 561 562 global $wpdb; 563 $response = ""; 564 $table = $wpdb->prefix."jot_messagequeue"; 565 566 $data = array( 567 'jot_messqstatus' => $status 568 ); 569 $wpdb->update( $table, $data, array( 'jot_messqid' => $queueid ) ); 570 571 572 } 573 525 574 526 575 -
joy-of-text/trunk/classes/class-jot-plugin-settings.php
r2170451 r2327333 612 612 } 613 613 } 614 615 // Get account balance info 616 $twilio_acc_balance_json = Joy_Of_Text_Plugin()->currentsmsprovider->getAccountBalance(); 617 $twilio_acc_balance = json_decode($twilio_acc_balance_json); 618 $display_balance = isset($twilio_acc_balance->balance) ? number_format((float)$twilio_acc_balance->balance, 2, '.', '') : "-"; 619 $display_currency = isset($twilio_acc_balance->currency) ? $twilio_acc_balance->currency : "-"; 620 $display_balance_currency = $display_balance . " " . $display_currency; 621 622 // Render account balance 623 $html .= $this->render_row('jot-accountbalance','',$display_balance_currency,$tab); 614 624 615 625 $smsprovider_numbers = Joy_Of_Text_Plugin()->currentsmsprovider->getPhoneNumbers(); … … 1571 1581 1572 1582 /** 1583 * Render HTML markup for the "textvalue" field type. 1584 * 1585 */ 1586 protected function render_field_textvalue ( $key, $args ) { 1587 1588 $html = "<span id='" . esc_attr( $key ) . "'>" . esc_attr( $args['value'] ) . "</span>"; 1589 1590 return apply_filters('jot_render_field_textvalue',$html); 1591 } // End render_field_text() 1592 1593 1594 /** 1573 1595 * Render HTML markup for the hidden field type. 1574 1596 * -
joy-of-text/trunk/classes/smsproviders/class-jot-provider-twilio.php
r1904319 r2327333 251 251 'subform' => 'main', 252 252 'description' => __( 'Select the Twilio number you wish to send your SMS messages from.', 'jot-plugin' ) 253 ); 253 ); 254 $settings_fields['jot-accountbalance'] = array( 255 'name' => __( 'Twilio Account Balance', 'jot-plugin' ), 256 'type' => 'textvalue', 257 'default' => '', 258 'section' => 'smsprovider', 259 'sectiontab' => 'twiliosettings', 260 'subform' => 'main', 261 'description' => __( 'Twilio account balance', 'jot-plugin' ) 262 ); 254 263 break; 255 264 } … … 289 298 } 290 299 300 /** 301 * Get account balance from Twilio 302 */ 303 public function getAccountBalance() { 304 305 306 $selected_provider = Joy_Of_Text_Plugin()->currentsmsprovidername; 307 $sid = Joy_Of_Text_Plugin()->settings->get_smsprovider_settings('jot-accountsid-' . $selected_provider); 308 309 try { 310 311 $data = array(); 312 $url = "https://api.twilio.com/2010-04-01/Accounts/$sid/Balance.json"; 313 $jot_response = Joy_Of_Text_Plugin()->messenger->call_curl($url,$data,'get'); 314 315 return $jot_response; 316 317 } catch (Exception $e) { 318 // Ignore error 319 } 320 } 321 291 322 292 323 } // end class -
joy-of-text/trunk/joy-of-text.php
r2170451 r2327333 17 17 * Plugin URI: http://www.getcloudsms.com 18 18 * Description: Send SMS and text-to-voice messages to your customers, subscribers, followers, members and friends. 19 * Version: 2.2. 519 * Version: 2.2.6 20 20 * Author: Stuart Wilson 21 21 * Author URI: http://www.getcloudsms.com … … 32 32 * 33 33 * Version 34 * 2.2.6 - Stop double clicking on the "Send message" button. 35 * Show Twilio account balance. 36 * Added functions to support changes to the JOT Scheduler plugin 34 37 * 2.2.5 - Added link to Twilio referral code. 35 38 * 2.2.4 - Added filters which are called when a new subscriber is added or removed from the group. … … 115 118 $this->product = "JOT Lite"; 116 119 $this->token = 'jot-plugin'; 117 $this->version = '2.2. 5';120 $this->version = '2.2.6'; 118 121 $this->debug = false; 119 122 -
joy-of-text/trunk/readme.txt
r2299925 r2327333 4 4 Tags: twilio, message, sms, mms, text, mobile, sms scheduler, scheduler, woocommerce, membermouse, voice message, notification, subscribe, buddypress, gravity forms 5 5 Requires at least: 3.0.1 6 Tested up to: 5.4. 17 Stable tag: 5.4. 16 Tested up to: 5.4.2 7 Stable tag: 5.4.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 257 257 258 258 == Changelog == 259 = 2.2.6 = 260 * Stop double clicking on the "Send message" button. 261 * Show Twilio account balance on Messaging-Settings-Twilio Settings page. 262 * Added functions to support changes to the JOT Scheduler plugin. 263 259 264 = 2.2.5 = 260 265 * Added a link to the Twilio referral scheme on the Get Started tab. … … 374 379 375 380 == Upgrade Notice == 376 = 2.2.5 = 377 * Added a link to the Twilio referral scheme on the Get Started tab. 378 381 = 2.2.6 = 382 * Stop double clicking on the "Send message" button. 383 * Show Twilio account balance on Messaging-Settings-Twilio Settings page. 384 * Added functions to support changes to the JOT Scheduler plugin. 385
Note: See TracChangeset
for help on using the changeset viewer.