SendinBlue Subscribe Form And WP SMTP - Version 3.1.50

Version Description

  • Weve fixed the form previewer for the country flag attached to the SMS number field.
Download this release

Release Info

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

Code changes from version 3.1.49 to 3.1.50

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.49';
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.50';
18
  const USER_AGENT = 'sendinblue_plugins/wordpress';
19
 
20
  private $apiKey;
inc/sib-sms-code.php CHANGED
@@ -55,7 +55,7 @@ if ( !class_exists( 'SIB_SMS_Code' ) ) {
55
  'IN'=>array('name'=>'INDIA','code'=>'91'),
56
  'IR'=>array('name'=>'IRAN','code'=>'98'),
57
  'IT'=>array('name'=>'ITALY','code'=>'39'),
58
- 'JM'=>array('name'=>'JAMAICA','code'=>'1'),
59
  'JO'=>array('name'=>'JORDAN','code'=>'962'),
60
  'JP'=>array('name'=>'JAPAN','code'=>'81'),
61
  'KM'=>array('name'=>'COMOROS','code'=>'269'),
@@ -85,7 +85,7 @@ if ( !class_exists( 'SIB_SMS_Code' ) ) {
85
  'PK'=>array('name'=>'PAKISTAN','code'=>'92'),
86
  'PL'=>array('name'=>'POLAND','code'=>'48'),
87
  'PM'=>array('name'=>'SAINT PIERRE AND MIQUELON','code'=>'508'),
88
- 'PR'=>array('name'=>'PUERTO RICO','code'=>'1'),
89
  'PT'=>array('name'=>'PORTUGAL','code'=>'351'),
90
  'PY'=>array('name'=>'PARAGUAY','code'=>'595'),
91
  'QA'=>array('name'=>'QATAR','code'=>'974'),
55
  'IN'=>array('name'=>'INDIA','code'=>'91'),
56
  'IR'=>array('name'=>'IRAN','code'=>'98'),
57
  'IT'=>array('name'=>'ITALY','code'=>'39'),
58
+ 'JM'=>array('name'=>'JAMAICA','code'=>'1876'),
59
  'JO'=>array('name'=>'JORDAN','code'=>'962'),
60
  'JP'=>array('name'=>'JAPAN','code'=>'81'),
61
  'KM'=>array('name'=>'COMOROS','code'=>'269'),
85
  'PK'=>array('name'=>'PAKISTAN','code'=>'92'),
86
  'PL'=>array('name'=>'POLAND','code'=>'48'),
87
  'PM'=>array('name'=>'SAINT PIERRE AND MIQUELON','code'=>'508'),
88
+ 'PR'=>array('name'=>'PUERTO RICO','code'=>'1787'),
89
  'PT'=>array('name'=>'PORTUGAL','code'=>'351'),
90
  'PY'=>array('name'=>'PARAGUAY','code'=>'595'),
91
  'QA'=>array('name'=>'QATAR','code'=>'974'),
js/admin.js CHANGED
@@ -1,4 +1,99 @@
1
  var $jQ = jQuery.noConflict();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  $jQ(document).ready(function(){
3
 
4
  var bodyHeight = $jQ(document).height();
@@ -990,7 +1085,22 @@ $jQ(document).ready(function(){
990
  var field_html = '';
991
  if(btn_id == 'sib_add_to_form_btn')
992
  {
993
- field_html = $jQ('#sib_field_html').val();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
994
  }
995
  else if(btn_id == 'sib_multi_lists_add_form_btn')
996
  {
1
  var $jQ = jQuery.noConflict();
2
+ var CountryList = {
3
+ 213: "DZ",
4
+ 376: "AD",
5
+ 54: "AR",
6
+ 971: "AE",
7
+ 43: "AT",
8
+ 61: "AU",
9
+ 387: "BA",
10
+ 880: "BD",
11
+ 32: "BE",
12
+ 359: "BG",
13
+ 973: "BH",
14
+ 590: "BL",
15
+ 55: "BR",
16
+ 1: "CA",
17
+ 41: "CH",
18
+ 56: "CL",
19
+ 86: "CN",
20
+ 57: "CO",
21
+ 420: "CZ",
22
+ 49: "DE",
23
+ 45: "DK",
24
+ 593: "EC",
25
+ 372: "EE",
26
+ 20: "EG",
27
+ 34: "ES",
28
+ 358: "FI",
29
+ 33: "FR",
30
+ 44: "GB",
31
+ 995: "GE",
32
+ 30: "GR",
33
+ 852: "HK",
34
+ 385: "HR",
35
+ 509: "HT",
36
+ 36: "HU",
37
+ 62: "ID",
38
+ 353: "IE",
39
+ 972: "IL",
40
+ 91: "IN",
41
+ 98: "IR",
42
+ 39: "IT",
43
+ 1876: "JM",
44
+ 962: "JO",
45
+ 81: "JP",
46
+ 269: "KM",
47
+ 961: "LB",
48
+ 94: "LK",
49
+ 370: "LT",
50
+ 352: "LU",
51
+ 371: "LV",
52
+ 212: "MA",
53
+ 261: "MG",
54
+ 356: "MT",
55
+ 230: "MU",
56
+ 52: "MX",
57
+ 60: "MY",
58
+ 687: "NC",
59
+ 234: "NG",
60
+ 505: "NI",
61
+ 31: "NL",
62
+ 47: "NO",
63
+ 977: "NP",
64
+ 64: "NZ",
65
+ 507: "PA",
66
+ 51: "PE",
67
+ 689: "PF",
68
+ 675: "PG",
69
+ 63: "PH",
70
+ 92: "PK",
71
+ 48: "PL",
72
+ 508: "PM",
73
+ 1787: "PR",
74
+ 351: "PT",
75
+ 595: "PY",
76
+ 974: "QA",
77
+ 40: "RO",
78
+ 7: "RU",
79
+ 46: "SE",
80
+ 65: "SG",
81
+ 386: "SI",
82
+ 421: "SK",
83
+ 66: "TH",
84
+ 216: "TN",
85
+ 90: "TR",
86
+ 886: "TW",
87
+ 380: "UA",
88
+ 256: "UG",
89
+ 1: "US",
90
+ 598: "UY",
91
+ 58: "VE",
92
+ 84: "VN",
93
+ 681: "WF",
94
+ 262: "YT",
95
+ 27: "ZA",
96
+ };
97
  $jQ(document).ready(function(){
98
 
99
  var bodyHeight = $jQ(document).height();
1085
  var field_html = '';
1086
  if(btn_id == 'sib_add_to_form_btn')
1087
  {
1088
+ let textToslice = $jQ("#sib_field_html").val();
1089
+ var position = textToslice.search("sib_SMS_prefix");
1090
+ let firstpart = position + 22;
1091
+
1092
+ let lastPoint = firstpart + 7;
1093
+ let sliceValue = textToslice.slice(firstpart, lastPoint);
1094
+ var code = sliceValue.substring(sliceValue.indexOf("+") + 1, sliceValue.lastIndexOf('"'));
1095
+
1096
+ var flagInicial = CountryList[code];
1097
+ if (typeof flagInicial !== "undefined") {
1098
+ var flagICo = jQuery('#getDomain').val() + flagInicial.toLowerCase() + ".png";
1099
+
1100
+ field_html = textToslice.replace('class="sib-cflags"', `class="sib-cflags" style=background-image:url(${flagICo})`);
1101
+ } else {
1102
+ field_html = textToslice;
1103
+ }
1104
  }
1105
  else if(btn_id == 'sib_multi_lists_add_form_btn')
1106
  {
model/model-forms.php CHANGED
@@ -157,6 +157,28 @@ if ( ! class_exists( 'SIB_Forms' ) ) {
157
  $results = $wpdb->get_row( $query, ARRAY_A ); // db call ok; no-cache ok.
158
  }
159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  if ( is_array( $results ) && count( $results ) > 0 ) {
161
  $listIDs = maybe_unserialize( $results['listID'] );
162
  $results['listID'] = $listIDs;
157
  $results = $wpdb->get_row( $query, ARRAY_A ); // db call ok; no-cache ok.
158
  }
159
 
160
+ if (str_contains($results['html'], 'class="sib-sms-field"')) {
161
+ $sms_manager = new SIB_SMS_Code();
162
+ $country_list = $sms_manager->get_sms_code_list();
163
+ $stripStartPoint = strpos($results['html'], '"sib-sms"');
164
+ $startPoint = $stripStartPoint + 18;
165
+ $endPoint = $startPoint + 1;
166
+ $stripData = substr($results['html'], $startPoint, $endPoint);
167
+ $countryCodeString = explode('"', $stripData);
168
+ $countryCode = $countryCodeString[0];
169
+ foreach ($country_list as $item => $value) {
170
+ $checkCountryCode = $value['code'];
171
+ if ($checkCountryCode == $countryCode) {
172
+ $flg_url = plugins_url('mailin/img/flags/',) . strtolower($item) . '.png';
173
+ $results['html'] = str_replace(
174
+ 'class="sib-cflags"',
175
+ 'class="sib-cflags" id="' . $frmID . '" style="background-image: url(' . $flg_url . ');"',
176
+ $results['html']
177
+ );
178
+ }
179
+ }
180
+ }
181
+
182
  if ( is_array( $results ) && count( $results ) > 0 ) {
183
  $listIDs = maybe_unserialize( $results['listID'] );
184
  $results['listID'] = $listIDs;
page/page-form.php CHANGED
@@ -338,6 +338,10 @@ if ( ! class_exists( 'SIB_Page_Form' ) ) {
338
  class="btn btn-primary sib-add-to-form"><span
339
  class="sib-large-icon"><</span> <?php esc_attr_e( 'Add to form', 'mailin' ); ?>
340
  </button>&nbsp;&nbsp;
 
 
 
 
341
  <?php SIB_Page_Home::get_narration_script( __( 'Add to form', 'mailin' ), __( 'Please click where you want to insert the field and click on this button. By default, the new field will be added at top.', 'mailin' ) ); ?>
342
  </div>
343
  <div class="small-content2" style="margin-top: 20px;"
338
  class="btn btn-primary sib-add-to-form"><span
339
  class="sib-large-icon"><</span> <?php esc_attr_e( 'Add to form', 'mailin' ); ?>
340
  </button>&nbsp;&nbsp;
341
+ <div style="display:none">
342
+ <input id="getDomain" value="<?php
343
+ echo plugins_url('mailin/img/flags/',) ?>"></input>
344
+ </div>
345
  <?php SIB_Page_Home::get_narration_script( __( 'Add to form', 'mailin' ), __( 'Please click where you want to insert the field and click on this button. By default, the new field will be added at top.', 'mailin' ) ); ?>
346
  </div>
347
  <div class="small-content2" style="margin-top: 20px;"
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: 6.0.2
6
  Requires PHP: 5.6
7
- Stable tag: 3.1.49
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -116,6 +116,8 @@ In order to create a signup form, you need to:
116
 
117
  == Changelog ==
118
 
 
 
119
 
120
  = 3.1.49 =
121
  * We’ve fixed the behaviour of the country flag attached to the SMS number field.
4
  Requires at least: 4.4
5
  Tested up to: 6.0.2
6
  Requires PHP: 5.6
7
+ Stable tag: 3.1.50
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.50 =
120
+ * We’ve fixed the form previewer for the country flag attached to the SMS number field.
121
 
122
  = 3.1.49 =
123
  * We’ve fixed the behaviour of the country flag attached to the SMS number field.
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.49
7
  * Author: Sendinblue
8
  * Author URI: https://www.sendinblue.com/?r=wporg
9
  * License: GPLv2 or later
@@ -714,30 +714,6 @@ if ( ! class_exists( 'SIB_Manager' ) ) {
714
  $formData['html']
715
  );
716
  }
717
- //Flag update according to country code
718
- if (str_contains($formData['html'], 'class="sib-sms-field"')) {
719
- $sms_manager = new SIB_SMS_Code();
720
- $country_list = $sms_manager->get_sms_code_list();
721
-
722
- $stripStartPoint = strpos($formData['html'], '"sib-sms"');
723
- $startPoint = $stripStartPoint + 18;
724
- $endPoint = $startPoint + 1;
725
- $stripData = substr($formData['html'], $startPoint, $endPoint);
726
-
727
- $countryCodeString = explode('"', $stripData);
728
- $countryCode = $countryCodeString[0];
729
- foreach ($country_list as $item => $value) {
730
- $checkCountryCode = $value['code'];
731
- if ($checkCountryCode == $countryCode) {
732
- $flg_url = plugins_url('img/flags/', __FILE__) . strtolower($item) . '.png';
733
- $formData['html'] = str_replace(
734
- 'class="sib-cflags"',
735
- 'class="sib-cflags" id="' . $frmID . '" style="background-image: url(' . $flg_url . ');"',
736
- $formData['html']
737
- );
738
- }
739
- }
740
- }
741
 
742
  echo wp_kses($formData['html'], SIB_Manager::wordpress_allowed_attributes());
743
  ?>
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.50
7
  * Author: Sendinblue
8
  * Author URI: https://www.sendinblue.com/?r=wporg
9
  * License: GPLv2 or later
714
  $formData['html']
715
  );
716
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
717
 
718
  echo wp_kses($formData['html'], SIB_Manager::wordpress_allowed_attributes());
719
  ?>