Changeset 2955592
- Timestamp:
- 08/19/2023 04:10:02 AM (3 years ago)
- Location:
- wp-line-notify/trunk
- Files:
-
- 3 edited
-
includes/page-setup.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
-
wp-line-notify.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-line-notify/trunk/includes/page-setup.php
r2954624 r2955592 182 182 if(isset($test_send)) echo $test_send; 183 183 ?> 184 <form id="sig_line_notify_test" action="<?php echo admin_url('admin-ajax.php?action=sig_line_notify_test')?>" method="post">184 <form id="sig_line_notify_test" action="<?php echo esc_url( admin_url('admin-ajax.php?action=sig_line_notify_test')); ?>" method="post"> 185 185 <?php wp_nonce_field( 'sig_line_notify_test_nonce' ); ?> 186 186 <table class="form-table"> … … 209 209 <textarea name="line_notify_content_test" style="width: 400px; height: 100px; "></textarea> 210 210 <div id="line_notify_result_test"></div> 211 <?php submit_button( __( 'Send test' , 'wp-line-notify' ), 'primary', '', true, 'id=submit_test'); ?> 211 212 </td> 212 213 </tr> 213 214 </table> 214 <?php submit_button(__( 'Send test' , 'wp-line-notify' )); ?> 215 215 216 </form> 216 217 </div> … … 221 222 $('#user-id').on('change',function(){ 222 223 var uid = $(this).val(); 223 location.href = '<?php echo admin_url('options-general.php?page=sig-wp-line-notify&uid=')?>'+uid;224 location.href = '<?php echo esc_url( admin_url('options-general.php?page=sig-wp-line-notify&uid=') ); ?>'+uid; 224 225 }); 225 226 … … 229 230 230 231 $('#sig_line_notify_test').submit(function(){ 231 $.post( '<?php echo admin_url('admin-ajax.php?action=sig_line_notify_test')?>', $('#sig_line_notify_test').serialize() ) 232 $('#submit_test').prop('disabled', true); 233 $.post( '<?php echo esc_url( admin_url('admin-ajax.php?action=sig_line_notify_test') ); ?>', $('#sig_line_notify_test').serialize() ) 232 234 .fail(function(jqXHR, textStatus) { 233 235 errText = jqXHR.responseText; 234 alert( 'Error.' + errText.replace(/<[^>]+>/g, '') ); 236 $('#line_notify_result_test').text('Error: ' + errText.replace(/<[^>]+>/g, '')); 237 $('#submit_test').prop('disabled', false); 235 238 }) 236 239 .done(function( data ) { 237 240 $('#line_notify_result_test').text(data); 241 $('#submit_test').prop('disabled', false); 238 242 }); 239 243 return false; 240 244 }); 241 245 242 $('#btn-revoke').click(function(){243 if(confirm("<?php _e( 'Are you sure to revoke notification configurations?' , 'wp-line-notify' ) ?>")){244 $.getJSON("<?php echo $revoke_url;?>", function(result){245 alert(result.message);246 if(result.rs) window.location.reload();247 });248 }else{249 return false;250 }251 });252 246 }); 253 247 </script> -
wp-line-notify/trunk/readme.txt
r2954624 r2955592 5 5 Tested up to: 6.3 6 6 Requires PHP: 7.4 7 Stable tag: 1.4. 37 Stable tag: 1.4.4 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 32 32 33 33 == Changelog == 34 35 = 1.4.4 - 2023-08-19 = 36 * Update: Form UI. 37 * Improved: Remove revoke function. 34 38 35 39 = 1.4.3 - 2023-08-17 = -
wp-line-notify/trunk/wp-line-notify.php
r2954624 r2955592 3 3 * Plugin Name: WordPress LINE Notify 4 4 * Description: This plugin can send a alert message by LINE Notify 5 * Version: 1.4. 35 * Version: 1.4.4 6 6 * Author: Simon Chuang 7 7 * Author URI: https://github.com/mark2me/wp-line-notify … … 28 28 private $plugin_name = ''; 29 29 30 private $revoke_url = 'admin-ajax.php?action=sig_line_notify_revoke';31 32 30 public $option; 33 31 … … 94 92 add_action( 'elementor_pro/forms/actions/register', array( $this, 'register_new_form_actions') ); 95 93 } 96 97 // revoke98 add_action( 'wp_ajax_sig_line_notify_revoke', function(){99 $line = new sig_line_notify( $this->option['token'] );100 return $line->revoke();101 });102 94 103 95 // test token … … 135 127 136 128 public function html_settings_page() { 137 138 $revoke_url = admin_url($this->revoke_url);139 129 140 130 $option_name = $this->current_user_option_name(); … … 505 495 check_admin_referer('sig_line_notify_test_nonce'); 506 496 507 $message = ( !empty($_POST['line_notify_content_test']) ) ? sanitize_textarea_field( $_POST['line_notify_content_test'] ) : __( 'This is a Line notify plugin test.' , 'wp-line-notify' ); 497 $message = sanitize_textarea_field( $_POST['line_notify_content_test'] ); 498 if( empty($message) ) $message = __( 'This is a Line notify plugin test.' , 'wp-line-notify' ); 508 499 509 500 $uid = $_POST['line_notify_uid_test']; … … 524 515 $rs_msg = __( 'Send test ok!' , 'wp-line-notify' ); 525 516 } else { 526 $rs_msg = sprintf('%1s, message: %2s', __( 'Error on send LINE Notify.' , 'wp-line-notify' ), $rs);527 } 528 529 } 530 531 wp_die( $rs_msg);517 $rs_msg = sprintf('%1s, message: %2s', __( 'Error on send LINE Notify.' , 'wp-line-notify' ), sanitize_text_field($rs) ); 518 } 519 520 } 521 522 wp_die( $rs_msg ); 532 523 } 533 524
Note: See TracChangeset
for help on using the changeset viewer.