From a5f8d8dce0f9f7cc373d62a820d07902e02548d7 Mon Sep 17 00:00:00 2001 From: yehudah Date: Mon, 20 Nov 2017 22:02:17 +0000 Subject: * Fixed: misspled false * Fixed: feedback form * Fixed: Some localization strings * Removed: deprecated function * New: Option to input emails when resend email * Added: explain message on email log filter --- Postman/PostmanPluginFeedback.php | 62 +++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 19 deletions(-) (limited to 'Postman/PostmanPluginFeedback.php') diff --git a/Postman/PostmanPluginFeedback.php b/Postman/PostmanPluginFeedback.php index de7d73f..3ac985d 100644 --- a/Postman/PostmanPluginFeedback.php +++ b/Postman/PostmanPluginFeedback.php @@ -4,7 +4,6 @@ class PostmanPluginFeedback { function __construct() { add_filter( 'plugin_action_links_' . plugin_basename( POST_BASE ), array( $this, 'insert_deactivate_link_id' ) ); add_action( 'wp_ajax_post_user_feedback', array( $this, 'post_user_feedback' ) ); - global $pagenow; if ( 'plugins.php' === $pagenow ) { add_action( 'admin_enqueue_scripts', array( $this, 'load_scripts' ) ); @@ -15,7 +14,7 @@ class PostmanPluginFeedback { function load_scripts() { wp_enqueue_style( 'wp-jquery-ui-dialog' ); - wp_register_script( 'post-feedback', plugins_url( 'script/feedback/feedback.js', POST_BASE ), array( 'jquery', 'jquery-ui-core', 'jquery-ui-dialog' ), fasle, true ); + wp_register_script( 'post-feedback', plugins_url( 'script/feedback/feedback.js', POST_BASE ), array( 'jquery', 'jquery-ui-core', 'jquery-ui-dialog' ), false, true ); wp_localize_script( 'post-feedback', 'post_feedback', array( 'admin_ajax' => admin_url( 'admin-ajax.php' ) ) ); wp_enqueue_script( 'post-feedback' ); } @@ -27,7 +26,7 @@ class PostmanPluginFeedback { $payload = array( 'reason' => sanitize_text_field( $_POST['reason'] ), - 'other_input' => isset( $_POST['other_input'] ) ? sanitize_textarea_field( $_POST['other_input'] ) : '', + 'other_input' => isset( $_POST['other_input'] ) ? sanitize_text_field( $_POST['other_input'] ) : '', ); if ( isset( $_POST['support'] ) ) { @@ -38,6 +37,7 @@ class PostmanPluginFeedback { $args = array( 'body' => $payload, + 'timeout' => 20, ); $result = wp_remote_post( 'https://postmansmtp.com/feedback', $args ); die( 'success' ); @@ -50,11 +50,11 @@ class PostmanPluginFeedback { float: none !important; } - #postman-feedback-dialog-skip { + #postman-feedback-dialog-go { float: left; } - #postman-feedback-dialog-go, #postman-feedback-dialog-cancel { + #postman-feedback-dialog-skip, #postman-feedback-dialog-cancel { float: right; } @@ -62,11 +62,31 @@ class PostmanPluginFeedback { font-size: 1.1em; } - #postman-deactivate-reasons textarea { + .postman-reason-input textarea { margin-top: 10px; width: 100%; height: 150px; } + + .postman-feedback-dialog-form .ui-icon { + display: none; + } + + #postman-feedback-dialog-go.postman-ajax-progress .ui-icon { + text-indent: inherit; + display: inline-block !important; + vertical-align: middle; + animation: rotate 2s infinite linear; + } + + #postman-feedback-dialog-go.postman-ajax-progress .ui-button-text { + vertical-align: middle; + } + + @keyframes rotate { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } +