Form Builder | Create Responsive Contact Forms - Version 1.8.5

Version Description

Download this release

Release Info

Developer umarbajwa
Plugin Icon 128x128 Form Builder | Create Responsive Contact Forms
Version 1.8.5
Comparing to
See all releases

Code changes from version 1.8.4 to 1.8.5

Files changed (4) hide show
  1. admin/assets/js/get-feedback.js +94 -0
  2. feedback.php +209 -0
  3. forms.php +17 -2
  4. readme.txt +1 -1
admin/assets/js/get-feedback.js ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Code Snippet from POST SMTP : https://wordpress.org/plugins/post-smtp/
3
+ License : GPL V2
4
+ */
5
+ jQuery(document).ready(function($) {
6
+
7
+ $( '#msfcf-plugin-deactivate-link' ).click(function(e) {
8
+ e.preventDefault();
9
+
10
+ var reason = $( '#MSFCF_feedback_form_container .MSFCF-reason' ),
11
+ deactivateLink = $( this ).attr( 'href' );
12
+
13
+ $( "#MSFCF_feedback_form_container" ).dialog({
14
+ title: 'PluginOps Feedback Form',
15
+ dialogClass: '#MSFCF_feedback_form-form',
16
+ resizable: false,
17
+ minWidth: 400,
18
+ minHeight: 300,
19
+ modal: true,
20
+ buttons: {
21
+ 'go' : {
22
+ text: 'Continue',
23
+ id: 'MSFCF_feedback_form_go',
24
+ class: 'button',
25
+ click: function() {
26
+
27
+ var dialog = $(this),
28
+ go = $('#MSFCF_feedback_form_go'),
29
+ form = dialog.find( 'form' ).serializeArray(),
30
+ result = {};
31
+
32
+ $.each( form, function() {
33
+ if ( '' !== this.value )
34
+ result[ this.name ] = this.value;
35
+ });
36
+
37
+ if ( ! jQuery.isEmptyObject( result ) ) {
38
+ result.action = 'mscf_send_user_feedback';
39
+ $.ajax({
40
+ url: CFWBS_feedback_URL.admin_ajax,
41
+ type: 'POST',
42
+ data: result,
43
+ error: function(){},
44
+ success: function(msg){},
45
+ beforeSend: function() {
46
+ go.addClass('MSFCF-ajax-progress');
47
+ },
48
+ complete: function() {
49
+ go.removeClass('MSFCF-ajax-progress');
50
+
51
+ dialog.dialog( "close" );
52
+ location.href = deactivateLink;
53
+ }
54
+ });
55
+
56
+ }
57
+
58
+
59
+ },
60
+ },
61
+ 'cancel' : {
62
+ text: 'Cancel',
63
+ id: 'MSFCF_feedback_form-cancel',
64
+ class: 'button button-primary',
65
+ click: function() {
66
+ $( this ).dialog( "close" );
67
+ }
68
+ },
69
+ 'skip' : {
70
+ text: 'Skip',
71
+ id: 'MSFCF_feedback_form-skip',
72
+ click: function() {
73
+ $( this ).dialog( "close" );
74
+
75
+ location.href = deactivateLink;
76
+ }
77
+ },
78
+ }
79
+ });
80
+
81
+ reason.change(function() {
82
+ $( '.MSFCF-reason-input' ).hide();
83
+
84
+ if ( $( this ).hasClass( 'MSFCF-custom-input' ) ) {
85
+ $( '#MSFCF-deactivate-reasons' ).next( '.MSFCF-reason-input' ).show();
86
+ }
87
+
88
+ if ( $( this ).hasClass( 'MSFCF-support-input' ) ) {
89
+ $( this ).find( '.MSFCF-reason-input' ).show();
90
+ }
91
+ });
92
+
93
+ });
94
+ });
feedback.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
+ class CF_WB_Admin_feedback_class {
4
+
5
+ function __construct(){
6
+
7
+ $this->_init();
8
+ $this->_hooks();
9
+ $this->_filters();
10
+
11
+ }
12
+
13
+ function _init(){
14
+ global $pagenow;
15
+ if ( 'plugins.php' === $pagenow ) {
16
+ add_action( 'admin_enqueue_scripts', array( $this, 'feedback_load_scripts' ) );
17
+ add_action( 'admin_footer', array( $this, 'deactivation_feedback_form' ) );
18
+ }
19
+ }
20
+
21
+ function _hooks(){
22
+
23
+ add_action( 'wp_ajax_mscf_send_user_feedback', array( $this, 'mscf_send_user_feedback' ) );
24
+
25
+ }
26
+
27
+ function _filters(){
28
+
29
+ }
30
+
31
+
32
+ function feedback_load_scripts() {
33
+ wp_enqueue_style( 'wp-jquery-ui-dialog' );
34
+ wp_enqueue_script( 'MSFM_Send_feedback',SMUZFORM_PLUGIN_URL.'/admin/assets/js/get-feedback.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-dialog' ), false, true );
35
+ wp_localize_script( 'MSFM_Send_feedback', 'CFWBS_feedback_URL',array( 'admin_ajax' => admin_url( 'admin-ajax.php' ) ) );
36
+ }
37
+
38
+
39
+ function deactivation_feedback_form() {
40
+
41
+ $pb_current_user = wp_get_current_user();
42
+ ?>
43
+ <div id="MSFCF_feedback_form_container" style="display: none;">
44
+ <p>
45
+ <b>It is really sad to see you leaving me. 😢 <br>
46
+ I would love to get a small feedback from you. </b>
47
+ </p>
48
+ <form>
49
+ <?php wp_nonce_field(); ?>
50
+ <ul id="MSFCF-deactivate-reasons">
51
+
52
+ <li class="MSFCF-reason">
53
+ <label>
54
+ <span><input value="Plugin is not good" type="radio" name="reason" checked="checked" /></span>
55
+ <span>Plugin is not good</span>
56
+ </label>
57
+ </li>
58
+ <li class="MSFCF-reason">
59
+ <label>
60
+ <span><input value="bad support" type="radio" name="reason" /></span>
61
+ <span>Bad Support</span>
62
+ </label>
63
+ </li>
64
+ <li class="MSFCF-reason MSFCF-custom-input">
65
+ <label>
66
+ <span><input value="Found a better plugin" type="radio" name="reason" /></span>
67
+ <span>Found a better plugin</span>
68
+ </label>
69
+ </li>
70
+ <li class="MSFCF-reason MSFCF-custom-input">
71
+ <label>
72
+ <span><input value="The plugin didn't work" type="radio" name="reason" /></span>
73
+ <span>The plugin didn't work</span>
74
+ </label>
75
+ </li>
76
+ <li class="MSFCF-reason MSFCF-custom-input">
77
+ <label>
78
+ <span><input value="Other Reason" type="radio" name="reason" /></span>
79
+ <span>Other Reason</span>
80
+ </label>
81
+ </li>
82
+ <li class="MSFCF-reason MSFCF-support-input">
83
+ <label>
84
+ <span><input value="Support Ticket" type="radio" name="reason" /></span>
85
+ <span>Open A support ticket for me</span>
86
+ </label>
87
+ <div class="MSFCF-reason-input" style="display: none;">
88
+ <input type="email" name="support[email]" placeholder="Your Email Address" required>
89
+ <input type="text" name="support[title]" placeholder="The Title" required>
90
+ <textarea name="support[text]" placeholder="Describe the issue" required></textarea>
91
+ </div>
92
+ </li>
93
+ <li class="MSFCF-reason">
94
+ <label>
95
+ <span><input type="checkbox" value="<?php echo($pb_current_user->user_email) ?>" name="followUpEmail" checked /></span>
96
+ <span>Share your email address. (We can get in touch with you to fix this)</span>
97
+ </label>
98
+ </li>
99
+ </ul>
100
+ <div class="MSFCF-reason-input" style="display: none;">
101
+ <input type="text" class="regular-text" name="other_input" placeholder="Do you mind help and give more detailes?">
102
+ </div>
103
+ </form>
104
+ </div>
105
+ <style type="text/css">
106
+ .MSFCF_feedback_form_form .ui-dialog-buttonset {
107
+ float: none !important;
108
+ }
109
+
110
+ #MSFCF_feedback_form_go {
111
+ float: left;
112
+ }
113
+
114
+ #MSFCF_feedback_form_skip, #MSFCF_feedback_form_cancel {
115
+ float: right;
116
+ }
117
+
118
+ #MSFCF_feedback_form_container p {
119
+ font-size: 1.1em;
120
+ }
121
+
122
+ .MSFCF-reason-input textarea {
123
+ margin-top: 10px;
124
+ width: 100%;
125
+ height: 150px;
126
+ }
127
+
128
+ .MSFCF_feedback_form_form .ui-icon {
129
+ display: none;
130
+ }
131
+
132
+ #MSFCF_feedback_form_go.MSFCF-ajax-progress .ui-icon {
133
+ text-indent: inherit;
134
+ display: inline-block !important;
135
+ vertical-align: middle;
136
+ animation: rotate 2s infinite linear;
137
+ }
138
+
139
+ #MSFCF_feedback_form_go.MSFCF-ajax-progress .ui-button-text {
140
+ vertical-align: middle;
141
+ }
142
+
143
+ @keyframes rotate {
144
+ 0% { transform: rotate(0deg); }
145
+ 100% { transform: rotate(360deg); }
146
+ }
147
+ </style>
148
+ <?php
149
+ }
150
+
151
+
152
+ function mscf_send_user_feedback(){
153
+
154
+ if ( ! check_ajax_referer() ) {
155
+ die( 'security error' );
156
+ }
157
+
158
+ $other_input = '';
159
+ if (isset($_POST['other_input']) ) {
160
+ $other_input = sanitize_text_field( $_POST['other_input']);
161
+ }
162
+ $postedFeedbackReason = sanitize_text_field( $_POST['reason'] ) . " : ". $other_input."\n";
163
+
164
+ if (isset($_POST['followUpEmail'])) {
165
+ $followUpEmail = sanitize_text_field($_POST['followUpEmail']);
166
+ $postedFeedbackReason = $postedFeedbackReason."\n".$followUpEmail;
167
+ }
168
+
169
+ $emailContents = $postedFeedbackReason;
170
+ if ( isset( $_POST['support'] ) ) {
171
+ $postedFeedbackSupportEmail = sanitize_email( $_POST['support']['email'] );
172
+ $postedFeedbackSupportTitle = sanitize_text_field( $_POST['support']['title'] );
173
+ $postedFeedbackSupportMessage = sanitize_textarea_field( $_POST['support']['text'] );
174
+
175
+ $emailContents = "Support Email : $postedFeedbackSupportEmail \n".
176
+ "Support Title : $postedFeedbackSupportTitle \n".
177
+ "Support Message : $postedFeedbackSupportMessage \n";
178
+ }
179
+
180
+ $fromEmailAddress = home_url();
181
+ $fromEmailAddress = trim($fromEmailAddress, '/');
182
+
183
+ if (!preg_match('#^http(s)?://#', $fromEmailAddress)) {
184
+ $fromEmailAddress = 'http://' . $fromEmailAddress;
185
+ }
186
+
187
+ $urlParts = parse_url($fromEmailAddress);
188
+
189
+ $OnlyDomain = preg_replace('/^www\./', '', $urlParts['host']);
190
+
191
+ $fromEmailAddress = "pluginopsfeedbackform@".$OnlyDomain;
192
+
193
+
194
+ $headers[]= "From: "." Contact Form Feedback Form"." <".$fromEmailAddress.">";
195
+
196
+
197
+ $sendFeedback = wp_mail( 'feedback@pluginops.com', "CF Uninstall FeedBack", $emailContents, $headers);
198
+
199
+ if ($sendFeedback == true) {
200
+ echo "success";
201
+ }
202
+ exit();
203
+
204
+ }
205
+
206
+
207
+ } //class ends
208
+
209
+ ?>
forms.php CHANGED
@@ -5,7 +5,7 @@ Description: Create Resposnive Forms using Drag & Drop Visual Builder.
5
  Author: Web-Settler
6
  Author URI: http://web-settler.com/form-builder/
7
  Plugin URI: http://web-settler.com/form-builder/
8
- Version: 1.8.4
9
  License: GPL V2+
10
  **/
11
 
@@ -13,6 +13,8 @@ require plugin_dir_path( __FILE__ ) . 'config.php';
13
 
14
  require plugin_dir_path( __FILE__ ) . 'core_functions.php';
15
 
 
 
16
  //require plugin_dir_path( __FILE__ ) . '/admin/Ask-Rev.php';
17
 
18
  /**
@@ -85,4 +87,17 @@ function smuzform_redirect_entrypage_option() {
85
 
86
  add_option( 'smuzform_activated', 'smuzform' );
87
 
88
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  Author: Web-Settler
6
  Author URI: http://web-settler.com/form-builder/
7
  Plugin URI: http://web-settler.com/form-builder/
8
+ Version: 1.8.5
9
  License: GPL V2+
10
  **/
11
 
13
 
14
  require plugin_dir_path( __FILE__ ) . 'core_functions.php';
15
 
16
+ require plugin_dir_path( __FILE__ ) . 'feedback.php';
17
+
18
  //require plugin_dir_path( __FILE__ ) . '/admin/Ask-Rev.php';
19
 
20
  /**
87
 
88
  add_option( 'smuzform_activated', 'smuzform' );
89
 
90
+ }
91
+
92
+ $cf_wb_forms_uninstall_feedbak_form = new CF_WB_Admin_feedback_class();
93
+
94
+ function cfwb_plugin_add_settings_link( $links ) {
95
+ $settings_link = '<a href="edit.php?post_type=subscribe_me_forms">' . __( 'Dashboard' ) . '</a>';
96
+ $support_link = '<a href="http://web-settler.com/ulp-support/">' . __( 'Support' ) . '</a>';
97
+ $links['deactivate'] = str_replace( '<a', '<a id="msfcf-plugin-deactivate-link"', $links['deactivate'] );
98
+ array_push( $links, $settings_link );
99
+ array_push( $links, $support_link );
100
+ return $links;
101
+ }
102
+ $plugin = plugin_basename( __FILE__ );
103
+ add_filter( "plugin_action_links_$plugin", 'cfwb_plugin_add_settings_link' );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: umarbajwa
3
  Requires at least: 3.7
4
  Tested up to: 4.9
5
  Tags: contact form, form builder, contact me, custom contact form, form, custom formss
6
- Stable tag: 1.8.4
7
  Donate Link: http://web-settler.com/form-builder/
8
  License: GPL V2 or latest
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
3
  Requires at least: 3.7
4
  Tested up to: 4.9
5
  Tags: contact form, form builder, contact me, custom contact form, form, custom formss
6
+ Stable tag: 1.8.5
7
  Donate Link: http://web-settler.com/form-builder/
8
  License: GPL V2 or latest
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html