Contact Form & SMTP Plugin for WordPress by PirateForms - Version 2.0.2

Version Description

  • 2017-08-07
Download this release

Release Info

Developer codeinwp
Plugin Icon 128x128 Contact Form & SMTP Plugin for WordPress by PirateForms
Version 2.0.2
Comparing to
See all releases

Code changes from version 2.0.1 to 2.0.2

CHANGELOG.md CHANGED
@@ -1,4 +1,13 @@
1
 
 
 
 
 
 
 
 
 
 
2
  ### v2.0.1 - 2017-08-01
3
  **Changes:**
4
  * Fixed backwards compatibility with Zerif themes
1
 
2
+ ### v2.0.2 - 2017-08-08
3
+ **Changes:**
4
+
5
+ ### v2.0.2 - 2017-08-07
6
+ **Changes:**
7
+ * Fixed none option for thank you page.
8
+ * Fixed various issues with form layout.
9
+ * Added support for future pro version.
10
+
11
  ### v2.0.1 - 2017-08-01
12
  **Changes:**
13
  * Fixed backwards compatibility with Zerif themes
admin/class-pirateforms-admin.php CHANGED
@@ -128,8 +128,8 @@ class PirateForms_Admin {
128
  * @since 1.0.0
129
  */
130
  public function add_to_admin() {
131
- add_menu_page( PIRATEFORMS_NAME, PIRATEFORMS_NAME, 'manage_options', 'pirateforms-admin', array( $this, 'pirate_forms_admin' ), 'dashicons-feedback' );
132
- add_submenu_page( 'pirateforms-admin', PIRATEFORMS_NAME, __( 'Settings', 'pirate-forms' ), 'manage_options', 'pirateforms-admin', array( $this, 'pirate_forms_admin' ) );
133
  }
134
 
135
 
@@ -138,7 +138,7 @@ class PirateForms_Admin {
138
  *
139
  * @since 1.0.0
140
  */
141
- function pirate_forms_admin() {
142
  global $current_user;
143
  $pirate_forms_options = PirateForms_Util::get_option();
144
  $plugin_options = $this->pirate_forms_plugin_options();
@@ -158,30 +158,6 @@ class PirateForms_Admin {
158
  }
159
  }
160
 
161
- /**
162
- * Get the list of all pages
163
- *
164
- * @since 1.0.0
165
- */
166
- function pirate_forms_get_pages_array( $type = 'page' ) {
167
- $content = array(
168
- '' => __( 'None', 'pirate-forms' ),
169
- );
170
- $items = get_posts(
171
- array(
172
- 'post_type' => $type,
173
- 'numberposts' => - 1,
174
- )
175
- );
176
- if ( ! empty( $items ) ) :
177
- foreach ( $items as $item ) :
178
- $content[ $item->ID ] = $item->post_title;
179
- endforeach;
180
- endif;
181
-
182
- return $content;
183
-
184
- }
185
 
186
  /**
187
  *
@@ -240,10 +216,10 @@ class PirateForms_Admin {
240
  'id' => 'pirateformsopt_email',
241
  'type' => 'text',
242
  'label' => array(
243
- 'value' => __( 'Contact notification sender email', 'pirate-forms' ),
244
  'html' => '<span class="dashicons dashicons-editor-help"></span>',
245
  'desc' => array(
246
- 'value' => '<strong>' . __( "Insert [email] to use the contact form submitter's email.", 'pirate-forms' ) . '</strong><br>' . __( "Email to use for the sender of the contact form emails both to the recipients below and the contact form submitter (if this is activated below). The domain for this email address should match your site's domain.", 'pirate-forms' ),
247
  'class' => 'pirate_forms_option_description',
248
  ),
249
  ),
@@ -328,18 +304,17 @@ class PirateForms_Admin {
328
  'type' => 'div',
329
  'class' => 'pirate-forms-grouped',
330
  ),
331
- 'class' => 'widefat',
332
- 'cols' => 30,
333
  'rows' => 5,
334
  ),
335
  array(
336
  'id' => 'pirateformsopt_thank_you_url',
337
  'type' => 'select',
338
  'label' => array(
339
- 'value' => __( '"Thank You" URL', 'pirate-forms' ),
340
  'html' => '<span class="dashicons dashicons-editor-help"></span>',
341
  'desc' => array(
342
- 'value' => __( 'Select the post-submit page for all forms submitted', 'pirate-forms' ),
343
  'class' => 'pirate_forms_option_description',
344
  ),
345
  ),
@@ -348,7 +323,7 @@ class PirateForms_Admin {
348
  'type' => 'div',
349
  'class' => 'pirate-forms-grouped',
350
  ),
351
- 'options' => $this->pirate_forms_get_pages_array(),
352
  ),
353
  )
354
  ),
@@ -376,7 +351,7 @@ class PirateForms_Admin {
376
  'class' => 'pirate-forms-grouped',
377
  ),
378
  'options' => array(
379
- '' => __( 'None', 'pirate-forms' ),
380
  'yes' => __( 'Yes but not required', 'pirate-forms' ),
381
  'req' => __( 'Required', 'pirate-forms' ),
382
  ),
@@ -400,7 +375,6 @@ class PirateForms_Admin {
400
  'class' => 'pirate-forms-grouped',
401
  ),
402
  'options' => array(
403
- '' => __( 'None', 'pirate-forms' ),
404
  'yes' => __( 'Yes but not required', 'pirate-forms' ),
405
  'req' => __( 'Required', 'pirate-forms' ),
406
  ),
@@ -424,7 +398,7 @@ class PirateForms_Admin {
424
  'class' => 'pirate-forms-grouped',
425
  ),
426
  'options' => array(
427
- '' => __( 'None', 'pirate-forms' ),
428
  'yes' => __( 'Yes but not required', 'pirate-forms' ),
429
  'req' => __( 'Required', 'pirate-forms' ),
430
  ),
@@ -443,7 +417,6 @@ class PirateForms_Admin {
443
  'class' => 'pirate-forms-grouped',
444
  ),
445
  'options' => array(
446
- '' => __( 'None', 'pirate-forms' ),
447
  'yes' => __( 'Yes but not required', 'pirate-forms' ),
448
  'req' => __( 'Required', 'pirate-forms' ),
449
  ),
@@ -461,8 +434,7 @@ class PirateForms_Admin {
461
  'class' => 'pirate-forms-grouped',
462
  ),
463
  'options' => array(
464
- '' => __( 'None', 'pirate-forms' ),
465
- 'no' => __( 'No', 'pirate-forms' ),
466
  'yes' => __( 'Yes but not required', 'pirate-forms' ),
467
  'req' => __( 'Required', 'pirate-forms' ),
468
  ),
128
  * @since 1.0.0
129
  */
130
  public function add_to_admin() {
131
+ add_menu_page( PIRATEFORMS_NAME, PIRATEFORMS_NAME, 'manage_options', 'pirateforms-admin', array( $this, 'settings' ), 'dashicons-feedback' );
132
+ add_submenu_page( 'pirateforms-admin', PIRATEFORMS_NAME, __( 'Settings', 'pirate-forms' ), 'manage_options', 'pirateforms-admin', array( $this, 'settings' ) );
133
  }
134
 
135
 
138
  *
139
  * @since 1.0.0
140
  */
141
+ function settings() {
142
  global $current_user;
143
  $pirate_forms_options = PirateForms_Util::get_option();
144
  $plugin_options = $this->pirate_forms_plugin_options();
158
  }
159
  }
160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
 
162
  /**
163
  *
216
  'id' => 'pirateformsopt_email',
217
  'type' => 'text',
218
  'label' => array(
219
+ 'value' => __( 'Contact notification email address', 'pirate-forms' ),
220
  'html' => '<span class="dashicons dashicons-editor-help"></span>',
221
  'desc' => array(
222
+ 'value' => '<strong>' . __( "Insert [email] to use the contact form submitter's email.", 'pirate-forms' ) . '</strong><br>' . __( "The notification email will be sent from this address both to the recipients below and the contact form submitter (if this is activated below in email confirmation, in which case the domain for this email address should match your site's domain).", 'pirate-forms' ),
223
  'class' => 'pirate_forms_option_description',
224
  ),
225
  ),
304
  'type' => 'div',
305
  'class' => 'pirate-forms-grouped',
306
  ),
307
+ 'cols' => 70,
 
308
  'rows' => 5,
309
  ),
310
  array(
311
  'id' => 'pirateformsopt_thank_you_url',
312
  'type' => 'select',
313
  'label' => array(
314
+ 'value' => __( '"Thank You" Page', 'pirate-forms' ),
315
  'html' => '<span class="dashicons dashicons-editor-help"></span>',
316
  'desc' => array(
317
+ 'value' => __( 'Select the page that displays after a successful form submission. The page will be displayed without pausing on the email form, so please be sure to configure a relevant thank you message in this page.', 'pirate-forms' ),
318
  'class' => 'pirate_forms_option_description',
319
  ),
320
  ),
323
  'type' => 'div',
324
  'class' => 'pirate-forms-grouped',
325
  ),
326
+ 'options' => PirateForms_Util::get_thank_you_pages(),
327
  ),
328
  )
329
  ),
351
  'class' => 'pirate-forms-grouped',
352
  ),
353
  'options' => array(
354
+ '' => __( 'No', 'pirate-forms' ),
355
  'yes' => __( 'Yes but not required', 'pirate-forms' ),
356
  'req' => __( 'Required', 'pirate-forms' ),
357
  ),
375
  'class' => 'pirate-forms-grouped',
376
  ),
377
  'options' => array(
 
378
  'yes' => __( 'Yes but not required', 'pirate-forms' ),
379
  'req' => __( 'Required', 'pirate-forms' ),
380
  ),
398
  'class' => 'pirate-forms-grouped',
399
  ),
400
  'options' => array(
401
+ '' => __( 'No', 'pirate-forms' ),
402
  'yes' => __( 'Yes but not required', 'pirate-forms' ),
403
  'req' => __( 'Required', 'pirate-forms' ),
404
  ),
417
  'class' => 'pirate-forms-grouped',
418
  ),
419
  'options' => array(
 
420
  'yes' => __( 'Yes but not required', 'pirate-forms' ),
421
  'req' => __( 'Required', 'pirate-forms' ),
422
  ),
434
  'class' => 'pirate-forms-grouped',
435
  ),
436
  'options' => array(
437
+ '' => __( 'No', 'pirate-forms' ),
 
438
  'yes' => __( 'Yes but not required', 'pirate-forms' ),
439
  'req' => __( 'Required', 'pirate-forms' ),
440
  ),
includes/class-pirateforms-html.php CHANGED
@@ -238,7 +238,7 @@ class PirateForms_HTML {
238
  private function select( $args ) {
239
  $html = $this->get_label( $args );
240
 
241
- $html .= '<select id="' . esc_attr( $args['id'] ) . '" name="' . esc_attr( $args['name'] ) . '" class="' . ( isset( $args['class'] ) ? esc_attr( $args['class'] ) : '' ) . '"';
242
  if ( isset( $args['options'] ) && is_array( $args['options'] ) ) {
243
  foreach ( $args['options'] as $key => $val ) {
244
  $extra = $key == $args['value'] ? 'selected' : '';
238
  private function select( $args ) {
239
  $html = $this->get_label( $args );
240
 
241
+ $html .= '<select id="' . esc_attr( $args['id'] ) . '" name="' . esc_attr( $args['name'] ) . '" class="' . ( isset( $args['class'] ) ? esc_attr( $args['class'] ) : '' ) . '">';
242
  if ( isset( $args['options'] ) && is_array( $args['options'] ) ) {
243
  foreach ( $args['options'] as $key => $val ) {
244
  $extra = $key == $args['value'] ? 'selected' : '';
includes/class-pirateforms-phpformbuilder.php CHANGED
@@ -47,10 +47,9 @@ class PirateForms_PhpFormBuilder {
47
  *
48
  * @since 1.2.6
49
  */
50
- public function set_element( $element_name, &$output ) {
51
  $name = str_replace( array( 'pirate-forms-', '-' ), array( '', '_' ), $element_name );
52
  $this->$name = $output;
53
- $output = '';
54
  }
55
 
56
  /**
47
  *
48
  * @since 1.2.6
49
  */
50
+ public function set_element( $element_name, $output ) {
51
  $name = str_replace( array( 'pirate-forms-', '-' ), array( '', '_' ), $element_name );
52
  $this->$name = $output;
 
53
  }
54
 
55
  /**
includes/class-pirateforms-util.php CHANGED
@@ -75,4 +75,95 @@ class PirateForms_Util {
75
  return true;
76
  }
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  }
75
  return true;
76
  }
77
 
78
+ /**
79
+ * Check if the email/IP is blacklisted
80
+ *
81
+ * @param string $error_key the key for the session object.
82
+ * @param string $email the email id to check.
83
+ * @param string $ip the IP to check.
84
+ *
85
+ * @since 1.0.0
86
+ */
87
+ public static function is_blacklisted( $error_key, $email, $ip ) {
88
+ $final_blocked_arr = array();
89
+
90
+ $blocked = get_option( 'blacklist_keys' );
91
+ $blocked = str_replace( "\r", "\n", $blocked );
92
+
93
+ $blocked_arr = explode( "\n", $blocked );
94
+ $blocked_arr = array_map( 'trim', $blocked_arr );
95
+
96
+ foreach ( $blocked_arr as $ip_or_email ) {
97
+ $ip_or_email = trim( $ip_or_email );
98
+ if (
99
+ filter_var( $ip_or_email, FILTER_VALIDATE_IP ) ||
100
+ filter_var( $ip_or_email, FILTER_VALIDATE_EMAIL )
101
+ ) {
102
+ $final_blocked_arr[] = $ip_or_email;
103
+ }
104
+ }
105
+
106
+ do_action( 'themeisle_log_event', PIRATEFORMS_NAME, sprintf( 'email = %s, IP = %s, final_blocked_arr = %s', $email, $ip, print_r( $final_blocked_arr, true ) ), 'debug', __FILE__, __LINE__ );
107
+
108
+ if ( ! empty( $final_blocked_arr ) ) {
109
+ if (
110
+ in_array( $email, $final_blocked_arr ) ||
111
+ in_array( $ip, $final_blocked_arr )
112
+ ) {
113
+ $_SESSION[ $error_key ]['blacklist-blocked'] = __( 'Form submission blocked!', 'pirate-forms' );
114
+
115
+ return true;
116
+ }
117
+ }
118
+
119
+ return false;
120
+ }
121
+
122
+ /**
123
+ * Get the list of all pages
124
+ *
125
+ * @since 1.0.0
126
+ */
127
+ public static function get_thank_you_pages() {
128
+ $content = array(
129
+ '' => __( 'None', 'pirate-forms' ),
130
+ );
131
+ $items = get_posts(
132
+ apply_filters(
133
+ 'pirate_forms_thank_you_pages_args',
134
+ array(
135
+ 'post_type' => 'page',
136
+ 'numberposts' => 300,
137
+ 'post_status' => 'publish',
138
+ )
139
+ )
140
+ );
141
+ if ( ! empty( $items ) ) :
142
+ foreach ( $items as $item ) :
143
+ $content[ $item->ID ] = $item->post_title;
144
+ endforeach;
145
+ endif;
146
+
147
+ return $content;
148
+
149
+ }
150
+
151
+ /**
152
+ * Get the post meta value
153
+ *
154
+ * @since 1.0.0
155
+ */
156
+ public static function get_post_meta( $id, $key, $single = false ) {
157
+ return get_post_meta( $id, PIRATEFORMS_SLUG . $key, $single );
158
+ }
159
+
160
+ /**
161
+ * Get the form options for the custom form id, else default
162
+ *
163
+ * @since 1.0.0
164
+ */
165
+ public static function get_form_options( $id = null ) {
166
+ $pirate_forms_options = self::get_option();
167
+ return apply_filters( 'pirateformpro_get_form_attributes', $pirate_forms_options, $id );
168
+ }
169
  }
includes/class-pirateforms.php CHANGED
@@ -69,7 +69,7 @@ class PirateForms {
69
  public function __construct() {
70
 
71
  $this->plugin_name = 'pirateforms';
72
- $this->version = '2.0.1';
73
 
74
  $this->load_dependencies();
75
  $this->set_locale();
69
  public function __construct() {
70
 
71
  $this->plugin_name = 'pirateforms';
72
+ $this->version = '2.0.2';
73
 
74
  $this->load_dependencies();
75
  $this->set_locale();
languages/pirate-forms.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the GPLv2.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Free & Simple Contact Form Plugin - Pirateforms 2.0.0\n"
6
  "Report-Msgid-Bugs-To: https://github.com/Codeinwp/pirate-forms/issues\n"
7
- "POT-Creation-Date: 2017-08-01 13:19:16+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -28,67 +28,62 @@ msgstr ""
28
  msgid "Settings"
29
  msgstr ""
30
 
31
- #: admin/class-pirateforms-admin.php:168 admin/class-pirateforms-admin.php:379
32
- #: admin/class-pirateforms-admin.php:403 admin/class-pirateforms-admin.php:427
33
- #: admin/class-pirateforms-admin.php:446 admin/class-pirateforms-admin.php:464
34
- msgid "None"
35
- msgstr ""
36
-
37
- #: admin/class-pirateforms-admin.php:214 admin/class-pirateforms-admin.php:218
38
  msgid "Send Message"
39
  msgstr ""
40
 
41
- #: admin/class-pirateforms-admin.php:236
42
  msgid "Form processing options"
43
  msgstr ""
44
 
45
- #: admin/class-pirateforms-admin.php:243
46
- msgid "Contact notification sender email"
47
  msgstr ""
48
 
49
- #: admin/class-pirateforms-admin.php:246
50
  msgid "Insert [email] to use the contact form submitter's email."
51
  msgstr ""
52
 
53
- #: admin/class-pirateforms-admin.php:246
54
  msgid ""
55
- "Email to use for the sender of the contact form emails both to the "
56
- "recipients below and the contact form submitter (if this is activated "
57
- "below). The domain for this email address should match your site's domain."
 
58
  msgstr ""
59
 
60
- #: admin/class-pirateforms-admin.php:262
61
  msgid "Contact submission recipients"
62
  msgstr ""
63
 
64
- #: admin/class-pirateforms-admin.php:265
65
  msgid ""
66
  "Email address(es) to receive contact submission notifications. You can "
67
  "separate multiple emails with a comma."
68
  msgstr ""
69
 
70
- #: admin/class-pirateforms-admin.php:281
71
  msgid "Store submissions in the database"
72
  msgstr ""
73
 
74
- #: admin/class-pirateforms-admin.php:284
75
  msgid ""
76
  "Should the submissions be stored in the admin area? If chosen, contact form "
77
  "submissions will be saved in Contacts on the left (appears after this "
78
  "option is activated)."
79
  msgstr ""
80
 
81
- #: admin/class-pirateforms-admin.php:294 admin/class-pirateforms-admin.php:313
82
- #: admin/class-pirateforms-admin.php:484 admin/class-pirateforms-admin.php:705
83
- #: admin/class-pirateforms-admin.php:748
84
  msgid "Yes"
85
  msgstr ""
86
 
87
- #: admin/class-pirateforms-admin.php:300
88
  msgid "Add a nonce to the contact form:"
89
  msgstr ""
90
 
91
- #: admin/class-pirateforms-admin.php:303
92
  msgid ""
93
  "Should the form use a WordPress nonce? This helps reduce spam by ensuring "
94
  "that the form submittor is on the site when submitting the form rather than "
@@ -97,230 +92,234 @@ msgid ""
97
  "forms not being able to be submitted with an error of \"Nonce failed!\""
98
  msgstr ""
99
 
100
- #: admin/class-pirateforms-admin.php:319
101
  msgid "Send email confirmation to form submitter"
102
  msgstr ""
103
 
104
- #: admin/class-pirateforms-admin.php:322
105
  msgid ""
106
  "Adding text here will send an email to the form submitter. The email uses "
107
  "the \"Successful form submission text\" field from the \"Alert Messages\" "
108
  "tab as the subject line. Plain text only here, no HTML."
109
  msgstr ""
110
 
111
- #: admin/class-pirateforms-admin.php:339
112
- msgid "\"Thank You\" URL"
113
  msgstr ""
114
 
115
- #: admin/class-pirateforms-admin.php:342
116
- msgid "Select the post-submit page for all forms submitted"
 
 
 
117
  msgstr ""
118
 
119
- #: admin/class-pirateforms-admin.php:357
120
  #: admin/partials/pirateforms-settings-display.php:31
121
  msgid "Fields Settings"
122
  msgstr ""
123
 
124
- #: admin/class-pirateforms-admin.php:365 admin/class-pirateforms-admin.php:531
125
  msgid "Name"
126
  msgstr ""
127
 
128
- #: admin/class-pirateforms-admin.php:368
129
  msgid "Do you want the name field to be displayed?"
130
  msgstr ""
131
 
132
- #: admin/class-pirateforms-admin.php:380 admin/class-pirateforms-admin.php:404
133
- #: admin/class-pirateforms-admin.php:428 admin/class-pirateforms-admin.php:447
134
- #: admin/class-pirateforms-admin.php:466
 
 
 
 
 
135
  msgid "Yes but not required"
136
  msgstr ""
137
 
138
- #: admin/class-pirateforms-admin.php:381 admin/class-pirateforms-admin.php:405
139
- #: admin/class-pirateforms-admin.php:429 admin/class-pirateforms-admin.php:448
140
- #: admin/class-pirateforms-admin.php:467
141
  msgid "Required"
142
  msgstr ""
143
 
144
- #: admin/class-pirateforms-admin.php:389
145
  msgid "Email address"
146
  msgstr ""
147
 
148
- #: admin/class-pirateforms-admin.php:392
149
  msgid "Do you want the email address field be displayed?"
150
  msgstr ""
151
 
152
- #: admin/class-pirateforms-admin.php:413 admin/class-pirateforms-admin.php:557
153
- #: admin/class-pirateforms-admin.php:559
154
  msgid "Subject"
155
  msgstr ""
156
 
157
- #: admin/class-pirateforms-admin.php:416
158
  msgid "Do you want the subject field be displayed?"
159
  msgstr ""
160
 
161
- #: admin/class-pirateforms-admin.php:437 admin/class-pirateforms-admin.php:570
162
  msgid "Message"
163
  msgstr ""
164
 
165
- #: admin/class-pirateforms-admin.php:456
166
  msgid "Attachment"
167
  msgstr ""
168
 
169
- #: admin/class-pirateforms-admin.php:465 admin/class-pirateforms-admin.php:767
170
- msgid "No"
171
- msgstr ""
172
-
173
- #: admin/class-pirateforms-admin.php:475
174
  msgid "Add a reCAPTCHA"
175
  msgstr ""
176
 
177
- #: admin/class-pirateforms-admin.php:492
178
  msgid "Site key"
179
  msgstr ""
180
 
181
- #: admin/class-pirateforms-admin.php:495
182
  msgid "Create an account here "
183
  msgstr ""
184
 
185
- #: admin/class-pirateforms-admin.php:495
186
  msgid "to get the Site key and the Secret key for the reCaptcha."
187
  msgstr ""
188
 
189
- #: admin/class-pirateforms-admin.php:511
190
  msgid "Secret key"
191
  msgstr ""
192
 
193
- #: admin/class-pirateforms-admin.php:524
194
  #: admin/partials/pirateforms-settings-display.php:34
195
  msgid "Fields Labels"
196
  msgstr ""
197
 
198
- #: admin/class-pirateforms-admin.php:533
199
  msgid "Your Name"
200
  msgstr ""
201
 
202
- #: admin/class-pirateforms-admin.php:544
203
  msgid "Email"
204
  msgstr ""
205
 
206
- #: admin/class-pirateforms-admin.php:546
207
  msgid "Your Email"
208
  msgstr ""
209
 
210
- #: admin/class-pirateforms-admin.php:572
211
  msgid "Your message"
212
  msgstr ""
213
 
214
- #: admin/class-pirateforms-admin.php:583
215
  msgid "Submit button"
216
  msgstr ""
217
 
218
- #: admin/class-pirateforms-admin.php:596
219
  #: admin/partials/pirateforms-settings-display.php:37
220
  msgid "Alert Messages"
221
  msgstr ""
222
 
223
- #: admin/class-pirateforms-admin.php:603
224
  msgid "Name required and missing"
225
  msgstr ""
226
 
227
- #: admin/class-pirateforms-admin.php:605
228
  msgid "Enter your name"
229
  msgstr ""
230
 
231
- #: admin/class-pirateforms-admin.php:616
232
  msgid "E-mail required and missing"
233
  msgstr ""
234
 
235
- #: admin/class-pirateforms-admin.php:618
236
  msgid "Enter valid email"
237
  msgstr ""
238
 
239
- #: admin/class-pirateforms-admin.php:629
240
  msgid "Subject required and missing"
241
  msgstr ""
242
 
243
- #: admin/class-pirateforms-admin.php:631
244
  msgid "Please enter a subject"
245
  msgstr ""
246
 
247
- #: admin/class-pirateforms-admin.php:642
248
  msgid "Question/comment is missing"
249
  msgstr ""
250
 
251
- #: admin/class-pirateforms-admin.php:644
252
  msgid "Enter your question or comment"
253
  msgstr ""
254
 
255
- #: admin/class-pirateforms-admin.php:655
256
  msgid "Attachment is missing"
257
  msgstr ""
258
 
259
- #: admin/class-pirateforms-admin.php:657
260
  msgid "Please add an attachment"
261
  msgstr ""
262
 
263
- #: admin/class-pirateforms-admin.php:668
264
  msgid "Successful form submission text"
265
  msgstr ""
266
 
267
- #: admin/class-pirateforms-admin.php:671
268
  msgid ""
269
  "This text is used on the page if no \"Thank You\" URL is set above. This is "
270
  "also used as the confirmation email title, if one is set to send out."
271
  msgstr ""
272
 
273
- #: admin/class-pirateforms-admin.php:675
274
  msgid "Thanks, your email was sent successfully!"
275
  msgstr ""
276
 
277
- #: admin/class-pirateforms-admin.php:686
278
  msgid "SMTP Options"
279
  msgstr ""
280
 
281
- #: admin/class-pirateforms-admin.php:693
282
  msgid "Use SMTP to send emails?"
283
  msgstr ""
284
 
285
- #: admin/class-pirateforms-admin.php:696
286
  msgid "Instead of PHP mail function"
287
  msgstr ""
288
 
289
- #: admin/class-pirateforms-admin.php:711
290
  msgid "SMTP Host"
291
  msgstr ""
292
 
293
- #: admin/class-pirateforms-admin.php:723
294
  msgid "SMTP Port"
295
  msgstr ""
296
 
297
- #: admin/class-pirateforms-admin.php:735
298
  msgid "Use SMTP Authentication?"
299
  msgstr ""
300
 
301
- #: admin/class-pirateforms-admin.php:738 admin/class-pirateforms-admin.php:757
302
  msgid ""
303
  "If you check this box, make sure the SMTP Username and SMTP Password are "
304
  "completed."
305
  msgstr ""
306
 
307
- #: admin/class-pirateforms-admin.php:754
308
  msgid "Security?"
309
  msgstr ""
310
 
311
- #: admin/class-pirateforms-admin.php:768
312
  msgid "SSL"
313
  msgstr ""
314
 
315
- #: admin/class-pirateforms-admin.php:769
316
  msgid "TLS"
317
  msgstr ""
318
 
319
- #: admin/class-pirateforms-admin.php:776
320
  msgid "SMTP Username"
321
  msgstr ""
322
 
323
- #: admin/class-pirateforms-admin.php:788
324
  msgid "SMTP Password"
325
  msgstr ""
326
 
@@ -421,6 +420,14 @@ msgid ""
421
  "newsletter."
422
  msgstr ""
423
 
 
 
 
 
 
 
 
 
424
  #: includes/class-pirateforms-widget.php:86
425
  msgid "Title"
426
  msgstr ""
@@ -485,52 +492,48 @@ msgstr ""
485
  msgid "Form submission failed!"
486
  msgstr ""
487
 
488
- #: public/class-pirateforms-public.php:140
489
  msgid "Contact form submission from"
490
  msgstr ""
491
 
492
- #: public/class-pirateforms-public.php:167
493
  msgid "Please enter one or more Contact submission recipients"
494
  msgstr ""
495
 
496
- #: public/class-pirateforms-public.php:182
497
  msgid "IP address: "
498
  msgstr ""
499
 
500
- #: public/class-pirateforms-public.php:183
501
  msgid "IP search:"
502
  msgstr ""
503
 
504
- #: public/class-pirateforms-public.php:188
505
  msgid "Came from: "
506
  msgstr ""
507
 
508
- #: public/class-pirateforms-public.php:192
509
  msgid "Sent from page: "
510
  msgstr ""
511
 
512
- #: public/class-pirateforms-public.php:326
513
- #: public/class-pirateforms-public.php:338
514
  msgid "Wrong reCAPTCHA"
515
  msgstr ""
516
 
517
  #: public/class-pirateforms-public.php:391
518
- msgid "Form submission blocked!"
519
- msgstr ""
520
-
521
- #: public/class-pirateforms-public.php:423
522
  msgid "Uploaded file is not allowed for file type"
523
  msgstr ""
524
 
525
- #: public/class-pirateforms-public.php:431
526
  msgid "Uploaded file is too large"
527
  msgstr ""
528
 
529
- #: public/class-pirateforms-public.php:447
530
  msgid "There was an unknown error uploading the file."
531
  msgstr ""
532
 
533
- #: public/class-pirateforms-public.php:818
534
  msgid "Submit"
535
  msgstr ""
536
 
@@ -538,16 +541,6 @@ msgstr ""
538
  msgid "Sorry, an error occured."
539
  msgstr ""
540
 
541
- #: vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-licenser.php:476
542
- msgid ""
543
- "Updating this theme will lose any customizations you have made. Cancel to "
544
- "stop, OK to update."
545
- msgstr ""
546
-
547
- #: vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-widget-dashboard-blog.php:212
548
- msgid "Install"
549
- msgstr ""
550
-
551
  #. Plugin Name of the plugin/theme
552
  msgid "Free & Simple Contact Form Plugin - Pirateforms"
553
  msgstr ""
2
  # This file is distributed under the GPLv2.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Free & Simple Contact Form Plugin - Pirateforms 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://github.com/Codeinwp/pirate-forms/issues\n"
7
+ "POT-Creation-Date: 2017-08-07 08:38:43+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
28
  msgid "Settings"
29
  msgstr ""
30
 
31
+ #: admin/class-pirateforms-admin.php:190 admin/class-pirateforms-admin.php:194
 
 
 
 
 
 
32
  msgid "Send Message"
33
  msgstr ""
34
 
35
+ #: admin/class-pirateforms-admin.php:212
36
  msgid "Form processing options"
37
  msgstr ""
38
 
39
+ #: admin/class-pirateforms-admin.php:219
40
+ msgid "Contact notification email address"
41
  msgstr ""
42
 
43
+ #: admin/class-pirateforms-admin.php:222
44
  msgid "Insert [email] to use the contact form submitter's email."
45
  msgstr ""
46
 
47
+ #: admin/class-pirateforms-admin.php:222
48
  msgid ""
49
+ "The notification email will be sent from this address both to the "
50
+ "recipients below and the contact form submitter (if this is activated below "
51
+ "in email confirmation, in which case the domain for this email address "
52
+ "should match your site's domain)."
53
  msgstr ""
54
 
55
+ #: admin/class-pirateforms-admin.php:238
56
  msgid "Contact submission recipients"
57
  msgstr ""
58
 
59
+ #: admin/class-pirateforms-admin.php:241
60
  msgid ""
61
  "Email address(es) to receive contact submission notifications. You can "
62
  "separate multiple emails with a comma."
63
  msgstr ""
64
 
65
+ #: admin/class-pirateforms-admin.php:257
66
  msgid "Store submissions in the database"
67
  msgstr ""
68
 
69
+ #: admin/class-pirateforms-admin.php:260
70
  msgid ""
71
  "Should the submissions be stored in the admin area? If chosen, contact form "
72
  "submissions will be saved in Contacts on the left (appears after this "
73
  "option is activated)."
74
  msgstr ""
75
 
76
+ #: admin/class-pirateforms-admin.php:270 admin/class-pirateforms-admin.php:289
77
+ #: admin/class-pirateforms-admin.php:456 admin/class-pirateforms-admin.php:677
78
+ #: admin/class-pirateforms-admin.php:720
79
  msgid "Yes"
80
  msgstr ""
81
 
82
+ #: admin/class-pirateforms-admin.php:276
83
  msgid "Add a nonce to the contact form:"
84
  msgstr ""
85
 
86
+ #: admin/class-pirateforms-admin.php:279
87
  msgid ""
88
  "Should the form use a WordPress nonce? This helps reduce spam by ensuring "
89
  "that the form submittor is on the site when submitting the form rather than "
92
  "forms not being able to be submitted with an error of \"Nonce failed!\""
93
  msgstr ""
94
 
95
+ #: admin/class-pirateforms-admin.php:295
96
  msgid "Send email confirmation to form submitter"
97
  msgstr ""
98
 
99
+ #: admin/class-pirateforms-admin.php:298
100
  msgid ""
101
  "Adding text here will send an email to the form submitter. The email uses "
102
  "the \"Successful form submission text\" field from the \"Alert Messages\" "
103
  "tab as the subject line. Plain text only here, no HTML."
104
  msgstr ""
105
 
106
+ #: admin/class-pirateforms-admin.php:314
107
+ msgid "\"Thank You\" Page"
108
  msgstr ""
109
 
110
+ #: admin/class-pirateforms-admin.php:317
111
+ msgid ""
112
+ "Select the page that displays after a successful form submission. The page "
113
+ "will be displayed without pausing on the email form, so please be sure to "
114
+ "configure a relevant thank you message in this page."
115
  msgstr ""
116
 
117
+ #: admin/class-pirateforms-admin.php:332
118
  #: admin/partials/pirateforms-settings-display.php:31
119
  msgid "Fields Settings"
120
  msgstr ""
121
 
122
+ #: admin/class-pirateforms-admin.php:340 admin/class-pirateforms-admin.php:503
123
  msgid "Name"
124
  msgstr ""
125
 
126
+ #: admin/class-pirateforms-admin.php:343
127
  msgid "Do you want the name field to be displayed?"
128
  msgstr ""
129
 
130
+ #: admin/class-pirateforms-admin.php:354 admin/class-pirateforms-admin.php:401
131
+ #: admin/class-pirateforms-admin.php:437 admin/class-pirateforms-admin.php:739
132
+ msgid "No"
133
+ msgstr ""
134
+
135
+ #: admin/class-pirateforms-admin.php:355 admin/class-pirateforms-admin.php:378
136
+ #: admin/class-pirateforms-admin.php:402 admin/class-pirateforms-admin.php:420
137
+ #: admin/class-pirateforms-admin.php:438
138
  msgid "Yes but not required"
139
  msgstr ""
140
 
141
+ #: admin/class-pirateforms-admin.php:356 admin/class-pirateforms-admin.php:379
142
+ #: admin/class-pirateforms-admin.php:403 admin/class-pirateforms-admin.php:421
143
+ #: admin/class-pirateforms-admin.php:439
144
  msgid "Required"
145
  msgstr ""
146
 
147
+ #: admin/class-pirateforms-admin.php:364
148
  msgid "Email address"
149
  msgstr ""
150
 
151
+ #: admin/class-pirateforms-admin.php:367
152
  msgid "Do you want the email address field be displayed?"
153
  msgstr ""
154
 
155
+ #: admin/class-pirateforms-admin.php:387 admin/class-pirateforms-admin.php:529
156
+ #: admin/class-pirateforms-admin.php:531
157
  msgid "Subject"
158
  msgstr ""
159
 
160
+ #: admin/class-pirateforms-admin.php:390
161
  msgid "Do you want the subject field be displayed?"
162
  msgstr ""
163
 
164
+ #: admin/class-pirateforms-admin.php:411 admin/class-pirateforms-admin.php:542
165
  msgid "Message"
166
  msgstr ""
167
 
168
+ #: admin/class-pirateforms-admin.php:429
169
  msgid "Attachment"
170
  msgstr ""
171
 
172
+ #: admin/class-pirateforms-admin.php:447
 
 
 
 
173
  msgid "Add a reCAPTCHA"
174
  msgstr ""
175
 
176
+ #: admin/class-pirateforms-admin.php:464
177
  msgid "Site key"
178
  msgstr ""
179
 
180
+ #: admin/class-pirateforms-admin.php:467
181
  msgid "Create an account here "
182
  msgstr ""
183
 
184
+ #: admin/class-pirateforms-admin.php:467
185
  msgid "to get the Site key and the Secret key for the reCaptcha."
186
  msgstr ""
187
 
188
+ #: admin/class-pirateforms-admin.php:483
189
  msgid "Secret key"
190
  msgstr ""
191
 
192
+ #: admin/class-pirateforms-admin.php:496
193
  #: admin/partials/pirateforms-settings-display.php:34
194
  msgid "Fields Labels"
195
  msgstr ""
196
 
197
+ #: admin/class-pirateforms-admin.php:505
198
  msgid "Your Name"
199
  msgstr ""
200
 
201
+ #: admin/class-pirateforms-admin.php:516
202
  msgid "Email"
203
  msgstr ""
204
 
205
+ #: admin/class-pirateforms-admin.php:518
206
  msgid "Your Email"
207
  msgstr ""
208
 
209
+ #: admin/class-pirateforms-admin.php:544
210
  msgid "Your message"
211
  msgstr ""
212
 
213
+ #: admin/class-pirateforms-admin.php:555
214
  msgid "Submit button"
215
  msgstr ""
216
 
217
+ #: admin/class-pirateforms-admin.php:568
218
  #: admin/partials/pirateforms-settings-display.php:37
219
  msgid "Alert Messages"
220
  msgstr ""
221
 
222
+ #: admin/class-pirateforms-admin.php:575
223
  msgid "Name required and missing"
224
  msgstr ""
225
 
226
+ #: admin/class-pirateforms-admin.php:577
227
  msgid "Enter your name"
228
  msgstr ""
229
 
230
+ #: admin/class-pirateforms-admin.php:588
231
  msgid "E-mail required and missing"
232
  msgstr ""
233
 
234
+ #: admin/class-pirateforms-admin.php:590
235
  msgid "Enter valid email"
236
  msgstr ""
237
 
238
+ #: admin/class-pirateforms-admin.php:601
239
  msgid "Subject required and missing"
240
  msgstr ""
241
 
242
+ #: admin/class-pirateforms-admin.php:603
243
  msgid "Please enter a subject"
244
  msgstr ""
245
 
246
+ #: admin/class-pirateforms-admin.php:614
247
  msgid "Question/comment is missing"
248
  msgstr ""
249
 
250
+ #: admin/class-pirateforms-admin.php:616
251
  msgid "Enter your question or comment"
252
  msgstr ""
253
 
254
+ #: admin/class-pirateforms-admin.php:627
255
  msgid "Attachment is missing"
256
  msgstr ""
257
 
258
+ #: admin/class-pirateforms-admin.php:629
259
  msgid "Please add an attachment"
260
  msgstr ""
261
 
262
+ #: admin/class-pirateforms-admin.php:640
263
  msgid "Successful form submission text"
264
  msgstr ""
265
 
266
+ #: admin/class-pirateforms-admin.php:643
267
  msgid ""
268
  "This text is used on the page if no \"Thank You\" URL is set above. This is "
269
  "also used as the confirmation email title, if one is set to send out."
270
  msgstr ""
271
 
272
+ #: admin/class-pirateforms-admin.php:647
273
  msgid "Thanks, your email was sent successfully!"
274
  msgstr ""
275
 
276
+ #: admin/class-pirateforms-admin.php:658
277
  msgid "SMTP Options"
278
  msgstr ""
279
 
280
+ #: admin/class-pirateforms-admin.php:665
281
  msgid "Use SMTP to send emails?"
282
  msgstr ""
283
 
284
+ #: admin/class-pirateforms-admin.php:668
285
  msgid "Instead of PHP mail function"
286
  msgstr ""
287
 
288
+ #: admin/class-pirateforms-admin.php:683
289
  msgid "SMTP Host"
290
  msgstr ""
291
 
292
+ #: admin/class-pirateforms-admin.php:695
293
  msgid "SMTP Port"
294
  msgstr ""
295
 
296
+ #: admin/class-pirateforms-admin.php:707
297
  msgid "Use SMTP Authentication?"
298
  msgstr ""
299
 
300
+ #: admin/class-pirateforms-admin.php:710 admin/class-pirateforms-admin.php:729
301
  msgid ""
302
  "If you check this box, make sure the SMTP Username and SMTP Password are "
303
  "completed."
304
  msgstr ""
305
 
306
+ #: admin/class-pirateforms-admin.php:726
307
  msgid "Security?"
308
  msgstr ""
309
 
310
+ #: admin/class-pirateforms-admin.php:740
311
  msgid "SSL"
312
  msgstr ""
313
 
314
+ #: admin/class-pirateforms-admin.php:741
315
  msgid "TLS"
316
  msgstr ""
317
 
318
+ #: admin/class-pirateforms-admin.php:748
319
  msgid "SMTP Username"
320
  msgstr ""
321
 
322
+ #: admin/class-pirateforms-admin.php:760
323
  msgid "SMTP Password"
324
  msgstr ""
325
 
420
  "newsletter."
421
  msgstr ""
422
 
423
+ #: includes/class-pirateforms-util.php:113
424
+ msgid "Form submission blocked!"
425
+ msgstr ""
426
+
427
+ #: includes/class-pirateforms-util.php:129
428
+ msgid "None"
429
+ msgstr ""
430
+
431
  #: includes/class-pirateforms-widget.php:86
432
  msgid "Title"
433
  msgstr ""
492
  msgid "Form submission failed!"
493
  msgstr ""
494
 
495
+ #: public/class-pirateforms-public.php:142
496
  msgid "Contact form submission from"
497
  msgstr ""
498
 
499
+ #: public/class-pirateforms-public.php:175
500
  msgid "Please enter one or more Contact submission recipients"
501
  msgstr ""
502
 
503
+ #: public/class-pirateforms-public.php:190
504
  msgid "IP address: "
505
  msgstr ""
506
 
507
+ #: public/class-pirateforms-public.php:191
508
  msgid "IP search:"
509
  msgstr ""
510
 
511
+ #: public/class-pirateforms-public.php:196
512
  msgid "Came from: "
513
  msgstr ""
514
 
515
+ #: public/class-pirateforms-public.php:200
516
  msgid "Sent from page: "
517
  msgstr ""
518
 
519
+ #: public/class-pirateforms-public.php:337
520
+ #: public/class-pirateforms-public.php:349
521
  msgid "Wrong reCAPTCHA"
522
  msgstr ""
523
 
524
  #: public/class-pirateforms-public.php:391
 
 
 
 
525
  msgid "Uploaded file is not allowed for file type"
526
  msgstr ""
527
 
528
+ #: public/class-pirateforms-public.php:399
529
  msgid "Uploaded file is too large"
530
  msgstr ""
531
 
532
+ #: public/class-pirateforms-public.php:415
533
  msgid "There was an unknown error uploading the file."
534
  msgstr ""
535
 
536
+ #: public/class-pirateforms-public.php:800
537
  msgid "Submit"
538
  msgstr ""
539
 
541
  msgid "Sorry, an error occured."
542
  msgstr ""
543
 
 
 
 
 
 
 
 
 
 
 
544
  #. Plugin Name of the plugin/theme
545
  msgid "Free & Simple Contact Form Plugin - Pirateforms"
546
  msgstr ""
pirate-forms.php CHANGED
@@ -16,13 +16,14 @@
16
  * Plugin Name: Free & Simple Contact Form Plugin - Pirateforms
17
  * Plugin URI: http://themeisle.com/plugins/pirate-forms/
18
  * Description: Easily creates a nice looking, simple contact form on your WP site.
19
- * Version: 2.0.1
20
  * Author: Themeisle
21
  * Author URI: http://themeisle.com
22
  * Text Domain: pirate-forms
23
  * Domain Path: /languages
24
  * License: GPLv2
25
  * WordPress Available: yes
 
26
  * Requires License: no
27
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
28
  */
@@ -34,7 +35,7 @@ if ( ! defined( 'WPINC' ) ) {
34
 
35
  define( 'PIRATEFORMS_NAME', 'Pirate Forms' );
36
  define( 'PIRATEFORMS_SLUG', 'pirate-forms' );
37
- define( 'PIRATE_FORMS_VERSION', '2.0.1' );
38
  define( 'PIRATEFORMS_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
39
  define( 'PIRATEFORMS_URL', plugin_dir_url( __FILE__ ) );
40
  define( 'PIRATEFORMS_BASENAME', plugin_basename( __FILE__ ) );
16
  * Plugin Name: Free & Simple Contact Form Plugin - Pirateforms
17
  * Plugin URI: http://themeisle.com/plugins/pirate-forms/
18
  * Description: Easily creates a nice looking, simple contact form on your WP site.
19
+ * Version: 2.0.2
20
  * Author: Themeisle
21
  * Author URI: http://themeisle.com
22
  * Text Domain: pirate-forms
23
  * Domain Path: /languages
24
  * License: GPLv2
25
  * WordPress Available: yes
26
+ * Pro Slug: pirate-forms-pro
27
  * Requires License: no
28
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
29
  */
35
 
36
  define( 'PIRATEFORMS_NAME', 'Pirate Forms' );
37
  define( 'PIRATEFORMS_SLUG', 'pirate-forms' );
38
+ define( 'PIRATE_FORMS_VERSION', '2.0.2' );
39
  define( 'PIRATEFORMS_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
40
  define( 'PIRATEFORMS_URL', plugin_dir_url( __FILE__ ) );
41
  define( 'PIRATEFORMS_BASENAME', plugin_basename( __FILE__ ) );
public/class-pirateforms-public.php CHANGED
@@ -132,7 +132,9 @@ class PirateForms_Public {
132
  return false;
133
  }
134
 
135
- if ( ! $this->validate_captcha( $error_key ) ) {
 
 
136
  return false;
137
  }
138
 
@@ -143,26 +145,32 @@ class PirateForms_Public {
143
  $body .= '<table>';
144
 
145
  $pirate_forms_contact_email = null;
 
 
146
  $fields = array( 'name', 'email', 'subject', 'message' );
147
  foreach ( $fields as $field ) {
148
  $value = isset( $_POST[ 'pirate-forms-contact-' . $field ] ) ? sanitize_text_field( trim( $_POST[ 'pirate-forms-contact-' . $field ] ) ) : '';
149
- if ( PirateForms_Util::get_option( 'pirateformsopt_' . $field . '_field' ) === 'req' && empty( $value ) ) {
150
- $_SESSION[ $error_key ][ 'pirate-forms-contact-' . $field ] = PirateForms_Util::get_option( 'pirateformsopt_label_err_' . $field );
151
  } elseif ( ! empty( $value ) ) {
152
  if ( 'email' === $field && ! filter_var( $value, FILTER_VALIDATE_EMAIL ) ) {
153
- $_SESSION[ $error_key ][ 'pirate-forms-contact-' . $field ] = PirateForms_Util::get_option( 'pirateformsopt_label_err_' . $field );
154
  } else {
155
  if ( 'email' === $field ) {
156
  $pirate_forms_contact_email = $value;
 
 
 
 
157
  }
158
- $body .= $this->table_row( stripslashes( PirateForms_Util::get_option( 'pirateformsopt_label_' . $field ) ), $value );
159
  }
160
  }
161
  }
162
 
163
  /**
164
  ******** Validate recipients email */
165
- $site_recipients = sanitize_text_field( PirateForms_Util::get_option( 'pirateformsopt_email_recipients' ) );
166
  if ( empty( $site_recipients ) ) {
167
  $_SESSION[ $error_key ]['pirate-forms-recipients-email'] = __( 'Please enter one or more Contact submission recipients', 'pirate-forms' );
168
  }
@@ -192,7 +200,7 @@ class PirateForms_Public {
192
  $body .= $this->table_row( __( 'Sent from page: ', 'pirate-forms' ), get_permalink( get_the_id() ) );
193
 
194
  // Check the blacklist
195
- $blocked = $this->is_blacklisted( $error_key, $pirate_forms_contact_email, $contact_ip );
196
  if ( $blocked ) {
197
  return false;
198
  }
@@ -201,17 +209,14 @@ class PirateForms_Public {
201
 
202
  // No errors? Go ahead and process the contact
203
  if ( empty( $_SESSION[ $error_key ] ) ) {
204
- $pirate_forms_options_tmp = get_option( 'pirate_forms_settings_array' );
205
- if ( isset( $pirate_forms_options_tmp['pirateformsopt_email'] ) ) {
206
- $site_email = $pirate_forms_options_tmp['pirateformsopt_email'];
207
- }
208
  if ( ! empty( $pirate_forms_contact_name ) ) :
209
  $site_name = $pirate_forms_contact_name;
210
  else :
211
  $site_name = htmlspecialchars_decode( get_bloginfo( 'name' ) );
212
  endif;
213
  // Notification recipients
214
- $site_recipients = sanitize_text_field( PirateForms_Util::get_option( 'pirateformsopt_email_recipients' ) );
215
  $site_recipients = explode( ',', $site_recipients );
216
  $site_recipients = array_map( 'trim', $site_recipients );
217
  $site_recipients = array_map( 'sanitize_email', $site_recipients );
@@ -220,37 +225,36 @@ class PirateForms_Public {
220
  if ( empty( $pirate_forms_contact_name ) ) {
221
  $pirate_forms_contact_name = ! empty( $pirate_forms_contact_email ) ? $pirate_forms_contact_email : '[None given]';
222
  }
 
223
  // Need an email address for the email notification
224
- if ( ! empty( $site_email ) ) {
225
- if ( $site_email == '[email]' ) {
226
- if ( ! empty( $pirate_forms_contact_email ) ) {
227
- $send_from = $pirate_forms_contact_email;
228
- } else {
229
- $send_from = PirateForms::pirate_forms_from_email();
230
- }
231
- } else {
232
- $send_from = $site_email;
233
- }
234
  } else {
235
- $send_from = PirateForms::pirate_forms_from_email();
236
  }
237
  $send_from_name = $site_name;
238
 
239
- // Sent an email notification to the correct address
240
  $headers = "From: $send_from_name <$send_from>\r\nReply-To: $pirate_forms_contact_name <$pirate_forms_contact_email>\r\nContent-type: text/html";
241
  add_action( 'phpmailer_init', array( $this, 'phpmailer' ) );
242
 
243
- $attachments = $this->get_attachments( $error_key );
244
  if ( is_bool( $attachments ) ) {
245
  return false;
246
  }
247
 
248
  $subject = 'Contact on ' . htmlspecialchars_decode( get_bloginfo( 'name' ) );
 
 
 
249
 
250
- do_action( 'pirate_forms_before_sending', $site_recipients, $subject, $body, $headers, $attachments );
251
  do_action( 'themeisle_log_event', PIRATEFORMS_NAME, sprintf( 'before sending email to = %s, subject = %s, body = %s, headers = %s, attachments = %s', $site_recipients, $subject, $body, $headers, print_r( $attachments, true ) ), 'debug', __FILE__, __LINE__ );
252
  $response = wp_mail( $site_recipients, $subject, $body, $headers, $attachments );
253
- do_action( 'pirate_forms_after_sending', $response, $site_recipients, $subject, $body, $headers, $attachments );
254
  do_action( 'themeisle_log_event', PIRATEFORMS_NAME, sprintf( 'after sending email, response = %s', $response ), 'debug', __FILE__, __LINE__ );
255
 
256
  // delete the tmp directory
@@ -260,19 +264,25 @@ class PirateForms_Public {
260
  $wp_filesystem->delete( $this->get_upload_tmp_dir(), true, 'd' );
261
 
262
  // Should a confirm email be sent?
263
- $confirm_body = stripslashes( trim( PirateForms_Util::get_option( 'pirateformsopt_confirm_email' ) ) );
264
  if ( ! empty( $confirm_body ) && ! empty( $pirate_forms_contact_email ) ) {
265
  // Removing entities
266
  $confirm_body = htmlspecialchars_decode( $confirm_body );
267
  $confirm_body = html_entity_decode( $confirm_body );
268
  $confirm_body = str_replace( '&#39;', "'", $confirm_body );
269
- $headers = "From: $site_name <$site_email>\r\nReply-To: $site_name <$site_email>";
270
- $subject = PirateForms_Util::get_option( 'pirateformsopt_label_submit' ) . ' - ' . $site_name;
 
 
 
 
 
 
271
 
272
- do_action( 'pirate_forms_before_sending_confirm', $pirate_forms_contact_email, $subject, $confirm_body, $headers );
273
  do_action( 'themeisle_log_event', PIRATEFORMS_NAME, sprintf( 'before sending confirm email to = %s, subject = %s, body = %s, headers = %s', $pirate_forms_contact_email, $subject, $confirm_body, $headers ), 'debug', __FILE__, __LINE__ );
274
  $response = wp_mail( $pirate_forms_contact_email, $subject, $confirm_body, $headers );
275
- do_action( 'pirate_forms_after_sending_confirm', $response, $pirate_forms_contact_email, $subject, $confirm_body, $headers );
276
  do_action( 'themeisle_log_event', PIRATEFORMS_NAME, sprintf( 'after sending confirm email response = %s', $response ), 'debug', __FILE__, __LINE__ );
277
  if ( ! $response ) {
278
  error_log( 'Email not sent' );
@@ -281,7 +291,7 @@ class PirateForms_Public {
281
 
282
  /**
283
  *********** Store the entries in the DB */
284
- if ( PirateForms_Util::get_option( 'pirateformsopt_store' ) === 'yes' ) {
285
  $new_post_id = wp_insert_post(
286
  array(
287
  'post_type' => 'pf_contact',
@@ -298,8 +308,8 @@ class PirateForms_Public {
298
  $pirate_forms_current_theme = wp_get_theme();
299
 
300
  /* If a Thank you page is selected, redirect to that page */
301
- if ( PirateForms_Util::get_option( 'pirateformsopt_thank_you_url' ) ) {
302
- $redirect_id = intval( PirateForms_Util::get_option( 'pirateformsopt_thank_you_url' ) );
303
  $redirect = get_permalink( $redirect_id );
304
  wp_safe_redirect( $redirect );
305
  } elseif ( ( 'Zerif Lite' == $pirate_forms_current_theme->name ) || ( 'Zerif Lite' == $pirate_forms_current_theme->parent_theme ) || ( 'Zerif PRO' == $pirate_forms_current_theme->name ) || ( 'Zerif PRO' == $pirate_forms_current_theme->parent_theme ) ) {
@@ -313,11 +323,12 @@ class PirateForms_Public {
313
  * Validate CAPTCHA
314
  *
315
  * @param string $error_key the key for the session object.
 
316
  */
317
- function validate_captcha( $error_key ) {
318
- $pirateformsopt_recaptcha_sitekey = PirateForms_Util::get_option( 'pirateformsopt_recaptcha_sitekey' );
319
- $pirateformsopt_recaptcha_secretkey = PirateForms_Util::get_option( 'pirateformsopt_recaptcha_secretkey' );
320
- $pirateformsopt_recaptcha_field = PirateForms_Util::get_option( 'pirateformsopt_recaptcha_field' );
321
  if ( ! empty( $pirateformsopt_recaptcha_secretkey ) && ! empty( $pirateformsopt_recaptcha_sitekey ) && ! empty( $pirateformsopt_recaptcha_field ) && ( $pirateformsopt_recaptcha_field == 'yes' ) ) :
322
  if ( isset( $_POST['g-recaptcha-response'] ) ) {
323
  $captcha = $_POST['g-recaptcha-response'];
@@ -353,62 +364,19 @@ class PirateForms_Public {
353
  return '<tr><th>' . $key . '</th><td>' . $value . '</td></tr>';
354
  }
355
 
356
- /**
357
- * Check if the email/IP is blacklisted
358
- *
359
- * @param string $error_key the key for the session object.
360
- * @param string $email the email id to check.
361
- * @param string $ip the IP to check.
362
- *
363
- * @since 1.0.0
364
- */
365
- public function is_blacklisted( $error_key, $email, $ip ) {
366
- $final_blocked_arr = array();
367
-
368
- $blocked = get_option( 'blacklist_keys' );
369
- $blocked = str_replace( "\r", "\n", $blocked );
370
-
371
- $blocked_arr = explode( "\n", $blocked );
372
- $blocked_arr = array_map( 'trim', $blocked_arr );
373
-
374
- foreach ( $blocked_arr as $ip_or_email ) {
375
- $ip_or_email = trim( $ip_or_email );
376
- if (
377
- filter_var( $ip_or_email, FILTER_VALIDATE_IP ) ||
378
- filter_var( $ip_or_email, FILTER_VALIDATE_EMAIL )
379
- ) {
380
- $final_blocked_arr[] = $ip_or_email;
381
- }
382
- }
383
-
384
- do_action( 'themeisle_log_event', PIRATEFORMS_NAME, sprintf( 'email = %s, IP = %s, final_blocked_arr = %s', $email, $ip, print_r( $final_blocked_arr, true ) ), 'debug', __FILE__, __LINE__ );
385
-
386
- if ( ! empty( $final_blocked_arr ) ) {
387
- if (
388
- in_array( $email, $final_blocked_arr ) ||
389
- in_array( $ip, $final_blocked_arr )
390
- ) {
391
- $_SESSION[ $error_key ]['blacklist-blocked'] = __( 'Form submission blocked!', 'pirate-forms' );
392
-
393
- return true;
394
- }
395
- }
396
-
397
- return false;
398
- }
399
-
400
  /**
401
  * Get attachments, if any
402
  *
403
  * @param string $error_key the key for the session object.
 
404
  *
405
  * @throws Exception When file uploading fails.
406
  */
407
- function get_attachments( $error_key ) {
408
  $attachments = '';
409
  /**
410
  ******* Validate Attachment */
411
- $use_files = PirateForms_Util::get_option( 'pirateformsopt_attachment_field' );
412
  if ( ! empty( $use_files ) && ( $use_files == 'yes' ) ) {
413
  $pirate_forms_attach_file = isset( $_FILES['pirate-forms-attachment'] ) ? $_FILES['pirate-forms-attachment'] : '';
414
  if ( ! empty( $pirate_forms_attach_file ) && ! empty( $pirate_forms_attach_file['name'] ) ) {
@@ -603,6 +571,7 @@ class PirateForms_Public {
603
  $atts = shortcode_atts(
604
  array(
605
  'from' => '',
 
606
  ), $atts
607
  );
608
 
@@ -627,6 +596,20 @@ class PirateForms_Public {
627
  'value' => empty( $atts['from'] ) ? 0 : 1,
628
  );
629
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
630
  $nonce_append = isset( $_POST['pirate_forms_from_widget'] ) && intval( $_POST['pirate_forms_from_widget'] ) === 1 ? 'yes' : 'no';
631
 
632
  $error_key = wp_create_nonce( get_bloginfo( 'admin_email' ) . ( empty( $atts['from'] ) ? 'no' : 'yes' ) );
@@ -637,7 +620,7 @@ class PirateForms_Public {
637
  && empty( $_SESSION[ $error_key ] )
638
  && wp_verify_nonce( $_POST['wordpress-nonce'], get_bloginfo( 'admin_email' ) . ( empty( $atts['from'] ) ? 'no' : 'yes' ) )
639
  ) {
640
- $thank_you_message = sanitize_text_field( PirateForms_Util::get_option( 'pirateformsopt_label_submit' ) );
641
  }
642
  $pirate_form->set_element( 'thank_you_message', $thank_you_message );
643
 
@@ -650,7 +633,6 @@ class PirateForms_Public {
650
  'value' => wp_create_nonce( get_bloginfo( 'admin_email' ) . $nonce_append ),
651
  );
652
  }
653
- $pirate_forms_options = get_option( 'pirate_forms_settings_array' );
654
  if ( ! empty( $pirate_forms_options ) ) :
655
  $field = $pirate_forms_options['pirateformsopt_name_field'];
656
  $label = $pirate_forms_options['pirateformsopt_label_name'];
@@ -660,7 +642,7 @@ class PirateForms_Public {
660
  if ( ! empty( $field ) && ! empty( $label ) ) :
661
  $required = $field === 'req' ? true : false;
662
  $wrap_classes = array(
663
- 'contact_name_wrap pirate_forms_three_inputs ',
664
  );
665
  // If this field was submitted with invalid data
666
  if ( isset( $_SESSION[ $error_key ]['contact-name'] ) ) {
@@ -669,7 +651,7 @@ class PirateForms_Public {
669
  $elements[] = array(
670
  'placeholder' => stripslashes( sanitize_text_field( $label ) ),
671
  'required' => $required,
672
- 'required_msg' => PirateForms_Util::get_option( 'pirateformsopt_label_err_name' ),
673
  'type' => 'text',
674
  'id' => 'pirate-forms-contact-name',
675
  'class' => 'form-control',
@@ -677,7 +659,7 @@ class PirateForms_Public {
677
  'type' => 'div',
678
  'class' => implode( ' ', apply_filters( 'pirateform_wrap_classes_name', $wrap_classes ) ),
679
  ),
680
- 'value' => isset( $_REQUEST['pirate-forms-contact-name'] ) ? $_REQUEST['pirate-forms-contact-name'] : '',
681
  );
682
  endif;
683
 
@@ -689,7 +671,7 @@ class PirateForms_Public {
689
  if ( ! empty( $field ) && ! empty( $label ) ) :
690
  $required = $field === 'req' ? true : false;
691
  $wrap_classes = array(
692
- 'contact_email_wrap pirate_forms_three_inputs ',
693
  );
694
  // If this field was submitted with invalid data
695
  if ( isset( $_SESSION[ $error_key ]['contact-email'] ) ) {
@@ -698,7 +680,7 @@ class PirateForms_Public {
698
  $elements[] = array(
699
  'placeholder' => stripslashes( sanitize_text_field( $label ) ),
700
  'required' => $required,
701
- 'required_msg' => PirateForms_Util::get_option( 'pirateformsopt_label_err_email' ),
702
  'type' => 'email',
703
  'id' => 'pirate-forms-contact-email',
704
  'class' => 'form-control',
@@ -706,7 +688,7 @@ class PirateForms_Public {
706
  'type' => 'div',
707
  'class' => implode( ' ', apply_filters( 'pirateform_wrap_classes_email', $wrap_classes ) ),
708
  ),
709
- 'value' => isset( $_REQUEST['pirate-forms-contact-email'] ) ? $_REQUEST['pirate-forms-contact-email'] : '',
710
  );
711
  endif;
712
 
@@ -718,7 +700,7 @@ class PirateForms_Public {
718
  if ( ! empty( $field ) && ! empty( $label ) ) :
719
  $required = $field === 'req' ? true : false;
720
  $wrap_classes = array(
721
- 'contact_subject_wrap pirate_forms_three_inputs ',
722
  );
723
  // If this field was submitted with invalid data
724
  if ( isset( $_SESSION[ $error_key ]['contact-subject'] ) ) {
@@ -727,7 +709,7 @@ class PirateForms_Public {
727
  $elements[] = array(
728
  'placeholder' => stripslashes( sanitize_text_field( $label ) ),
729
  'required' => $required,
730
- 'required_msg' => PirateForms_Util::get_option( 'pirateformsopt_label_err_subject' ),
731
  'type' => 'text',
732
  'id' => 'pirate-forms-contact-subject',
733
  'class' => 'form-control',
@@ -735,7 +717,7 @@ class PirateForms_Public {
735
  'type' => 'div',
736
  'class' => implode( ' ', apply_filters( 'pirateform_wrap_classes_subject', $wrap_classes ) ),
737
  ),
738
- 'value' => isset( $_REQUEST['pirate-forms-contact-subject'] ) ? $_REQUEST['pirate-forms-contact-subject'] : '',
739
  );
740
  endif;
741
 
@@ -754,7 +736,7 @@ class PirateForms_Public {
754
  $elements[] = array(
755
  'placeholder' => stripslashes( sanitize_text_field( $label ) ),
756
  'required' => $required,
757
- 'required_msg' => PirateForms_Util::get_option( 'pirateformsopt_label_err_no_content' ),
758
  'type' => 'textarea',
759
  'class' => 'form-control',
760
  'id' => 'pirate-forms-contact-message',
@@ -762,7 +744,7 @@ class PirateForms_Public {
762
  'type' => 'div',
763
  'class' => implode( ' ', apply_filters( 'pirateform_wrap_classes_message', $wrap_classes ) ),
764
  ),
765
- 'value' => isset( $_REQUEST['pirate-forms-contact-message'] ) ? $_REQUEST['pirate-forms-contact-message'] : '',
766
  );
767
  endif;
768
 
@@ -780,7 +762,7 @@ class PirateForms_Public {
780
  $elements[] = array(
781
  'placeholder' => stripslashes( sanitize_text_field( $label ) ),
782
  'required' => $required,
783
- 'required_msg' => PirateForms_Util::get_option( 'pirateformsopt_label_err_no_attachment' ),
784
  'type' => 'file',
785
  'class' => 'form-control',
786
  'id' => 'pirate-forms-attachment',
@@ -865,13 +847,14 @@ class PirateForms_Public {
865
  * @param object $phpmailer PHPMailer object.
866
  */
867
  function phpmailer( $phpmailer ) {
868
- $pirateformsopt_use_smtp = PirateForms_Util::get_option( 'pirateformsopt_use_smtp' );
869
- $pirateformsopt_smtp_host = PirateForms_Util::get_option( 'pirateformsopt_smtp_host' );
870
- $pirateformsopt_smtp_port = PirateForms_Util::get_option( 'pirateformsopt_smtp_port' );
871
- $pirateformsopt_smtp_username = PirateForms_Util::get_option( 'pirateformsopt_smtp_username' );
872
- $pirateformsopt_smtp_password = PirateForms_Util::get_option( 'pirateformsopt_smtp_password' );
873
- $pirateformsopt_use_secure = PirateForms_Util::get_option( 'pirateformsopt_use_secure' );
874
- $pirateformsopt_use_smtp_authentication = PirateForms_Util::get_option( 'pirateformsopt_use_smtp_authentication' );
 
875
  if ( ! empty( $pirateformsopt_use_smtp ) && ( $pirateformsopt_use_smtp == 'yes' ) && ! empty( $pirateformsopt_smtp_host ) && ! empty( $pirateformsopt_smtp_port ) ) :
876
  // @codingStandardsIgnoreStart
877
  $phpmailer->isSMTP();
132
  return false;
133
  }
134
 
135
+ $pirate_forms_options = PirateForms_Util::get_form_options( isset( $_POST['pirate_forms_form_id'] ) ? $_POST['pirate_forms_form_id'] : null );
136
+
137
+ if ( ! $this->validate_captcha( $error_key, $pirate_forms_options ) ) {
138
  return false;
139
  }
140
 
145
  $body .= '<table>';
146
 
147
  $pirate_forms_contact_email = null;
148
+ $pirate_forms_contact_name = null;
149
+ $pirate_forms_contact_subject = null;
150
  $fields = array( 'name', 'email', 'subject', 'message' );
151
  foreach ( $fields as $field ) {
152
  $value = isset( $_POST[ 'pirate-forms-contact-' . $field ] ) ? sanitize_text_field( trim( $_POST[ 'pirate-forms-contact-' . $field ] ) ) : '';
153
+ if ( $pirate_forms_options[ 'pirateformsopt_' . $field . '_field' ] === 'req' && empty( $value ) ) {
154
+ $_SESSION[ $error_key ][ 'pirate-forms-contact-' . $field ] = $pirate_forms_options[ 'pirateformsopt_label_err_' . $field ];
155
  } elseif ( ! empty( $value ) ) {
156
  if ( 'email' === $field && ! filter_var( $value, FILTER_VALIDATE_EMAIL ) ) {
157
+ $_SESSION[ $error_key ][ 'pirate-forms-contact-' . $field ] = $pirate_forms_options[ 'pirateformsopt_label_err_' . $field ];
158
  } else {
159
  if ( 'email' === $field ) {
160
  $pirate_forms_contact_email = $value;
161
+ } elseif ( 'name' === $field ) {
162
+ $pirate_forms_contact_name = $value;
163
+ } elseif ( 'subject' === $field ) {
164
+ $pirate_forms_contact_subject = $value;
165
  }
166
+ $body .= $this->table_row( stripslashes( $pirate_forms_options[ 'pirateformsopt_label_' . $field ] ), $value );
167
  }
168
  }
169
  }
170
 
171
  /**
172
  ******** Validate recipients email */
173
+ $site_recipients = sanitize_text_field( $pirate_forms_options['pirateformsopt_email_recipients'] );
174
  if ( empty( $site_recipients ) ) {
175
  $_SESSION[ $error_key ]['pirate-forms-recipients-email'] = __( 'Please enter one or more Contact submission recipients', 'pirate-forms' );
176
  }
200
  $body .= $this->table_row( __( 'Sent from page: ', 'pirate-forms' ), get_permalink( get_the_id() ) );
201
 
202
  // Check the blacklist
203
+ $blocked = PirateForms_Util::is_blacklisted( $error_key, $pirate_forms_contact_email, $contact_ip );
204
  if ( $blocked ) {
205
  return false;
206
  }
209
 
210
  // No errors? Go ahead and process the contact
211
  if ( empty( $_SESSION[ $error_key ] ) ) {
212
+ $site_email = sanitize_text_field( $pirate_forms_options['pirateformsopt_email'] );
 
 
 
213
  if ( ! empty( $pirate_forms_contact_name ) ) :
214
  $site_name = $pirate_forms_contact_name;
215
  else :
216
  $site_name = htmlspecialchars_decode( get_bloginfo( 'name' ) );
217
  endif;
218
  // Notification recipients
219
+ $site_recipients = sanitize_text_field( $pirate_forms_options['pirateformsopt_email_recipients'] );
220
  $site_recipients = explode( ',', $site_recipients );
221
  $site_recipients = array_map( 'trim', $site_recipients );
222
  $site_recipients = array_map( 'sanitize_email', $site_recipients );
225
  if ( empty( $pirate_forms_contact_name ) ) {
226
  $pirate_forms_contact_name = ! empty( $pirate_forms_contact_email ) ? $pirate_forms_contact_email : '[None given]';
227
  }
228
+
229
  // Need an email address for the email notification
230
+ $send_from = '';
231
+ if ( '[email]' == $site_email && ! empty( $pirate_forms_contact_email ) ) {
232
+ $send_from = $pirate_forms_contact_email;
233
+ } elseif ( ! empty( $site_email ) ) {
234
+ $send_from = $site_email;
 
 
 
 
 
235
  } else {
236
+ $send_from = PirateForms_Util::get_from_email();
237
  }
238
  $send_from_name = $site_name;
239
 
240
+ // Send an email notification to the correct address
241
  $headers = "From: $send_from_name <$send_from>\r\nReply-To: $pirate_forms_contact_name <$pirate_forms_contact_email>\r\nContent-type: text/html";
242
  add_action( 'phpmailer_init', array( $this, 'phpmailer' ) );
243
 
244
+ $attachments = $this->get_attachments( $error_key, $pirate_forms_options );
245
  if ( is_bool( $attachments ) ) {
246
  return false;
247
  }
248
 
249
  $subject = 'Contact on ' . htmlspecialchars_decode( get_bloginfo( 'name' ) );
250
+ if ( ! empty( $pirate_forms_contact_subject ) ) {
251
+ $subject = $pirate_forms_contact_subject;
252
+ }
253
 
254
+ do_action( 'pirate_forms_before_sending', $pirate_forms_contact_email, $site_recipients, $subject, $body, $headers, $attachments );
255
  do_action( 'themeisle_log_event', PIRATEFORMS_NAME, sprintf( 'before sending email to = %s, subject = %s, body = %s, headers = %s, attachments = %s', $site_recipients, $subject, $body, $headers, print_r( $attachments, true ) ), 'debug', __FILE__, __LINE__ );
256
  $response = wp_mail( $site_recipients, $subject, $body, $headers, $attachments );
257
+ do_action( 'pirate_forms_after_sending', $pirate_forms_options, $response, $pirate_forms_contact_email, $site_recipients, $subject, $body, $headers, $attachments );
258
  do_action( 'themeisle_log_event', PIRATEFORMS_NAME, sprintf( 'after sending email, response = %s', $response ), 'debug', __FILE__, __LINE__ );
259
 
260
  // delete the tmp directory
264
  $wp_filesystem->delete( $this->get_upload_tmp_dir(), true, 'd' );
265
 
266
  // Should a confirm email be sent?
267
+ $confirm_body = stripslashes( trim( $pirate_forms_options['pirateformsopt_confirm_email'] ) );
268
  if ( ! empty( $confirm_body ) && ! empty( $pirate_forms_contact_email ) ) {
269
  // Removing entities
270
  $confirm_body = htmlspecialchars_decode( $confirm_body );
271
  $confirm_body = html_entity_decode( $confirm_body );
272
  $confirm_body = str_replace( '&#39;', "'", $confirm_body );
273
+ $send_from = PirateForms_Util::get_from_email();
274
+ if ( ! empty( $site_email ) && '[email]' !== $site_email ) {
275
+ $send_from = $site_email;
276
+ }
277
+ $site_name = htmlspecialchars_decode( get_bloginfo( 'name' ) );
278
+
279
+ $headers = "From: $site_name <$send_from>\r\nReply-To: $site_name <$send_from>";
280
+ $subject = $pirate_forms_options['pirateformsopt_label_submit'] . ' - ' . $site_name;
281
 
282
+ do_action( 'pirate_forms_before_sending_confirm', $pirate_forms_contact_email, $pirate_forms_contact_email, $subject, $confirm_body, $headers );
283
  do_action( 'themeisle_log_event', PIRATEFORMS_NAME, sprintf( 'before sending confirm email to = %s, subject = %s, body = %s, headers = %s', $pirate_forms_contact_email, $subject, $confirm_body, $headers ), 'debug', __FILE__, __LINE__ );
284
  $response = wp_mail( $pirate_forms_contact_email, $subject, $confirm_body, $headers );
285
+ do_action( 'pirate_forms_after_sending_confirm', $pirate_forms_options, $response, $pirate_forms_contact_email, $pirate_forms_contact_email, $subject, $confirm_body, $headers );
286
  do_action( 'themeisle_log_event', PIRATEFORMS_NAME, sprintf( 'after sending confirm email response = %s', $response ), 'debug', __FILE__, __LINE__ );
287
  if ( ! $response ) {
288
  error_log( 'Email not sent' );
291
 
292
  /**
293
  *********** Store the entries in the DB */
294
+ if ( 'yes' === $pirate_forms_options['pirateformsopt_store'] ) {
295
  $new_post_id = wp_insert_post(
296
  array(
297
  'post_type' => 'pf_contact',
308
  $pirate_forms_current_theme = wp_get_theme();
309
 
310
  /* If a Thank you page is selected, redirect to that page */
311
+ if ( $pirate_forms_options['pirateformsopt_thank_you_url'] ) {
312
+ $redirect_id = intval( $pirate_forms_options['pirateformsopt_thank_you_url'] );
313
  $redirect = get_permalink( $redirect_id );
314
  wp_safe_redirect( $redirect );
315
  } elseif ( ( 'Zerif Lite' == $pirate_forms_current_theme->name ) || ( 'Zerif Lite' == $pirate_forms_current_theme->parent_theme ) || ( 'Zerif PRO' == $pirate_forms_current_theme->name ) || ( 'Zerif PRO' == $pirate_forms_current_theme->parent_theme ) ) {
323
  * Validate CAPTCHA
324
  *
325
  * @param string $error_key the key for the session object.
326
+ * @param array $pirate_forms_options the array of options for this form.
327
  */
328
+ function validate_captcha( $error_key, $pirate_forms_options ) {
329
+ $pirateformsopt_recaptcha_sitekey = $pirate_forms_options['pirateformsopt_recaptcha_sitekey'];
330
+ $pirateformsopt_recaptcha_secretkey = $pirate_forms_options['pirateformsopt_recaptcha_secretkey'];
331
+ $pirateformsopt_recaptcha_field = $pirate_forms_options['pirateformsopt_recaptcha_field'];
332
  if ( ! empty( $pirateformsopt_recaptcha_secretkey ) && ! empty( $pirateformsopt_recaptcha_sitekey ) && ! empty( $pirateformsopt_recaptcha_field ) && ( $pirateformsopt_recaptcha_field == 'yes' ) ) :
333
  if ( isset( $_POST['g-recaptcha-response'] ) ) {
334
  $captcha = $_POST['g-recaptcha-response'];
364
  return '<tr><th>' . $key . '</th><td>' . $value . '</td></tr>';
365
  }
366
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
367
  /**
368
  * Get attachments, if any
369
  *
370
  * @param string $error_key the key for the session object.
371
+ * @param array $pirate_forms_options the array of options for the form.
372
  *
373
  * @throws Exception When file uploading fails.
374
  */
375
+ function get_attachments( $error_key, $pirate_forms_options ) {
376
  $attachments = '';
377
  /**
378
  ******* Validate Attachment */
379
+ $use_files = $pirate_forms_options['pirateformsopt_attachment_field'];
380
  if ( ! empty( $use_files ) && ( $use_files == 'yes' ) ) {
381
  $pirate_forms_attach_file = isset( $_FILES['pirate-forms-attachment'] ) ? $_FILES['pirate-forms-attachment'] : '';
382
  if ( ! empty( $pirate_forms_attach_file ) && ! empty( $pirate_forms_attach_file['name'] ) ) {
571
  $atts = shortcode_atts(
572
  array(
573
  'from' => '',
574
+ 'id' => '',
575
  ), $atts
576
  );
577
 
596
  'value' => empty( $atts['from'] ) ? 0 : 1,
597
  );
598
 
599
+ $pirate_forms_options = PirateForms_Util::get_option();
600
+
601
+ if ( isset( $atts['id'] ) && ! empty( $atts['id'] ) ) {
602
+ $pirate_forms_options = apply_filters( 'pirateformpro_get_form_attributes', $pirate_forms_options, $atts['id'] );
603
+ if ( isset( $pirate_forms_options['id'] ) ) {
604
+ // add the form id to the form so that it can be used when we are processing the form
605
+ $elements[] = array(
606
+ 'type' => 'hidden',
607
+ 'id' => 'pirate_forms_form_id',
608
+ 'value' => $atts['id'],
609
+ );
610
+ }
611
+ }
612
+
613
  $nonce_append = isset( $_POST['pirate_forms_from_widget'] ) && intval( $_POST['pirate_forms_from_widget'] ) === 1 ? 'yes' : 'no';
614
 
615
  $error_key = wp_create_nonce( get_bloginfo( 'admin_email' ) . ( empty( $atts['from'] ) ? 'no' : 'yes' ) );
620
  && empty( $_SESSION[ $error_key ] )
621
  && wp_verify_nonce( $_POST['wordpress-nonce'], get_bloginfo( 'admin_email' ) . ( empty( $atts['from'] ) ? 'no' : 'yes' ) )
622
  ) {
623
+ $thank_you_message = sanitize_text_field( $pirate_forms_options['pirateformsopt_label_submit'] );
624
  }
625
  $pirate_form->set_element( 'thank_you_message', $thank_you_message );
626
 
633
  'value' => wp_create_nonce( get_bloginfo( 'admin_email' ) . $nonce_append ),
634
  );
635
  }
 
636
  if ( ! empty( $pirate_forms_options ) ) :
637
  $field = $pirate_forms_options['pirateformsopt_name_field'];
638
  $label = $pirate_forms_options['pirateformsopt_label_name'];
642
  if ( ! empty( $field ) && ! empty( $label ) ) :
643
  $required = $field === 'req' ? true : false;
644
  $wrap_classes = array(
645
+ 'contact_name_wrap pirate_forms_three_inputs form_field_wrap',
646
  );
647
  // If this field was submitted with invalid data
648
  if ( isset( $_SESSION[ $error_key ]['contact-name'] ) ) {
651
  $elements[] = array(
652
  'placeholder' => stripslashes( sanitize_text_field( $label ) ),
653
  'required' => $required,
654
+ 'required_msg' => $pirate_forms_options['pirateformsopt_label_err_name'],
655
  'type' => 'text',
656
  'id' => 'pirate-forms-contact-name',
657
  'class' => 'form-control',
659
  'type' => 'div',
660
  'class' => implode( ' ', apply_filters( 'pirateform_wrap_classes_name', $wrap_classes ) ),
661
  ),
662
+ 'value' => empty( $thank_you_message ) && isset( $_REQUEST['pirate-forms-contact-name'] ) ? $_REQUEST['pirate-forms-contact-name'] : '',
663
  );
664
  endif;
665
 
671
  if ( ! empty( $field ) && ! empty( $label ) ) :
672
  $required = $field === 'req' ? true : false;
673
  $wrap_classes = array(
674
+ 'contact_email_wrap pirate_forms_three_inputs form_field_wrap',
675
  );
676
  // If this field was submitted with invalid data
677
  if ( isset( $_SESSION[ $error_key ]['contact-email'] ) ) {
680
  $elements[] = array(
681
  'placeholder' => stripslashes( sanitize_text_field( $label ) ),
682
  'required' => $required,
683
+ 'required_msg' => $pirate_forms_options['pirateformsopt_label_err_email'],
684
  'type' => 'email',
685
  'id' => 'pirate-forms-contact-email',
686
  'class' => 'form-control',
688
  'type' => 'div',
689
  'class' => implode( ' ', apply_filters( 'pirateform_wrap_classes_email', $wrap_classes ) ),
690
  ),
691
+ 'value' => empty( $thank_you_message ) && isset( $_REQUEST['pirate-forms-contact-email'] ) ? $_REQUEST['pirate-forms-contact-email'] : '',
692
  );
693
  endif;
694
 
700
  if ( ! empty( $field ) && ! empty( $label ) ) :
701
  $required = $field === 'req' ? true : false;
702
  $wrap_classes = array(
703
+ 'contact_subject_wrap pirate_forms_three_inputs form_field_wrap',
704
  );
705
  // If this field was submitted with invalid data
706
  if ( isset( $_SESSION[ $error_key ]['contact-subject'] ) ) {
709
  $elements[] = array(
710
  'placeholder' => stripslashes( sanitize_text_field( $label ) ),
711
  'required' => $required,
712
+ 'required_msg' => $pirate_forms_options['pirateformsopt_label_err_subject'],
713
  'type' => 'text',
714
  'id' => 'pirate-forms-contact-subject',
715
  'class' => 'form-control',
717
  'type' => 'div',
718
  'class' => implode( ' ', apply_filters( 'pirateform_wrap_classes_subject', $wrap_classes ) ),
719
  ),
720
+ 'value' => empty( $thank_you_message ) && isset( $_REQUEST['pirate-forms-contact-subject'] ) ? $_REQUEST['pirate-forms-contact-subject'] : '',
721
  );
722
  endif;
723
 
736
  $elements[] = array(
737
  'placeholder' => stripslashes( sanitize_text_field( $label ) ),
738
  'required' => $required,
739
+ 'required_msg' => $pirate_forms_options['pirateformsopt_label_err_no_content'],
740
  'type' => 'textarea',
741
  'class' => 'form-control',
742
  'id' => 'pirate-forms-contact-message',
744
  'type' => 'div',
745
  'class' => implode( ' ', apply_filters( 'pirateform_wrap_classes_message', $wrap_classes ) ),
746
  ),
747
+ 'value' => empty( $thank_you_message ) && isset( $_REQUEST['pirate-forms-contact-message'] ) ? $_REQUEST['pirate-forms-contact-message'] : '',
748
  );
749
  endif;
750
 
762
  $elements[] = array(
763
  'placeholder' => stripslashes( sanitize_text_field( $label ) ),
764
  'required' => $required,
765
+ 'required_msg' => $pirate_forms_options['pirateformsopt_label_err_no_attachment'],
766
  'type' => 'file',
767
  'class' => 'form-control',
768
  'id' => 'pirate-forms-attachment',
847
  * @param object $phpmailer PHPMailer object.
848
  */
849
  function phpmailer( $phpmailer ) {
850
+ $pirate_forms_options = PirateForms_Util::get_form_options( isset( $_POST['pirate_forms_form_id'] ) && ! empty( $_POST['pirate_forms_form_id'] ) ? $_POST['pirate_forms_form_id'] : null );
851
+ $pirateformsopt_use_smtp = $pirate_forms_options['pirateformsopt_use_smtp'];
852
+ $pirateformsopt_smtp_host = $pirate_forms_options['pirateformsopt_smtp_host'];
853
+ $pirateformsopt_smtp_port = $pirate_forms_options['pirateformsopt_smtp_port'];
854
+ $pirateformsopt_smtp_username = $pirate_forms_options['pirateformsopt_smtp_username'];
855
+ $pirateformsopt_smtp_password = $pirate_forms_options['pirateformsopt_smtp_password'];
856
+ $pirateformsopt_use_secure = $pirate_forms_options['pirateformsopt_use_secure'];
857
+ $pirateformsopt_use_smtp_authentication = $pirate_forms_options['pirateformsopt_use_smtp_authentication'];
858
  if ( ! empty( $pirateformsopt_use_smtp ) && ( $pirateformsopt_use_smtp == 'yes' ) && ! empty( $pirateformsopt_smtp_host ) && ! empty( $pirateformsopt_smtp_port ) ) :
859
  // @codingStandardsIgnoreStart
860
  $phpmailer->isSMTP();
public/css/front.css CHANGED
@@ -1,5 +1,5 @@
1
  /*
2
- Version: 2.0.1
3
  */
4
  .pirate_forms_wrap .form_field_wrap {
5
  margin-bottom: 20px;
1
  /*
2
+ Version: 2.0.2
3
  */
4
  .pirate_forms_wrap .form_field_wrap {
5
  margin-bottom: 20px;
public/partials/pirateforms-form.php CHANGED
@@ -42,15 +42,18 @@ if ( ! empty( $this->thank_you_message ) ) :
42
  <?php echo $this->form_start; ?>
43
 
44
  <div class="pirate_forms_three_inputs_wrap">
45
- <?php echo $this->contact_name; ?>
 
 
46
 
47
  <?php echo $this->contact_email; ?>
48
 
49
- <?php echo $this->contact_subject; ?>
 
 
50
  </div>
51
 
52
- <?php echo $this->contact_message; ?>
53
-
54
 
55
  <?php if ( isset( $this->attachment ) ) { ?>
56
  <div class="col-sm-12 col-lg-12 form_field_wrap contact_attachment_wrap ">
@@ -64,8 +67,7 @@ if ( ! empty( $this->thank_you_message ) ) :
64
  </div>
65
  <?php } ?>
66
 
67
- <?php echo $this->contact_submit; ?>
68
-
69
 
70
  <?php echo $this->form_end; ?>
71
  <div class="pirate_forms_clearfix"></div>
42
  <?php echo $this->form_start; ?>
43
 
44
  <div class="pirate_forms_three_inputs_wrap">
45
+ <?php if ( isset( $this->contact_name ) ) { ?>
46
+ <?php echo $this->contact_name; ?>
47
+ <?php } ?>
48
 
49
  <?php echo $this->contact_email; ?>
50
 
51
+ <?php if ( isset( $this->contact_subject ) ) { ?>
52
+ <?php echo $this->contact_subject; ?>
53
+ <?php } ?>
54
  </div>
55
 
56
+ <?php echo $this->contact_message; ?>
 
57
 
58
  <?php if ( isset( $this->attachment ) ) { ?>
59
  <div class="col-sm-12 col-lg-12 form_field_wrap contact_attachment_wrap ">
67
  </div>
68
  <?php } ?>
69
 
70
+ <?php echo $this->contact_submit; ?>
 
71
 
72
  <?php echo $this->form_end; ?>
73
  <div class="pirate_forms_clearfix"></div>
readme.txt CHANGED
@@ -1,5 +1,5 @@
1
  === Contact Form & SMTP Plugin for WordPress by PirateForms ===
2
- Contributors: themeisle, codeinwp, rodicaelena, hardeepasrani, pirateforms
3
  Tags: contact form, contact form plugin, forms, smtp, custom form, subscribe form, feedback form, wordpress contact form
4
  Requires at least: 3.0
5
  Tested up to: 4.8
@@ -113,6 +113,13 @@ Activating the Pirate Contact Form plugin is just like any other plugin. If you'
113
  4. Screenshot 4. Enabling SMTP
114
 
115
  == Changelog ==
 
 
 
 
 
 
 
116
  = 2.0.1 - 2017-08-01 =
117
 
118
  * Fixed backwards compatibility with Zerif themes
1
  === Contact Form & SMTP Plugin for WordPress by PirateForms ===
2
+ Contributors: themeisle, codeinwp, rodicaelena, hardeepasrani, pirateforms, rozroz
3
  Tags: contact form, contact form plugin, forms, smtp, custom form, subscribe form, feedback form, wordpress contact form
4
  Requires at least: 3.0
5
  Tested up to: 4.8
113
  4. Screenshot 4. Enabling SMTP
114
 
115
  == Changelog ==
116
+ = 2.0.2 - 2017-08-07 =
117
+
118
+ * Fixed none option for thank you page.
119
+ * Fixed various issues with form layout.
120
+ * Added support for future pro version.
121
+
122
+
123
  = 2.0.1 - 2017-08-01 =
124
 
125
  * Fixed backwards compatibility with Zerif themes
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitc5c968f47d29c52d25f37143f61a236b::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitaded4f45b366ed7e0b9f96fb32075fe9::getLoader();
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInite8c84b227df2c7a8d0e5941c35929b93::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInit937464a07bd020256623265eaff345a7::getLoader();
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-deactivate.php CHANGED
@@ -19,9 +19,9 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Deactivate' ) ) :
19
  class ThemeIsle_SDK_Feedback_Deactivate extends ThemeIsle_SDK_Feedback {
20
 
21
  /**
22
- * @var array $options The main options list
23
  */
24
- private $options = array(
25
  'I only needed the plugin for a short period' => array(
26
  'id' => 1,
27
  ),
@@ -46,6 +46,26 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Deactivate' ) ) :
46
  ),
47
  );
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  /**
50
  * @var array $other The other option
51
  */
@@ -58,9 +78,14 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Deactivate' ) ) :
58
  );
59
 
60
  /**
61
- * @var string $heading The heading of the modal
 
 
 
 
 
62
  */
63
- private $heading = 'If you have a moment, please let us know why you are deactivating:';
64
 
65
  /**
66
  * @var string $button_submit_before The text of the deactivate button before an option is chosen
@@ -77,6 +102,16 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Deactivate' ) ) :
77
  */
78
  private $button_cancel = 'Cancel';
79
 
 
 
 
 
 
 
 
 
 
 
80
  /**
81
  * ThemeIsle_SDK_Feedback_Deactivate constructor.
82
  *
@@ -91,7 +126,8 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Deactivate' ) ) :
91
  */
92
  public function setup_hooks_child() {
93
  global $pagenow;
94
- if ( 'plugins.php' === $pagenow ) {
 
95
  add_action( 'admin_head', array( $this, 'load_resources' ) );
96
  }
97
  add_action( 'wp_ajax_' . $this->product->get_key() . __CLASS__, array( $this, 'post_deactivate' ) );
@@ -105,18 +141,20 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Deactivate' ) ) :
105
 
106
  $id = $this->product->get_key() . '_deactivate';
107
 
108
- $this->add_css( $this->product->get_key() );
109
- $this->add_js( $this->product->get_key(), '#TB_inline?' . apply_filters( $this->product->get_key() . '_feedback_deactivate_attributes', 'width=600&height=550' ) . '&inlineId=' . $id );
110
 
111
- echo '<div id="' . $id . '" style="display:none;" class="themeisle-deactivate-box">' . $this->get_html( $this->product->get_key() ) . '</div>';
112
  }
113
 
114
  /**
115
  * Loads the css
116
  *
 
117
  * @param string $key The product key.
118
  */
119
- function add_css( $key ) {
 
120
  ?>
121
  <style type="text/css" id="<?php echo $key; ?>ti-deactivate-css">
122
  input[name="ti-deactivate-option"] ~ div {
@@ -127,59 +165,59 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Deactivate' ) ) :
127
  display: block;
128
  }
129
 
130
- body.plugins-php .<?php echo $key; ?>-container #TB_window.thickbox-loading:before {
131
  background: none !important;
132
  }
133
 
134
- body.plugins-php .<?php echo $key; ?>-container #TB_title {
135
  font-size: 21px;
136
  padding: 20px 0;
137
  background-color: #f3f3f3;
138
  }
139
 
140
- body.plugins-php .<?php echo $key; ?>-container div.actions {
141
  padding: 20px 0;
142
  background-color: #f3f3f3;
143
  border-top: 1px solid #dddddd;
144
  }
145
 
146
- body.plugins-php .<?php echo $key; ?>-container input.button.button-primary {
147
  margin-right: 20px;
148
  }
149
 
150
- body.plugins-php .<?php echo $key; ?>-container input.button {
151
  margin-right: 20px;
152
  }
153
 
154
- body.plugins-php .<?php echo $key; ?>-container #TB_ajaxWindowTitle {
155
  text-align: left;
156
  margin-left: 15px;
157
  }
158
 
159
- body.plugins-php .<?php echo $key; ?>-container div.revive_network-container {
160
  background-color: #ffffff;
161
  }
162
 
163
- body.plugins-php .<?php echo $key; ?>-container ul.ti-list li {
164
  font-size: 14px;
165
  }
166
 
167
- body.plugins-php .<?php echo $key; ?>-container ul.ti-list li label {
168
  margin-left: 10px;
169
  line-height: 32px;
170
  font-size: 16px;
171
  }
172
 
173
- body.plugins-php .<?php echo $key; ?>-container #TB_ajaxContent {
174
  padding: 10px 20px;
175
  }
176
 
177
- body.plugins-php .<?php echo $key; ?>-container li div textarea {
178
  padding: 10px 15px;
179
  width: 100%;
180
  }
181
 
182
- body.plugins-php .<?php echo $key; ?>-container ul.ti-list li div {
183
  margin: 10px 30px;
184
  }
185
 
@@ -187,7 +225,7 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Deactivate' ) ) :
187
  display: block;
188
  }
189
 
190
- body.plugins-php .<?php echo $key; ?>-container .actions {
191
 
192
  width: 100%;
193
  display: block;
@@ -197,14 +235,29 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Deactivate' ) ) :
197
  text-align: right;
198
  }
199
 
200
- body.plugins-php .<?php echo $key; ?>-container #TB_title {
201
 
202
  height: 33px;
203
  width: 100%;
204
  text-align: center;
205
  }
206
 
207
- body.plugins-php .<?php echo $key; ?>-container {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
 
209
  margin: auto !important;
210
  height: 550px !important;
@@ -220,61 +273,102 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Deactivate' ) ) :
220
  /**
221
  * Loads the js
222
  *
 
223
  * @param string $key The product key.
224
  * @param string $src The url that will hijack the deactivate button url.
225
  */
226
- function add_js( $key, $src ) {
227
-
228
- $heading = apply_filters( $this->product->get_key() . '_feedback_deactivate_heading', $this->heading );
229
  ?>
230
  <script type="text/javascript" id="ti-deactivate-js">
231
  (function ($) {
232
  $(document).ready(function () {
 
 
 
 
 
 
 
 
 
 
 
 
 
233
 
234
- var href = $('tr[data-plugin^="<?php echo $this->product->get_slug();?>/"] span.deactivate a').attr('href');
235
- $('#<?php echo $key;?>ti-deactivate-no').on('click', function (e) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  e.preventDefault();
237
  e.stopPropagation();
 
238
  $('body').unbind('thickbox:removed');
239
  tb_remove();
240
  });
241
 
242
- $('#<?php echo $key;?> ul.ti-list label, #<?php echo $key;?> ul.ti-list input[name="ti-deactivate-option"]').on('click', function (e) {
243
- $('#<?php echo $key;?>ti-deactivate-yes').val($('#<?php echo $key;?>ti-deactivate-yes').attr('data-after-text'));
244
 
245
  var radio = $(this).prop('tagName') === 'LABEL' ? $(this).parent() : $(this);
246
  if (radio.parent().find('textarea').length > 0 && radio.parent().find('textarea').val().length === 0) {
247
- $('#<?php echo $key;?>ti-deactivate-yes').attr('disabled', 'disabled');
248
  radio.parent().find('textarea').on('keyup', function (ee) {
249
  if ($(this).val().length === 0) {
250
- $('#<?php echo $key;?>ti-deactivate-yes').attr('disabled', 'disabled');
251
  } else {
252
- $('#<?php echo $key;?>ti-deactivate-yes').removeAttr('disabled');
253
  }
254
  });
255
  } else {
256
- $('#<?php echo $key;?>ti-deactivate-yes').removeAttr('disabled');
257
  }
258
  });
259
 
260
- $('#<?php echo $key;?>ti-deactivate-yes').attr('data-ti-action', href).on('click', function (e) {
261
  e.preventDefault();
262
  e.stopPropagation();
263
  $.ajax({
264
  url: ajaxurl,
265
  method: 'post',
266
  data: {
267
- 'action': '<?php echo $key . __CLASS__;?>',
268
- 'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ );?>',
269
- 'id': $('#<?php echo $key;?> input[name="ti-deactivate-option"]:checked').parent().attr('ti-option-id'),
270
- 'msg': $('#<?php echo $key;?> input[name="ti-deactivate-option"]:checked').parent().find('textarea').val()
 
 
271
  },
272
  });
273
- location.href = $(this).attr('data-ti-action');
 
 
 
 
 
 
274
  });
275
- $('tr[data-plugin^="<?php echo $this->product->get_slug();?>/"] span.deactivate a').attr('name', '<?php echo esc_html( $heading ); ?>').attr('href', '<?php echo $src;?>').addClass('thickbox');
 
276
  var thicbox_timer;
277
- $('tr[data-plugin^="<?php echo $this->product->get_slug();?>/"] span.deactivate a').on('click', function () {
278
  tiBindThickbox();
279
  });
280
 
@@ -299,12 +393,16 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Deactivate' ) ) :
299
  /**
300
  * Generates the HTML
301
  *
 
302
  * @param string $key The product key.
303
  */
304
- function get_html( $key ) {
305
- $options = $this->randomize_options( apply_filters( $this->product->get_key() . '_feedback_deactivate_options', $this->options ) );
306
- $button_submit_before = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_submit_before', $this->button_submit_before );
307
- $button_submit = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_submit', $this->button_submit );
 
 
 
308
  $button_cancel = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_cancel', $this->button_cancel );
309
 
310
  $options += $this->other;
@@ -312,7 +410,7 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Deactivate' ) ) :
312
  $list = '';
313
  foreach ( $options as $title => $attributes ) {
314
  $id = $attributes['id'];
315
- $list .= '<li ti-option-id="' . $id . '"><input type="radio" name="ti-deactivate-option" id="' . $key . $id . '"><label for="' . $key . $id . '">' . __( $title ) . '</label>';
316
  if ( array_key_exists( 'type', $attributes ) ) {
317
  $list .= '<div>';
318
  $placeholder = array_key_exists( 'placeholder', $attributes ) ? __( $attributes['placeholder'] ) : '';
@@ -330,13 +428,15 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Deactivate' ) ) :
330
  }
331
 
332
  return '<div id="' . $this->product->get_key() . '">'
333
- . '<ul class="ti-list">' . $list . '</ul>'
334
- . '<div class="actions">'
335
- . get_submit_button( __( $button_submit_before ), 'secondary', $this->product->get_key() . 'ti-deactivate-yes', false, array(
336
- 'data-after-text' => $button_submit,
337
- ) )
338
- . get_submit_button( __( $button_cancel ), 'primary', $this->product->get_key() . 'ti-deactivate-no', false )
339
- . '</div></div>';
 
 
340
  }
341
 
342
  /**
@@ -346,11 +446,24 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Deactivate' ) ) :
346
  check_ajax_referer( (string) __CLASS__, 'nonce' );
347
 
348
  if ( ! empty( $_POST['id'] ) ) {
349
- $this->call_api( array(
350
- 'type' => 'deactivate',
351
- 'id' => $_POST['id'],
352
- 'comment' => isset( $_POST['msg'] ) ? $_POST['msg'] : '',
353
- ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
354
  }
355
  }
356
  }
19
  class ThemeIsle_SDK_Feedback_Deactivate extends ThemeIsle_SDK_Feedback {
20
 
21
  /**
22
+ * @var array $options_plugin The main options list for plugins.
23
  */
24
+ private $options_plugin = array(
25
  'I only needed the plugin for a short period' => array(
26
  'id' => 1,
27
  ),
46
  ),
47
  );
48
 
49
+ /**
50
+ * @var array $options_theme The main options list for themes.
51
+ */
52
+ private $options_theme = array(
53
+ 'I don\'t know how to make it look like demo' => array(
54
+ 'id' => 7,
55
+ ),
56
+ 'It lacks options' => array(
57
+ 'id' => 8,
58
+ ),
59
+ 'Is not working with a plugin that I need' => array(
60
+ 'id' => 9,
61
+ 'type' => 'text',
62
+ 'placeholder' => 'What is the name of the plugin',
63
+ ),
64
+ 'I want to try a new design, I don\'t like {theme} style' => array(
65
+ 'id' => 10,
66
+ ),
67
+ );
68
+
69
  /**
70
  * @var array $other The other option
71
  */
78
  );
79
 
80
  /**
81
+ * @var string $heading_plugin The heading of the modal
82
+ */
83
+ private $heading_plugin = 'If you have a moment, please let us know why you are deactivating:';
84
+
85
+ /**
86
+ * @var string $heading_theme The heading of the modal
87
  */
88
+ private $heading_theme = 'Looking to change {theme}, what doesn\'t work for you?';
89
 
90
  /**
91
  * @var string $button_submit_before The text of the deactivate button before an option is chosen
102
  */
103
  private $button_cancel = 'Cancel';
104
 
105
+ /**
106
+ * @var int how many seconds before the deactivation window is triggered for themes
107
+ */
108
+ const AUTO_TRIGGER_DEACTIVATE_WINDOW_SECONDS = 3;
109
+
110
+ /**
111
+ * @var int how many days before the deactivation window pops up again for the theme
112
+ */
113
+ const PAUSE_DEACTIVATE_WINDOW_DAYS = 100;
114
+
115
  /**
116
  * ThemeIsle_SDK_Feedback_Deactivate constructor.
117
  *
126
  */
127
  public function setup_hooks_child() {
128
  global $pagenow;
129
+
130
+ if ( ( $this->product->get_type() === 'plugin' && $pagenow === 'plugins.php' ) || ( $this->product->get_type() === 'theme' && $pagenow === 'theme-install.php' ) ) {
131
  add_action( 'admin_head', array( $this, 'load_resources' ) );
132
  }
133
  add_action( 'wp_ajax_' . $this->product->get_key() . __CLASS__, array( $this, 'post_deactivate' ) );
141
 
142
  $id = $this->product->get_key() . '_deactivate';
143
 
144
+ $this->add_css( $this->product->get_type(), $this->product->get_key() );
145
+ $this->add_js( $this->product->get_type(), $this->product->get_key(), '#TB_inline?' . apply_filters( $this->product->get_key() . '_feedback_deactivate_attributes', 'width=600&height=550' ) . '&inlineId=' . $id );
146
 
147
+ echo '<div id="' . $id . '" style="display:none;" class="themeisle-deactivate-box">' . $this->get_html( $this->product->get_type(), $this->product->get_key() ) . '</div>';
148
  }
149
 
150
  /**
151
  * Loads the css
152
  *
153
+ * @param string $type The type of product.
154
  * @param string $key The product key.
155
  */
156
+ function add_css( $type, $key ) {
157
+ $suffix = 'theme' === $type ? 'theme-install-php' : 'plugins-php';
158
  ?>
159
  <style type="text/css" id="<?php echo $key; ?>ti-deactivate-css">
160
  input[name="ti-deactivate-option"] ~ div {
165
  display: block;
166
  }
167
 
168
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container #TB_window.thickbox-loading:before {
169
  background: none !important;
170
  }
171
 
172
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container #TB_title {
173
  font-size: 21px;
174
  padding: 20px 0;
175
  background-color: #f3f3f3;
176
  }
177
 
178
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container div.actions {
179
  padding: 20px 0;
180
  background-color: #f3f3f3;
181
  border-top: 1px solid #dddddd;
182
  }
183
 
184
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container input.button.button-primary {
185
  margin-right: 20px;
186
  }
187
 
188
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container input.button {
189
  margin-right: 20px;
190
  }
191
 
192
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container #TB_ajaxWindowTitle {
193
  text-align: left;
194
  margin-left: 15px;
195
  }
196
 
197
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container div.revive_network-container {
198
  background-color: #ffffff;
199
  }
200
 
201
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container ul.ti-list li {
202
  font-size: 14px;
203
  }
204
 
205
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container ul.ti-list li label {
206
  margin-left: 10px;
207
  line-height: 32px;
208
  font-size: 16px;
209
  }
210
 
211
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container #TB_ajaxContent {
212
  padding: 10px 20px;
213
  }
214
 
215
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container li div textarea {
216
  padding: 10px 15px;
217
  width: 100%;
218
  }
219
 
220
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container ul.ti-list li div {
221
  margin: 10px 30px;
222
  }
223
 
225
  display: block;
226
  }
227
 
228
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container .actions {
229
 
230
  width: 100%;
231
  display: block;
235
  text-align: right;
236
  }
237
 
238
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container #TB_title {
239
 
240
  height: 33px;
241
  width: 100%;
242
  text-align: center;
243
  }
244
 
245
+ .theme-install-php .<?php echo $key; ?>-container #TB_closeWindowButton .tb-close-icon:before {
246
+ font-size: 32px;
247
+ }
248
+
249
+ .<?php echo $key; ?>-container #TB_closeWindowButton .tb-close-icon {
250
+
251
+ color: #eee;
252
+ }
253
+
254
+ .<?php echo $key; ?>-container #TB_closeWindowButton {
255
+ left: auto;
256
+ right: -30px;
257
+ color: #eee;
258
+ }
259
+
260
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container {
261
 
262
  margin: auto !important;
263
  height: 550px !important;
273
  /**
274
  * Loads the js
275
  *
276
+ * @param string $type The type of product.
277
  * @param string $key The product key.
278
  * @param string $src The url that will hijack the deactivate button url.
279
  */
280
+ function add_js( $type, $key, $src ) {
281
+ $heading = 'plugin' === $type ? $this->heading_plugin : str_replace( '{theme}', $this->product->get_name(), $this->heading_theme );
282
+ $heading = apply_filters( $this->product->get_key() . '_feedback_deactivate_heading', $heading );
283
  ?>
284
  <script type="text/javascript" id="ti-deactivate-js">
285
  (function ($) {
286
  $(document).ready(function () {
287
+ var auto_trigger = false;
288
+ var target_element = 'tr[data-plugin^="<?php echo $this->product->get_slug(); ?>/"] span.deactivate a';
289
+ <?php
290
+ if ( 'theme' === $type ) {
291
+ ?>
292
+ auto_trigger = true;
293
+ if ($('a.ti-auto-anchor').length == 0) {
294
+ $('body').append($('<a class="ti-auto-anchor" href=""></a>'));
295
+ }
296
+ target_element = 'a.ti-auto-anchor';
297
+ <?php
298
+ }
299
+ ?>
300
 
301
+ if (auto_trigger) {
302
+ setTimeout(function () {
303
+ $('a.ti-auto-anchor').trigger('click');
304
+ }, <?php echo self::AUTO_TRIGGER_DEACTIVATE_WINDOW_SECONDS * 1000; ?> );
305
+ }
306
+ $( document ).on( 'thickbox:removed', function() {
307
+ $.ajax({
308
+ url: ajaxurl,
309
+ method: 'post',
310
+ data: {
311
+ 'action' : '<?php echo $key . __CLASS__; ?>',
312
+ 'nonce' : '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
313
+ 'type' : '<?php echo $type; ?>',
314
+ 'key' : '<?php echo $key; ?>'
315
+ },
316
+ });
317
+ });
318
+ var href = $(target_element).attr('href');
319
+ $('#<?php echo $key; ?>ti-deactivate-no').on('click', function (e) {
320
  e.preventDefault();
321
  e.stopPropagation();
322
+
323
  $('body').unbind('thickbox:removed');
324
  tb_remove();
325
  });
326
 
327
+ $('#<?php echo $key; ?> ul.ti-list label, #<?php echo $key; ?> ul.ti-list input[name="ti-deactivate-option"]').on('click', function (e) {
328
+ $('#<?php echo $key; ?>ti-deactivate-yes').val($('#<?php echo $key; ?>ti-deactivate-yes').attr('data-after-text'));
329
 
330
  var radio = $(this).prop('tagName') === 'LABEL' ? $(this).parent() : $(this);
331
  if (radio.parent().find('textarea').length > 0 && radio.parent().find('textarea').val().length === 0) {
332
+ $('#<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
333
  radio.parent().find('textarea').on('keyup', function (ee) {
334
  if ($(this).val().length === 0) {
335
+ $('#<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
336
  } else {
337
+ $('#<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
338
  }
339
  });
340
  } else {
341
+ $('#<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
342
  }
343
  });
344
 
345
+ $('#<?php echo $key; ?>ti-deactivate-yes').attr('data-ti-action', href).on('click', function (e) {
346
  e.preventDefault();
347
  e.stopPropagation();
348
  $.ajax({
349
  url: ajaxurl,
350
  method: 'post',
351
  data: {
352
+ 'action' : '<?php echo $key . __CLASS__; ?>',
353
+ 'nonce' : '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
354
+ 'id' : $('#<?php echo $key; ?> input[name="ti-deactivate-option"]:checked').parent().attr('ti-option-id'),
355
+ 'msg' : $('#<?php echo $key; ?> input[name="ti-deactivate-option"]:checked').parent().find('textarea').val(),
356
+ 'type' : '<?php echo $type; ?>',
357
+ 'key' : '<?php echo $key; ?>'
358
  },
359
  });
360
+ var redirect = $(this).attr('data-ti-action');
361
+ if (redirect != '') {
362
+ location.href = redirect;
363
+ } else {
364
+ $('body').unbind('thickbox:removed');
365
+ tb_remove();
366
+ }
367
  });
368
+
369
+ $(target_element).attr('name', '<?php echo esc_html( $heading ); ?>').attr('href', '<?php echo $src; ?>').addClass('thickbox');
370
  var thicbox_timer;
371
+ $(target_element).on('click', function () {
372
  tiBindThickbox();
373
  });
374
 
393
  /**
394
  * Generates the HTML
395
  *
396
+ * @param string $type The type of product.
397
  * @param string $key The product key.
398
  */
399
+ function get_html( $type, $key ) {
400
+ $options = 'plugin' === $type ? $this->options_plugin : $this->options_theme;
401
+ $button_submit_before = 'plugin' === $type ? $this->button_submit_before : 'Submit';
402
+ $button_submit = 'plugin' === $type ? $this->button_submit : 'Submit';
403
+ $options = $this->randomize_options( apply_filters( $this->product->get_key() . '_feedback_deactivate_options', $options ) );
404
+ $button_submit_before = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_submit_before', $button_submit_before );
405
+ $button_submit = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_submit', $button_submit );
406
  $button_cancel = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_cancel', $this->button_cancel );
407
 
408
  $options += $this->other;
410
  $list = '';
411
  foreach ( $options as $title => $attributes ) {
412
  $id = $attributes['id'];
413
+ $list .= '<li ti-option-id="' . $id . '"><input type="radio" name="ti-deactivate-option" id="' . $key . $id . '"><label for="' . $key . $id . '">' . str_replace( '{theme}', $this->product->get_name(), $title ) . '</label>';
414
  if ( array_key_exists( 'type', $attributes ) ) {
415
  $list .= '<div>';
416
  $placeholder = array_key_exists( 'placeholder', $attributes ) ? __( $attributes['placeholder'] ) : '';
428
  }
429
 
430
  return '<div id="' . $this->product->get_key() . '">'
431
+ . '<ul class="ti-list">' . $list . '</ul>'
432
+ . '<div class="actions">'
433
+ . get_submit_button(
434
+ __( $button_submit_before ), 'secondary', $this->product->get_key() . 'ti-deactivate-yes', false, array(
435
+ 'data-after-text' => $button_submit,
436
+ )
437
+ )
438
+ . get_submit_button( __( $button_cancel ), 'primary', $this->product->get_key() . 'ti-deactivate-no', false )
439
+ . '</div></div>';
440
  }
441
 
442
  /**
446
  check_ajax_referer( (string) __CLASS__, 'nonce' );
447
 
448
  if ( ! empty( $_POST['id'] ) ) {
449
+ $this->call_api(
450
+ array(
451
+ 'type' => 'deactivate',
452
+ 'id' => $_POST['id'],
453
+ 'comment' => isset( $_POST['msg'] ) ? $_POST['msg'] : '',
454
+ )
455
+ );
456
+ }
457
+
458
+ $this->post_deactivate_or_cancel();
459
+ }
460
+
461
+ /**
462
+ * Called when the deactivate/cancel button is clicked
463
+ */
464
+ private function post_deactivate_or_cancel() {
465
+ if ( isset( $_POST['type'] ) && isset( $_POST['key'] ) && 'theme' === $_POST['type'] ) {
466
+ set_transient( 'ti_sdk_pause_' . $_POST['key'], true, PAUSE_DEACTIVATE_WINDOW_DAYS * DAY_IN_SECONDS );
467
  }
468
  }
469
  }
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-review.php CHANGED
@@ -21,12 +21,19 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Review' ) ) :
21
  /**
22
  * @var string $heading The heading of the modal
23
  */
24
- private $heading = 'Hey, it’s great to see you have {product} active for a few days now. How is everything going? If you can spare a few moments to rate it on WordPress.org it would help us a lot (and boost my motivation). Cheers! <br/> <br/>~ Marius, developer of {product}';
25
 
26
  /**
27
  * @var string $button_cancel The text of the cancel button
28
  */
29
  private $button_cancel = 'No, thanks.';
 
 
 
 
 
 
 
30
  /**
31
  * @var string $button_already The text of the already did it button
32
  */
@@ -107,17 +114,17 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Review' ) ) :
107
  <script type="text/javascript" id="<?php echo $key; ?>ti-review-js">
108
  (function ($) {
109
  $(document).ready(function () {
110
- $('#<?php echo $key?>_review').on('click', '.notice-dismiss, .review-dismiss', function (e) {
111
 
112
  $.ajax({
113
  url: ajaxurl,
114
  method: "post",
115
  data: {
116
- 'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ );?>',
117
- 'action': '<?php echo $this->product->get_key() . __CLASS__;?>'
118
  },
119
  success: function () {
120
- $('#<?php echo $key;?>_review').hide();
121
  }
122
  });
123
  });
@@ -133,19 +140,23 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Review' ) ) :
133
  * @param string $key The product key.
134
  */
135
  function get_html( $key ) {
136
- $link = 'https://wordpress.org/support/plugin/' . $this->product->get_slug() . '/reviews/#wporg-footer';
137
- $heading = apply_filters( $this->product->get_key() . '_feedback_review_heading', $this->heading );
138
- $heading = str_replace( array( '{product}' ),
139
- trim( str_replace( 'Lite', '', $this->product->get_name() ) ), $heading );
 
 
 
 
140
  $button_cancel = apply_filters( $this->product->get_key() . '_feedback_review_button_cancel', $this->button_cancel );
141
  $button_do = apply_filters( $this->product->get_key() . '_feedback_review_button_do', $this->button_do );
142
 
143
  return '<div id="' . $this->product->get_key() . '-review-notification" class="themeisle-sdk-review-box">'
144
- . '<p>' . $heading . '</p>'
145
- . '<div class="actions">'
146
- . '<a href="' . $link . '" target="_blank" class="button button-primary review-dismiss"> ' . $button_do . '</a>'
147
- . get_submit_button( $button_cancel, 'review-dismiss ' . $this->product->get_key() . '-ti-review', $this->product->get_key() . 'ti-review-no', false )
148
- . '</div></div>';
149
  }
150
 
151
  /**
21
  /**
22
  * @var string $heading The heading of the modal
23
  */
24
+ private $heading = 'Hey, it’s great to see you have {product} active for a few days now. How is everything going? If you can spare a few moments to rate it on WordPress.org it would help us a lot (and boost my motivation). Cheers! <br/> <br/>~ {developer}, developer of {product}';
25
 
26
  /**
27
  * @var string $button_cancel The text of the cancel button
28
  */
29
  private $button_cancel = 'No, thanks.';
30
+ /**
31
+ * @var array Developers who work for each type of product for review purpose.
32
+ */
33
+ private $developers = array(
34
+ 'plugin' => array( 'Marius', 'Bogdan' ),
35
+ 'theme' => array( 'Rodica', 'Andrei', 'Bogdan', 'Cristi' ),
36
+ );
37
  /**
38
  * @var string $button_already The text of the already did it button
39
  */
114
  <script type="text/javascript" id="<?php echo $key; ?>ti-review-js">
115
  (function ($) {
116
  $(document).ready(function () {
117
+ $('#<?php echo $key; ?>_review').on('click', '.notice-dismiss, .review-dismiss', function (e) {
118
 
119
  $.ajax({
120
  url: ajaxurl,
121
  method: "post",
122
  data: {
123
+ 'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
124
+ 'action': '<?php echo $this->product->get_key() . __CLASS__; ?>'
125
  },
126
  success: function () {
127
+ $('#<?php echo $key; ?>_review').hide();
128
  }
129
  });
130
  });
140
  * @param string $key The product key.
141
  */
142
  function get_html( $key ) {
143
+ $link = 'https://wordpress.org/support/' . $this->product->get_type() . '/' . $this->product->get_slug() . '/reviews/#wporg-footer';
144
+ $heading = apply_filters( $this->product->get_key() . '_feedback_review_heading', $this->heading );
145
+ $heading = str_replace(
146
+ array( '{product}' ),
147
+ trim( str_replace( 'Lite', '', $this->product->get_name() ) ), $heading
148
+ );
149
+ $heading = str_replace( '{developer}', $this->developers[ $this->product->get_type() ][ rand( 0, ( count( $this->developers[ $this->product->get_type() ] ) - 1 ) ) ], $heading );
150
+
151
  $button_cancel = apply_filters( $this->product->get_key() . '_feedback_review_button_cancel', $this->button_cancel );
152
  $button_do = apply_filters( $this->product->get_key() . '_feedback_review_button_do', $this->button_do );
153
 
154
  return '<div id="' . $this->product->get_key() . '-review-notification" class="themeisle-sdk-review-box">'
155
+ . '<p>' . $heading . '</p>'
156
+ . '<div class="actions">'
157
+ . '<a href="' . $link . '" target="_blank" class="button button-primary review-dismiss"> ' . $button_do . '</a>'
158
+ . get_submit_button( $button_cancel, 'review-dismiss ' . $this->product->get_key() . '-ti-review', $this->product->get_key() . 'ti-review-no', false )
159
+ . '</div></div>';
160
  }
161
 
162
  /**
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback.php CHANGED
@@ -57,9 +57,11 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback' ) ) :
57
  $attributes['slug'] = $slug;
58
  $attributes['version'] = $version;
59
 
60
- $response = wp_remote_post( $this->feedback_url, array(
61
- 'body' => $attributes,
62
- ) );
 
 
63
  }
64
 
65
  /**
57
  $attributes['slug'] = $slug;
58
  $attributes['version'] = $version;
59
 
60
+ $response = wp_remote_post(
61
+ $this->feedback_url, array(
62
+ 'body' => $attributes,
63
+ )
64
+ );
65
  }
66
 
67
  /**
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-licenser.php CHANGED
@@ -90,13 +90,14 @@ if ( ! class_exists( 'ThemeIsle_SDK_Licenser' ) ) :
90
  // Decode the JSON response
91
  $themes = json_decode( $r['body']['themes'] );
92
 
93
- unset( $themes->themes->{ $this->product->get_slug() } );
94
 
95
  // Encode the updated JSON response
96
  $r['body']['themes'] = json_encode( $themes );
97
 
98
  return $r;
99
  }
 
100
  /**
101
  * Register the setting for the license of the product
102
  *
@@ -228,25 +229,35 @@ if ( ! class_exists( 'ThemeIsle_SDK_Licenser' ) ) :
228
  return false;
229
  }
230
  $status = $this->get_license_status();
231
- $no_activations_string = apply_filters( $this->product->get_key() . '_lc_no_activations_string', 'No activations left for %s !!!. You need to
 
232
  upgrade your plan in order to use %s on more
233
  websites. Please ask the %s
234
- Staff for more details.' );
235
- $no_valid_string = apply_filters( $this->product->get_key() . '_lc_no_valid_string', 'In order to benefit from updates and support for %s , please add
 
 
236
  your license code from your <a href="%s" target="_blank">purchase history</a> and validate it <a
237
- href="%s">here</a> ' );
238
- $expiration_string = apply_filters( $this->product->get_key() . '_lc_expiration_string', 'Your license is about to expire
239
- for %s. You can go to %s and renew it ' );
 
 
 
240
  $hide_notice_string = apply_filters( $this->product->get_key() . '_lc_hide_notice_string', 'Hide Notice' );
241
  if ( $status != 'valid' ) {
242
  if ( $this->check_activation() ) {
243
  if ( $this->check_hide( 'activation' ) ) {
244
  ?>
245
  <div class="error">
246
- <p><strong><?php
247
- echo sprintf( $no_activations_string, $this->product->get_name(), $this->product->get_name(), '<a href="' . $this->product->get_store_url() . '"
248
- target="_blank">' . $this->product->get_store_name() . '</a>' );
249
- ?></strong> | <a
 
 
 
 
250
  href="<?php echo add_query_arg( $this->product->get_key() . '_activation', 'yes' ); ?> "><?php echo $hide_notice_string; ?></a>
251
  </p>
252
  </div>
@@ -271,9 +282,15 @@ if ( ! class_exists( 'ThemeIsle_SDK_Licenser' ) ) :
271
  ?>
272
  <div class="update-nag">
273
  <p>
274
- <strong><?php echo sprintf( $expiration_string, $this->product->get_name() . ' ' . $this->product->get_type(), '<a
 
 
 
275
  href="' . $this->renew_url() . '"
276
- target="_blank">' . $this->product->get_store_name() . '</a>' ); ?> </strong> |
 
 
 
277
  <a
278
  href="<?php echo add_query_arg( $this->product->get_key() . '_hide_expiration', 'yes' ); ?> "><?php echo $hide_notice_string; ?></a>
279
  </p>
@@ -333,10 +350,12 @@ if ( ! class_exists( 'ThemeIsle_SDK_Licenser' ) ) :
333
  'url' => rawurlencode( home_url() ),
334
  );
335
  // Call the custom API.
336
- $response = wp_remote_get( add_query_arg( $api_params, $this->product->get_store_url() ), array(
337
- 'timeout' => 15,
338
- 'sslverify' => false,
339
- ) );
 
 
340
  if ( is_wp_error( $response ) ) {
341
  $license_data = new stdClass();
342
  $license_data->license = 'valid';
@@ -436,10 +455,12 @@ if ( ! class_exists( 'ThemeIsle_SDK_Licenser' ) ) :
436
  */
437
  public function enable() {
438
  if ( $this->product->get_type() == 'plugin' ) {
439
- add_filter( 'pre_set_site_transient_update_plugins', array(
440
- $this,
441
- 'pre_set_site_transient_update_plugins_filter',
442
- ) );
 
 
443
  add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
444
  add_filter( 'http_request_args', array( $this, 'http_request_args' ), 10, 2 );
445
  }
@@ -473,10 +494,12 @@ if ( ! class_exists( 'ThemeIsle_SDK_Licenser' ) ) :
473
  return;
474
  }
475
  $update_url = wp_nonce_url( 'update.php?action=upgrade-theme&amp;theme=' . urlencode( $this->product->get_slug() ), 'upgrade-theme_' . $this->product->get_slug() );
476
- $update_onclick = ' onclick="if ( confirm(\'' . esc_js( __( 'Updating this theme will lose any customizations you have made. Cancel to stop, OK to update.' ) ) . '\') ) {return true;}return false;"';
 
477
  if ( version_compare( $this->product->get_version(), $api_response->new_version, '<' ) ) {
478
  echo '<div id="update-nag">';
479
- printf( '<strong>%1$s %2$s</strong> is available. <a href="%3$s" class="thickbox" title="%4s">Check out what\'s new</a> or <a href="%5$s"%6$s>update now</a>.',
 
480
  $theme->get( 'Name' ),
481
  $api_response->new_version,
482
  '#TB_inline?width=640&amp;inlineId=' . $this->product->get_version() . '_changelog',
@@ -534,11 +557,13 @@ if ( ! class_exists( 'ThemeIsle_SDK_Licenser' ) ) :
534
  'author' => $this->product->get_store_name(),
535
  'url' => rawurlencode( home_url() ),
536
  );
537
- $response = wp_remote_post( $this->product->get_store_url(), array(
538
- 'timeout' => 15,
539
- 'sslverify' => false,
540
- 'body' => $api_params,
541
- ) );
 
 
542
  // make sure the response was successful
543
  if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
544
  $failed = true;
@@ -606,7 +631,7 @@ if ( ! class_exists( 'ThemeIsle_SDK_Licenser' ) ) :
606
  * @uses is_wp_error()
607
  *
608
  * @param string $_action The requested action.
609
- * @param array $_data Parameters for the API action.
610
  *
611
  * @return false||object
612
  */
@@ -622,11 +647,13 @@ if ( ! class_exists( 'ThemeIsle_SDK_Licenser' ) ) :
622
  'author' => $this->product->get_store_name(),
623
  'url' => rawurlencode( home_url() ),
624
  );
625
- $request = wp_remote_post( $this->product->get_store_url(), array(
626
- 'timeout' => 15,
627
- 'sslverify' => false,
628
- 'body' => $api_params,
629
- ) );
 
 
630
  if ( ! is_wp_error( $request ) ) :
631
  $request = json_decode( wp_remote_retrieve_body( $request ) );
632
  if ( $request && isset( $request->sections ) ) {
@@ -644,9 +671,9 @@ if ( ! class_exists( 'ThemeIsle_SDK_Licenser' ) ) :
644
  *
645
  * @uses api_request()
646
  *
647
- * @param mixed $_data Plugin data.
648
  * @param string $_action Action to send.
649
- * @param object $_args Arguments to use.
650
  *
651
  * @return object $_data
652
  */
@@ -666,7 +693,7 @@ if ( ! class_exists( 'ThemeIsle_SDK_Licenser' ) ) :
666
  * Disable SSL verification in order to prevent download update failures
667
  *
668
  * @param array $args Http args.
669
- * @param string $url Url to check.
670
  *
671
  * @return object $array
672
  */
90
  // Decode the JSON response
91
  $themes = json_decode( $r['body']['themes'] );
92
 
93
+ unset( $themes->themes->{$this->product->get_slug()} );
94
 
95
  // Encode the updated JSON response
96
  $r['body']['themes'] = json_encode( $themes );
97
 
98
  return $r;
99
  }
100
+
101
  /**
102
  * Register the setting for the license of the product
103
  *
229
  return false;
230
  }
231
  $status = $this->get_license_status();
232
+ $no_activations_string = apply_filters(
233
+ $this->product->get_key() . '_lc_no_activations_string', 'No activations left for %s !!!. You need to
234
  upgrade your plan in order to use %s on more
235
  websites. Please ask the %s
236
+ Staff for more details.'
237
+ );
238
+ $no_valid_string = apply_filters(
239
+ $this->product->get_key() . '_lc_no_valid_string', 'In order to benefit from updates and support for %s , please add
240
  your license code from your <a href="%s" target="_blank">purchase history</a> and validate it <a
241
+ href="%s">here</a> '
242
+ );
243
+ $expiration_string = apply_filters(
244
+ $this->product->get_key() . '_lc_expiration_string', 'Your license is about to expire
245
+ for %s. You can go to %s and renew it '
246
+ );
247
  $hide_notice_string = apply_filters( $this->product->get_key() . '_lc_hide_notice_string', 'Hide Notice' );
248
  if ( $status != 'valid' ) {
249
  if ( $this->check_activation() ) {
250
  if ( $this->check_hide( 'activation' ) ) {
251
  ?>
252
  <div class="error">
253
+ <p><strong>
254
+ <?php
255
+ echo sprintf(
256
+ $no_activations_string, $this->product->get_name(), $this->product->get_name(), '<a href="' . $this->product->get_store_url() . '"
257
+ target="_blank">' . $this->product->get_store_name() . '</a>'
258
+ );
259
+ ?>
260
+ </strong> | <a
261
  href="<?php echo add_query_arg( $this->product->get_key() . '_activation', 'yes' ); ?> "><?php echo $hide_notice_string; ?></a>
262
  </p>
263
  </div>
282
  ?>
283
  <div class="update-nag">
284
  <p>
285
+ <strong>
286
+ <?php
287
+ echo sprintf(
288
+ $expiration_string, $this->product->get_name() . ' ' . $this->product->get_type(), '<a
289
  href="' . $this->renew_url() . '"
290
+ target="_blank">' . $this->product->get_store_name() . '</a>'
291
+ );
292
+ ?>
293
+ </strong> |
294
  <a
295
  href="<?php echo add_query_arg( $this->product->get_key() . '_hide_expiration', 'yes' ); ?> "><?php echo $hide_notice_string; ?></a>
296
  </p>
350
  'url' => rawurlencode( home_url() ),
351
  );
352
  // Call the custom API.
353
+ $response = wp_remote_get(
354
+ add_query_arg( $api_params, $this->product->get_store_url() ), array(
355
+ 'timeout' => 15,
356
+ 'sslverify' => false,
357
+ )
358
+ );
359
  if ( is_wp_error( $response ) ) {
360
  $license_data = new stdClass();
361
  $license_data->license = 'valid';
455
  */
456
  public function enable() {
457
  if ( $this->product->get_type() == 'plugin' ) {
458
+ add_filter(
459
+ 'pre_set_site_transient_update_plugins', array(
460
+ $this,
461
+ 'pre_set_site_transient_update_plugins_filter',
462
+ )
463
+ );
464
  add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
465
  add_filter( 'http_request_args', array( $this, 'http_request_args' ), 10, 2 );
466
  }
494
  return;
495
  }
496
  $update_url = wp_nonce_url( 'update.php?action=upgrade-theme&amp;theme=' . urlencode( $this->product->get_slug() ), 'upgrade-theme_' . $this->product->get_slug() );
497
+ $update_message = apply_filters( 'themeisle_sdk_license_update_message', 'Updating this theme will lose any customizations you have made. Cancel to stop, OK to update.' );
498
+ $update_onclick = ' onclick="if ( confirm(\'' . esc_js( $update_message ) . '\') ) {return true;}return false;"';
499
  if ( version_compare( $this->product->get_version(), $api_response->new_version, '<' ) ) {
500
  echo '<div id="update-nag">';
501
+ printf(
502
+ '<strong>%1$s %2$s</strong> is available. <a href="%3$s" class="thickbox" title="%4s">Check out what\'s new</a> or <a href="%5$s"%6$s>update now</a>.',
503
  $theme->get( 'Name' ),
504
  $api_response->new_version,
505
  '#TB_inline?width=640&amp;inlineId=' . $this->product->get_version() . '_changelog',
557
  'author' => $this->product->get_store_name(),
558
  'url' => rawurlencode( home_url() ),
559
  );
560
+ $response = wp_remote_post(
561
+ $this->product->get_store_url(), array(
562
+ 'timeout' => 15,
563
+ 'sslverify' => false,
564
+ 'body' => $api_params,
565
+ )
566
+ );
567
  // make sure the response was successful
568
  if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
569
  $failed = true;
631
  * @uses is_wp_error()
632
  *
633
  * @param string $_action The requested action.
634
+ * @param array $_data Parameters for the API action.
635
  *
636
  * @return false||object
637
  */
647
  'author' => $this->product->get_store_name(),
648
  'url' => rawurlencode( home_url() ),
649
  );
650
+ $request = wp_remote_post(
651
+ $this->product->get_store_url(), array(
652
+ 'timeout' => 15,
653
+ 'sslverify' => false,
654
+ 'body' => $api_params,
655
+ )
656
+ );
657
  if ( ! is_wp_error( $request ) ) :
658
  $request = json_decode( wp_remote_retrieve_body( $request ) );
659
  if ( $request && isset( $request->sections ) ) {
671
  *
672
  * @uses api_request()
673
  *
674
+ * @param mixed $_data Plugin data.
675
  * @param string $_action Action to send.
676
+ * @param object $_args Arguments to use.
677
  *
678
  * @return object $_data
679
  */
693
  * Disable SSL verification in order to prevent download update failures
694
  *
695
  * @param array $args Http args.
696
+ * @param string $url Url to check.
697
  *
698
  * @return object $array
699
  */
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-loader.php CHANGED
@@ -47,7 +47,7 @@ if ( ! class_exists( 'ThemeIsle_SDK_Loader' ) ) :
47
  self::$products[ $product_object->get_slug() ] = $product_object;
48
 
49
  $notifications = array();
50
- // Based on the Wordpress Available file header we enable the logger or not.
51
  if ( ! $product_object->is_wordpress_available() ) {
52
  $licenser = new ThemeIsle_SDK_Licenser( $product_object );
53
  $licenser->enable();
47
  self::$products[ $product_object->get_slug() ] = $product_object;
48
 
49
  $notifications = array();
50
+ // Based on the WordPress Available file header we enable the logger or not.
51
  if ( ! $product_object->is_wordpress_available() ) {
52
  $licenser = new ThemeIsle_SDK_Licenser( $product_object );
53
  $licenser->enable();
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-logger.php CHANGED
@@ -37,7 +37,7 @@ if ( ! class_exists( 'ThemeIsle_SDK_Logger' ) ) :
37
  /**
38
  * @var string $heading The heading of the modal
39
  */
40
- private $heading = 'Do you enjoy {product}? Become a contributor by opting in to our anonymous plugin data tracking. We guarantee no sensitive data is collected.';
41
 
42
  /**
43
  * @var string $button_submit The text of the submit button
@@ -77,20 +77,22 @@ if ( ! class_exists( 'ThemeIsle_SDK_Logger' ) ) :
77
  * Send the statistics to the api endpoint
78
  */
79
  public function send_log() {
80
- wp_remote_post( $this->logging_url, array(
81
- 'method' => 'POST',
82
- 'timeout' => 3,
83
- 'redirection' => 5,
84
- 'headers' => array(
85
- 'X-ThemeIsle-Event' => 'log_site',
86
- ),
87
- 'body' => array(
88
- 'site' => get_site_url(),
89
- 'slug' => $this->product->get_slug(),
90
- 'version' => $this->product->get_version(),
91
- 'data' => apply_filters( $this->product->get_key() . '_logger_data', array() ),
92
- ),
93
- ) );
 
 
94
  }
95
 
96
  /**
@@ -140,8 +142,9 @@ if ( ! class_exists( 'ThemeIsle_SDK_Logger' ) ) :
140
  */
141
  function get_html( $key ) {
142
  $heading = apply_filters( $this->product->get_key() . '_logger_heading', $this->heading );
143
- $heading = str_replace( array( '{product}' ), array(
144
- trim( str_replace( 'Lite', '', $this->product->get_name() ) )
 
145
  ),
146
  $heading
147
  );
@@ -149,15 +152,19 @@ if ( ! class_exists( 'ThemeIsle_SDK_Logger' ) ) :
149
  $button_cancel = apply_filters( $this->product->get_key() . '_logger_button_cancel', $this->button_cancel );
150
 
151
  return '<div >'
152
- . '<p>' . $heading . '</p>'
153
- . '<div class="actions">'
154
- . get_submit_button( __( $button_submit ), 'primary ' . $this->product->get_key() . '-ti-logger', $this->product->get_key() . 'ti-logger-yes', false, array(
155
- 'data-ti-log-enable' => 1,
156
- ) )
157
- . get_submit_button( __( $button_cancel ), 'secondary ' . $this->product->get_key() . '-ti-logger', $this->product->get_key() . 'ti-logger-no', false, array(
158
- 'data-ti-log-enable' => 0,
159
- ) )
160
- . '</div></div>';
 
 
 
 
161
  }
162
 
163
  /**
@@ -179,18 +186,18 @@ if ( ! class_exists( 'ThemeIsle_SDK_Logger' ) ) :
179
  <script type="text/javascript" id="<?php echo $key; ?>ti-logger-js">
180
  (function ($) {
181
  $(document).ready(function () {
182
- $('.<?php echo $key?>-ti-logger').on('click', function (e) {
183
 
184
  $.ajax({
185
  url: ajaxurl,
186
  method: "post",
187
  data: {
188
- 'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ );?>',
189
- 'action': '<?php echo $this->product->get_key() . __CLASS__;?>',
190
  'enable': $(this).attr('data-ti-log-enable')
191
  },
192
  success: function () {
193
- $('#<?php echo $key;?>-logger-notification').hide();
194
  }
195
  });
196
  });
37
  /**
38
  * @var string $heading The heading of the modal
39
  */
40
+ private $heading = 'Do you enjoy {product}? Become a contributor by opting in to our anonymous data tracking. We guarantee no sensitive data is collected.';
41
 
42
  /**
43
  * @var string $button_submit The text of the submit button
77
  * Send the statistics to the api endpoint
78
  */
79
  public function send_log() {
80
+ wp_remote_post(
81
+ $this->logging_url, array(
82
+ 'method' => 'POST',
83
+ 'timeout' => 3,
84
+ 'redirection' => 5,
85
+ 'headers' => array(
86
+ 'X-ThemeIsle-Event' => 'log_site',
87
+ ),
88
+ 'body' => array(
89
+ 'site' => get_site_url(),
90
+ 'slug' => $this->product->get_slug(),
91
+ 'version' => $this->product->get_version(),
92
+ 'data' => apply_filters( $this->product->get_key() . '_logger_data', array() ),
93
+ ),
94
+ )
95
+ );
96
  }
97
 
98
  /**
142
  */
143
  function get_html( $key ) {
144
  $heading = apply_filters( $this->product->get_key() . '_logger_heading', $this->heading );
145
+ $heading = str_replace(
146
+ array( '{product}' ), array(
147
+ trim( str_replace( 'Lite', '', $this->product->get_name() ) ),
148
  ),
149
  $heading
150
  );
152
  $button_cancel = apply_filters( $this->product->get_key() . '_logger_button_cancel', $this->button_cancel );
153
 
154
  return '<div >'
155
+ . '<p>' . $heading . '</p>'
156
+ . '<div class="actions">'
157
+ . get_submit_button(
158
+ __( $button_submit ), 'primary ' . $this->product->get_key() . '-ti-logger', $this->product->get_key() . 'ti-logger-yes', false, array(
159
+ 'data-ti-log-enable' => 1,
160
+ )
161
+ )
162
+ . get_submit_button(
163
+ __( $button_cancel ), 'secondary ' . $this->product->get_key() . '-ti-logger', $this->product->get_key() . 'ti-logger-no', false, array(
164
+ 'data-ti-log-enable' => 0,
165
+ )
166
+ )
167
+ . '</div></div>';
168
  }
169
 
170
  /**
186
  <script type="text/javascript" id="<?php echo $key; ?>ti-logger-js">
187
  (function ($) {
188
  $(document).ready(function () {
189
+ $('.<?php echo $key; ?>-ti-logger').on('click', function (e) {
190
 
191
  $.ajax({
192
  url: ajaxurl,
193
  method: "post",
194
  data: {
195
+ 'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
196
+ 'action': '<?php echo $this->product->get_key() . __CLASS__; ?>',
197
  'enable': $(this).attr('data-ti-log-enable')
198
  },
199
  success: function () {
200
+ $('#<?php echo $key; ?>-logger-notification').hide();
201
  }
202
  });
203
  });
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-product.php CHANGED
@@ -60,13 +60,13 @@ if ( ! class_exists( 'ThemeIsle_SDK_Product' ) ) :
60
  /**
61
  * @var array $allowed_authors The allowed authors.
62
  */
63
- private $allowed_authors = array( 'proteusthemes.com' );
64
  /**
65
  * @var bool $requires_license Either user needs to activate it with license.
66
  */
67
  private $requires_license;
68
  /**
69
- * @var bool $wordpress_available Either is available on wordpress or not.
70
  */
71
  private $wordpress_available;
72
  /**
@@ -152,7 +152,7 @@ if ( ! class_exists( 'ThemeIsle_SDK_Product' ) ) :
152
  if ( $this->require_uninstall_feedback() ) {
153
  $this->feedback_types[] = 'deactivate';
154
  }
155
- if ( $this->is_wordpress_available() && $this->get_type() === 'plugin' ) {
156
  $this->feedback_types[] = 'review';
157
  }
158
  }
@@ -343,7 +343,7 @@ if ( ! class_exists( 'ThemeIsle_SDK_Product' ) ) :
343
  * @return bool Either we log the data or not.
344
  */
345
  public function is_logger_active() {
346
- // If is not available on wordpress log this automatically.
347
  if ( ! $this->is_wordpress_available() ) {
348
  return true;
349
  } else {
@@ -385,7 +385,16 @@ if ( ! class_exists( 'ThemeIsle_SDK_Product' ) ) :
385
  * @return bool Either we should require feedback on uninstall or not.
386
  */
387
  public function require_uninstall_feedback() {
388
- return $this->get_type() === 'plugin';
 
 
 
 
 
 
 
 
 
389
  }
390
 
391
  }
60
  /**
61
  * @var array $allowed_authors The allowed authors.
62
  */
63
+ private $allowed_authors = array( 'proteusthemes.com', 'anarieldesign.com' );
64
  /**
65
  * @var bool $requires_license Either user needs to activate it with license.
66
  */
67
  private $requires_license;
68
  /**
69
+ * @var bool $wordpress_available Either is available on WordPress or not.
70
  */
71
  private $wordpress_available;
72
  /**
152
  if ( $this->require_uninstall_feedback() ) {
153
  $this->feedback_types[] = 'deactivate';
154
  }
155
+ if ( $this->is_wordpress_available() ) {
156
  $this->feedback_types[] = 'review';
157
  }
158
  }
343
  * @return bool Either we log the data or not.
344
  */
345
  public function is_logger_active() {
346
+ // If is not available on WordPress log this automatically.
347
  if ( ! $this->is_wordpress_available() ) {
348
  return true;
349
  } else {
385
  * @return bool Either we should require feedback on uninstall or not.
386
  */
387
  public function require_uninstall_feedback() {
388
+ if ( $this->get_type() == 'theme' && ! $this->is_wordpress_available() && ! $this->is_external_author() ) {
389
+ return ! get_transient( 'ti_sdk_pause_' . $this->get_key(), false );
390
+ }
391
+
392
+ if ( $this->get_type() == 'plugin' ) {
393
+
394
+ return true;
395
+ }
396
+
397
+ return false;
398
  }
399
 
400
  }
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-widget-dashboard-blog.php CHANGED
@@ -52,9 +52,11 @@ if ( ! class_exists( 'ThemeIsle_SDK_Widget_Dashboard_Blog' ) ) :
52
  */
53
  function setup_vars() {
54
  $this->dashboard_name = apply_filters( 'themeisle_sdk_dashboard_widget_name', 'WordPress Guides/Tutorials' );
55
- $this->feeds = apply_filters( 'themeisle_sdk_dashboard_widget_feeds', array(
56
- 'https://themeisle.com/blog/feed'
57
- ) );
 
 
58
  }
59
 
60
  /**
@@ -67,10 +69,12 @@ if ( ! class_exists( 'ThemeIsle_SDK_Widget_Dashboard_Blog' ) ) :
67
  if ( isset( $wp_meta_boxes['dashboard']['normal']['core']['themeisle'] ) ) {
68
  return;
69
  }
70
- wp_add_dashboard_widget( 'themeisle', $this->dashboard_name, array(
71
- &$this,
72
- 'render_dashboard_widget',
73
- ) );
 
 
74
  }
75
 
76
  /**
@@ -174,11 +178,16 @@ if ( ! class_exists( 'ThemeIsle_SDK_Widget_Dashboard_Blog' ) ) :
174
  <li class="ti-dw-feed-item"><span class="ti-dw-date-container"><span
175
  class="ti-dw-day-container"><?php echo date( 'd', $item['date'] ); ?></span> <span
176
  class="ti-dw-month-container"><?php echo substr( date( 'M', $item['date'] ), 0, 3 ); ?></span></span><a
177
- href="<?php echo add_query_arg(
 
 
178
  array(
179
  'utm_campaign' => 'feed',
180
  'utm_medium' => 'dashboard_widget',
181
- ), $item['link'] ); ?>" target="_blank"><?php echo $item['title']; ?></a>
 
 
 
182
  <div class="clear"></div>
183
  </li>
184
  <?php
@@ -190,26 +199,37 @@ if ( ! class_exists( 'ThemeIsle_SDK_Widget_Dashboard_Blog' ) ) :
190
  $type = $recommend['type'];
191
  if ( ( $type == 'theme' && current_user_can( 'install_themes' ) ) || ( $type == 'plugin' && current_user_can( 'install_plugins' ) ) ) {
192
  add_thickbox();
193
- $url = add_query_arg( array(
194
- 'theme' => $recommend['slug'],
195
- ), network_admin_url( 'theme-install.php' ) );
 
 
196
 
197
  if ( 'plugin' === $type ) {
198
 
199
- $url = add_query_arg( array(
200
- 'tab' => 'plugin-information',
201
- 'plugin' => $recommend['slug'],
202
- ), network_admin_url( 'plugin-install.php' ) );
 
 
203
  }
204
  ?>
205
  <li class="ti-dw-recommend-item ">
206
  <span class="ti-dw-recommend"><?php echo apply_filters( 'themeisle_sdk_dashboard_popular_label', sprintf( 'Popular %s', ucwords( $type ) ) ); ?>
207
- : </span><?php echo trim( str_replace( array(
208
- 'lite',
209
- 'Lite',
210
- ), '', $recommend['name'] ) ); ?>
 
 
 
 
 
 
 
211
  (<a class="thickbox open-plugin-details-modal"
212
- href="<?php echo $url . '&TB_iframe=true&width=600&height=500'; ?>"><?php _e( 'Install' ); ?></a>)
213
  </li>
214
 
215
  <?php
52
  */
53
  function setup_vars() {
54
  $this->dashboard_name = apply_filters( 'themeisle_sdk_dashboard_widget_name', 'WordPress Guides/Tutorials' );
55
+ $this->feeds = apply_filters(
56
+ 'themeisle_sdk_dashboard_widget_feeds', array(
57
+ 'https://themeisle.com/blog/feed',
58
+ )
59
+ );
60
  }
61
 
62
  /**
69
  if ( isset( $wp_meta_boxes['dashboard']['normal']['core']['themeisle'] ) ) {
70
  return;
71
  }
72
+ wp_add_dashboard_widget(
73
+ 'themeisle', $this->dashboard_name, array(
74
+ &$this,
75
+ 'render_dashboard_widget',
76
+ )
77
+ );
78
  }
79
 
80
  /**
178
  <li class="ti-dw-feed-item"><span class="ti-dw-date-container"><span
179
  class="ti-dw-day-container"><?php echo date( 'd', $item['date'] ); ?></span> <span
180
  class="ti-dw-month-container"><?php echo substr( date( 'M', $item['date'] ), 0, 3 ); ?></span></span><a
181
+ href="
182
+ <?php
183
+ echo add_query_arg(
184
  array(
185
  'utm_campaign' => 'feed',
186
  'utm_medium' => 'dashboard_widget',
187
+ ), $item['link']
188
+ );
189
+ ?>
190
+ " target="_blank"><?php echo $item['title']; ?></a>
191
  <div class="clear"></div>
192
  </li>
193
  <?php
199
  $type = $recommend['type'];
200
  if ( ( $type == 'theme' && current_user_can( 'install_themes' ) ) || ( $type == 'plugin' && current_user_can( 'install_plugins' ) ) ) {
201
  add_thickbox();
202
+ $url = add_query_arg(
203
+ array(
204
+ 'theme' => $recommend['slug'],
205
+ ), network_admin_url( 'theme-install.php' )
206
+ );
207
 
208
  if ( 'plugin' === $type ) {
209
 
210
+ $url = add_query_arg(
211
+ array(
212
+ 'tab' => 'plugin-information',
213
+ 'plugin' => $recommend['slug'],
214
+ ), network_admin_url( 'plugin-install.php' )
215
+ );
216
  }
217
  ?>
218
  <li class="ti-dw-recommend-item ">
219
  <span class="ti-dw-recommend"><?php echo apply_filters( 'themeisle_sdk_dashboard_popular_label', sprintf( 'Popular %s', ucwords( $type ) ) ); ?>
220
+ : </span>
221
+ <?php
222
+ echo trim(
223
+ str_replace(
224
+ array(
225
+ 'lite',
226
+ 'Lite',
227
+ ), '', $recommend['name']
228
+ )
229
+ );
230
+ ?>
231
  (<a class="thickbox open-plugin-details-modal"
232
+ href="<?php echo $url . '&TB_iframe=true&width=600&height=500'; ?>"><?php echo apply_filters( 'themeisle_sdk_dashboard_install_label', 'Install' ); ?></a>)
233
  </li>
234
 
235
  <?php
vendor/codeinwp/themeisle-sdk/load.php CHANGED
@@ -11,7 +11,7 @@
11
  */
12
 
13
  // Current SDK version and path.
14
- $themeisle_sdk_version = '1.4.0';
15
  $themeisle_sdk_path = dirname( __FILE__ );
16
 
17
  global $themeisle_sdk_max_version;
11
  */
12
 
13
  // Current SDK version and path.
14
+ $themeisle_sdk_version = '1.5.2';
15
  $themeisle_sdk_path = dirname( __FILE__ );
16
 
17
  global $themeisle_sdk_max_version;
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitc5c968f47d29c52d25f37143f61a236b
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitc5c968f47d29c52d25f37143f61a236b
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitc5c968f47d29c52d25f37143f61a236b', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitc5c968f47d29c52d25f37143f61a236b', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInitc5c968f47d29c52d25f37143f61a236b
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
- composerRequirec5c968f47d29c52d25f37143f61a236b($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
- function composerRequirec5c968f47d29c52d25f37143f61a236b($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitaded4f45b366ed7e0b9f96fb32075fe9
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitaded4f45b366ed7e0b9f96fb32075fe9', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitaded4f45b366ed7e0b9f96fb32075fe9', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
+ composerRequireaded4f45b366ed7e0b9f96fb32075fe9($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
+ function composerRequireaded4f45b366ed7e0b9f96fb32075fe9($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
vendor/composer/autoload_real_52.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
- class ComposerAutoloaderInite8c84b227df2c7a8d0e5941c35929b93 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInite8c84b227df2c7a8d0e5941c35929b93 {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInite8c84b227df2c7a8d0e5941c35929b93', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInite8c84b227df2c7a8d0e5941c35929b93', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
+ class ComposerAutoloaderInit937464a07bd020256623265eaff345a7 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit937464a07bd020256623265eaff345a7', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit937464a07bd020256623265eaff345a7', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
vendor/composer/installed.json CHANGED
@@ -39,15 +39,15 @@
39
  "source": {
40
  "type": "git",
41
  "url": "https://github.com/Codeinwp/themeisle-sdk.git",
42
- "reference": "ebbbe0398ef8ee9922d17704e1dd2e9114e53ccb"
43
  },
44
  "dist": {
45
  "type": "zip",
46
- "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/ebbbe0398ef8ee9922d17704e1dd2e9114e53ccb",
47
- "reference": "ebbbe0398ef8ee9922d17704e1dd2e9114e53ccb",
48
  "shasum": ""
49
  },
50
- "time": "2017-07-04 13:54:14",
51
  "type": "library",
52
  "installation-source": "dist",
53
  "autoload": {
39
  "source": {
40
  "type": "git",
41
  "url": "https://github.com/Codeinwp/themeisle-sdk.git",
42
+ "reference": "45eeb250ea521acad002f59d7006933bb34e6f0b"
43
  },
44
  "dist": {
45
  "type": "zip",
46
+ "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/45eeb250ea521acad002f59d7006933bb34e6f0b",
47
+ "reference": "45eeb250ea521acad002f59d7006933bb34e6f0b",
48
  "shasum": ""
49
  },
50
+ "time": "2017-08-08 11:48:44",
51
  "type": "library",
52
  "installation-source": "dist",
53
  "autoload": {