Changeset 1453190
- Timestamp:
- 07/12/2016 05:37:05 AM (10 years ago)
- Location:
- twilio-sms-for-woo/trunk
- Files:
-
- 9 edited
-
README.txt (modified) (1 diff)
-
admin/class-twilio-sms-for-woo-admin.php (modified) (3 diffs)
-
admin/partials/class-twilio-sms-for-woo-setting.php (modified) (4 diffs)
-
includes/class-twilio-sms-for-woo-activator.php (modified) (1 diff)
-
includes/class-twilio-sms-for-woo-deactivator.php (modified) (1 diff)
-
includes/class-twilio-sms-for-woo-i18n.php (modified) (1 diff)
-
includes/class-twilio-sms-for-woo-loader.php (modified) (1 diff)
-
includes/class-twilio-sms-for-woo.php (modified) (3 diffs)
-
twilio-sms-for-woo.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
twilio-sms-for-woo/trunk/README.txt
r1393730 r1453190 53 53 54 54 == Changelog == 55 = 1.0.6 = 56 * Tested Twilio SMS For Woo working very well. 55 57 = 1.0.5 = 56 * Tested up to: 4.558 * Tested up to: 4.5 57 59 = 1.0.4 = 58 * uInternal server error during checkout if I enter two mobile numbers.60 * uInternal server error during checkout if I enter two mobile numbers. 59 61 = 1.0.3 = 60 * update version.62 * update version. 61 63 = 1.0.2 = 62 * Add hook64 * Add hook 63 65 = 1.0.1 = 64 * code optimized66 * code optimized 65 67 = 1.0.0 = 66 68 * Release Date - 20 Aug, 2015 -
twilio-sms-for-woo/trunk/admin/class-twilio-sms-for-woo-admin.php
r1337041 r1453190 50 50 */ 51 51 public function enqueue_scripts() { 52 wp_enqueue_script($this->plugin_name .'bn', plugin_dir_url(__FILE__) . 'js/twilio-sms-for-woo-bn.js', array('jquery'), $this->version, false);52 wp_enqueue_script($this->plugin_name . 'bn', plugin_dir_url(__FILE__) . 'js/twilio-sms-for-woo-bn.js', array('jquery'), $this->version, false); 53 53 wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/twilio-sms-for-woo-admin.js', array('jquery'), $this->version, false); 54 54 if (wp_script_is($this->plugin_name)) { … … 64 64 return $paypal_args; 65 65 } 66 66 67 public function twilio_sms_for_woo_paypal_digital_goods_nvp_args($paypal_args) { 67 68 $paypal_args['BUTTONSOURCE'] = 'mbjtechnolabs_SP'; 68 69 return $paypal_args; 69 70 } 71 70 72 public function twilio_sms_for_woo_gateway_paypal_pro_payflow_request($paypal_args) { 71 73 $paypal_args['BUTTONSOURCE'] = 'mbjtechnolabs_SP'; 72 74 return $paypal_args; 73 75 } 76 74 77 public function twilio_sms_for_woo_gateway_paypal_pro_request($paypal_args) { 75 78 $paypal_args['BUTTONSOURCE'] = 'mbjtechnolabs_SP'; … … 130 133 public static function send_customer_notification_sms_twilio_sms_for_woo($phone, $message) { 131 134 $log = new Twilio_SMS_For_Woo_Logger(); 132 135 133 136 if (file_exists(TWILLIO_PLUGIN_DIR_PATH . '/admin/partials/lib/Twilio.php')) { 134 require_once TWILLIO_PLUGIN_DIR_PATH . '/admin/partials/lib/Twilio.php'; 135 } 137 require_once TWILLIO_PLUGIN_DIR_PATH . '/admin/partials/lib/Twilio.php'; 138 } 136 139 $AccountSid = get_option("twilio_sms_woo_account_sid"); 137 140 $AuthToken = get_option("twilio_sms_woo_auth_token"); -
twilio-sms-for-woo/trunk/admin/partials/class-twilio-sms-for-woo-setting.php
r1337041 r1453190 21 21 } 22 22 23 public static function twilio_sms_send_test_sms() {23 public static function twilio_sms_send_test_sms() { 24 24 check_ajax_referer('twilio_sms_woo_test_sms', 'security'); 25 25 $log = new Twilio_SMS_For_Woo_Logger(); … … 29 29 $from_number = get_option("twilio_sms_woo_from_number"); 30 30 $response = ''; 31 31 32 32 $test_mobile_number = $_POST['twilio_sms_woo_test_phone']; 33 $Test_Mobile_Array = ''; 34 $Test_Mobile_Array = explode(',', $test_mobile_number); 35 33 $Test_Mobile_Array = ''; 34 $Test_Mobile_Array = explode(',', $test_mobile_number); 35 36 36 $test_message = sanitize_text_field($_POST['twilio_sms_woo_test_message']); 37 37 $http = new Services_Twilio_TinyHttp( … … 41 41 )) 42 42 ); 43 44 if (is_array($Test_Mobile_Array) && count($Test_Mobile_Array) > 0){45 43 44 if (is_array($Test_Mobile_Array) && count($Test_Mobile_Array) > 0) { 45 46 46 foreach ($Test_Mobile_Array as $key => $value) { 47 47 try { … … 61 61 $log->add('Twilio SMS', 'TEST SMS Error message ' . $e->getMessage()); 62 62 } 63 } 64 } 63 } 64 } 65 65 } 66 66 echo json_encode($response); -
twilio-sms-for-woo/trunk/includes/class-twilio-sms-for-woo-activator.php
r1232891 r1453190 20 20 } 21 21 22 23 22 private function create_files() { 24 23 $files = array( -
twilio-sms-for-woo/trunk/includes/class-twilio-sms-for-woo-deactivator.php
r1232891 r1453190 13 13 class Twilio_Sms_For_Woo_Deactivator { 14 14 15 /**16 * @since 1.0.017 */18 public static function deactivate() {19 20 }15 /** 16 * @since 1.0.0 17 */ 18 public static function deactivate() { 19 20 } 21 21 22 22 } -
twilio-sms-for-woo/trunk/includes/class-twilio-sms-for-woo-i18n.php
r1232891 r1453190 14 14 class Twilio_Sms_For_Woo_i18n { 15 15 16 /**17 * The domain specified for this plugin.18 *19 * @since 1.0.020 * @access private21 * @var string $domain The domain identifier for this plugin.22 */23 private $domain;16 /** 17 * The domain specified for this plugin. 18 * 19 * @since 1.0.0 20 * @access private 21 * @var string $domain The domain identifier for this plugin. 22 */ 23 private $domain; 24 24 25 /**26 * Load the plugin text domain for translation.27 *28 * @since 1.0.029 */30 public function load_plugin_textdomain() {25 /** 26 * Load the plugin text domain for translation. 27 * 28 * @since 1.0.0 29 */ 30 public function load_plugin_textdomain() { 31 31 32 load_plugin_textdomain( 33 $this->domain, 34 false, 35 dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/' 36 ); 32 load_plugin_textdomain( 33 $this->domain, false, dirname(dirname(plugin_basename(__FILE__))) . '/languages/' 34 ); 35 } 37 36 38 } 39 40 /** 41 * Set the domain equal to that of the specified domain. 42 * 43 * @since 1.0.0 44 * @param string $domain The domain that represents the locale of this plugin. 45 */ 46 public function set_domain( $domain ) { 47 $this->domain = $domain; 48 } 37 /** 38 * Set the domain equal to that of the specified domain. 39 * 40 * @since 1.0.0 41 * @param string $domain The domain that represents the locale of this plugin. 42 */ 43 public function set_domain($domain) { 44 $this->domain = $domain; 45 } 49 46 50 47 } -
twilio-sms-for-woo/trunk/includes/class-twilio-sms-for-woo-loader.php
r1232891 r1453190 14 14 class Twilio_Sms_For_Woo_Loader { 15 15 16 /**17 * The array of actions registered with WordPress.18 *19 * @since 1.0.020 * @access protected21 * @var array $actions The actions registered with WordPress to fire when the plugin loads.22 */23 protected $actions;16 /** 17 * The array of actions registered with WordPress. 18 * 19 * @since 1.0.0 20 * @access protected 21 * @var array $actions The actions registered with WordPress to fire when the plugin loads. 22 */ 23 protected $actions; 24 24 25 /**26 * The array of filters registered with WordPress.27 *28 * @since 1.0.029 * @access protected30 * @var array $filters The filters registered with WordPress to fire when the plugin loads.31 */32 protected $filters;25 /** 26 * The array of filters registered with WordPress. 27 * 28 * @since 1.0.0 29 * @access protected 30 * @var array $filters The filters registered with WordPress to fire when the plugin loads. 31 */ 32 protected $filters; 33 33 34 /**35 * Initialize the collections used to maintain the actions and filters.36 *37 * @since 1.0.038 */39 public function __construct() {34 /** 35 * Initialize the collections used to maintain the actions and filters. 36 * 37 * @since 1.0.0 38 */ 39 public function __construct() { 40 40 41 $this->actions = array(); 42 $this->filters = array(); 41 $this->actions = array(); 42 $this->filters = array(); 43 } 43 44 44 } 45 /** 46 * Add a new action to the collection to be registered with WordPress. 47 * 48 * @since 1.0.0 49 * @param string $hook The name of the WordPress action that is being registered. 50 * @param object $component A reference to the instance of the object on which the action is defined. 51 * @param string $callback The name of the function definition on the $component. 52 * @param int Optional $priority The priority at which the function should be fired. 53 * @param int Optional $accepted_args The number of arguments that should be passed to the $callback. 54 */ 55 public function add_action($hook, $component, $callback, $priority = 10, $accepted_args = 1) { 56 $this->actions = $this->add($this->actions, $hook, $component, $callback, $priority, $accepted_args); 57 } 45 58 46 /**47 * Add a new actionto the collection to be registered with WordPress.48 *49 * @since 1.0.050 * @param string $hook The name of the WordPress actionthat is being registered.51 * @param object $component A reference to the instance of the object on which the actionis defined.52 * @param string $callback The name of the function definition on the $component.53 * @param int Optional $priority The priority at which the function should be fired.54 * @param int Optional $accepted_args The number of arguments that should be passed to the $callback.55 */56 public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1) {57 $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args);58 }59 /** 60 * Add a new filter to the collection to be registered with WordPress. 61 * 62 * @since 1.0.0 63 * @param string $hook The name of the WordPress filter that is being registered. 64 * @param object $component A reference to the instance of the object on which the filter is defined. 65 * @param string $callback The name of the function definition on the $component. 66 * @param int Optional $priority The priority at which the function should be fired. 67 * @param int Optional $accepted_args The number of arguments that should be passed to the $callback. 68 */ 69 public function add_filter($hook, $component, $callback, $priority = 10, $accepted_args = 1) { 70 $this->filters = $this->add($this->filters, $hook, $component, $callback, $priority, $accepted_args); 71 } 59 72 60 /** 61 * Add a new filter to the collection to be registered with WordPress. 62 * 63 * @since 1.0.0 64 * @param string $hook The name of the WordPress filter that is being registered. 65 * @param object $component A reference to the instance of the object on which the filter is defined. 66 * @param string $callback The name of the function definition on the $component. 67 * @param int Optional $priority The priority at which the function should be fired. 68 * @param int Optional $accepted_args The number of arguments that should be passed to the $callback. 69 */ 70 public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { 71 $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args ); 72 } 73 /** 74 * A utility function that is used to register the actions and hooks into a single 75 * collection. 76 * 77 * @since 1.0.0 78 * @access private 79 * @param array $hooks The collection of hooks that is being registered (that is, actions or filters). 80 * @param string $hook The name of the WordPress filter that is being registered. 81 * @param object $component A reference to the instance of the object on which the filter is defined. 82 * @param string $callback The name of the function definition on the $component. 83 * @param int Optional $priority The priority at which the function should be fired. 84 * @param int Optional $accepted_args The number of arguments that should be passed to the $callback. 85 * @return type The collection of actions and filters registered with WordPress. 86 */ 87 private function add($hooks, $hook, $component, $callback, $priority, $accepted_args) { 73 88 74 /** 75 * A utility function that is used to register the actions and hooks into a single 76 * collection. 77 * 78 * @since 1.0.0 79 * @access private 80 * @param array $hooks The collection of hooks that is being registered (that is, actions or filters). 81 * @param string $hook The name of the WordPress filter that is being registered. 82 * @param object $component A reference to the instance of the object on which the filter is defined. 83 * @param string $callback The name of the function definition on the $component. 84 * @param int Optional $priority The priority at which the function should be fired. 85 * @param int Optional $accepted_args The number of arguments that should be passed to the $callback. 86 * @return type The collection of actions and filters registered with WordPress. 87 */ 88 private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) { 89 $hooks[] = array( 90 'hook' => $hook, 91 'component' => $component, 92 'callback' => $callback, 93 'priority' => $priority, 94 'accepted_args' => $accepted_args 95 ); 89 96 90 $hooks[] = array( 91 'hook' => $hook, 92 'component' => $component, 93 'callback' => $callback, 94 'priority' => $priority, 95 'accepted_args' => $accepted_args 96 ); 97 return $hooks; 98 } 97 99 98 return $hooks; 100 /** 101 * Register the filters and actions with WordPress. 102 * 103 * @since 1.0.0 104 */ 105 public function run() { 99 106 100 } 107 foreach ($this->filters as $hook) { 108 add_filter($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']); 109 } 101 110 102 /** 103 * Register the filters and actions with WordPress. 104 * 105 * @since 1.0.0 106 */ 107 public function run() { 108 109 foreach ( $this->filters as $hook ) { 110 add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); 111 } 112 113 foreach ( $this->actions as $hook ) { 114 add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); 115 } 116 117 } 111 foreach ($this->actions as $hook) { 112 add_action($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']); 113 } 114 } 118 115 119 116 } -
twilio-sms-for-woo/trunk/includes/class-twilio-sms-for-woo.php
r1393730 r1453190 57 57 58 58 $this->plugin_name = 'twilio-sms-for-woo'; 59 $this->version = '1.0. 5';59 $this->version = '1.0.6'; 60 60 $this->load_dependencies(); 61 61 $this->set_locale(); … … 165 165 $this->loader->add_action('woocommerce_order_status_failed_to_processing', $plugin_admin, 'twilio_send_admin_order_notification_sms', 10, 1); 166 166 $this->loader->add_action('woocommerce_order_status_failed_to_completed', $plugin_admin, 'twilio_send_admin_order_notification_sms', 10, 1); 167 168 $this->loader->add_filter('twilio_sms_for_woo_paypal_args', $plugin_admin, 'twilio_sms_for_woo_paypal_args', 10, 1); 167 168 $this->loader->add_filter('twilio_sms_for_woo_paypal_args', $plugin_admin, 'twilio_sms_for_woo_paypal_args', 10, 1); 169 169 $this->loader->add_filter('twilio_sms_for_woo_paypal_digital_goods_nvp_args', $plugin_admin, 'twilio_sms_for_woo_paypal_digital_goods_nvp_args', 10, 1); 170 170 $this->loader->add_filter('twilio_sms_for_woo_gateway_paypal_pro_payflow_request', $plugin_admin, 'twilio_sms_for_woo_gateway_paypal_pro_payflow_request', 10, 1); … … 217 217 } 218 218 } 219 220 219 } -
twilio-sms-for-woo/trunk/twilio-sms-for-woo.php
r1393730 r1453190 6 6 * Plugin URI: http://localleadminer.com/ 7 7 * Description: WooCommerce Twilio SMS Notifications. 8 * Version: 1.0. 58 * Version: 1.0.6 9 9 * Author: mbj-webdevelopment 10 10 * Author URI: http://localleadminer.com/ … … 14 14 * Domain Path: /languages 15 15 */ 16 17 16 // If this file is called directly, abort. 18 if ( ! defined( 'WPINC' )) {19 die;17 if (!defined('WPINC')) { 18 die; 20 19 } 21 20 if (!defined('TWILIO_SMS_FOR_WOO_LOG_DIR')) { … … 24 23 } 25 24 if (!defined('TWILLIO_PLUGIN_DIR_PATH')) { 26 define('TWILLIO_PLUGIN_DIR_PATH', untrailingslashit( plugin_dir_path( __FILE__ )));25 define('TWILLIO_PLUGIN_DIR_PATH', untrailingslashit(plugin_dir_path(__FILE__))); 27 26 } 28 27 … … 32 31 */ 33 32 function activate_twilio_sms_for_woo() { 34 require_once plugin_dir_path( __FILE__) . 'includes/class-twilio-sms-for-woo-activator.php';35 Twilio_Sms_For_Woo_Activator::activate();33 require_once plugin_dir_path(__FILE__) . 'includes/class-twilio-sms-for-woo-activator.php'; 34 Twilio_Sms_For_Woo_Activator::activate(); 36 35 } 37 36 … … 41 40 */ 42 41 function deactivate_twilio_sms_for_woo() { 43 require_once plugin_dir_path( __FILE__) . 'includes/class-twilio-sms-for-woo-deactivator.php';44 Twilio_Sms_For_Woo_Deactivator::deactivate();42 require_once plugin_dir_path(__FILE__) . 'includes/class-twilio-sms-for-woo-deactivator.php'; 43 Twilio_Sms_For_Woo_Deactivator::deactivate(); 45 44 } 46 45 47 register_activation_hook( __FILE__, 'activate_twilio_sms_for_woo');48 register_deactivation_hook( __FILE__, 'deactivate_twilio_sms_for_woo');46 register_activation_hook(__FILE__, 'activate_twilio_sms_for_woo'); 47 register_deactivation_hook(__FILE__, 'deactivate_twilio_sms_for_woo'); 49 48 50 49 /** … … 52 51 * admin-specific hooks, and public-facing site hooks. 53 52 */ 54 require plugin_dir_path( __FILE__) . 'includes/class-twilio-sms-for-woo.php';53 require plugin_dir_path(__FILE__) . 'includes/class-twilio-sms-for-woo.php'; 55 54 56 55 /** … … 65 64 function run_twilio_sms_for_woo() { 66 65 67 $plugin = new Twilio_Sms_For_Woo(); 68 $plugin->run(); 66 $plugin = new Twilio_Sms_For_Woo(); 67 $plugin->run(); 68 } 69 69 70 }71 70 run_twilio_sms_for_woo();
Note: See TracChangeset
for help on using the changeset viewer.