Version Description
Improvements
- Improved technical performance of the plugin
Download this release
Release Info
Developer | amarsib |
Plugin | SendinBlue Subscribe Form And WP SMTP |
Version | 3.1.11 |
Comparing to | |
See all releases |
Code changes from version 3.1.10 to 3.1.11
- inc/SendinblueAccount.php +61 -0
- inc/SendinblueApiClient.php +17 -2
- inc/sib-api-manager.php +1 -1
- page/page-home.php +0 -1
- readme.txt +4 -0
- sendinblue.php +4 -1
inc/SendinblueAccount.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class SendinblueAccount
|
4 |
+
{
|
5 |
+
private static $sendinblueAccountObj = null;
|
6 |
+
private $sendinblueAccountData;
|
7 |
+
private $lastResponseCode;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* SendinblueAccount private constructor.
|
11 |
+
*/
|
12 |
+
private function __construct()
|
13 |
+
{
|
14 |
+
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Getter function for account data
|
19 |
+
*/
|
20 |
+
public function getSendinblueAccountData()
|
21 |
+
{
|
22 |
+
return $this->sendinblueAccountData;
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Setter function for account data
|
27 |
+
*/
|
28 |
+
public function setSendinblueAccountData($sendinblueAccountData)
|
29 |
+
{
|
30 |
+
$this->sendinblueAccountData = $sendinblueAccountData;
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Getter function for last response code
|
35 |
+
*/
|
36 |
+
public function getLastResponseCode()
|
37 |
+
{
|
38 |
+
return $this->lastResponseCode;
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Setter function for last response code
|
43 |
+
*/
|
44 |
+
public function setLastResponseCode($lastResponseCode)
|
45 |
+
{
|
46 |
+
$this->lastResponseCode = $lastResponseCode;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Static function to create a new instance or return an existing instance.
|
51 |
+
*/
|
52 |
+
public static function getInstance()
|
53 |
+
{
|
54 |
+
if( null == self::$sendinblueAccountObj )
|
55 |
+
{
|
56 |
+
self::$sendinblueAccountObj = new SendinblueAccount();
|
57 |
+
}
|
58 |
+
|
59 |
+
return self::$sendinblueAccountObj;
|
60 |
+
}
|
61 |
+
}
|
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.
|
18 |
|
19 |
private $apiKey;
|
20 |
private $lastResponseCode;
|
@@ -32,7 +32,22 @@ class SendinblueApiClient
|
|
32 |
*/
|
33 |
public function getAccount()
|
34 |
{
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
37 |
|
38 |
/**
|
14 |
const RESPONSE_CODE_CREATED = 201;
|
15 |
const RESPONSE_CODE_ACCEPTED = 202;
|
16 |
const RESPONSE_CODE_UNAUTHORIZED = 401;
|
17 |
+
const PLUGIN_VERSION = '3.1.11';
|
18 |
|
19 |
private $apiKey;
|
20 |
private $lastResponseCode;
|
32 |
*/
|
33 |
public function getAccount()
|
34 |
{
|
35 |
+
$sibAccObj = SendinblueAccount::getInstance();
|
36 |
+
if($sibAccObj->getSendinblueAccountData())
|
37 |
+
{
|
38 |
+
$this->lastResponseCode = $sibAccObj->getLastResponseCode();
|
39 |
+
return $sibAccObj->getSendinblueAccountData();
|
40 |
+
}
|
41 |
+
else
|
42 |
+
{
|
43 |
+
$accData = $this->get('/account');
|
44 |
+
if ($this->getLastResponseCode() === self::RESPONSE_CODE_OK)
|
45 |
+
{
|
46 |
+
$sibAccObj->setSendinblueAccountData($accData);
|
47 |
+
$sibAccObj->setLastResponseCode($this->lastResponseCode);
|
48 |
+
}
|
49 |
+
return $accData;
|
50 |
+
}
|
51 |
}
|
52 |
|
53 |
/**
|
inc/sib-api-manager.php
CHANGED
@@ -15,7 +15,7 @@ if ( ! class_exists( 'SIB_API_Manager' ) ) {
|
|
15 |
class SIB_API_Manager {
|
16 |
|
17 |
/** Transient delay time */
|
18 |
-
const DELAYTIME =
|
19 |
|
20 |
/**
|
21 |
* SIB_API_Manager constructor.
|
15 |
class SIB_API_Manager {
|
16 |
|
17 |
/** Transient delay time */
|
18 |
+
const DELAYTIME = 900;
|
19 |
|
20 |
/**
|
21 |
* SIB_API_Manager constructor.
|
page/page-home.php
CHANGED
@@ -681,7 +681,6 @@ if ( ! class_exists( 'SIB_Page_Home' ) ) {
|
|
681 |
/** Ajax module for remove all transient value */
|
682 |
public static function ajax_remove_cache() {
|
683 |
check_ajax_referer( 'ajax_sib_admin_nonce', 'security' );
|
684 |
-
SIB_API_Manager::remove_transients();
|
685 |
wp_send_json( 'success' );
|
686 |
}
|
687 |
|
681 |
/** Ajax module for remove all transient value */
|
682 |
public static function ajax_remove_cache() {
|
683 |
check_ajax_referer( 'ajax_sib_admin_nonce', 'security' );
|
|
|
684 |
wp_send_json( 'success' );
|
685 |
}
|
686 |
|
readme.txt
CHANGED
@@ -114,6 +114,10 @@ In order to create a signup form, you need to:
|
|
114 |
2. Integrate the form in a sidebar using a widget from WP panel > Appearance > Widgets. The Sendinblue widget form should appear in your widgets list, you just to have to drag and drop the widget into the sidebar of your choice.
|
115 |
|
116 |
== Changelog ==
|
|
|
|
|
|
|
|
|
117 |
|
118 |
= 3.1.10 =
|
119 |
**Improvements**
|
114 |
2. Integrate the form in a sidebar using a widget from WP panel > Appearance > Widgets. The Sendinblue widget form should appear in your widgets list, you just to have to drag and drop the widget into the sidebar of your choice.
|
115 |
|
116 |
== Changelog ==
|
117 |
+
= 3.1.11 =
|
118 |
+
**Improvements**
|
119 |
+
|
120 |
+
* Improved technical performance of the plugin
|
121 |
|
122 |
= 3.1.10 =
|
123 |
**Improvements**
|
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.
|
7 |
* Author: Sendinblue
|
8 |
* Author URI: https://www.sendinblue.com/?r=wporg
|
9 |
* License: GPLv2 or later
|
@@ -34,6 +34,9 @@ if ( ! class_exists( 'Mailin' ) ) {
|
|
34 |
if ( ! class_exists( 'SendinblueApiClient' ) ) {
|
35 |
require_once( 'inc/SendinblueApiClient.php' );
|
36 |
}
|
|
|
|
|
|
|
37 |
// For marketing automation.
|
38 |
if ( ! class_exists( 'Sendinblue' ) ) {
|
39 |
require_once( 'inc/sendinblue.php' );
|
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.11
|
7 |
* Author: Sendinblue
|
8 |
* Author URI: https://www.sendinblue.com/?r=wporg
|
9 |
* License: GPLv2 or later
|
34 |
if ( ! class_exists( 'SendinblueApiClient' ) ) {
|
35 |
require_once( 'inc/SendinblueApiClient.php' );
|
36 |
}
|
37 |
+
if ( ! class_exists( 'SendinblueAccount' ) ) {
|
38 |
+
require_once( 'inc/SendinblueAccount.php' );
|
39 |
+
}
|
40 |
// For marketing automation.
|
41 |
if ( ! class_exists( 'Sendinblue' ) ) {
|
42 |
require_once( 'inc/sendinblue.php' );
|