SendinBlue Subscribe Form And WP SMTP - Version 3.1.41

Version Description

  • UI fixes for the form building page and user synchronization popup.
  • HereDoc string literals have been removed.
Download this release

Release Info

Developer shubham773
Plugin Icon 128x128 SendinBlue Subscribe Form And WP SMTP
Version 3.1.41
Comparing to
See all releases

Code changes from version 3.1.40 to 3.1.41

form/css/default-form-message.css ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [form] p.sib-alert-message {
2
+ padding: 6px 12px;
3
+ margin-bottom: 20px;
4
+ border: 1px solid transparent;
5
+ border-radius: 4px;
6
+ -webkit-box-sizing: border-box;
7
+ -moz-box-sizing: border-box;
8
+ box-sizing: border-box;
9
+ }
10
+ [form] p.sib-alert-message-error {
11
+ background-color: #f2dede;
12
+ border-color: #ebccd1;
13
+ color: #a94442;
14
+ }
15
+ [form] p.sib-alert-message-success {
16
+ background-color: #dff0d8;
17
+ border-color: #d6e9c6;
18
+ color: #3c763d;
19
+ }
20
+ [form] p.sib-alert-message-warning {
21
+ background-color: #fcf8e3;
22
+ border-color: #faebcc;
23
+ color: #8a6d3b;
24
+ }
form/css/default-form.css ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [form] {
2
+ padding: 5px;
3
+ -moz-box-sizing:border-box;
4
+ -webkit-box-sizing: border-box;
5
+ box-sizing: border-box;
6
+ }
7
+ [form] input[type=text],[form] input[type=email], [form] select {
8
+ width: 100%;
9
+ border: 1px solid #bbb;
10
+ height: auto;
11
+ margin: 5px 0 0 0;
12
+ }
13
+ [form] .sib-default-btn {
14
+ margin: 5px 0;
15
+ padding: 6px 12px;
16
+ color:#fff;
17
+ background-color: #333;
18
+ border-color: #2E2E2E;
19
+ font-size: 14px;
20
+ font-weight:400;
21
+ line-height: 1.4285;
22
+ text-align: center;
23
+ cursor: pointer;
24
+ vertical-align: middle;
25
+ -webkit-user-select:none;
26
+ -moz-user-select:none;
27
+ -ms-user-select:none;
28
+ user-select:none;
29
+ white-space: normal;
30
+ border:1px solid transparent;
31
+ border-radius: 3px;
32
+ }
33
+ [form] .sib-default-btn:hover {
34
+ background-color: #444;
35
+ }
36
+ [form] p{
37
+ margin: 10px 0 0 0;
38
+ }
form/default-form.html ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <p class="sib-email-area">
2
+ <label class="sib-email-area">Email Address*</label>
3
+ <input type="email" class="sib-email-area" name="email" required="required">
4
+ </p>
5
+ <p class="sib-NAME-area">
6
+ <label class="sib-NAME-area">Name</label>
7
+ <input type="text" class="sib-NAME-area" name="NAME" >
8
+ </p>
9
+ <p>
10
+ <input type="submit" class="sib-default-btn" value="Subscribe">
11
+ </p>
inc/SendinblueApiClient.php CHANGED
@@ -14,7 +14,7 @@ class SendinblueApiClient
14
  const RESPONSE_CODE_CREATED = 201;
15
  const RESPONSE_CODE_ACCEPTED = 202;
16
  const RESPONSE_CODE_UNAUTHORIZED = 401;
17
- const PLUGIN_VERSION = '3.1.40';
18
  const USER_AGENT = 'sendinblue_plugins/wordpress';
19
 
20
  private $apiKey;
14
  const RESPONSE_CODE_CREATED = 201;
15
  const RESPONSE_CODE_ACCEPTED = 202;
16
  const RESPONSE_CODE_UNAUTHORIZED = 401;
17
+ const PLUGIN_VERSION = '3.1.41';
18
  const USER_AGENT = 'sendinblue_plugins/wordpress';
19
 
20
  private $apiKey;
js/admin.js CHANGED
@@ -885,8 +885,12 @@ $jQ(document).ready(function(){
885
  });
886
 
887
  var attrFieldLine = $jQ('.sync-attr-line').html();
 
888
  // sync add attr line filed
889
  $jQ('.modal-body').on('click', '.sync-attr-plus', function(){
 
 
 
890
  $jQ('.sync-attr-line').append(attrFieldLine);
891
  $jQ('.sync-attr-dismiss').show();
892
  });
@@ -894,7 +898,11 @@ $jQ(document).ready(function(){
894
  $jQ('.modal-body').on('click', '.sync-attr-dismiss', function(){
895
  $jQ(this).closest('.sync-attr').remove();
896
  var attrCount = $jQ('.sync-attr').length;
897
- if(attrCount == 1) $jQ('.sync-attr-dismiss').hide();
 
 
 
 
898
  });
899
 
900
  // set attribute matching
885
  });
886
 
887
  var attrFieldLine = $jQ('.sync-attr-line').html();
888
+ var appenderLine = $jQ('.sync-attr-plus-col').html();
889
  // sync add attr line filed
890
  $jQ('.modal-body').on('click', '.sync-attr-plus', function(){
891
+ $jQ(this).css('visibility', 'hidden');
892
+ $jQ(this).addClass('pb-2');
893
+ $jQ('.sync-attr-plus-col').append(appenderLine);
894
  $jQ('.sync-attr-line').append(attrFieldLine);
895
  $jQ('.sync-attr-dismiss').show();
896
  });
898
  $jQ('.modal-body').on('click', '.sync-attr-dismiss', function(){
899
  $jQ(this).closest('.sync-attr').remove();
900
  var attrCount = $jQ('.sync-attr').length;
901
+ if(attrCount == 1) {
902
+ $jQ('.sync-attr-dismiss').hide();
903
+ }
904
+ $jQ(`.sync-attr-plus-col .sync-attr-plus:nth-child(${attrCount - 1})`).css('visibility', 'show');
905
+ $jQ(`.sync-attr-plus-col .sync-attr-plus:nth-child(${attrCount})`).remove();
906
  });
907
 
908
  // set attribute matching
model/model-forms.php CHANGED
@@ -17,6 +17,9 @@ if ( ! class_exists( 'SIB_Forms' ) ) {
17
  * Tab table name
18
  */
19
  const TABLE_NAME = 'sib_model_forms';
 
 
 
20
 
21
  /** Create Table */
22
  public static function createTable() {
@@ -292,59 +295,9 @@ if ( ! class_exists( 'SIB_Forms' ) ) {
292
 
293
  /** Get default form data */
294
  public static function getDefaultForm() {
295
- $html = <<<EOD
296
- <p class="sib-email-area">
297
- <label class="sib-email-area">Email Address*</label>
298
- <input type="email" class="sib-email-area" name="email" required="required">
299
- </p>
300
- <p class="sib-NAME-area">
301
- <label class="sib-NAME-area">Name</label>
302
- <input type="text" class="sib-NAME-area" name="NAME" >
303
- </p>
304
- <p>
305
- <input type="submit" class="sib-default-btn" value="Subscribe">
306
- </p>
307
- EOD;
308
- $css = <<<EOD
309
- [form] {
310
- padding: 5px;
311
- -moz-box-sizing:border-box;
312
- -webkit-box-sizing: border-box;
313
- box-sizing: border-box;
314
- }
315
- [form] input[type=text],[form] input[type=email], [form] select {
316
- width: 100%;
317
- border: 1px solid #bbb;
318
- height: auto;
319
- margin: 5px 0 0 0;
320
- }
321
- [form] .sib-default-btn {
322
- margin: 5px 0;
323
- padding: 6px 12px;
324
- color:#fff;
325
- background-color: #333;
326
- border-color: #2E2E2E;
327
- font-size: 14px;
328
- font-weight:400;
329
- line-height: 1.4285;
330
- text-align: center;
331
- cursor: pointer;
332
- vertical-align: middle;
333
- -webkit-user-select:none;
334
- -moz-user-select:none;
335
- -ms-user-select:none;
336
- user-select:none;
337
- white-space: normal;
338
- border:1px solid transparent;
339
- border-radius: 3px;
340
- }
341
- [form] .sib-default-btn:hover {
342
- background-color: #444;
343
- }
344
- [form] p{
345
- margin: 10px 0 0 0;
346
- }
347
- EOD;
348
 
349
  $result = array(
350
  'html' => $html,
@@ -360,34 +313,8 @@ EOD;
360
 
361
  /** Get Default css */
362
  public static function getDefaultMessageCss() {
363
- $css = <<<EOD
364
- [form] p.sib-alert-message {
365
- padding: 6px 12px;
366
- margin-bottom: 20px;
367
- border: 1px solid transparent;
368
- border-radius: 4px;
369
- -webkit-box-sizing: border-box;
370
- -moz-box-sizing: border-box;
371
- box-sizing: border-box;
372
- }
373
- [form] p.sib-alert-message-error {
374
- background-color: #f2dede;
375
- border-color: #ebccd1;
376
- color: #a94442;
377
- }
378
- [form] p.sib-alert-message-success {
379
- background-color: #dff0d8;
380
- border-color: #d6e9c6;
381
- color: #3c763d;
382
- }
383
- [form] p.sib-alert-message-warning {
384
- background-color: #fcf8e3;
385
- border-color: #faebcc;
386
- color: #8a6d3b;
387
- }
388
- EOD;
389
- return $css;
390
-
391
  }
392
 
393
  /**
@@ -470,5 +397,20 @@ EOD;
470
  return $wpdb->get_var( "SHOW TABLES LIKE '" . self::TABLE_NAME . "'" ) == self::TABLE_NAME;
471
  }
472
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
473
  }
474
  }
17
  * Tab table name
18
  */
19
  const TABLE_NAME = 'sib_model_forms';
20
+ const DEFAULT_FORM_HTML_PATH = '../form/default-form.html';
21
+ const DEFAULT_FORM_CSS_PATH = '../form/css/default-form.css';
22
+ const DEFAULT_FORM_MESSAGE_CSS_PATH = '../form/css/default-form-message.css';
23
 
24
  /** Create Table */
25
  public static function createTable() {
295
 
296
  /** Get default form data */
297
  public static function getDefaultForm() {
298
+
299
+ $html = wp_kses(self::get_default_form_html(), SIB_Manager::SIB_ATTRIBUTE);
300
+ $css = wp_kses(self::get_default_css_html(), SIB_Manager::SIB_ATTRIBUTE);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301
 
302
  $result = array(
303
  'html' => $html,
313
 
314
  /** Get Default css */
315
  public static function getDefaultMessageCss() {
316
+ $css = file_get_contents(__DIR__ . '/' . self::DEFAULT_FORM_MESSAGE_CSS_PATH) ?: '';
317
+ return wp_kses($css, SIB_Manager::SIB_ATTRIBUTE);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
318
  }
319
 
320
  /**
397
  return $wpdb->get_var( "SHOW TABLES LIKE '" . self::TABLE_NAME . "'" ) == self::TABLE_NAME;
398
  }
399
 
400
+ /**
401
+ * @return string
402
+ */
403
+ public static function get_default_form_html()
404
+ {
405
+ return file_get_contents(__DIR__ . '/' . self::DEFAULT_FORM_HTML_PATH) ?: '';
406
+ }
407
+
408
+ /**
409
+ * @return string
410
+ */
411
+ public static function get_default_css_html()
412
+ {
413
+ return file_get_contents(__DIR__ . '/' . self::DEFAULT_FORM_CSS_PATH) ?: '';
414
+ }
415
  }
416
  }
page/page-form.php CHANGED
@@ -564,9 +564,8 @@ if ( ! class_exists( 'SIB_Page_Form' ) ) {
564
  <div class="card form-field">
565
  <div class="small-content2" style="margin-top: 15px;margin-bottom: 15px;">
566
  <b><?php esc_attr_e( 'Preview', 'mailin' ); ?>&nbsp;
567
- <span id="sib-preview-form-refresh"
568
- class="glyphicon glyphicon-refresh"
569
- style="cursor:pointer"></span></b>
570
  </div>
571
  <iframe id="sib-preview-form"
572
  src="<?php echo esc_url( site_url() . '/?sib_form=' . esc_attr( $this->formID ) ); ?>"
564
  <div class="card form-field">
565
  <div class="small-content2" style="margin-top: 15px;margin-bottom: 15px;">
566
  <b><?php esc_attr_e( 'Preview', 'mailin' ); ?>&nbsp;
567
+ <i id="sib-preview-form-refresh" class="fa fa-refresh" style="cursor:pointer;font-weight: bold;" aria-hidden="true"></i>
568
+ </b>
 
569
  </div>
570
  <iframe id="sib-preview-form"
571
  src="<?php echo esc_url( site_url() . '/?sib_form=' . esc_attr( $this->formID ) ); ?>"
page/page-home.php CHANGED
@@ -554,8 +554,10 @@ if ( ! class_exists( 'SIB_Page_Home' ) ) {
554
  <input type="hidden" class="sync-match" name="<?php echo esc_attr( $sibAttrs[0]['name'] ); ?>" value="first_name">
555
  </div>
556
  </div>
557
- <div class="col-md-1" style="padding-top: 9px;">
558
- <a href="javascript:void(0)" class="sync-attr-plus"><span class="dashicons dashicons-plus-alt "></span></a>
 
 
559
  </div>
560
  </div>
561
  <!-- Apply button -->
554
  <input type="hidden" class="sync-match" name="<?php echo esc_attr( $sibAttrs[0]['name'] ); ?>" value="first_name">
555
  </div>
556
  </div>
557
+ <div class="col-md-1 sync-attr-plus-col">
558
+ <div class="row sync-attr-plus">
559
+ <a href="javascript:void(0)"><span class="dashicons dashicons-plus-alt "></span></a>
560
+ </div>
561
  </div>
562
  </div>
563
  <!-- Apply button -->
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: Email Marketing, Newsletter, Sendinblue, Forms, smtp, marketing automation
4
  Requires at least: 4.4
5
  Tested up to: 5.9
6
  Requires PHP: 5.6
7
- Stable tag: 3.1.40
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -116,6 +116,10 @@ In order to create a signup form, you need to:
116
 
117
  == Changelog ==
118
 
 
 
 
 
119
  = 3.1.40 =
120
  * Security fixes related to data sanitization and output escaping.
121
  * Fixed the issue, where the “Sync My Users” button stays active after synching all users.
4
  Requires at least: 4.4
5
  Tested up to: 5.9
6
  Requires PHP: 5.6
7
+ Stable tag: 3.1.41
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
116
 
117
  == Changelog ==
118
 
119
+ = 3.1.41 =
120
+ * UI fixes for the form building page and user synchronization popup.
121
+ * HereDoc string literals have been removed.
122
+
123
  = 3.1.40 =
124
  * Security fixes related to data sanitization and output escaping.
125
  * Fixed the issue, where the “Sync My Users” button stays active after synching all users.
sendinblue.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Newsletter, SMTP, Email marketing and Subscribe forms by Sendinblue
4
  * Plugin URI: https://www.sendinblue.com/?r=wporg
5
  * Description: Manage your contact lists, subscription forms and all email and marketing-related topics from your wp panel, within one single plugin
6
- * Version: 3.1.40
7
  * Author: Sendinblue
8
  * Author URI: https://www.sendinblue.com/?r=wporg
9
  * License: GPLv2 or later
3
  * Plugin Name: Newsletter, SMTP, Email marketing and Subscribe forms by Sendinblue
4
  * Plugin URI: https://www.sendinblue.com/?r=wporg
5
  * Description: Manage your contact lists, subscription forms and all email and marketing-related topics from your wp panel, within one single plugin
6
+ * Version: 3.1.41
7
  * Author: Sendinblue
8
  * Author URI: https://www.sendinblue.com/?r=wporg
9
  * License: GPLv2 or later