BlossomThemes Email Newsletter - Version 2.1.7

Version Description

Download this release

Release Info

Developer blossomthemes
Plugin Icon 128x128 BlossomThemes Email Newsletter
Version 2.1.7
Comparing to
See all releases

Code changes from version 2.1.6 to 2.1.7

Files changed (96) hide show
  1. vendor/getresponse/sdk-php/src/Operation/Campaigns/GetCampaigns/svn-B825428B → admin/css/svn-B82D9348 +0 -0
  2. vendor/getresponse/sdk-php/src/Operation/Campaigns/GetCampaigns/svn-B825C2A0 → admin/images/newsletter-icon/demo-files/svn-B82E0B4F +0 -0
  3. admin/js/bten-mailing-platform-lists.js +202 -204
  4. includes/class-blossomthemes-email-newsletter-functions.php +355 -357
  5. includes/class-blossomthemes-email-newsletter-getresponse.php +161 -161
  6. includes/class-blossomthemes-email-newsletter-mailerlite.php +13 -17
  7. includes/class-blossomthemes-email-newsletter-sendinblue.php +288 -288
  8. includes/class-blossomthemes-email-newsletter-settings.php +668 -654
  9. includes/class-blossomthemes-email-newsletter-shortcodes.php +460 -459
  10. includes/class-blossomthemes-email-newsletter.php +340 -356
  11. includes/libs/mailerlite_rest/ML_Campaigns.php +0 -55
  12. includes/libs/mailerlite_rest/ML_Lists.php +0 -40
  13. includes/libs/mailerlite_rest/ML_Subscribers.php +0 -57
  14. includes/libs/mailerlite_rest/ML_Webforms.php +0 -13
  15. includes/libs/mailerlite_rest/base/ML_Rest.php +0 -59
  16. includes/libs/mailerlite_rest/base/ML_Rest_Base.php +0 -234
  17. includes/libs/sendinblue/Blossom_Sendinblue_API_Client.php +316 -316
  18. includes/setting/form-list-meta.php +131 -131
  19. includes/tabs/general.php +114 -114
  20. includes/widgets/widget-blossomthemes-newsletter.php +378 -374
  21. languages/blossomthemes-email-newsletter.pot +77 -77
  22. vendor/clue/stream-filter/CHANGELOG.md +75 -0
  23. vendor/clue/stream-filter/LICENSE +21 -0
  24. vendor/clue/stream-filter/README.md +323 -0
  25. vendor/clue/stream-filter/composer.json +26 -0
  26. vendor/clue/stream-filter/src/CallbackFilter.php +114 -0
  27. vendor/clue/stream-filter/src/functions.php +327 -0
  28. vendor/clue/stream-filter/src/functions_include.php +6 -0
  29. vendor/composer/ClassLoader.php +3 -3
  30. vendor/composer/InstalledVersions.php +504 -0
  31. vendor/composer/autoload_classmap.php +7 -0
  32. vendor/composer/autoload_files.php +10 -0
  33. vendor/composer/autoload_psr4.php +19 -1
  34. vendor/composer/autoload_real.php +10 -8
  35. vendor/composer/autoload_static.php +132 -4
  36. vendor/composer/installed.json +1865 -301
  37. vendor/composer/installed.php +309 -0
  38. vendor/composer/platform_check.php +26 -0
  39. vendor/getresponse/sdk-php/src/Operation/Autoresponders/Statistics/GetAutoresponderStatistics/GetAutoresponderStatistics.php +0 -94
  40. vendor/getresponse/sdk-php/src/Operation/{Campaigns/Statistics/Balance/GetCampaignStatisticsBalance/svn-B825C2A7 → Autoresponders/Statistics/GetAutoresponderStatistics/svn-3E57D9B6} +0 -0
  41. vendor/getresponse/sdk-php/src/Operation/Autoresponders/Statistics/GetAutorespondersStatistics/GetAutorespondersStatisticsFields.php +0 -28
  42. vendor/getresponse/sdk-php/src/Operation/Autoresponders/Statistics/GetAutorespondersStatistics/GetAutorespondersStatisticsSearchQuery.php +0 -94
  43. vendor/getresponse/sdk-php/src/Operation/{Campaigns/Statistics/Balance/GetCampaignStatisticsBalance/svn-B825C2AE → Autoresponders/Statistics/GetAutorespondersStatistics/svn-3E58D1D2} +0 -0
  44. vendor/getresponse/sdk-php/src/Operation/{Campaigns/Statistics/ListSize/GetCampaignStatisticsListSize/svn-B8273AB5 → Autoresponders/Statistics/GetAutorespondersStatistics/svn-3E58D1D9} +0 -0
  45. vendor/getresponse/sdk-php/src/Operation/Autoresponders/Thumbnail/GetAutoresponderThumbnail/GetAutoresponderThumbnail.php +0 -61
  46. vendor/getresponse/sdk-php/src/Operation/{Campaigns/Statistics/ListSize/GetCampaignStatisticsListSize/svn-B8273ABC → Autoresponders/Thumbnail/GetAutoresponderThumbnail/svn-3E58D1E0} +0 -0
  47. vendor/getresponse/sdk-php/src/Operation/Autoresponders/Thumbnail/GetAutoresponderThumbnail/{svn-B821DA30 → svn-3E58D1E7} +0 -0
  48. vendor/getresponse/sdk-php/src/Operation/Autoresponders/UpdateAutoresponder/UpdateAutoresponder.php +0 -82
  49. vendor/getresponse/sdk-php/src/Operation/{Campaigns/Statistics/Locations/GetCampaignStatisticsLocations/svn-B8273AC3 → Autoresponders/UpdateAutoresponder/svn-3E58D1EE} +0 -0
  50. vendor/getresponse/sdk-php/src/Operation/Campaigns/Blacklists/GetBlacklists/GetBlacklists.php +0 -60
  51. vendor/getresponse/sdk-php/src/Operation/Campaigns/Blacklists/GetBlacklists/GetBlacklistsFields.php +0 -17
  52. vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Locations/GetCampaignStatisticsLocations/svn-B8273ACA → Blacklists/GetBlacklists/svn-3E58D1F5} +0 -0
  53. vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Origins/GetCampaignStatisticsOrigins/svn-B8273AD1 → Blacklists/GetBlacklists/svn-3E58D1FC} +0 -0
  54. vendor/getresponse/sdk-php/src/Operation/Campaigns/Blacklists/UpdateBlacklists/UpdateBlacklists.php +0 -82
  55. vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Origins/GetCampaignStatisticsOrigins/svn-B8273AD8 → Blacklists/UpdateBlacklists/svn-3E58D20A} +0 -0
  56. vendor/getresponse/sdk-php/src/Operation/Campaigns/Contacts/GetContacts/GetContacts.php +0 -108
  57. vendor/getresponse/sdk-php/src/Operation/Campaigns/Contacts/GetContacts/GetContactsFields.php +0 -31
  58. vendor/getresponse/sdk-php/src/Operation/Campaigns/Contacts/GetContacts/GetContactsSearchQuery.php +0 -53
  59. vendor/getresponse/sdk-php/src/Operation/Campaigns/Contacts/GetContacts/GetContactsSortParams.php +0 -19
  60. vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Removals/GetCampaignStatisticsRemovals/svn-B8273ADF → Contacts/GetContacts/svn-3E59CA11} +0 -0
  61. vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Removals/GetCampaignStatisticsRemovals/svn-B8273AE6 → Contacts/GetContacts/svn-3E59CA18} +0 -0
  62. vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Subscriptions/GetCampaignStatisticsSubscriptions/svn-B827B2ED → Contacts/GetContacts/svn-3E59CA1F} +0 -0
  63. vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Subscriptions/GetCampaignStatisticsSubscriptions/svn-B827B2F4 → Contacts/GetContacts/svn-3E59CA26} +0 -0
  64. vendor/getresponse/sdk-php/src/Operation/Campaigns/CreateCampaign/CreateCampaign.php +0 -73
  65. vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Summary/GetCampaignStatisticsSummary/svn-B827B2FB → CreateCampaign/svn-3E59CA2D} +0 -0
  66. vendor/getresponse/sdk-php/src/Operation/Campaigns/GetCampaign/GetCampaign.php +0 -61
  67. vendor/getresponse/sdk-php/src/Operation/Campaigns/GetCampaign/GetCampaignFields.php +0 -27
  68. vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Summary/GetCampaignStatisticsSummary/svn-B828AB02 → GetCampaign/svn-3E59CA34} +0 -0
  69. vendor/getresponse/sdk-php/src/Operation/Campaigns/{UpdateCampaign/svn-B828AB09 → GetCampaign/svn-3E59CA3B} +0 -0
  70. vendor/getresponse/sdk-php/src/Operation/Campaigns/GetCampaigns/GetCampaignsFields.php +0 -23
  71. vendor/getresponse/sdk-php/src/Operation/Campaigns/GetCampaigns/GetCampaignsSearchQuery.php +0 -40
  72. vendor/getresponse/sdk-php/src/Operation/{ClickTracks/GetClickTrack/svn-B828AB10 → Campaigns/GetCampaigns/svn-3E59CA42} +0 -0
  73. vendor/getresponse/sdk-php/src/Operation/{ClickTracks/GetClickTrack/svn-B828AB17 → Campaigns/GetCampaigns/svn-3E59CA49} +0 -0
  74. vendor/getresponse/sdk-php/src/Operation/{ClickTracks/GetClickTracks/svn-B828AB1E → Campaigns/GetCampaigns/svn-3E59CA50} +0 -0
  75. vendor/getresponse/sdk-php/src/Operation/{ClickTracks/GetClickTracks/svn-B828AB25 → Campaigns/GetCampaigns/svn-3E59CA57} +0 -0
  76. vendor/getresponse/sdk-php/src/Operation/{ClickTracks/GetClickTracks/svn-B828AB2C → Campaigns/Statistics/Balance/GetCampaignStatisticsBalance/svn-3E5F2A5E} +0 -0
  77. vendor/getresponse/sdk-php/src/Operation/{ClickTracks/GetClickTracks/svn-B828AB33 → Campaigns/Statistics/Balance/GetCampaignStatisticsBalance/svn-3E5F2A65} +0 -0
  78. vendor/getresponse/sdk-php/src/Operation/{Contacts/Activities/GetActivities/svn-B8292B3A → Campaigns/Statistics/ListSize/GetCampaignStatisticsListSize/svn-3E5FAA6C} +0 -0
  79. vendor/getresponse/sdk-php/src/Operation/{Contacts/Activities/GetActivities/svn-B8292B41 → Campaigns/Statistics/ListSize/GetCampaignStatisticsListSize/svn-3E5FAA73} +0 -0
  80. vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Locations/GetCampaignStatisticsLocations/svn-3E5FAA7A +0 -0
  81. vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Locations/GetCampaignStatisticsLocations/svn-3E5FAA81 +0 -0
  82. vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Origins/GetCampaignStatisticsOrigins/svn-3E5FAA88 +0 -0
  83. vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Origins/GetCampaignStatisticsOrigins/svn-3E5FAA8F +0 -0
  84. vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Removals/GetCampaignStatisticsRemovals/svn-3E60A296 +0 -0
  85. vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Removals/GetCampaignStatisticsRemovals/svn-3E60A29D +0 -0
  86. vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Subscriptions/GetCampaignStatisticsSubscriptions/svn-3E60A2A4 +0 -0
  87. vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Subscriptions/GetCampaignStatisticsSubscriptions/svn-3E60A2AB +0 -0
  88. vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Summary/GetCampaignStatisticsSummary/svn-3E60A2B2 +0 -0
  89. vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Summary/GetCampaignStatisticsSummary/svn-3E60A2B9 +0 -0
  90. vendor/getresponse/sdk-php/src/Operation/Campaigns/UpdateCampaign/svn-3E60A2C0 +0 -0
  91. vendor/getresponse/sdk-php/src/Operation/ClickTracks/GetClickTrack/svn-3E6122C7 +0 -0
  92. vendor/getresponse/sdk-php/src/Operation/ClickTracks/GetClickTrack/svn-3E6122CE +0 -0
  93. vendor/getresponse/sdk-php/src/Operation/ClickTracks/GetClickTracks/svn-3E6122D5 +0 -0
  94. vendor/getresponse/sdk-php/src/Operation/ClickTracks/GetClickTracks/svn-3E6122DC +0 -0
  95. vendor/getresponse/sdk-php/src/Operation/ClickTracks/GetClickTracks/svn-3E6122E3 +0 -0
  96. vendor/getresponse/sdk-php/src/Operation/ClickTracks/GetClickTracks/svn-3E6122EA +0 -0
vendor/getresponse/sdk-php/src/Operation/Campaigns/GetCampaigns/svn-B825428B → admin/css/svn-B82D9348 RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/GetCampaigns/svn-B825C2A0 → admin/images/newsletter-icon/demo-files/svn-B82E0B4F RENAMED
File without changes
admin/js/bten-mailing-platform-lists.js CHANGED
@@ -1,204 +1,202 @@
1
- jQuery(document).ready(function () {
2
- //MailChimp Lists
3
- jQuery("body").on("click", ".bten_get_mailchimp_lists", function (e) {
4
- ListsSelect = jQuery("#" + jQuery(this).attr("rel-id"));
5
- ListsSelect.find("option").remove();
6
- jQuery("<option/>").val(0).text("Loading...").appendTo(ListsSelect);
7
- jQuery.ajax({
8
- url: ajaxurl,
9
- data: {
10
- action: "bten_get_mailing_list",
11
- calling_action: "bten_mailchimp_list",
12
- bten_mc_api_key: jQuery("#bten_mailchimp_api_key").val(),
13
- },
14
- dataType: "JSON",
15
- type: "POST",
16
- success: function (response) {
17
- ListsSelect.find("option").remove();
18
- jQuery.each(response, function (i, option) {
19
- if (option.name) {
20
- jQuery("<option/>")
21
- .val(option.id)
22
- .text(option.name)
23
- .appendTo(ListsSelect);
24
- } else {
25
- jQuery("<option/>")
26
- .val(i)
27
- .text("No Lists Found")
28
- .appendTo(ListsSelect);
29
- }
30
- });
31
- },
32
- error: function (errorThrown) {
33
- alert("Error...");
34
- },
35
- });
36
- });
37
-
38
- //MailerLite Lists
39
- jQuery("body").on("click", ".bten_get_mailerlite_lists", function (e) {
40
- ListsSelect = jQuery("#" + jQuery(this).attr("rel-id"));
41
- ListsSelect.find("option").remove();
42
- jQuery("<option/>").val(0).text("Loading...").appendTo(ListsSelect);
43
- jQuery.ajax({
44
- url: ajaxurl,
45
- data: {
46
- action: "bten_get_mailing_list",
47
- calling_action: "bten_mailerlite_list",
48
- bten_ml_api_key: jQuery("#bten_mailerlite_api_key").val(),
49
- },
50
- dataType: "JSON",
51
- type: "POST",
52
- success: function (response) {
53
- ListsSelect.find("option").remove();
54
- jQuery.each(response, function (i, option) {
55
- if (option.name) {
56
- jQuery("<option/>")
57
- .val(option.id)
58
- .text(option.name)
59
- .appendTo(ListsSelect);
60
- } else {
61
- jQuery("<option/>")
62
- .val(i)
63
- .text("No Lists Found")
64
- .appendTo(ListsSelect);
65
- }
66
- });
67
- },
68
- error: function (errorThrown) {
69
- alert("Error...");
70
- },
71
- });
72
- });
73
-
74
- //ConvertKit Lists
75
- jQuery("body").on("click", ".bten_get_convertkit_lists", function (e) {
76
- ListsSelect = jQuery("#" + jQuery(this).attr("rel-id"));
77
- ListsSelect.find("option").remove();
78
- jQuery("<option/>").val(0).text("Loading...").appendTo(ListsSelect);
79
- jQuery.ajax({
80
- url: ajaxurl,
81
- data: {
82
- action: "bten_get_mailing_list",
83
- calling_action: "bten_convertkit_list",
84
- bten_ck_api_key: jQuery("#bten_convertkit_api_key").val(),
85
- },
86
- dataType: "JSON",
87
- type: "POST",
88
- success: function (response) {
89
- ListsSelect.find("option").remove();
90
- jQuery.each(response, function (i, option) {
91
- jQuery("<option/>").val(i).text(option.name).appendTo(ListsSelect);
92
- });
93
- },
94
- error: function (errorThrown) {
95
- alert("Error...");
96
- },
97
- });
98
- });
99
-
100
- //GetResponse Lists
101
- jQuery("body").on("click", ".bten_get_getresponse_lists", function (e) {
102
- ListsSelect = jQuery("#" + jQuery(this).attr("rel-id"));
103
- ListsSelect.find("option").remove();
104
- jQuery("<option/>").val(0).text("Loading...").appendTo(ListsSelect);
105
- jQuery.ajax({
106
- url: ajaxurl,
107
- data: {
108
- action: "bten_get_mailing_list",
109
- calling_action: "bten_getresponse_list",
110
- bten_gr_api_key: jQuery("#bten_getresponse_api_key").val(),
111
- },
112
- dataType: "JSON",
113
- type: "POST",
114
- success: function (response) {
115
- ListsSelect.find("option").remove();
116
- jQuery.each(response, function (i, option) {
117
- jQuery("<option/>")
118
- .val(option.campaignId)
119
- .text(option.name)
120
- .appendTo(ListsSelect);
121
- });
122
- },
123
- error: function (errorThrown) {
124
- ListsSelect.find("option").remove();
125
- jQuery("<option/>")
126
- .val("-")
127
- .text("No Lists Found")
128
- .appendTo(ListsSelect);
129
- alert("Error: Invalid API key");
130
- },
131
- });
132
- });
133
-
134
- //sendinblue Lists
135
- jQuery("body").on("click", ".bten_get_sendinblue_lists", function (e) {
136
- if ("" === jQuery("#bten_sendinblue_api_key").val()) {
137
- alert("Please enter your API key first");
138
- return false;
139
- }
140
-
141
- ListsSelect = jQuery("#" + jQuery(this).attr("rel-id"));
142
- ListsSelect.find("option").remove();
143
- jQuery("<option/>").val(0).text("Loading...").appendTo(ListsSelect);
144
- jQuery.ajax({
145
- url: ajaxurl,
146
- data: {
147
- action: "bten_get_mailing_list",
148
- calling_action: "bten_sendinblue_list",
149
- bten_sendin_api_key: jQuery("#bten_sendinblue_api_key").val(),
150
- },
151
- dataType: "JSON",
152
- type: "POST",
153
- success: function (response) {
154
- ListsSelect.find("option").remove();
155
- jQuery.each(response.data, function (i, option) {
156
- jQuery("<option/>")
157
- .val(option.id)
158
- .text(option.name)
159
- .appendTo(ListsSelect);
160
- });
161
- },
162
- error: function (errorThrown) {
163
- ListsSelect.find("option").remove();
164
- jQuery("<option/>")
165
- .val("-")
166
- .text("No Lists Found")
167
- .appendTo(ListsSelect);
168
- alert("Error: Invalid API key");
169
- },
170
- });
171
- });
172
-
173
- //ActiveCampaign Lists
174
- jQuery("body").on("click", ".bten_get_activecampaign_lists", function (e) {
175
- ListsSelect = jQuery("#" + jQuery(this).attr("rel-id"));
176
- ListsSelect.find("option").remove();
177
- jQuery("<option/>").val(0).text("Loading...").appendTo(ListsSelect);
178
- jQuery.ajax({
179
- url: ajaxurl,
180
- data: {
181
- action: "bten_get_mailing_list",
182
- calling_action: "bten_activecampaign_list",
183
- bten_ac_api_url: jQuery("#bten_activecampaign_api_url").val(),
184
- bten_ac_api_key: jQuery("#bten_activecampaign_api_key").val(),
185
- },
186
- dataType: "JSON",
187
- type: "POST",
188
- success: function (response) {
189
- ListsSelect.find("option").remove();
190
- jQuery.each(response, function (i, option) {
191
- jQuery("<option/>").val(i).text(option.name).appendTo(ListsSelect);
192
- });
193
- },
194
- error: function (errorThrown) {
195
- ListsSelect.find("option").remove();
196
- jQuery("<option/>")
197
- .val("-")
198
- .text("No Lists Found")
199
- .appendTo(ListsSelect);
200
- alert("Error: Invalid API key or Url");
201
- },
202
- });
203
- });
204
- });
1
+ jQuery(document).ready(function () {
2
+ //MailChimp Lists
3
+ jQuery("body").on("click", ".bten_get_mailchimp_lists", function (e) {
4
+ ListsSelect = jQuery("#" + jQuery(this).attr("rel-id"));
5
+ ListsSelect.find("option").remove();
6
+ jQuery("<option/>").val(0).text("Loading...").appendTo(ListsSelect);
7
+ jQuery.ajax({
8
+ url: ajaxurl,
9
+ data: {
10
+ action: "bten_get_mailing_list",
11
+ calling_action: "bten_mailchimp_list",
12
+ bten_mc_api_key: jQuery("#bten_mailchimp_api_key").val(),
13
+ },
14
+ dataType: "JSON",
15
+ type: "POST",
16
+ success: function (response) {
17
+ ListsSelect.find("option").remove();
18
+ jQuery.each(response, function (i, option) {
19
+ if (option.name) {
20
+ jQuery("<option/>")
21
+ .val(option.id)
22
+ .text(option.name)
23
+ .appendTo(ListsSelect);
24
+ } else {
25
+ jQuery("<option/>")
26
+ .val(i)
27
+ .text("No Lists Found")
28
+ .appendTo(ListsSelect);
29
+ }
30
+ });
31
+ },
32
+ error: function (errorThrown) {
33
+ alert("Error...");
34
+ },
35
+ });
36
+ });
37
+
38
+ //MailerLite Lists
39
+ jQuery("body").on("click", ".bten_get_mailerlite_lists", function (e) {
40
+ ListsSelect = jQuery("#" + jQuery(this).attr("rel-id"));
41
+ ListsSelect.find("option").remove();
42
+ jQuery("<option/>").val(0).text("Loading...").appendTo(ListsSelect);
43
+ jQuery.ajax({
44
+ url: ajaxurl,
45
+ data: {
46
+ action: "bten_get_mailing_list",
47
+ calling_action: "bten_mailerlite_list",
48
+ bten_ml_api_key: jQuery("#bten_mailerlite_api_key").val(),
49
+ },
50
+ dataType: "JSON",
51
+ type: "POST",
52
+ success: function (response) {
53
+ ListsSelect.find("option").remove();
54
+ jQuery.each(response.data, function (i, option) {
55
+ jQuery("<option/>")
56
+ .val(option.id)
57
+ .text(option.name)
58
+ .appendTo(ListsSelect);
59
+ });
60
+ },
61
+ error: function (errorThrown) {
62
+ ListsSelect.find("option").remove();
63
+ jQuery("<option/>")
64
+ .val("-")
65
+ .text("No Lists Found")
66
+ .appendTo(ListsSelect);
67
+ alert("Error: Invalid API key");
68
+ },
69
+ });
70
+ });
71
+
72
+ //ConvertKit Lists
73
+ jQuery("body").on("click", ".bten_get_convertkit_lists", function (e) {
74
+ ListsSelect = jQuery("#" + jQuery(this).attr("rel-id"));
75
+ ListsSelect.find("option").remove();
76
+ jQuery("<option/>").val(0).text("Loading...").appendTo(ListsSelect);
77
+ jQuery.ajax({
78
+ url: ajaxurl,
79
+ data: {
80
+ action: "bten_get_mailing_list",
81
+ calling_action: "bten_convertkit_list",
82
+ bten_ck_api_key: jQuery("#bten_convertkit_api_key").val(),
83
+ },
84
+ dataType: "JSON",
85
+ type: "POST",
86
+ success: function (response) {
87
+ ListsSelect.find("option").remove();
88
+ jQuery.each(response, function (i, option) {
89
+ jQuery("<option/>").val(i).text(option.name).appendTo(ListsSelect);
90
+ });
91
+ },
92
+ error: function (errorThrown) {
93
+ alert("Error...");
94
+ },
95
+ });
96
+ });
97
+
98
+ //GetResponse Lists
99
+ jQuery("body").on("click", ".bten_get_getresponse_lists", function (e) {
100
+ ListsSelect = jQuery("#" + jQuery(this).attr("rel-id"));
101
+ ListsSelect.find("option").remove();
102
+ jQuery("<option/>").val(0).text("Loading...").appendTo(ListsSelect);
103
+ jQuery.ajax({
104
+ url: ajaxurl,
105
+ data: {
106
+ action: "bten_get_mailing_list",
107
+ calling_action: "bten_getresponse_list",
108
+ bten_gr_api_key: jQuery("#bten_getresponse_api_key").val(),
109
+ },
110
+ dataType: "JSON",
111
+ type: "POST",
112
+ success: function (response) {
113
+ ListsSelect.find("option").remove();
114
+ jQuery.each(response, function (i, option) {
115
+ jQuery("<option/>")
116
+ .val(option.campaignId)
117
+ .text(option.name)
118
+ .appendTo(ListsSelect);
119
+ });
120
+ },
121
+ error: function (errorThrown) {
122
+ ListsSelect.find("option").remove();
123
+ jQuery("<option/>")
124
+ .val("-")
125
+ .text("No Lists Found")
126
+ .appendTo(ListsSelect);
127
+ alert("Error: Invalid API key");
128
+ },
129
+ });
130
+ });
131
+
132
+ //sendinblue Lists
133
+ jQuery("body").on("click", ".bten_get_sendinblue_lists", function (e) {
134
+ if ("" === jQuery("#bten_sendinblue_api_key").val()) {
135
+ alert("Please enter your API key first");
136
+ return false;
137
+ }
138
+
139
+ ListsSelect = jQuery("#" + jQuery(this).attr("rel-id"));
140
+ ListsSelect.find("option").remove();
141
+ jQuery("<option/>").val(0).text("Loading...").appendTo(ListsSelect);
142
+ jQuery.ajax({
143
+ url: ajaxurl,
144
+ data: {
145
+ action: "bten_get_mailing_list",
146
+ calling_action: "bten_sendinblue_list",
147
+ bten_sendin_api_key: jQuery("#bten_sendinblue_api_key").val(),
148
+ },
149
+ dataType: "JSON",
150
+ type: "POST",
151
+ success: function (response) {
152
+ ListsSelect.find("option").remove();
153
+ jQuery.each(response.data, function (i, option) {
154
+ jQuery("<option/>")
155
+ .val(option.id)
156
+ .text(option.name)
157
+ .appendTo(ListsSelect);
158
+ });
159
+ },
160
+ error: function (errorThrown) {
161
+ ListsSelect.find("option").remove();
162
+ jQuery("<option/>")
163
+ .val("-")
164
+ .text("No Lists Found")
165
+ .appendTo(ListsSelect);
166
+ alert("Error: Invalid API key");
167
+ },
168
+ });
169
+ });
170
+
171
+ //ActiveCampaign Lists
172
+ jQuery("body").on("click", ".bten_get_activecampaign_lists", function (e) {
173
+ ListsSelect = jQuery("#" + jQuery(this).attr("rel-id"));
174
+ ListsSelect.find("option").remove();
175
+ jQuery("<option/>").val(0).text("Loading...").appendTo(ListsSelect);
176
+ jQuery.ajax({
177
+ url: ajaxurl,
178
+ data: {
179
+ action: "bten_get_mailing_list",
180
+ calling_action: "bten_activecampaign_list",
181
+ bten_ac_api_url: jQuery("#bten_activecampaign_api_url").val(),
182
+ bten_ac_api_key: jQuery("#bten_activecampaign_api_key").val(),
183
+ },
184
+ dataType: "JSON",
185
+ type: "POST",
186
+ success: function (response) {
187
+ ListsSelect.find("option").remove();
188
+ jQuery.each(response, function (i, option) {
189
+ jQuery("<option/>").val(i).text(option.name).appendTo(ListsSelect);
190
+ });
191
+ },
192
+ error: function (errorThrown) {
193
+ ListsSelect.find("option").remove();
194
+ jQuery("<option/>")
195
+ .val("-")
196
+ .text("No Lists Found")
197
+ .appendTo(ListsSelect);
198
+ alert("Error: Invalid API key or Url");
199
+ },
200
+ });
201
+ });
202
+ });
 
 
includes/class-blossomthemes-email-newsletter-functions.php CHANGED
@@ -1,357 +1,355 @@
1
- <?php
2
- /**
3
- * Functions of the plugin.
4
- *
5
- * @package Blossomthemes_Email_Newsletter
6
- * @subpackage Blossomthemes_Email_Newsletter/includes
7
- * @author blossomthemes
8
- */
9
-
10
- class Blossomthemes_Email_Newsletter_Functions {
11
- // JavaScript Minifier
12
- function __construct()
13
- {
14
- add_action( 'wp_ajax_bten_get_mailing_list', array( $this, 'bten_get_mailing_list' ) );
15
- }
16
-
17
- function bten_minify_js( $input ) {
18
- if(trim($input) === "") return $input;
19
- return preg_replace(
20
- array(
21
- // Remove comment(s)
22
- '#\s*("(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\')\s*|\s*\/\*(?!\!|@cc_on)(?>[\s\S]*?\*\/)\s*|\s*(?<![\:\=])\/\/.*(?=[\n\r]|$)|^\s*|\s*$#',
23
- // Remove white-space(s) outside the string and regex
24
- '#("(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\'|\/\*(?>.*?\*\/)|\/(?!\/)[^\n\r]*?\/(?=[\s.,;]|[gimuy]|$))|\s*([!%&*\(\)\-=+\[\]\{\}|;:,.<>?\/])\s*#s',
25
- // Remove the last semicolon
26
- '#;+\}#',
27
- // Minify object attribute(s) except JSON attribute(s). From `{'foo':'bar'}` to `{foo:'bar'}`
28
- '#([\{,])([\'])(\d+|[a-z_]\w*)\2(?=\:)#i',
29
- // --ibid. From `foo['bar']` to `foo.bar`
30
- '#([\w\)\]])\[([\'"])([a-z_]\w*)\2\]#i',
31
- // Replace `true` with `!0`
32
- '#(?<=return |[=:,\(\[])true\b#',
33
- // Replace `false` with `!1`
34
- '#(?<=return |[=:,\(\[])false\b#',
35
- // Clean up ...
36
- '#\s*(\/\*|\*\/)\s*#'
37
- ),
38
- array(
39
- '$1',
40
- '$1$2',
41
- '}',
42
- '$1$3',
43
- '$1.$3',
44
- '!0',
45
- '!1',
46
- '$1'
47
- ),
48
- $input);
49
- }
50
-
51
-
52
-
53
- function bten_minify_css( $input ) {
54
- if(trim($input) === "") return $input;
55
- // Force white-space(s) in `calc()`
56
- if(strpos($input, 'calc(') !== false) {
57
- $input = preg_replace_callback('#(?<=[\s:])calc\(\s*(.*?)\s*\)#', function($matches) {
58
- return 'calc(' . preg_replace('#\s+#', "\x1A", $matches[1]) . ')';
59
- }, $input);
60
- }
61
- return preg_replace(
62
- array(
63
- // Remove comment(s)
64
- '#("(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\')|\/\*(?!\!)(?>.*?\*\/)|^\s*|\s*$#s',
65
- // Remove unused white-space(s)
66
- '#("(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\'|\/\*(?>.*?\*\/))|\s*+;\s*+(})\s*+|\s*+([*$~^|]?+=|[{};,>~+]|\s*+-(?![0-9\.])|!important\b)\s*+|([[(:])\s++|\s++([])])|\s++(:)\s*+(?!(?>[^{}"\']++|"(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\')*+{)|^\s++|\s++\z|(\s)\s+#si',
67
- // Replace `0(cm|em|ex|in|mm|pc|pt|px|vh|vw|%)` with `0`
68
- '#(?<=[\s:])(0)(cm|em|ex|in|mm|pc|pt|px|vh|vw|%)#si',
69
- // Replace `:0 0 0 0` with `:0`
70
- '#:(0\s+0|0\s+0\s+0\s+0)(?=[;\}]|\!important)#i',
71
- // Replace `background-position:0` with `background-position:0 0`
72
- '#(background-position):0(?=[;\}])#si',
73
- // Replace `0.6` with `.6`, but only when preceded by a white-space or `=`, `:`, `,`, `(`, `-`
74
- '#(?<=[\s=:,\(\-]|&\#32;)0+\.(\d+)#s',
75
- // Minify string value
76
- '#(\/\*(?>.*?\*\/))|(?<!content\:)([\'"])([a-z_][-\w]*?)\2(?=[\s\{\}\];,])#si',
77
- '#(\/\*(?>.*?\*\/))|(\burl\()([\'"])([^\s]+?)\3(\))#si',
78
- // Minify HEX color code
79
- '#(?<=[\s=:,\(]\#)([a-f0-6]+)\1([a-f0-6]+)\2([a-f0-6]+)\3#i',
80
- // Replace `(border|outline):none` with `(border|outline):0`
81
- '#(?<=[\{;])(border|outline):none(?=[;\}\!])#',
82
- // Remove empty selector(s)
83
- '#(\/\*(?>.*?\*\/))|(^|[\{\}])(?:[^\s\{\}]+)\{\}#s',
84
- '#\x1A#'
85
- ),
86
- array(
87
- '$1',
88
- '$1$2$3$4$5$6$7',
89
- '$1',
90
- ':0',
91
- '$1:0 0',
92
- '.$1',
93
- '$1$3',
94
- '$1$2$4$5',
95
- '$1$2$3',
96
- '$1:0',
97
- '$1$2',
98
- ' '
99
- ),
100
- $input);
101
- }
102
-
103
- /**
104
- * Retrieves the image field.
105
- *
106
- * @link https://pippinsplugins.com/retrieve-attachment-id-from-image-url/
107
- */
108
- function blossomthemes_email_newsletter_companion_get_image_field( $id, $name, $image, $label ){
109
- $output = '';
110
- $output .= '<div class="widget-upload">';
111
- $output .= '<label for="' . esc_attr( $id ) . '">' . esc_html( $label ) . '</label><br/>';
112
- $output .= '<input id="' . esc_attr( $id ) . '" class="bten-upload" type="hidden" name="' . esc_attr( $name ) . '" value="' . esc_attr( $image ) . '" placeholder="' . __('No file chosen', 'blossomthemes-email-newsletter') . '" />' . "\n";
113
- if ( function_exists( 'wp_enqueue_media' ) ) {
114
- if ( $image == '' ) {
115
- $output .= '<input id="upload-' . esc_attr( $id ) . '" class="bten-upload-button button" type="button" value="' . __('Upload', 'blossomthemes-email-newsletter') . '" />' . "\n";
116
- } else {
117
- $output .= '<input id="upload-' . esc_attr( $id ) . '" class="bten-upload-button button" type="button" value="' . __('Change', 'blossomthemes-email-newsletter') . '" />' . "\n";
118
- }
119
- } else {
120
- $output .= '<p><i>' . __('Upgrade your version of WordPress for full media support.', 'blossomthemes-email-newsletter') . '</i></p>';
121
- }
122
-
123
- $output .= '<div class="bten-screenshot" id="' . esc_attr( $id ) . '-image">' . "\n";
124
-
125
- if ( $image != '' ) {
126
- $remove = '<a href="#" class="bten-remove-image">'.__('Remove Image','blossomthemes-email-newsletter').'</a>';
127
- $attachment_id = $image;
128
- $image_array = wp_get_attachment_image_src( $attachment_id, 'full');
129
- if ( $image_array[0] ) {
130
- $output .= '<img src="' . esc_url( $image_array[0] ) . '" alt="" />' . $remove;
131
- } else {
132
- // Standard generic output if it's not an image.
133
- $output .= '<small>' . __( 'Please upload valid image file.', 'blossomthemes-email-newsletter' ) . '</small>';
134
- }
135
- }
136
- $output .= '</div></div>' . "\n";
137
-
138
- echo $output;
139
- }
140
-
141
- /**
142
- * Get an attachment ID given a URL.
143
- *
144
- * @param string $url
145
- *
146
- * @return int Attachment ID on success, 0 on failure
147
- */
148
- function blossomthemes_email_newsletter_get_attachment_id( $url ) {
149
- $attachment_id = 0;
150
- $dir = wp_upload_dir();
151
- if ( false !== strpos( $url, $dir['baseurl'] . '/' ) ) { // Is URL in uploads directory?
152
- $file = basename( $url );
153
- $query_args = array(
154
- 'post_type' => 'attachment',
155
- 'post_status' => 'inherit',
156
- 'fields' => 'ids',
157
- 'meta_query' => array(
158
- array(
159
- 'value' => $file,
160
- 'compare' => 'LIKE',
161
- 'key' => '_wp_attachment_metadata',
162
- ),
163
- )
164
- );
165
- $query = new WP_Query( $query_args );
166
- if ( $query->have_posts() ) {
167
- foreach ( $query->posts as $post_id ) {
168
- $meta = wp_get_attachment_metadata( $post_id );
169
- $original_file = basename( $meta['file'] );
170
- $cropped_image_files = wp_list_pluck( $meta['sizes'], 'file' );
171
- if ( $original_file === $file || in_array( $file, $cropped_image_files ) ) {
172
- $attachment_id = $post_id;
173
- break;
174
- }
175
- }
176
- }
177
- }
178
- return $attachment_id;
179
- }
180
-
181
- function bten_get_mailing_list()
182
- {
183
- if ($_POST['calling_action'] == 'bten_aweber_auth')
184
- {
185
- $aw = new Blossomthemes_Email_Newsletter_AWeber;
186
- echo json_encode($aw->bten_get_aw_auth($_POST['bten_aw_auth_code']));
187
- }
188
-
189
- elseif($_POST['calling_action'] == 'bten_aweber_remove_auth')
190
- {
191
- $aw = new Blossomthemes_Email_Newsletter_AWeber;
192
- echo json_encode($aw->bten_get_aw_remove_auth());
193
- }
194
-
195
- elseif ($_POST['calling_action'] == 'bten_aweber_list')
196
- {
197
- $aw = new Blossomthemes_Email_Newsletter_AWeber;
198
- echo json_encode($aw->bten_get_aw_lists());
199
- }
200
-
201
- elseif ($_POST['calling_action'] == 'bten_mailchimp_list')
202
- {
203
- if(empty($_POST['bten_mc_api_key']))
204
- {
205
- $data[0] = array('name' => 'No Lists Found', 'message' => "Please enter a valid API Key", 'desc' => 'empty api key');
206
- echo json_encode($data);
207
- }
208
- else
209
- {
210
- $mc = new BlossomThemes_Email_Newsletter_Settings;
211
- $data = $mc->mailchimp_lists($_POST['bten_mc_api_key']);
212
- if(empty($data['lists']))
213
- {
214
- $data[0] = array('name' => 'No Lists Found', 'message' => "Please enter a valid API Key", 'desc' => 'invalid api key');
215
- echo json_encode($data);
216
- }
217
- else
218
- {
219
- echo json_encode($data['lists']);
220
- }
221
- }
222
- }
223
-
224
- elseif ($_POST['calling_action'] == 'bten_mailerlite_list')
225
- {
226
- if(empty($_POST['bten_ml_api_key']))
227
- {
228
- $data[0] = array('name' => 'No Lists Found', 'message' => "Please enter a valid API Key", 'desc' => 'empty api key');
229
- echo json_encode($data);
230
- }
231
- else
232
- {
233
- $ml = new BlossomThemes_Email_Newsletter_Settings;
234
- $data = $ml->mailerlite_lists($_POST['bten_ml_api_key']);
235
-
236
- if(empty($data['Results']))
237
- {
238
- echo json_encode($data);
239
- }
240
- else
241
- {
242
- echo json_encode($data['Results']);
243
- }
244
- }
245
-
246
- }
247
-
248
- elseif ($_POST['calling_action'] == 'bten_convertkit_list')
249
- {
250
- if(empty($_POST['bten_ck_api_key']))
251
- {
252
- $data[0] = array('name' => 'No Lists Found', 'message' => "Please enter a valid API Key", 'desc' => 'empty api key');
253
- echo json_encode($data);
254
- }
255
- else
256
- {
257
- $ck = new BlossomThemes_Email_Newsletter_Settings;
258
- $data = $ck->convertkit_lists($_POST['bten_ck_api_key']);
259
- if(empty($data))
260
- {
261
- $data[0] = array('name' => 'No Lists Found', 'message' => "Please enter a valid API Key", 'desc' => 'invalid api key');
262
- echo json_encode($data);
263
- }
264
- else
265
- {
266
- echo json_encode($data);
267
- }
268
- }
269
- }
270
-
271
- elseif ($_POST['calling_action'] == 'bten_getresponse_list')
272
- {
273
- if(empty($_POST['bten_gr_api_key']))
274
- {
275
- $data[0] = array('name' => 'No Lists Found', 'message' => "Please enter a valid API Key", 'desc' => 'empty api key');
276
- echo json_encode($data);
277
- }
278
- else
279
- {
280
- $gt = new Blossomthemes_Email_Newsletter_GetResponse();
281
- $data = $gt->getresponse_lists($_POST['bten_gr_api_key']);
282
- if(empty($data))
283
- {
284
- $data[0] = array('name' => 'No Lists Found', 'message' => "Please enter a valid API Key", 'desc' => 'invalid api key');
285
- echo json_encode($data);
286
- }
287
- else
288
- {
289
- echo json_encode($data);
290
- }
291
- }
292
- }
293
-
294
- elseif ($_POST['calling_action'] == 'bten_activecampaign_list')
295
- {
296
- if(empty($_POST['bten_ac_api_url']) || empty($_POST['bten_ac_api_key']))
297
- {
298
- $data[0] = array('name' => 'No Lists Found', 'message' => "Please enter a valid API Key or URL", 'desc' => 'empty api key or url');
299
- echo json_encode($data);
300
- }
301
- else
302
- {
303
- $ac = new BlossomThemes_Email_Newsletter_Settings;
304
- $data = $ac->activecampaign_lists( $_POST['bten_ac_api_key'], $_POST['bten_ac_api_url'] );
305
- echo json_encode($data);
306
-
307
- }
308
- } elseif ( $_POST['calling_action'] == 'bten_sendinblue_list' ) {
309
- $lists = array();
310
-
311
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', false );
312
-
313
- if ( ! $blossomthemes_email_newsletter_settings ) {
314
- return $lists;
315
- }
316
-
317
- $api_key = isset( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) ? esc_attr( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) : '';
318
-
319
- if ( empty( $api_key ) ) {
320
- $api_key = isset( $_POST['bten_sendin_api_key'] ) ? $_POST['bten_sendin_api_key'] : '';
321
- }
322
-
323
- if ( ! empty( $api_key ) ) {
324
-
325
- $mailin = new Blossom_Sendinblue_API_Client();
326
- $lists = array();
327
- $list_data = $mailin->getAllLists();
328
-
329
- if (!empty($list_data['lists'])) {
330
- foreach ( $list_data['lists'] as $value ) {
331
- if ( 'Temp - DOUBLE OPTIN' == $value['name'] ) {
332
- $tempList = $value['id'];
333
- update_option( 'bten_sib_temp_list', $tempList );
334
- continue;
335
- }
336
- $lists[] = array(
337
- 'id' => $value['id'],
338
- 'name' => $value['name'],
339
- );
340
- }
341
- }
342
- }
343
- if ( count( $lists ) > 0 ) {
344
- set_transient( 'bten_sib_list_' . md5( $api_key ), $lists, 4 * HOUR_IN_SECONDS );
345
- }
346
- wp_send_json_success( $lists );
347
- }
348
-
349
- else {
350
- echo json_encode(array());
351
- }
352
-
353
- die();
354
- }
355
-
356
- }
357
- new Blossomthemes_Email_Newsletter_Functions;
1
+ <?php
2
+ /**
3
+ * Functions of the plugin.
4
+ *
5
+ * @package Blossomthemes_Email_Newsletter
6
+ * @subpackage Blossomthemes_Email_Newsletter/includes
7
+ * @author blossomthemes
8
+ */
9
+
10
+ class Blossomthemes_Email_Newsletter_Functions {
11
+ // JavaScript Minifier
12
+ function __construct()
13
+ {
14
+ add_action( 'wp_ajax_bten_get_mailing_list', array( $this, 'bten_get_mailing_list' ) );
15
+ }
16
+
17
+ function bten_minify_js( $input ) {
18
+ if(trim($input) === "") return $input;
19
+ return preg_replace(
20
+ array(
21
+ // Remove comment(s)
22
+ '#\s*("(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\')\s*|\s*\/\*(?!\!|@cc_on)(?>[\s\S]*?\*\/)\s*|\s*(?<![\:\=])\/\/.*(?=[\n\r]|$)|^\s*|\s*$#',
23
+ // Remove white-space(s) outside the string and regex
24
+ '#("(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\'|\/\*(?>.*?\*\/)|\/(?!\/)[^\n\r]*?\/(?=[\s.,;]|[gimuy]|$))|\s*([!%&*\(\)\-=+\[\]\{\}|;:,.<>?\/])\s*#s',
25
+ // Remove the last semicolon
26
+ '#;+\}#',
27
+ // Minify object attribute(s) except JSON attribute(s). From `{'foo':'bar'}` to `{foo:'bar'}`
28
+ '#([\{,])([\'])(\d+|[a-z_]\w*)\2(?=\:)#i',
29
+ // --ibid. From `foo['bar']` to `foo.bar`
30
+ '#([\w\)\]])\[([\'"])([a-z_]\w*)\2\]#i',
31
+ // Replace `true` with `!0`
32
+ '#(?<=return |[=:,\(\[])true\b#',
33
+ // Replace `false` with `!1`
34
+ '#(?<=return |[=:,\(\[])false\b#',
35
+ // Clean up ...
36
+ '#\s*(\/\*|\*\/)\s*#'
37
+ ),
38
+ array(
39
+ '$1',
40
+ '$1$2',
41
+ '}',
42
+ '$1$3',
43
+ '$1.$3',
44
+ '!0',
45
+ '!1',
46
+ '$1'
47
+ ),
48
+ $input);
49
+ }
50
+
51
+
52
+
53
+ function bten_minify_css( $input ) {
54
+ if(trim($input) === "") return $input;
55
+ // Force white-space(s) in `calc()`
56
+ if(strpos($input, 'calc(') !== false) {
57
+ $input = preg_replace_callback('#(?<=[\s:])calc\(\s*(.*?)\s*\)#', function($matches) {
58
+ return 'calc(' . preg_replace('#\s+#', "\x1A", $matches[1]) . ')';
59
+ }, $input);
60
+ }
61
+ return preg_replace(
62
+ array(
63
+ // Remove comment(s)
64
+ '#("(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\')|\/\*(?!\!)(?>.*?\*\/)|^\s*|\s*$#s',
65
+ // Remove unused white-space(s)
66
+ '#("(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\'|\/\*(?>.*?\*\/))|\s*+;\s*+(})\s*+|\s*+([*$~^|]?+=|[{};,>~+]|\s*+-(?![0-9\.])|!important\b)\s*+|([[(:])\s++|\s++([])])|\s++(:)\s*+(?!(?>[^{}"\']++|"(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\')*+{)|^\s++|\s++\z|(\s)\s+#si',
67
+ // Replace `0(cm|em|ex|in|mm|pc|pt|px|vh|vw|%)` with `0`
68
+ '#(?<=[\s:])(0)(cm|em|ex|in|mm|pc|pt|px|vh|vw|%)#si',
69
+ // Replace `:0 0 0 0` with `:0`
70
+ '#:(0\s+0|0\s+0\s+0\s+0)(?=[;\}]|\!important)#i',
71
+ // Replace `background-position:0` with `background-position:0 0`
72
+ '#(background-position):0(?=[;\}])#si',
73
+ // Replace `0.6` with `.6`, but only when preceded by a white-space or `=`, `:`, `,`, `(`, `-`
74
+ '#(?<=[\s=:,\(\-]|&\#32;)0+\.(\d+)#s',
75
+ // Minify string value
76
+ '#(\/\*(?>.*?\*\/))|(?<!content\:)([\'"])([a-z_][-\w]*?)\2(?=[\s\{\}\];,])#si',
77
+ '#(\/\*(?>.*?\*\/))|(\burl\()([\'"])([^\s]+?)\3(\))#si',
78
+ // Minify HEX color code
79
+ '#(?<=[\s=:,\(]\#)([a-f0-6]+)\1([a-f0-6]+)\2([a-f0-6]+)\3#i',
80
+ // Replace `(border|outline):none` with `(border|outline):0`
81
+ '#(?<=[\{;])(border|outline):none(?=[;\}\!])#',
82
+ // Remove empty selector(s)
83
+ '#(\/\*(?>.*?\*\/))|(^|[\{\}])(?:[^\s\{\}]+)\{\}#s',
84
+ '#\x1A#'
85
+ ),
86
+ array(
87
+ '$1',
88
+ '$1$2$3$4$5$6$7',
89
+ '$1',
90
+ ':0',
91
+ '$1:0 0',
92
+ '.$1',
93
+ '$1$3',
94
+ '$1$2$4$5',
95
+ '$1$2$3',
96
+ '$1:0',
97
+ '$1$2',
98
+ ' '
99
+ ),
100
+ $input);
101
+ }
102
+
103
+ /**
104
+ * Retrieves the image field.
105
+ *
106
+ * @link https://pippinsplugins.com/retrieve-attachment-id-from-image-url/
107
+ */
108
+ function blossomthemes_email_newsletter_companion_get_image_field( $id, $name, $image, $label ){
109
+ $output = '';
110
+ $output .= '<div class="widget-upload">';
111
+ $output .= '<label for="' . esc_attr( $id ) . '">' . esc_html( $label ) . '</label><br/>';
112
+ $output .= '<input id="' . esc_attr( $id ) . '" class="bten-upload" type="hidden" name="' . esc_attr( $name ) . '" value="' . esc_attr( $image ) . '" placeholder="' . __('No file chosen', 'blossomthemes-email-newsletter') . '" />' . "\n";
113
+ if ( function_exists( 'wp_enqueue_media' ) ) {
114
+ if ( $image == '' ) {
115
+ $output .= '<input id="upload-' . esc_attr( $id ) . '" class="bten-upload-button button" type="button" value="' . __('Upload', 'blossomthemes-email-newsletter') . '" />' . "\n";
116
+ } else {
117
+ $output .= '<input id="upload-' . esc_attr( $id ) . '" class="bten-upload-button button" type="button" value="' . __('Change', 'blossomthemes-email-newsletter') . '" />' . "\n";
118
+ }
119
+ } else {
120
+ $output .= '<p><i>' . __('Upgrade your version of WordPress for full media support.', 'blossomthemes-email-newsletter') . '</i></p>';
121
+ }
122
+
123
+ $output .= '<div class="bten-screenshot" id="' . esc_attr( $id ) . '-image">' . "\n";
124
+
125
+ if ( $image != '' ) {
126
+ $remove = '<a href="#" class="bten-remove-image">'.__('Remove Image','blossomthemes-email-newsletter').'</a>';
127
+ $attachment_id = $image;
128
+ $image_array = wp_get_attachment_image_src( $attachment_id, 'full');
129
+ if ( $image_array[0] ) {
130
+ $output .= '<img src="' . esc_url( $image_array[0] ) . '" alt="" />' . $remove;
131
+ } else {
132
+ // Standard generic output if it's not an image.
133
+ $output .= '<small>' . __( 'Please upload valid image file.', 'blossomthemes-email-newsletter' ) . '</small>';
134
+ }
135
+ }
136
+ $output .= '</div></div>' . "\n";
137
+
138
+ echo $output;
139
+ }
140
+
141
+ /**
142
+ * Get an attachment ID given a URL.
143
+ *
144
+ * @param string $url
145
+ *
146
+ * @return int Attachment ID on success, 0 on failure
147
+ */
148
+ function blossomthemes_email_newsletter_get_attachment_id( $url ) {
149
+ $attachment_id = 0;
150
+ $dir = wp_upload_dir();
151
+ if ( false !== strpos( $url, $dir['baseurl'] . '/' ) ) { // Is URL in uploads directory?
152
+ $file = basename( $url );
153
+ $query_args = array(
154
+ 'post_type' => 'attachment',
155
+ 'post_status' => 'inherit',
156
+ 'fields' => 'ids',
157
+ 'meta_query' => array(
158
+ array(
159
+ 'value' => $file,
160
+ 'compare' => 'LIKE',
161
+ 'key' => '_wp_attachment_metadata',
162
+ ),
163
+ )
164
+ );
165
+ $query = new WP_Query( $query_args );
166
+ if ( $query->have_posts() ) {
167
+ foreach ( $query->posts as $post_id ) {
168
+ $meta = wp_get_attachment_metadata( $post_id );
169
+ $original_file = basename( $meta['file'] );
170
+ $cropped_image_files = wp_list_pluck( $meta['sizes'], 'file' );
171
+ if ( $original_file === $file || in_array( $file, $cropped_image_files ) ) {
172
+ $attachment_id = $post_id;
173
+ break;
174
+ }
175
+ }
176
+ }
177
+ }
178
+ return $attachment_id;
179
+ }
180
+
181
+ function bten_get_mailing_list()
182
+ {
183
+ if ($_POST['calling_action'] == 'bten_aweber_auth')
184
+ {
185
+ $aw = new Blossomthemes_Email_Newsletter_AWeber;
186
+ echo json_encode($aw->bten_get_aw_auth($_POST['bten_aw_auth_code']));
187
+ }
188
+
189
+ elseif($_POST['calling_action'] == 'bten_aweber_remove_auth')
190
+ {
191
+ $aw = new Blossomthemes_Email_Newsletter_AWeber;
192
+ echo json_encode($aw->bten_get_aw_remove_auth());
193
+ }
194
+
195
+ elseif ($_POST['calling_action'] == 'bten_aweber_list')
196
+ {
197
+ $aw = new Blossomthemes_Email_Newsletter_AWeber;
198
+ echo json_encode($aw->bten_get_aw_lists());
199
+ }
200
+
201
+ elseif ($_POST['calling_action'] == 'bten_mailchimp_list')
202
+ {
203
+ if(empty($_POST['bten_mc_api_key']))
204
+ {
205
+ $data[0] = array('name' => 'No Lists Found', 'message' => "Please enter a valid API Key", 'desc' => 'empty api key');
206
+ echo json_encode($data);
207
+ }
208
+ else
209
+ {
210
+ $mc = new BlossomThemes_Email_Newsletter_Settings;
211
+ $data = $mc->mailchimp_lists($_POST['bten_mc_api_key']);
212
+ if(empty($data['lists']))
213
+ {
214
+ $data[0] = array('name' => 'No Lists Found', 'message' => "Please enter a valid API Key", 'desc' => 'invalid api key');
215
+ echo json_encode($data);
216
+ }
217
+ else
218
+ {
219
+ echo json_encode($data['lists']);
220
+ }
221
+ }
222
+ }
223
+
224
+ elseif ($_POST['calling_action'] == 'bten_mailerlite_list')
225
+ {
226
+ if(empty($_POST['bten_ml_api_key']))
227
+ {
228
+ $data[0] = array('name' => 'No Lists Found', 'message' => "Please enter a valid API Key", 'desc' => 'empty api key');
229
+ echo json_encode($data);
230
+ }
231
+ else
232
+ {
233
+ $ml = new BlossomThemes_Email_Newsletter_Settings;
234
+ $data = $ml->mailerlite_lists($_POST['bten_ml_api_key']);
235
+
236
+ if( empty( $data ) ) {
237
+ $data[0] = array('name' => 'No Lists Found', 'message' => "Please enter a valid API Key", 'desc' => 'empty api key');
238
+ echo json_encode( $data );
239
+ } else {
240
+ wp_send_json_success( $data );
241
+ }
242
+ }
243
+
244
+ }
245
+
246
+ elseif ($_POST['calling_action'] == 'bten_convertkit_list')
247
+ {
248
+ if(empty($_POST['bten_ck_api_key']))
249
+ {
250
+ $data[0] = array('name' => 'No Lists Found', 'message' => "Please enter a valid API Key", 'desc' => 'empty api key');
251
+ echo json_encode($data);
252
+ }
253
+ else
254
+ {
255
+ $ck = new BlossomThemes_Email_Newsletter_Settings;
256
+ $data = $ck->convertkit_lists($_POST['bten_ck_api_key']);
257
+ if(empty($data))
258
+ {
259
+ $data[0] = array('name' => 'No Lists Found', 'message' => "Please enter a valid API Key", 'desc' => 'invalid api key');
260
+ echo json_encode($data);
261
+ }
262
+ else
263
+ {
264
+ echo json_encode($data);
265
+ }
266
+ }
267
+ }
268
+
269
+ elseif ($_POST['calling_action'] == 'bten_getresponse_list')
270
+ {
271
+ if(empty($_POST['bten_gr_api_key']))
272
+ {
273
+ $data[0] = array('name' => 'No Lists Found', 'message' => "Please enter a valid API Key", 'desc' => 'empty api key');
274
+ echo json_encode($data);
275
+ }
276
+ else
277
+ {
278
+ $gt = new Blossomthemes_Email_Newsletter_GetResponse();
279
+ $data = $gt->getresponse_lists($_POST['bten_gr_api_key']);
280
+ if(empty($data))
281
+ {
282
+ $data[0] = array('name' => 'No Lists Found', 'message' => "Please enter a valid API Key", 'desc' => 'invalid api key');
283
+ echo json_encode($data);
284
+ }
285
+ else
286
+ {
287
+ echo json_encode($data);
288
+ }
289
+ }
290
+ }
291
+
292
+ elseif ($_POST['calling_action'] == 'bten_activecampaign_list')
293
+ {
294
+ if(empty($_POST['bten_ac_api_url']) || empty($_POST['bten_ac_api_key']))
295
+ {
296
+ $data[0] = array('name' => 'No Lists Found', 'message' => "Please enter a valid API Key or URL", 'desc' => 'empty api key or url');
297
+ echo json_encode($data);
298
+ }
299
+ else
300
+ {
301
+ $ac = new BlossomThemes_Email_Newsletter_Settings;
302
+ $data = $ac->activecampaign_lists( $_POST['bten_ac_api_key'], $_POST['bten_ac_api_url'] );
303
+ echo json_encode($data);
304
+
305
+ }
306
+ } elseif ( $_POST['calling_action'] == 'bten_sendinblue_list' ) {
307
+ $lists = array();
308
+
309
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', false );
310
+
311
+ if ( ! $blossomthemes_email_newsletter_settings ) {
312
+ return $lists;
313
+ }
314
+
315
+ $api_key = isset( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) ? esc_attr( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) : '';
316
+
317
+ if ( empty( $api_key ) ) {
318
+ $api_key = isset( $_POST['bten_sendin_api_key'] ) ? $_POST['bten_sendin_api_key'] : '';
319
+ }
320
+
321
+ if ( ! empty( $api_key ) ) {
322
+
323
+ $mailin = new Blossom_Sendinblue_API_Client();
324
+ $lists = array();
325
+ $list_data = $mailin->getAllLists();
326
+
327
+ if (!empty($list_data['lists'])) {
328
+ foreach ( $list_data['lists'] as $value ) {
329
+ if ( 'Temp - DOUBLE OPTIN' == $value['name'] ) {
330
+ $tempList = $value['id'];
331
+ update_option( 'bten_sib_temp_list', $tempList );
332
+ continue;
333
+ }
334
+ $lists[] = array(
335
+ 'id' => $value['id'],
336
+ 'name' => $value['name'],
337
+ );
338
+ }
339
+ }
340
+ }
341
+ if ( count( $lists ) > 0 ) {
342
+ set_transient( 'bten_sib_list_' . md5( $api_key ), $lists, 4 * HOUR_IN_SECONDS );
343
+ }
344
+ wp_send_json_success( $lists );
345
+ }
346
+
347
+ else {
348
+ echo json_encode(array());
349
+ }
350
+
351
+ die();
352
+ }
353
+
354
+ }
355
+ new Blossomthemes_Email_Newsletter_Functions;
 
 
includes/class-blossomthemes-email-newsletter-getresponse.php CHANGED
@@ -1,162 +1,162 @@
1
- <?php
2
- /**
3
- * GetResponse handler of the plugin.
4
- *
5
- * @package Blossomthemes_Email_Newsletter
6
- * @subpackage Blossomthemes_Email_Newsletter/includes
7
- * @author blossomthemes
8
- */
9
-
10
- use Getresponse\Sdk\GetresponseClientFactory;
11
- use Getresponse\Sdk\Operation\Model\NewContact;
12
- use Getresponse\Sdk\Client\Operation\Pagination;
13
- use Getresponse\Sdk\Operation\Model\CampaignReference;
14
- use Getresponse\Sdk\Operation\Campaigns\GetCampaigns\GetCampaigns;
15
- use Getresponse\Sdk\Operation\Contacts\CreateContact\CreateContact;
16
-
17
- class Blossomthemes_Email_Newsletter_GetResponse {
18
-
19
- function bten_getresponse_action( $email,$sid,$fname)
20
- {
21
- $list = array();
22
- if(!empty($email) && !filter_var($email, FILTER_VALIDATE_EMAIL) === false)
23
- {
24
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
25
- $api_key = $blossomthemes_email_newsletter_settings['getresponse']['api-key']; //Place API key here
26
-
27
- try{
28
-
29
- if( ! empty( $api_key ))
30
- {
31
- $client = GetresponseClientFactory::createWithApiKey( $api_key );
32
-
33
- /**
34
- * let search for campaign. f.e. the first one we could find
35
- */
36
- $campaignsOperation = new GetCampaigns();
37
- $response = $client->call($campaignsOperation);
38
-
39
- if ($response->isSuccess()) {
40
- $campaignList = $response->getData();
41
- // $campaign = $campaignList[0];
42
-
43
- $listids = get_post_meta($sid,'blossomthemes_email_newsletter_setting',true);
44
-
45
- if(!isset($listids['getresponse']['list-id']))
46
- {
47
- $listids = $blossomthemes_email_newsletter_settings['getresponse']['list-id'];
48
- /**
49
- * first lets try to add single contact
50
- */
51
- $newContact = new NewContact(
52
- new CampaignReference($listids),
53
- $email
54
- );
55
- if ( ! empty( $fname ) ) {
56
- $newContact->setName($fname);
57
- }
58
- $newContact->setDayOfCycle(0);
59
- $createContact = new CreateContact($newContact);
60
- $response = $client->call($createContact);
61
- // var_dump($response);
62
- if ($response->isSuccess()) {
63
- $list['response'] = '200' ;
64
- }
65
- }
66
- else
67
- {
68
- foreach ($listids['getresponse']['list-id'] as $key => $value) {
69
- /**
70
- * first lets try to add single contact
71
- */
72
- $newContact = new NewContact(
73
- new CampaignReference($key),
74
- $email
75
- );
76
- if ( ! empty( $fname ) ) {
77
- $newContact->setName($fname);
78
- }
79
- $newContact->setDayOfCycle(0);
80
- $createContact = new CreateContact($newContact);
81
- $response = $client->call($createContact);
82
- // var_dump($response);
83
- }
84
- if ($response->isSuccess()) {
85
- $list['response'] = '200' ;
86
- }
87
- }
88
- }
89
- }
90
- }
91
-
92
- catch (Exception $e) {
93
- $list['log']['errorMessage'] = $e->getMessage();
94
- }
95
- }
96
- return $list;
97
- }
98
-
99
- /**
100
- * Get Response API
101
- *
102
- */
103
- function getresponse_lists($api_key = '')
104
- {
105
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
106
- $campaignsArray = array();
107
-
108
- if( empty($api_key ) && isset( $blossomthemes_email_newsletter_settings['getresponse']['api-key'] ) && $blossomthemes_email_newsletter_settings['getresponse']['api-key'] !='' )
109
- {
110
- $api_key = $blossomthemes_email_newsletter_settings['getresponse']['api-key']; //Place API key here
111
- }
112
-
113
- if(!empty($api_key)) {
114
- $client = GetresponseClientFactory::createWithApiKey( $api_key );
115
- /**
116
- * How to get list of campaigns
117
- */
118
- $campaignsOperation = new GetCampaigns();
119
-
120
- /**
121
- * There could be pagination, so we have to send requests for each page.
122
- */
123
- $pageNumber = 1;
124
- $finalPage = 1;
125
-
126
- do {
127
- $campaignsOperation->setPagination(new Pagination($pageNumber, 10));
128
-
129
- $response = $client->call($campaignsOperation);
130
-
131
- if ($response->isSuccess()) {
132
- /**
133
- * note: as operations are asynchronous, pagination data could change during the execution
134
- * of this code, so os better to adjust finalPage every call.
135
- */
136
- if ($response->isPaginated()) {
137
- $paginationValues = $response->getPaginationValues();
138
- $finalPage = $paginationValues->getTotalPages();
139
- }
140
- $campaignList = $response->getData();
141
- foreach ($campaignList as $campaign) {
142
- $campaignsArray[$campaign['campaignId']] = array('name' => $campaign['name'],
143
- 'campaignId' => $campaign['campaignId']);
144
- // var_dump($campaign);
145
- }
146
- $pageNumber++;
147
- } else {
148
- /**
149
- * put some error handling here
150
- */
151
- $errorData = $response->getData();
152
- var_dump($errorData['message']);
153
- break;
154
- }
155
-
156
- } while ($pageNumber <= $finalPage);
157
-
158
- }
159
- return $campaignsArray;
160
- }
161
- }
162
  new Blossomthemes_Email_Newsletter_GetResponse;
1
+ <?php
2
+ /**
3
+ * GetResponse handler of the plugin.
4
+ *
5
+ * @package Blossomthemes_Email_Newsletter
6
+ * @subpackage Blossomthemes_Email_Newsletter/includes
7
+ * @author blossomthemes
8
+ */
9
+
10
+ use Getresponse\Sdk\GetresponseClientFactory;
11
+ use Getresponse\Sdk\Operation\Model\NewContact;
12
+ use Getresponse\Sdk\Client\Operation\Pagination;
13
+ use Getresponse\Sdk\Operation\Model\CampaignReference;
14
+ use Getresponse\Sdk\Operation\Campaigns\GetCampaigns\GetCampaigns;
15
+ use Getresponse\Sdk\Operation\Contacts\CreateContact\CreateContact;
16
+
17
+ class Blossomthemes_Email_Newsletter_GetResponse {
18
+
19
+ function bten_getresponse_action( $email,$sid,$fname)
20
+ {
21
+ $list = array();
22
+ if(!empty($email) && !filter_var($email, FILTER_VALIDATE_EMAIL) === false)
23
+ {
24
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
25
+ $api_key = $blossomthemes_email_newsletter_settings['getresponse']['api-key']; //Place API key here
26
+
27
+ try{
28
+
29
+ if( ! empty( $api_key ))
30
+ {
31
+ $client = GetresponseClientFactory::createWithApiKey( $api_key );
32
+
33
+ /**
34
+ * let search for campaign. f.e. the first one we could find
35
+ */
36
+ $campaignsOperation = new GetCampaigns();
37
+ $response = $client->call($campaignsOperation);
38
+
39
+ if ($response->isSuccess()) {
40
+ $campaignList = $response->getData();
41
+ // $campaign = $campaignList[0];
42
+
43
+ $listids = get_post_meta($sid,'blossomthemes_email_newsletter_setting',true);
44
+
45
+ if(!isset($listids['getresponse']['list-id']))
46
+ {
47
+ $listids = $blossomthemes_email_newsletter_settings['getresponse']['list-id'];
48
+ /**
49
+ * first lets try to add single contact
50
+ */
51
+ $newContact = new NewContact(
52
+ new CampaignReference($listids),
53
+ $email
54
+ );
55
+ if ( ! empty( $fname ) ) {
56
+ $newContact->setName($fname);
57
+ }
58
+ $newContact->setDayOfCycle(0);
59
+ $createContact = new CreateContact($newContact);
60
+ $response = $client->call($createContact);
61
+ // var_dump($response);
62
+ if ($response->isSuccess()) {
63
+ $list['response'] = '200' ;
64
+ }
65
+ }
66
+ else
67
+ {
68
+ foreach ($listids['getresponse']['list-id'] as $key => $value) {
69
+ /**
70
+ * first lets try to add single contact
71
+ */
72
+ $newContact = new NewContact(
73
+ new CampaignReference($key),
74
+ $email
75
+ );
76
+ if ( ! empty( $fname ) ) {
77
+ $newContact->setName($fname);
78
+ }
79
+ $newContact->setDayOfCycle(0);
80
+ $createContact = new CreateContact($newContact);
81
+ $response = $client->call($createContact);
82
+ // var_dump($response);
83
+ }
84
+ if ($response->isSuccess()) {
85
+ $list['response'] = '200' ;
86
+ }
87
+ }
88
+ }
89
+ }
90
+ }
91
+
92
+ catch (Exception $e) {
93
+ $list['log']['errorMessage'] = $e->getMessage();
94
+ }
95
+ }
96
+ return $list;
97
+ }
98
+
99
+ /**
100
+ * Get Response API
101
+ *
102
+ */
103
+ function getresponse_lists($api_key = '')
104
+ {
105
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
106
+ $campaignsArray = array();
107
+
108
+ if( empty($api_key ) && isset( $blossomthemes_email_newsletter_settings['getresponse']['api-key'] ) && $blossomthemes_email_newsletter_settings['getresponse']['api-key'] !='' )
109
+ {
110
+ $api_key = $blossomthemes_email_newsletter_settings['getresponse']['api-key']; //Place API key here
111
+ }
112
+
113
+ if(!empty($api_key)) {
114
+ $client = GetresponseClientFactory::createWithApiKey( $api_key );
115
+ /**
116
+ * How to get list of campaigns
117
+ */
118
+ $campaignsOperation = new GetCampaigns();
119
+
120
+ /**
121
+ * There could be pagination, so we have to send requests for each page.
122
+ */
123
+ $pageNumber = 1;
124
+ $finalPage = 1;
125
+
126
+ do {
127
+ $campaignsOperation->setPagination(new Pagination($pageNumber, 10));
128
+
129
+ $response = $client->call($campaignsOperation);
130
+
131
+ if ($response->isSuccess()) {
132
+ /**
133
+ * note: as operations are asynchronous, pagination data could change during the execution
134
+ * of this code, so os better to adjust finalPage every call.
135
+ */
136
+ if ($response->isPaginated()) {
137
+ $paginationValues = $response->getPaginationValues();
138
+ $finalPage = $paginationValues->getTotalPages();
139
+ }
140
+ $campaignList = $response->getData();
141
+ foreach ($campaignList as $campaign) {
142
+ $campaignsArray[$campaign['campaignId']] = array('name' => $campaign['name'],
143
+ 'campaignId' => $campaign['campaignId']);
144
+ // var_dump($campaign);
145
+ }
146
+ $pageNumber++;
147
+ } else {
148
+ /**
149
+ * put some error handling here
150
+ */
151
+ $errorData = $response->getData();
152
+ var_dump($errorData['message']);
153
+ break;
154
+ }
155
+
156
+ } while ($pageNumber <= $finalPage);
157
+
158
+ }
159
+ return $campaignsArray;
160
+ }
161
+ }
162
  new Blossomthemes_Email_Newsletter_GetResponse;
includes/class-blossomthemes-email-newsletter-mailerlite.php CHANGED
@@ -18,36 +18,32 @@ class Blossomthemes_Email_Newsletter_Mailerlite {
18
  $blossomthemes_email_newsletter_setting = get_option( 'blossomthemes_email_newsletter_settings', true );
19
  $apiKey = $blossomthemes_email_newsletter_setting['mailerlite']['api-key'];
20
 
21
- if(!empty($apiKey))
22
  {
23
- include BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH.'/includes/libs/mailerlite_rest/ML_Subscribers.php';
24
 
25
- $ML_Subscribers = new ML_Subscribers( $apiKey );
26
-
27
- $subscriber = array(
28
- 'email' => $email,
29
- 'name' => $fname,
30
- );
31
 
32
  $obj = new BlossomThemes_Email_Newsletter_Settings;
33
  $data = $obj->mailerlite_lists();
34
 
35
- if(! empty($data['Results']) )
36
- {
37
- $listids = get_post_meta($sid,'blossomthemes_email_newsletter_setting',true);
38
 
39
- if(!isset($listids['mailerlite']['list-id']))
40
- {
41
  $listid = $blossomthemes_email_newsletter_setting['mailerlite']['list-id'];
42
- $subscriber = $ML_Subscribers->setId( $listid )->add( $subscriber, 1 /* set resubscribe to true*/ );
43
- $response = '200';
44
 
45
  }
46
  else{
47
  foreach ($listids['mailerlite']['list-id'] as $key => $value) {
48
- $ML_Subscribers->setId( $key )->add( $subscriber, 1 /* set resubscribe to true*/ );
49
  }
50
- $response = '200';
51
  }
52
  }
53
  }
18
  $blossomthemes_email_newsletter_setting = get_option( 'blossomthemes_email_newsletter_settings', true );
19
  $apiKey = $blossomthemes_email_newsletter_setting['mailerlite']['api-key'];
20
 
21
+ if( ! empty( $apiKey ) )
22
  {
23
+ $groupsApi = (new \MailerLiteApi\MailerLite( $apiKey ))->groups();
24
 
25
+ $subscriber = [
26
+ 'email' => $email,
27
+ 'name' => $fname,
28
+ ];
 
 
29
 
30
  $obj = new BlossomThemes_Email_Newsletter_Settings;
31
  $data = $obj->mailerlite_lists();
32
 
33
+ if( ! empty( $data ) ) {
34
+ $listids = get_post_meta( $sid,'blossomthemes_email_newsletter_setting',true );
 
35
 
36
+ if( ! isset( $listids['mailerlite']['list-id'] ) ) {
 
37
  $listid = $blossomthemes_email_newsletter_setting['mailerlite']['list-id'];
38
+ $addedSubscriber = $groupsApi->addSubscriber( $listid, $subscriber, 1 ); // returns added subscriber
39
+ $response = isset( $addedSubscriber->error ) ? $addedSubscriber->error->message : '200';
40
 
41
  }
42
  else{
43
  foreach ($listids['mailerlite']['list-id'] as $key => $value) {
44
+ $addedSubscriber = $groupsApi->addSubscriber( $key, $subscriber, 1 );
45
  }
46
+ $response = isset( $addedSubscriber->error ) ? $addedSubscriber->error->message : '200';
47
  }
48
  }
49
  }
includes/class-blossomthemes-email-newsletter-sendinblue.php CHANGED
@@ -1,288 +1,288 @@
1
- <?php
2
- /**
3
- * Sendinblue Handler.
4
- */
5
- class Blossomthemes_Email_Newsletter_Sendinblue {
6
-
7
- /**
8
- * Get Seninblue lists.
9
- *
10
- * @return void
11
- */
12
- public function get_lists() {
13
- $lists = array();
14
-
15
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', false );
16
-
17
- if ( ! $blossomthemes_email_newsletter_settings ) {
18
- return $lists;
19
- }
20
-
21
- $api_key = isset( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) ? esc_attr( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) : '';
22
- // get lists.
23
- $lists = get_transient( 'bten_sib_list_' . md5( $api_key ) );
24
- if ( false === $lists || false == $lists ) {
25
-
26
- $mailin = new Blossom_Sendinblue_API_Client();
27
- $lists = array();
28
- $list_data = $mailin->getAllLists();
29
-
30
- if (!empty($list_data['lists'])) {
31
- foreach ( $list_data['lists'] as $value ) {
32
- if ( 'Temp - DOUBLE OPTIN' == $value['name'] ) {
33
- $tempList = $value['id'];
34
- update_option( 'bten_sib_temp_list', $tempList );
35
- continue;
36
- }
37
- $lists[] = array(
38
- 'id' => $value['id'],
39
- 'name' => $value['name'],
40
- );
41
- }
42
- }
43
- }
44
- if ( count( $lists ) > 0 ) {
45
- set_transient( 'bten_sib_list_' . md5( $api_key ), $lists, 4 * HOUR_IN_SECONDS );
46
- }
47
- return $lists;
48
- }
49
-
50
- /**
51
- * Action for form submissions.
52
- *
53
- * @return void
54
- */
55
- public function action_form_submission( $email, $sid, $fname ) {
56
-
57
- // MailChimp API credentials
58
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
59
-
60
- $listids = get_post_meta( $sid, 'blossomthemes_email_newsletter_setting', true );
61
-
62
- if( ! isset( $listids['sendinblue']['list-id'] ) ) {
63
- $listids = $blossomthemes_email_newsletter_settings['sendinblue']['list-id'];
64
- $result = $this->create_subscriber( $email, $listids, $info = array( 'name' => $fname ), 'simple', $unlinkedLists = array() );
65
- }else {
66
- // foreach ( $listids['sendinblue']['list-id'] as $key => $value ) {
67
- $result = $this->create_subscriber( $email, $listids['sendinblue']['list-id'], $info = array( 'name' => $fname ), 'simple', $unlinkedLists = array() );
68
- // }
69
- }
70
-
71
- return $result;
72
- }
73
-
74
- /**
75
- * Signup process
76
- *
77
- * @param string $type - simple, confirm, double-optin / subscribe.
78
- * @param $email - subscriber email.
79
- * @param $list_id - desired list ids.
80
- * @param $info - user's attributes.
81
- * @param null $list_unlink - remove temp list.
82
- * @return string
83
- */
84
- public function create_subscriber( $email, $list_id, $info, $type = 'simple', $list_unlink = null ) {
85
- $mailin = new Blossom_Sendinblue_API_Client();
86
- $user = $mailin->getUser($email);
87
-
88
- $response = $this->validation_email( $user, $email, $list_id, $type );
89
- $exist = '';
90
-
91
- if ( 'already_exist' == $response['code'] ) {
92
- $exist = 'already_exist';
93
- }
94
-
95
- if ( 'subscribe' == $type ) {
96
- $info['DOUBLE_OPT-IN'] = '1'; // Yes.
97
- } else {
98
- if ( 'double-optin' == $type ) {
99
- if ( ( 'new' == $response['code'] && ! $response['isDopted']) || ( 'update' == $response['code'] && ! $response['isDopted']) ) {
100
- $info['DOUBLE_OPT-IN'] = '2'; // No.
101
- }
102
- }
103
- }
104
-
105
- $listid = $response['listid'];
106
- if ( $list_unlink != null ) {
107
- $listid = array_diff( $listid, $list_unlink );
108
- }
109
-
110
- $attributes = $this->get_attributes();
111
- if( !empty($attributes["attributes"]["normal_attributes"]) ) {
112
- foreach ( $attributes["attributes"]["normal_attributes"] as $key => $value ) {
113
- if( "boolean" == $value["type"] && array_key_exists($value["name"], $info) )
114
- if( in_array($info[ $value["name"] ], array("true","True","TRUE",1)) ) {
115
- $info[ $value["name"] ] = true;
116
- }
117
- else {
118
- $info[ $value["name"] ] = false;
119
- }
120
- }
121
- }
122
-
123
- $info = array(
124
- 'email' => $email,
125
- 'FIRSTNAME' => $info['name'],
126
- );
127
-
128
- if ($mailin->getLastResponseCode() === Blossom_Sendinblue_API_Client::RESPONSE_CODE_OK && isset($user['email'])) {
129
- unset($info["email"]);
130
- if (isset($info["internalUserHistory"]) && is_array($info["internalUserHistory"])) {
131
- $info["internalUserHistory"][] = array("action"=>"SUBSCRIBE_BY_PLUGIN", "id"=> 1, "name"=>"Blossomthemes Email Newsletter");
132
- } else {
133
- $info["internalUserHistory"] = array(array("action"=>"SUBSCRIBE_BY_PLUGIN", "id"=> 1, "name"=>"Blossomthemes Email Newsletter"));
134
- }
135
- $data = [
136
- 'email' => $email,
137
- 'attributes' => $info,
138
- 'emailBlacklisted' => false,
139
- 'smsBlacklisted' => false,
140
- 'listIds' => $listid,
141
- 'unlinkListIds' => $list_unlink
142
- ];
143
- $mailin->updateUser($email ,$data );
144
- $exist = $mailin->getLastResponseCode() == 204 ? 'success' : '' ;
145
- } else {
146
- $info["internalUserHistory"] = array(array("action"=>"SUBSCRIBE_BY_PLUGIN", "id"=> 1, "name"=>"Blossomthemes Email Newsletter"));
147
- $data = [
148
- 'email' => $email,
149
- 'attributes' => $info,
150
- 'emailBlacklisted' => false,
151
- 'smsBlacklisted' => false,
152
- 'listIds' => $listid
153
- ];
154
-
155
- $created_user = $mailin->createUser( $data );
156
- }
157
-
158
- if ('' != $exist) {
159
- $response['code'] = $exist;
160
- } else if(isset($created_user['id'])) {
161
- $response['code'] = "success";
162
- }
163
-
164
- return $response['code'];
165
- }
166
-
167
- /**
168
- * Validation the email if it exist in contact list
169
- *
170
- * @param $res
171
- * @param string $type - form type.
172
- * @param string $email - email.
173
- * @param array $list_id - list ids.
174
- * @return array
175
- */
176
- static function validation_email( $res, $email, $list_id, $type = 'simple' ) {
177
-
178
- $isDopted = false;
179
-
180
- $temp_dopt_list = get_option( 'bten_sib_temp_list' );
181
- $desired_lists = $list_id;
182
-
183
- if ( 'double-optin' == $type ) {
184
- $list_id = array( $temp_dopt_list );
185
- }
186
-
187
- // new user.
188
- if ( isset($res['code']) && $res['code'] == 'document_not_found' ) {
189
- $ret = array(
190
- 'code' => 'new',
191
- 'isDopted' => $isDopted,
192
- 'listid' => $list_id,
193
- );
194
- return $ret;
195
- }
196
-
197
- $listid = $res['listIds'];
198
-
199
- // update user when listid is empty.
200
- if ( ! isset( $listid ) || ! is_array( $listid ) ) {
201
- $ret = array(
202
- 'code' => 'update',
203
- 'isDopted' => $isDopted,
204
- 'listid' => $list_id,
205
- );
206
- return $ret;
207
- }
208
-
209
- $attrs = $res['attributes'];
210
- if ( isset( $attrs['DOUBLE_OPT-IN'] ) && '1' == $attrs['DOUBLE_OPT-IN'] ) {
211
- $isDopted = true;
212
- }
213
- // remove dopt temp list from $listid.
214
- if (($key = array_search($temp_dopt_list, $listid)) !== false) {
215
- unset($listid[$key]);
216
- }
217
-
218
- // $diff = array_diff( $desired_lists, $listid );
219
- // if ( ! empty( $diff ) ) {
220
- // $status = 'update';
221
- // if ( 'double-optin' != $type ) {
222
- // $listid = array_unique( array_merge( $listid, $list_id ) );
223
- // }
224
- // if ( ( 'double-optin' == $type && ! $isDopted) ) {
225
- // array_push( $listid, $temp_dopt_list );
226
- // }
227
- // } else {
228
- if ( '1' == $res['emailBlacklisted'] ) {
229
- $status = 'update';
230
- } else {
231
- $status = 'already_exist';
232
- }
233
- // }
234
-
235
- $ret = array(
236
- 'code' => $status,
237
- 'isDopted' => $isDopted,
238
- 'listid' => $listid,
239
- );
240
- return $ret;
241
- }
242
-
243
- /**
244
- * Get Attributes.
245
- *
246
- * @return void
247
- */
248
- public function get_attributes() {
249
-
250
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', false );
251
-
252
- $api_key = isset( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) ? esc_attr( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) : '';
253
- // get attributes.
254
- $attrs = get_transient( 'sib_attributes_' . md5( $api_key ) );
255
-
256
- if ( false === $attrs || false == $attrs ) {
257
- $mailin = new Blossom_Sendinblue_API_Client();
258
- $response = $mailin->getAttributes();
259
- $attributes = $response['attributes'];
260
- $attrs = array(
261
- 'attributes' => array(
262
- 'normal_attributes' => array(),
263
- 'category_attributes' => array(),
264
- )
265
- );
266
-
267
- if ( count( $attributes ) > 0 ) {
268
- foreach ($attributes as $key => $value) {
269
- if ($value["category"] == "normal") {
270
- $attrs['attributes']['normal_attributes'][] = $value;
271
- }
272
- elseif ($value["category"] == "category") {
273
- $value["type"] = "category";
274
- $attrs['attributes']['category_attributes'][] = $value;
275
- }
276
-
277
- }
278
- }
279
-
280
- set_transient( 'sib_attributes_' . md5( $api_key ), $attrs, 4 * HOUR_IN_SECONDS );
281
- }
282
-
283
- return $attrs;
284
-
285
- }
286
-
287
- }
288
- new Blossomthemes_Email_Newsletter_Sendinblue;
1
+ <?php
2
+ /**
3
+ * Sendinblue Handler.
4
+ */
5
+ class Blossomthemes_Email_Newsletter_Sendinblue {
6
+
7
+ /**
8
+ * Get Seninblue lists.
9
+ *
10
+ * @return void
11
+ */
12
+ public function get_lists() {
13
+ $lists = array();
14
+
15
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', false );
16
+
17
+ if ( ! $blossomthemes_email_newsletter_settings ) {
18
+ return $lists;
19
+ }
20
+
21
+ $api_key = isset( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) ? esc_attr( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) : '';
22
+ // get lists.
23
+ $lists = get_transient( 'bten_sib_list_' . md5( $api_key ) );
24
+ if ( false === $lists || false == $lists ) {
25
+
26
+ $mailin = new Blossom_Sendinblue_API_Client();
27
+ $lists = array();
28
+ $list_data = $mailin->getAllLists();
29
+
30
+ if (!empty($list_data['lists'])) {
31
+ foreach ( $list_data['lists'] as $value ) {
32
+ if ( 'Temp - DOUBLE OPTIN' == $value['name'] ) {
33
+ $tempList = $value['id'];
34
+ update_option( 'bten_sib_temp_list', $tempList );
35
+ continue;
36
+ }
37
+ $lists[] = array(
38
+ 'id' => $value['id'],
39
+ 'name' => $value['name'],
40
+ );
41
+ }
42
+ }
43
+ }
44
+ if ( count( $lists ) > 0 ) {
45
+ set_transient( 'bten_sib_list_' . md5( $api_key ), $lists, 4 * HOUR_IN_SECONDS );
46
+ }
47
+ return $lists;
48
+ }
49
+
50
+ /**
51
+ * Action for form submissions.
52
+ *
53
+ * @return void
54
+ */
55
+ public function action_form_submission( $email, $sid, $fname ) {
56
+
57
+ // MailChimp API credentials
58
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
59
+
60
+ $listids = get_post_meta( $sid, 'blossomthemes_email_newsletter_setting', true );
61
+
62
+ if( ! isset( $listids['sendinblue']['list-id'] ) ) {
63
+ $listids = $blossomthemes_email_newsletter_settings['sendinblue']['list-id'];
64
+ $result = $this->create_subscriber( $email, $listids, $info = array( 'name' => $fname ), 'simple', $unlinkedLists = array() );
65
+ }else {
66
+ // foreach ( $listids['sendinblue']['list-id'] as $key => $value ) {
67
+ $result = $this->create_subscriber( $email, $listids['sendinblue']['list-id'], $info = array( 'name' => $fname ), 'simple', $unlinkedLists = array() );
68
+ // }
69
+ }
70
+
71
+ return $result;
72
+ }
73
+
74
+ /**
75
+ * Signup process
76
+ *
77
+ * @param string $type - simple, confirm, double-optin / subscribe.
78
+ * @param $email - subscriber email.
79
+ * @param $list_id - desired list ids.
80
+ * @param $info - user's attributes.
81
+ * @param null $list_unlink - remove temp list.
82
+ * @return string
83
+ */
84
+ public function create_subscriber( $email, $list_id, $info, $type = 'simple', $list_unlink = null ) {
85
+ $mailin = new Blossom_Sendinblue_API_Client();
86
+ $user = $mailin->getUser($email);
87
+
88
+ $response = $this->validation_email( $user, $email, $list_id, $type );
89
+ $exist = '';
90
+
91
+ if ( 'already_exist' == $response['code'] ) {
92
+ $exist = 'already_exist';
93
+ }
94
+
95
+ if ( 'subscribe' == $type ) {
96
+ $info['DOUBLE_OPT-IN'] = '1'; // Yes.
97
+ } else {
98
+ if ( 'double-optin' == $type ) {
99
+ if ( ( 'new' == $response['code'] && ! $response['isDopted']) || ( 'update' == $response['code'] && ! $response['isDopted']) ) {
100
+ $info['DOUBLE_OPT-IN'] = '2'; // No.
101
+ }
102
+ }
103
+ }
104
+
105
+ $listid = $response['listid'];
106
+ if ( $list_unlink != null ) {
107
+ $listid = array_diff( $listid, $list_unlink );
108
+ }
109
+
110
+ $attributes = $this->get_attributes();
111
+ if( !empty($attributes["attributes"]["normal_attributes"]) ) {
112
+ foreach ( $attributes["attributes"]["normal_attributes"] as $key => $value ) {
113
+ if( "boolean" == $value["type"] && array_key_exists($value["name"], $info) )
114
+ if( in_array($info[ $value["name"] ], array("true","True","TRUE",1)) ) {
115
+ $info[ $value["name"] ] = true;
116
+ }
117
+ else {
118
+ $info[ $value["name"] ] = false;
119
+ }
120
+ }
121
+ }
122
+
123
+ $info = array(
124
+ 'email' => $email,
125
+ 'FIRSTNAME' => $info['name'],
126
+ );
127
+
128
+ if ($mailin->getLastResponseCode() === Blossom_Sendinblue_API_Client::RESPONSE_CODE_OK && isset($user['email'])) {
129
+ unset($info["email"]);
130
+ if (isset($info["internalUserHistory"]) && is_array($info["internalUserHistory"])) {
131
+ $info["internalUserHistory"][] = array("action"=>"SUBSCRIBE_BY_PLUGIN", "id"=> 1, "name"=>"Blossomthemes Email Newsletter");
132
+ } else {
133
+ $info["internalUserHistory"] = array(array("action"=>"SUBSCRIBE_BY_PLUGIN", "id"=> 1, "name"=>"Blossomthemes Email Newsletter"));
134
+ }
135
+ $data = [
136
+ 'email' => $email,
137
+ 'attributes' => $info,
138
+ 'emailBlacklisted' => false,
139
+ 'smsBlacklisted' => false,
140
+ 'listIds' => $listid,
141
+ 'unlinkListIds' => $list_unlink
142
+ ];
143
+ $mailin->updateUser($email ,$data );
144
+ $exist = $mailin->getLastResponseCode() == 204 ? 'success' : '' ;
145
+ } else {
146
+ $info["internalUserHistory"] = array(array("action"=>"SUBSCRIBE_BY_PLUGIN", "id"=> 1, "name"=>"Blossomthemes Email Newsletter"));
147
+ $data = [
148
+ 'email' => $email,
149
+ 'attributes' => $info,
150
+ 'emailBlacklisted' => false,
151
+ 'smsBlacklisted' => false,
152
+ 'listIds' => $listid
153
+ ];
154
+
155
+ $created_user = $mailin->createUser( $data );
156
+ }
157
+
158
+ if ('' != $exist) {
159
+ $response['code'] = $exist;
160
+ } else if(isset($created_user['id'])) {
161
+ $response['code'] = "success";
162
+ }
163
+
164
+ return $response['code'];
165
+ }
166
+
167
+ /**
168
+ * Validation the email if it exist in contact list
169
+ *
170
+ * @param $res
171
+ * @param string $type - form type.
172
+ * @param string $email - email.
173
+ * @param array $list_id - list ids.
174
+ * @return array
175
+ */
176
+ static function validation_email( $res, $email, $list_id, $type = 'simple' ) {
177
+
178
+ $isDopted = false;
179
+
180
+ $temp_dopt_list = get_option( 'bten_sib_temp_list' );
181
+ $desired_lists = $list_id;
182
+
183
+ if ( 'double-optin' == $type ) {
184
+ $list_id = array( $temp_dopt_list );
185
+ }
186
+
187
+ // new user.
188
+ if ( isset($res['code']) && $res['code'] == 'document_not_found' ) {
189
+ $ret = array(
190
+ 'code' => 'new',
191
+ 'isDopted' => $isDopted,
192
+ 'listid' => $list_id,
193
+ );
194
+ return $ret;
195
+ }
196
+
197
+ $listid = $res['listIds'];
198
+
199
+ // update user when listid is empty.
200
+ if ( ! isset( $listid ) || ! is_array( $listid ) ) {
201
+ $ret = array(
202
+ 'code' => 'update',
203
+ 'isDopted' => $isDopted,
204
+ 'listid' => $list_id,
205
+ );
206
+ return $ret;
207
+ }
208
+
209
+ $attrs = $res['attributes'];
210
+ if ( isset( $attrs['DOUBLE_OPT-IN'] ) && '1' == $attrs['DOUBLE_OPT-IN'] ) {
211
+ $isDopted = true;
212
+ }
213
+ // remove dopt temp list from $listid.
214
+ if (($key = array_search($temp_dopt_list, $listid)) !== false) {
215
+ unset($listid[$key]);
216
+ }
217
+
218
+ // $diff = array_diff( $desired_lists, $listid );
219
+ // if ( ! empty( $diff ) ) {
220
+ // $status = 'update';
221
+ // if ( 'double-optin' != $type ) {
222
+ // $listid = array_unique( array_merge( $listid, $list_id ) );
223
+ // }
224
+ // if ( ( 'double-optin' == $type && ! $isDopted) ) {
225
+ // array_push( $listid, $temp_dopt_list );
226
+ // }
227
+ // } else {
228
+ if ( '1' == $res['emailBlacklisted'] ) {
229
+ $status = 'update';
230
+ } else {
231
+ $status = 'already_exist';
232
+ }
233
+ // }
234
+
235
+ $ret = array(
236
+ 'code' => $status,
237
+ 'isDopted' => $isDopted,
238
+ 'listid' => $listid,
239
+ );
240
+ return $ret;
241
+ }
242
+
243
+ /**
244
+ * Get Attributes.
245
+ *
246
+ * @return void
247
+ */
248
+ public function get_attributes() {
249
+
250
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', false );
251
+
252
+ $api_key = isset( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) ? esc_attr( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) : '';
253
+ // get attributes.
254
+ $attrs = get_transient( 'sib_attributes_' . md5( $api_key ) );
255
+
256
+ if ( false === $attrs || false == $attrs ) {
257
+ $mailin = new Blossom_Sendinblue_API_Client();
258
+ $response = $mailin->getAttributes();
259
+ $attributes = $response['attributes'];
260
+ $attrs = array(
261
+ 'attributes' => array(
262
+ 'normal_attributes' => array(),
263
+ 'category_attributes' => array(),
264
+ )
265
+ );
266
+
267
+ if ( count( $attributes ) > 0 ) {
268
+ foreach ($attributes as $key => $value) {
269
+ if ($value["category"] == "normal") {
270
+ $attrs['attributes']['normal_attributes'][] = $value;
271
+ }
272
+ elseif ($value["category"] == "category") {
273
+ $value["type"] = "category";
274
+ $attrs['attributes']['category_attributes'][] = $value;
275
+ }
276
+
277
+ }
278
+ }
279
+
280
+ set_transient( 'sib_attributes_' . md5( $api_key ), $attrs, 4 * HOUR_IN_SECONDS );
281
+ }
282
+
283
+ return $attrs;
284
+
285
+ }
286
+
287
+ }
288
+ new Blossomthemes_Email_Newsletter_Sendinblue;
includes/class-blossomthemes-email-newsletter-settings.php CHANGED
@@ -1,654 +1,668 @@
1
- <?php
2
- /**
3
- * Settings section of the plugin.
4
- *
5
- * Maintain a list of functions that are used for settings purposes of the plugin
6
- *
7
- * @package BlossomThemes Email Newsletters
8
- * @subpackage BlossomThemes_Email_Newsletters/includes
9
- * @author blossomthemes
10
- */
11
-
12
- class BlossomThemes_Email_Newsletter_Settings {
13
-
14
- function __construct()
15
- {
16
- add_action( 'wp_ajax_bten_get_platform', array( $this, 'bten_get_platform' ) );
17
- }
18
-
19
- function bten_get_platform(){
20
- if ($_POST['calling_action'] == 'bten_platform_settings')
21
- {
22
- echo $this->bten_platform_settings($_POST['platform']);
23
- exit;
24
- }
25
- }
26
-
27
- function mailerlite_lists($api_key='')
28
- {
29
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
30
-
31
- if( empty($api_key) && isset( $blossomthemes_email_newsletter_settings['mailerlite']['api-key'] ) && $blossomthemes_email_newsletter_settings['mailerlite']['api-key'] !='' )
32
- {
33
- $api_key = $blossomthemes_email_newsletter_settings['mailerlite']['api-key'];
34
- }
35
-
36
- $key = preg_replace('/[^a-z0-9]/i', '', $api_key);
37
- $ML_Lists = new ML_Lists($key);
38
- $lists = $ML_Lists->getAll();
39
- $data = json_decode($lists, TRUE);
40
- return $data;
41
-
42
- }
43
-
44
- function mailchimp_lists($api_key='')
45
- {
46
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
47
-
48
- if( empty($api_key ) && isset( $blossomthemes_email_newsletter_settings['mailchimp']['api-key'] ) && $blossomthemes_email_newsletter_settings['mailchimp']['api-key'] !='' )
49
- {
50
- $api_key = $blossomthemes_email_newsletter_settings['mailchimp']['api-key'];
51
- }
52
-
53
- $MC_Lists = new MC_Lists($api_key);
54
- $lists = $MC_Lists->getAll();
55
- $data = json_decode($lists, TRUE);
56
- return $data;
57
-
58
- }
59
-
60
- /**
61
- * Get Sendinblue lists.
62
- *
63
- * @return void
64
- */
65
- function sendinblue_lists() {
66
- $lists = array();
67
-
68
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', false );
69
-
70
- if ( ! $blossomthemes_email_newsletter_settings ) {
71
- return $lists;
72
- }
73
-
74
- $api_key = isset( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) ? esc_attr( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) : '';
75
-
76
- if ( ! $api_key ) {
77
- return $lists;
78
- }
79
- // get lists.
80
- $lists = get_transient( 'bten_sib_list_' . md5( $api_key ) );
81
- if ( false === $lists || false == $lists ) {
82
-
83
- $mailin = new Blossom_Sendinblue_API_Client();
84
- $lists = array();
85
- $list_data = $mailin->getAllLists();
86
-
87
- if (!empty($list_data['lists'])) {
88
- foreach ( $list_data['lists'] as $value ) {
89
- if ( 'Temp - DOUBLE OPTIN' == $value['name'] ) {
90
- $tempList = $value['id'];
91
- update_option( 'bten_sib_temp_list', $tempList );
92
- continue;
93
- }
94
- $lists[] = array(
95
- 'id' => $value['id'],
96
- 'name' => $value['name'],
97
- );
98
- }
99
- }
100
- }
101
- if ( count( $lists ) > 0 ) {
102
- set_transient( 'bten_sib_list_' . md5( $api_key ), $lists, 4 * HOUR_IN_SECONDS );
103
- }
104
- return $lists;
105
- }
106
-
107
- function convertkit_lists($apikey = '')
108
- {
109
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
110
- $list = array();
111
- if( empty($apikey ) && isset( $blossomthemes_email_newsletter_settings['convertkit']['api-key'] ) && $blossomthemes_email_newsletter_settings['convertkit']['api-key'] !='' )
112
- {
113
- $apikey = $blossomthemes_email_newsletter_settings['convertkit']['api-key'];
114
- }
115
-
116
- $api = new Convertkit($apikey);
117
-
118
- try {
119
- $result = $api->getForms();
120
-
121
- if (isset($result->forms)) {
122
- foreach ($result->forms as $l) {
123
- $list[$l->id] = array('name' => $l->name);
124
- }
125
- }
126
- }
127
- catch (Exception $e) {
128
- echo $e->getMessage();
129
- }
130
-
131
- return $list;
132
- }
133
-
134
- /**
135
- * Get Response API
136
- *
137
- */
138
- function getresponse_lists($api_key = '')
139
- {
140
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
141
- $list = array();
142
-
143
- if( empty($api_key ) && isset( $blossomthemes_email_newsletter_settings['getresponse']['api-key'] ) && $blossomthemes_email_newsletter_settings['getresponse']['api-key'] !='' )
144
- {
145
- $api_key = $blossomthemes_email_newsletter_settings['getresponse']['api-key']; //Place API key here
146
- }
147
-
148
- if(!empty($api_key)) {
149
- $getres = new Blossomthemes_Email_Newsletter_GetResponse();
150
- $list = $getres->getresponse_lists($api_key);
151
- }
152
- return $list;
153
- }
154
-
155
- /**
156
- * ActiveCampaign API
157
- *
158
- */
159
- function activecampaign_lists($api_key = '', $url = '')
160
- {
161
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
162
- $list = array();
163
- if( empty($api_key) && empty($url) && isset($blossomthemes_email_newsletter_settings['activecampaign']['api-url']) && $blossomthemes_email_newsletter_settings['activecampaign']['api-url']!='' && isset($blossomthemes_email_newsletter_settings['activecampaign']['api-key']) && $blossomthemes_email_newsletter_settings['activecampaign']['api-key']!='' )
164
- {
165
- $api_key = $blossomthemes_email_newsletter_settings['activecampaign']['api-key']; //Place API key here
166
- $url = $blossomthemes_email_newsletter_settings['activecampaign']['api-url'];
167
- }
168
-
169
- if(!empty($api_key) && !empty($url)){
170
-
171
- $ac = new ActiveCampaign($url, $api_key);
172
- try
173
- {
174
- $response = $ac->api( "list/list", array('ids' => 'all') );
175
- // print_r($response);
176
- if (is_object($response) && !empty($response) && $response->success==1) {
177
- foreach ($response as $v) {
178
- if(is_object($v)) {
179
- $list[$v->id] = array('name' => $v->name);
180
- }
181
- }
182
- }
183
- elseif( is_object($response) && !empty($response) && $response->success==0 ){
184
- echo $response->result_message;
185
- }
186
- else{
187
- echo $response;
188
- }
189
-
190
- } catch (Exception $e){
191
- echo $e->getMessage();
192
- }
193
-
194
- }
195
- return $list;
196
- }
197
-
198
- function get_status($url)
199
- {
200
- // must set $url first.
201
- $ch = curl_init();
202
- curl_setopt($ch, CURLOPT_URL, $url);
203
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
204
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
205
- // do your curl thing here
206
- $data = curl_exec($ch);
207
- $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
208
- curl_close($ch);
209
- return $http_status;
210
- }
211
-
212
- function blossomthemes_email_newsletter_settings_tabs() {
213
-
214
- $tabs = array(
215
- 'general' => 'general.php',
216
- 'popup' => 'popup.php',
217
- );
218
- $tabs = apply_filters( 'blossomthemes_email_newsletter_settings_tabs', $tabs );
219
- return $tabs;
220
- }
221
-
222
- function blossomthemes_email_newsletter_backend_settings()
223
- { ?>
224
- <div class="wrap">
225
- <div class="btnb-header">
226
- <h3><?php _e('Settings','blossomthemes-email-newsletter');?></h3>
227
- </div>
228
- <?php
229
- if( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] ==true )
230
- { ?>
231
- <div id="setting-error-settings_updated" class="updated settings-error notice is-dismissible">
232
- <p><strong><?php _e('Settings updated.','blossomthemes-email-newsletter');?></strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php _e('Dismiss this notice.','blossomthemes-email-newsletter');?></span></button>
233
- </div>
234
- <?php
235
- }
236
- ?>
237
- <div id="tabs-container">
238
- <ul class="tabs-menu">
239
- <?php
240
- $settings_tab = $this->blossomthemes_email_newsletter_settings_tabs();
241
- $count = 0;
242
- foreach ($settings_tab as $key => $value) {
243
- $tab_label = preg_replace('/_/', ' ', $key);
244
- ?>
245
- <li <?php if($count==0){ ?>class="current"<?php } ?>><a href="<?php echo $key;?>"><?php echo $tab_label;?></a></li>
246
- <?php $count++;
247
- } ?>
248
- </ul>
249
- <div class="tab">
250
- <form method="POST" name="form1" action="options.php" id="form1" class="btemn-settings-form">
251
- <?php
252
- settings_fields( 'blossomthemes_email_newsletter_settings' );
253
- do_settings_sections( __FILE__ );
254
-
255
- $counter = 0;
256
- foreach ($settings_tab as $key => $value) { ?>
257
- <div id="<?php echo $key;?>" class="tab-content" <?php if($counter==0){ ?> style="display: block;" <?php } else{ ?> style="display: none;" <?php } ?>>
258
- <?php
259
- include_once BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/tabs/'.$value;
260
- ?>
261
- </div>
262
- <?php $counter++; }
263
- ?>
264
-
265
- <div class="blossomthemes_email_newsletter_settings-settings-submit">
266
- <?php echo submit_button();?>
267
- </div>
268
- </form>
269
- </div>
270
- </div>
271
- </div>
272
- <?php
273
- }
274
-
275
- function bten_platform_settings($platform='')
276
- {
277
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
278
- switch ($platform) {
279
- case 'mailchimp':
280
- ob_start();
281
- ?>
282
- <div id="mailchimp" class="newsletter-settings<?php if( $platform == 'mailchimp' || !isset($platform) ){ echo ' current'; }?>">
283
- <div class="blossomthemes-email-newsletter-wrap-field">
284
- <label for="blossomthemes_email_newsletter_settings[mailchimp][api-key]"><?php _e('API Key : ','blossomthemes-email-newsletter');?></label>
285
- <input type="text" id="bten_mailchimp_api_key" name="blossomthemes_email_newsletter_settings[mailchimp][api-key]" value="<?php echo isset($blossomthemes_email_newsletter_settings['mailchimp']['api-key']) ? esc_attr( $blossomthemes_email_newsletter_settings['mailchimp']['api-key'] ): '';?>">
286
- <?php echo '<div class="blossomthemes-email-newsletter-note">'.sprintf( __( 'Get your API key %1$shere%2$s', 'blossomthemes-email-newsletter' ), '<a href="https://us15.admin.mailchimp.com/account/api/" target="_blank">','</a>' ).'</div>';?>
287
- </div>
288
- <div class="blossomthemes-email-newsletter-wrap-field">
289
- <label for="blossomthemes_email_newsletter_settings[mailchimp][list-id]"><?php _e('List Id : ','blossomthemes-email-newsletter');?>
290
- <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose the default list. If no groups/lists are selected in the newsletter posts, users will be subscribed to the list selected above.', 'blossomthemes-email-newsletter' ); ?>"><i class="far fa-question-circle"></i>
291
- </span>
292
- </label>
293
- <?php
294
- $data = $this->mailchimp_lists();
295
- ?>
296
- <div class="select-holder">
297
- <select id="bten_mailchimp_list" name="blossomthemes_email_newsletter_settings[mailchimp][list-id]">
298
- <?php $mailchimp_list = isset($blossomthemes_email_newsletter_settings['mailchimp']['list-id']) ? $blossomthemes_email_newsletter_settings['mailchimp']['list-id'] : '';
299
- if( empty( $data['lists'] ) ){ ?>
300
- <option value="-"><?php _e('No Lists Found','blossomthemes-email-newsletter');?></option>
301
- <?php } else{
302
- $max = max(array_keys($data['lists']));
303
- for ($i=0; $i <= $max; $i++) { ?>
304
- <option <?php selected( $mailchimp_list, esc_attr($data['lists'][$i]['id'] ) );?> value="<?php echo esc_attr($data['lists'][$i]['id']);?>"><?php echo esc_attr($data['lists'][$i]['name']);?></option>
305
-
306
- <?php }} ?>
307
- </select>
308
- </div>
309
- <input type="button" rel-id="bten_mailchimp_list" class="button bten_get_mailchimp_lists" name="" value="Grab Lists">
310
-
311
- </div>
312
- <div class="blossomthemes-email-newsletter-wrap-field">
313
- <input type="checkbox" class="enable_notif_opt" name="blossomthemes_email_newsletter_settings[mailchimp][enable_notif]" <?php $j = isset( $blossomthemes_email_newsletter_settings['mailchimp']['enable_notif'] ) ? esc_attr( $blossomthemes_email_newsletter_settings['mailchimp']['enable_notif'] ): '0';?> id="blossomthemes_email_newsletter_settings[mailchimp][enable_notif]" value="<?php echo esc_attr($j);?>" <?php if($j=='1'){ echo "checked";}?>/>
314
-
315
- <label for="blossomthemes_email_newsletter_settings[mailchimp][enable_notif]"><?php _e('Confirmation','blossomthemes-email-newsletter');?>
316
- <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Check this box if you want subscribers to receive confirmation mail before they are added to list.', 'blossomthemes-email-newsletter' ); ?>">
317
- <i class="far fa-question-circle"></i>
318
- </span>
319
- </label>
320
- </div>
321
- </div>
322
- <?php
323
- $output = ob_get_contents();
324
- ob_end_clean();
325
- return $output;
326
- break;
327
-
328
- case 'mailerlite':
329
- ob_start();
330
- ?>
331
- <div id="mailerlite" class="newsletter-settings<?php if($platform == 'mailerlite'){ echo ' current'; }?>">
332
- <div class="blossomthemes-email-newsletter-wrap-field">
333
- <label for="blossomthemes_email_newsletter_settings[mailerlite][api-key]"><?php _e('API Key : ','blossomthemes-email-newsletter');?></label>
334
- <input type="text" id="bten_mailerlite_api_key" name="blossomthemes_email_newsletter_settings[mailerlite][api-key]" value="<?php echo isset($blossomthemes_email_newsletter_settings['mailerlite']['api-key']) ? esc_attr( $blossomthemes_email_newsletter_settings['mailerlite']['api-key'] ): '';?>">
335
- <?php echo '<div class="blossomthemes-email-newsletter-note">'.sprintf( __( 'Get your api key %1$shere%2$s', 'blossomthemes-email-newsletter' ), '<a href="https://app.mailerlite.com/subscribe/api" target="_blank">','</a>' ).'</div>';?>
336
- </div>
337
- <div class="blossomthemes-email-newsletter-wrap-field">
338
- <label for="blossomthemes_email_newsletter_settings[mailerlite][list-id]"><?php _e('List Id : ','blossomthemes-email-newsletter');?>
339
- <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose the default list. If no groups/lists are selected in the newsletter posts, users will be subscribed to the list selected above.', 'blossomthemes-email-newsletter' ); ?>"><i class="far fa-question-circle"></i>
340
- </span>
341
- </label>
342
- <?php
343
- $data = $this->mailerlite_lists();
344
- ?>
345
- <div class="select-holder">
346
- <select id="bten_mailerlite_list" name="blossomthemes_email_newsletter_settings[mailerlite][list-id]">
347
- <?php $mailerlite_list = isset($blossomthemes_email_newsletter_settings['mailerlite']['list-id']) ? $blossomthemes_email_newsletter_settings['mailerlite']['list-id']: '';
348
- if( empty($data['Results']) ){ ?>
349
- <option value="-"><?php _e('No Lists Found','blossomthemes-email-newsletter');?></option>
350
- <?php } else{
351
- $max = max(array_keys($data['Results']));
352
- for ($i=0; $i <= $max; $i++) { ?>
353
- <option <?php selected( $mailerlite_list, esc_attr($data['Results'][$i]['id'] ) );?> value="<?php echo esc_attr($data['Results'][$i]['id']);?>"><?php echo esc_attr($data['Results'][$i]['name']);?></option>
354
-
355
- <?php }} ?>
356
- </select>
357
- </div>
358
- <input type="button" rel-id="bten_mailerlite_list" class="button bten_get_mailerlite_lists" name="" value="Grab Lists">
359
- </div>
360
- </div>
361
- <?php
362
- $output = ob_get_contents();
363
- ob_end_clean();
364
- return $output;
365
- break;
366
-
367
- case 'convertkit':
368
- ob_start();
369
- ?>
370
- <div id="convertkit" class="newsletter-settings<?php if($platform == 'convertkit'){ echo ' current'; }?>">
371
- <div class="blossomthemes-email-newsletter-wrap-field">
372
- <label for="blossomthemes_email_newsletter_settings[convertkit][api-key]"><?php _e('API Key : ','blossomthemes-email-newsletter');?></label>
373
- <input type="text" id="bten_convertkit_api_key" name="blossomthemes_email_newsletter_settings[convertkit][api-key]" value="<?php echo isset($blossomthemes_email_newsletter_settings['convertkit']['api-key']) ? esc_attr( $blossomthemes_email_newsletter_settings['convertkit']['api-key'] ): '';?>">
374
- </div>
375
- <div class="blossomthemes-email-newsletter-wrap-field">
376
- <label for="blossomthemes_email_newsletter_settings[convertkit][api-secret]"><?php _e('API Secret : ','blossomthemes-email-newsletter');?></label>
377
- <input type="text" id="bten_convertkit_api_secret" name="blossomthemes_email_newsletter_settings[convertkit][api-secret]" value="<?php echo isset($blossomthemes_email_newsletter_settings['convertkit']['api-secret']) ? esc_attr( $blossomthemes_email_newsletter_settings['convertkit']['api-secret'] ): '';?>">
378
- </div>
379
- <div class="blossomthemes-email-newsletter-wrap-field">
380
- <label for="blossomthemes_email_newsletter_settings[convertkit][list-id]"><?php _e('List Id : ','blossomthemes-email-newsletter');?>
381
- <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose the default list. If no groups/lists are selected in the newsletter posts, users will be subscribed to the list selected above.', 'blossomthemes-email-newsletter' ); ?>"><i class="far fa-question-circle"></i>
382
- </span>
383
- </label>
384
- <?php
385
- $data = $this->convertkit_lists();
386
- ?>
387
- <div class="select-holder">
388
- <select id="bten_convertkit_list" name="blossomthemes_email_newsletter_settings[convertkit][list-id]">
389
- <?php $convertkit_list = isset( $blossomthemes_email_newsletter_settings['convertkit']['list-id'] ) ? $blossomthemes_email_newsletter_settings['convertkit']['list-id'] : '';
390
- if( sizeof($data) < 1 ){ ?>
391
- <option value="-"><?php _e('No Lists Found','blossomthemes-email-newsletter');?></option>
392
- <?php } else{
393
- foreach ($data as $key => $value) {
394
- ?>
395
- <option <?php selected( $convertkit_list, esc_attr($key) );?> value="<?php echo esc_attr($key);?>"><?php echo esc_attr($value['name']);?></option>
396
- <?php }} ?>
397
- </select>
398
- </div>
399
- <input type="button" rel-id="bten_convertkit_list" class="button bten_get_convertkit_lists" name="" value="Grab Lists">
400
- </div>
401
- </div>
402
- <?php
403
- $output = ob_get_contents();
404
- ob_end_clean();
405
- return $output;
406
- break;
407
-
408
- case 'getresponse':
409
- ob_start();
410
- ?>
411
- <div id="getresponse" class="newsletter-settings<?php if($platform == 'getresponse'){ echo ' current'; }?>">
412
- <div class="blossomthemes-email-newsletter-wrap-field">
413
- <label for="blossomthemes_email_newsletter_settings[getresponse][api-key]"><?php _e('API Key : ','blossomthemes-email-newsletter');?></label>
414
- <input type="text" id="bten_getresponse_api_key" name="blossomthemes_email_newsletter_settings[getresponse][api-key]" value="<?php echo isset($blossomthemes_email_newsletter_settings['getresponse']['api-key']) ? esc_attr( $blossomthemes_email_newsletter_settings['getresponse']['api-key'] ): '';?>">
415
- </div>
416
- <div class="blossomthemes-email-newsletter-wrap-field">
417
- <label for="blossomthemes_email_newsletter_settings[getresponse][list-id]"><?php _e('List Id : ','blossomthemes-email-newsletter');?>
418
- <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose the default list. If no groups/lists are selected in the newsletter posts, users will be subscribed to the list selected above.', 'blossomthemes-email-newsletter' ); ?>"><i class="far fa-question-circle"></i>
419
- </span>
420
- </label>
421
- <?php
422
- $data = $this->getresponse_lists();
423
- ?>
424
- <div class="select-holder">
425
- <select id="bten_getresponse_list" name="blossomthemes_email_newsletter_settings[getresponse][list-id]">
426
- <?php
427
- $getresponse_list = isset($blossomthemes_email_newsletter_settings['getresponse']['list-id']) ? $blossomthemes_email_newsletter_settings['getresponse']['list-id'] : '';
428
- if( empty($data) ){ ?>
429
- <option value="-"><?php _e('No Lists Found','blossomthemes-email-newsletter');?></option>
430
- <?php } else{ ?>
431
- <option value=""><?php _e('Choose Campaign ID','blossomthemes-email-newsletter');?></option>
432
- <?php
433
- foreach ($data as $key => $value) {
434
- ?>
435
- <option <?php selected( $getresponse_list, esc_attr($key) );?> value="<?php echo esc_attr($key);?>"><?php echo esc_attr($value['name']);?></option>
436
- <?php }} ?>
437
- </select></div>
438
- <input type="button" rel-id="bten_getresponse_list" class="button bten_get_getresponse_lists" name="" value="Grab Lists">
439
- </div>
440
- </div>
441
- <?php
442
- $output = ob_get_contents();
443
- ob_end_clean();
444
- return $output;
445
- break;
446
-
447
- case 'activecampaign':
448
- ob_start();
449
- ?>
450
- <div id="activecampaign" class="newsletter-settings<?php if($platform == 'activecampaign'){ echo ' current'; }?>">
451
- <div class="blossomthemes-email-newsletter-wrap-field">
452
- <label for="blossomthemes_email_newsletter_settings[activecampaign][api-url]"><?php _e('API Url : ','blossomthemes-email-newsletter');?></label>
453
- <input type="text" id="bten_activecampaign_api_url" name="blossomthemes_email_newsletter_settings[activecampaign][api-url]" value="<?php echo isset($blossomthemes_email_newsletter_settings['activecampaign']['api-url']) ? esc_attr( $blossomthemes_email_newsletter_settings['activecampaign']['api-url'] ): '';?>">
454
- </div>
455
- <div class="blossomthemes-email-newsletter-wrap-field">
456
- <label for="blossomthemes_email_newsletter_settings[activecampaign][api-key]"><?php _e('API Key : ','blossomthemes-email-newsletter');?></label>
457
- <input type="text" id="bten_activecampaign_api_key" name="blossomthemes_email_newsletter_settings[activecampaign][api-key]" value="<?php echo isset($blossomthemes_email_newsletter_settings['activecampaign']['api-key']) ? esc_attr( $blossomthemes_email_newsletter_settings['activecampaign']['api-key'] ): '';?>">
458
- </div>
459
- <div class="blossomthemes-email-newsletter-wrap-field">
460
- <label for="blossomthemes_email_newsletter_settings[activecampaign][list-id]"><?php _e('List Id : ','blossomthemes-email-newsletter');?>
461
- <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose the default list. If no groups/lists are selected in the newsletter posts, users will be subscribed to the list selected above.', 'blossomthemes-email-newsletter' ); ?>"><i class="far fa-question-circle"></i>
462
- </span>
463
- </label>
464
- <?php
465
- $data = $this->activecampaign_lists();
466
- // print_r($data);
467
- ?>
468
- <div class="select-holder">
469
- <select id="bten_activecampaign_list" name="blossomthemes_email_newsletter_settings[activecampaign][list-id]">
470
- <?php
471
- $activecampaign_list = isset( $blossomthemes_email_newsletter_settings['activecampaign']['list-id'] ) ? $blossomthemes_email_newsletter_settings['activecampaign']['list-id'] : '';
472
- if( sizeof($data) < 1 ){ ?>
473
- <option value="-"><?php _e('No Lists Found','blossomthemes-email-newsletter');?></option>
474
- <?php } else{ ?>
475
- <option value=""><?php _e('Choose Campaign ID','blossomthemes-email-newsletter');?></option>
476
- <?php
477
- foreach ($data as $key => $value) {
478
- ?>
479
- <option <?php selected( $activecampaign_list, esc_attr($key) );?> value="<?php echo esc_attr($key);?>"><?php echo esc_attr($value['name']);?></option>
480
- <?php }} ?>
481
- </select>
482
- </div>
483
- <input type="button" rel-id="bten_activecampaign_list" class="button bten_get_activecampaign_lists" name="" value="Grab Lists">
484
- </div>
485
- </div>
486
- <?php
487
- $output = ob_get_contents();
488
- ob_end_clean();
489
- return $output;
490
- break;
491
-
492
- case 'aweber':
493
- ob_start();
494
- ?>
495
- <div id="aweber" class="newsletter-settings<?php if($platform == 'aweber'){ echo ' current'; }?>">
496
-
497
- <?php
498
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
499
- $bten_aw_auth_info = get_option('bten_aw_auth_info');
500
-
501
- $appId = '9c213c43'; //Place APP ID here
502
- $url = "https://auth.aweber.com/1.0/oauth/authorize_app/".$appId;
503
- $status = $this->get_status($url);
504
-
505
- if($status!=200)
506
- {
507
- echo '<div class="blossomthemes-email-newsletter-note">' . __( 'The APP ID does not seem to exist. Please enter a valid AWeber APP ID to connect to the mailing lists.', 'blossomthemes-email-newsletter' ).'</div>';
508
- }
509
- else
510
- {
511
- echo '<div id="bten_aweber_connect_div"'.($bten_aw_auth_info ? 'style="display:none;"': '').'>';
512
- echo '<label>' .__('AWeber Connection : ','blossomthemes-email-newsletter'). '</label> ';
513
- echo '<b>Step 1:</b> <a href="https://auth.aweber.com/1.0/oauth/authorize_app/'.$appId.'" target="_blank">Click here to get your authorization code.</a><br />';
514
- echo '<b>Step 2:</b> Paste in your authorization code:<br />';
515
- echo '<textarea id="bten_aweber_auth_code" rows="3"></textarea><br />';
516
- echo '<input type="button" class="button-primary bten_aweber_auth" name="" value="Connect" />';
517
- echo '</div>';
518
-
519
- echo '<div id="bten_aweber_disconnect_div"'.($bten_aw_auth_info ? '': ' style="display:none;"').'>';
520
- echo '<label>' .__('AWeber Connection : ','blossomthemes-email-newsletter'). '</label> ';
521
- echo '<input type="button" class="button-primary bten_aweber_remove_auth" name="" value="Remove Connection" />';
522
- echo '</div>';
523
- ?>
524
- <div class="blossomthemes-email-newsletter-wrap-field">
525
- <label for="blossomthemes_email_newsletter_settings[aweber][list-id]"><?php _e('List Id : ','blossomthemes-email-newsletter');?>
526
- <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose the default list. If no groups/lists are selected in the newsletter posts, users will be subscribed to the list selected above.', 'blossomthemes-email-newsletter' ); ?>">
527
- <i class="far fa-question-circle"></i>
528
- </span>
529
- </label>
530
- <div class="select-holder">
531
- <select id="bten_aweber_list" name="blossomthemes_email_newsletter_settings[aweber][list-id]">
532
- <?php
533
- $aw = new Blossomthemes_Email_Newsletter_AWeber;
534
- $aweber_list = isset($blossomthemes_email_newsletter_settings['aweber']['list-id']) ? $blossomthemes_email_newsletter_settings['aweber']['list-id'] : '';
535
- $data = $aw->bten_get_aw_lists();
536
- if( sizeof($data) < 1 ){ ?>
537
- <option value="-"><?php _e('No Lists Found','blossomthemes-email-newsletter');?></option>
538
- <?php } else{ ?>
539
- <option value=""><?php _e('Choose Campaign ID','blossomthemes-email-newsletter');?></option>
540
- <?php
541
- foreach ($data as $key => $value) {
542
- ?>
543
- <option <?php selected( $aweber_list, esc_attr($key) );?> value="<?php echo esc_attr($key);?>"><?php echo esc_attr($value['name']);?></option>
544
- <?php }} ?>
545
- </select>
546
- </div>
547
- <input type="button" rel-id="bten_aweber_list" class="button bten_get_aweber_lists" name="" value="Grab Lists">
548
- </div>
549
- <?php
550
- }
551
-
552
- ?>
553
- </div>
554
- <?php
555
- $output = ob_get_contents();
556
- ob_end_clean();
557
- return $output;
558
- break;
559
-
560
- case 'sendinblue' :
561
- ob_start();
562
- ?>
563
- <div id="sendinblue-settings" class="newsletter-settings <?php echo 'sendinblue' === $platform ? esc_attr( 'current' ) : ''; ?>">
564
- <div class="blossomthemes-email-newsletter-wrap-field">
565
- <label for="blossomthemes_email_newsletter_settings[sendinblue][api-key]"><?php _e('API Key : ','blossomthemes-email-newsletter');?></label>
566
- <input type="text" id="bten_sendinblue_api_key" name="blossomthemes_email_newsletter_settings[sendinblue][api-key]" value="<?php echo isset($blossomthemes_email_newsletter_settings['sendinblue']['api-key']) ? esc_attr( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ): '';?>">
567
- <?php echo '<div class="blossomthemes-email-newsletter-note">'.sprintf( __( 'Get your API key %1$shere%2$s', 'blossomthemes-email-newsletter' ), '<a href="https://my.sendinblue.com/advanced/apikey/" target="_blank">','</a>' ).'</div>';?>
568
- </div>
569
- <div class="blossomthemes-email-newsletter-wrap-field">
570
- <label for="blossomthemes_email_newsletter_settings[sendinblue][list-id]"><?php _e('List Id : ','blossomthemes-email-newsletter');?>
571
- <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose the default list. If no groups/lists are selected in the newsletter posts, users will be subscribed to the list selected above.', 'blossomthemes-email-newsletter' ); ?>">
572
- <i class="far fa-question-circle"></i>
573
- </span>
574
- </label>
575
- <?php
576
- $data = $this->sendinblue_lists();
577
- ?>
578
- <div class="select-holder">
579
- <select id="bten_sendinblue_list" name="blossomthemes_email_newsletter_settings[sendinblue][list-id]">
580
- <?php
581
- $sendinblue_list = isset( $blossomthemes_email_newsletter_settings['sendinblue']['list-id'] ) ? $blossomthemes_email_newsletter_settings['sendinblue']['list-id'] : '' ;
582
- if ( empty( $data ) ) { ?>
583
- <option value="-">
584
- <?php _e('No Lists Found','blossomthemes-email-newsletter');?>
585
- </option>
586
- <?php
587
- } else {
588
- echo '<option>'. esc_html( 'Choose sendinblue list' ) .'</option>';
589
- foreach ( $data as $listarray => $list ) {
590
- echo '<option '. selected( $sendinblue_list, $list['id'] ) .' value="'. esc_attr( $list['id'] ) .'" >'. esc_html( $list['name'] ) .'</option>';
591
- }
592
- }
593
- ?>
594
- </select>
595
- </div>
596
- <input type="button" rel-id="bten_sendinblue_list" class="button bten_get_sendinblue_lists" name="" value="<?php esc_attr_e( 'Grab Lists', 'blossomthemes-email-newsletter' ); ?>">
597
- </div>
598
- </div>
599
- <?php
600
- $output = ob_get_clean();
601
- return $output;
602
- break;
603
-
604
- default:
605
- ob_start();
606
- ?>
607
- <div id="mailchimp" class="newsletter-settings current">
608
- <div class="blossomthemes-email-newsletter-wrap-field">
609
- <label for="blossomthemes_email_newsletter_settings[mailchimp][api-key]"><?php _e('API Key : ','blossomthemes-email-newsletter');?></label>
610
- <input type="text" id="bten_mailchimp_api_key" name="blossomthemes_email_newsletter_settings[mailchimp][api-key]" value="<?php echo isset($blossomthemes_email_newsletter_settings['mailchimp']['api-key']) ? esc_attr( $blossomthemes_email_newsletter_settings['mailchimp']['api-key'] ): '';?>">
611
- <?php echo '<div class="blossomthemes-email-newsletter-note">'.sprintf( __( 'Get your API key %1$shere%2$s', 'blossomthemes-email-newsletter' ), '<a href="https://us15.admin.mailchimp.com/account/api/" target="_blank">','</a>' ).'</div>';?>
612
- </div>
613
- <div class="blossomthemes-email-newsletter-wrap-field">
614
- <label for="blossomthemes_email_newsletter_settings[mailchimp][list-id]"><?php _e('List Id : ','blossomthemes-email-newsletter');?>
615
- <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose the default list. If no groups/lists are selected in the newsletter posts, users will be subscribed to the list selected above.', 'blossomthemes-email-newsletter' ); ?>"><i class="far fa-question-circle"></i>
616
- </span>
617
- </label>
618
- <?php
619
- $data = $this->mailchimp_lists();
620
- ?>
621
- <div class="select-holder">
622
- <select id="bten_mailchimp_list" name="blossomthemes_email_newsletter_settings[mailchimp][list-id]">
623
- <?php $mailchimp_list = isset($blossomthemes_email_newsletter_settings['mailchimp']['list-id']) ? $blossomthemes_email_newsletter_settings['mailchimp']['list-id'] : '' ;
624
- if( empty( $data['lists'] ) ){ ?>
625
- <option value="-"><?php _e('No Lists Found','blossomthemes-email-newsletter');?></option>
626
- <?php } else{
627
- $max = max(array_keys($data['lists']));
628
- for ($i=0; $i <= $max; $i++) { ?>
629
- <option <?php selected( $mailchimp_list, esc_attr($data['lists'][$i]['id'] ) );?> value="<?php echo esc_attr($data['lists'][$i]['id']);?>"><?php echo esc_attr($data['lists'][$i]['name']);?></option>
630
-
631
- <?php }} ?>
632
- </select>
633
- </div>
634
- <input type="button" rel-id="bten_mailchimp_list" class="button bten_get_mailchimp_lists" name="" value="Grab Lists">
635
- </div>
636
- <div class="blossomthemes-email-newsletter-wrap-field">
637
- <input type="checkbox" class="enable_notif_opt" name="blossomthemes_email_newsletter_settings[mailchimp][enable_notif]" <?php $j = isset( $blossomthemes_email_newsletter_settings['mailchimp']['enable_notif'] ) ? esc_attr( $blossomthemes_email_newsletter_settings['mailchimp']['enable_notif'] ): '0';?> id="blossomthemes_email_newsletter_settings[mailchimp][enable_notif]" value="<?php echo esc_attr($j);?>" <?php if($j=='1'){ echo "checked";}?>/>
638
-
639
- <label for="blossomthemes_email_newsletter_settings[mailchimp][enable_notif]"><?php _e('Confirmation','blossomthemes-email-newsletter');?>
640
- <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Check this box if you want subscribers to receive confirmation mail before they are added to list.', 'blossomthemes-email-newsletter' ); ?>">
641
- <i class="far fa-question-circle"></i>
642
- </span>
643
- </label>
644
- </div>
645
- </div>
646
- <?php
647
- $output = ob_get_contents();
648
- ob_end_clean();
649
- return $output;
650
- break;
651
- }
652
- }
653
- }
654
- new BlossomThemes_Email_Newsletter_Settings;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings section of the plugin.
4
+ *
5
+ * Maintain a list of functions that are used for settings purposes of the plugin
6
+ *
7
+ * @package BlossomThemes Email Newsletters
8
+ * @subpackage BlossomThemes_Email_Newsletters/includes
9
+ * @author blossomthemes
10
+ */
11
+
12
+ class BlossomThemes_Email_Newsletter_Settings {
13
+
14
+ function __construct()
15
+ {
16
+ add_action( 'wp_ajax_bten_get_platform', array( $this, 'bten_get_platform' ) );
17
+ }
18
+
19
+ function bten_get_platform(){
20
+ if ($_POST['calling_action'] == 'bten_platform_settings')
21
+ {
22
+ echo $this->bten_platform_settings($_POST['platform']);
23
+ exit;
24
+ }
25
+ }
26
+
27
+ function mailerlite_lists($api_key='')
28
+ {
29
+ $lists = array();
30
+
31
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
32
+
33
+ if( empty($api_key) && isset( $blossomthemes_email_newsletter_settings['mailerlite']['api-key'] ) && $blossomthemes_email_newsletter_settings['mailerlite']['api-key'] !='' )
34
+ {
35
+ $api_key = $blossomthemes_email_newsletter_settings['mailerlite']['api-key'];
36
+ }
37
+
38
+ $key = preg_replace('/[^a-z0-9]/i', '', $api_key);
39
+
40
+ $mailerliteClient = new \MailerLiteApi\MailerLite( $key );
41
+ $groupsApi = $mailerliteClient->groups();
42
+ $groups = $groupsApi->get();
43
+
44
+ if ( ! empty( $groups ) && ! isset( $groups['0']->error ) ) {
45
+ foreach ( $groups as $value ) {
46
+ $lists[] = array(
47
+ 'id' => $value->id,
48
+ 'name' => $value->name,
49
+ );
50
+ }
51
+ }
52
+ return $lists;
53
+
54
+ }
55
+
56
+ function mailchimp_lists($api_key='')
57
+ {
58
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
59
+
60
+ if( empty($api_key ) && isset( $blossomthemes_email_newsletter_settings['mailchimp']['api-key'] ) && $blossomthemes_email_newsletter_settings['mailchimp']['api-key'] !='' )
61
+ {
62
+ $api_key = $blossomthemes_email_newsletter_settings['mailchimp']['api-key'];
63
+ }
64
+
65
+ $MC_Lists = new MC_Lists($api_key);
66
+ $lists = $MC_Lists->getAll();
67
+ $data = json_decode($lists, TRUE);
68
+ return $data;
69
+
70
+ }
71
+
72
+ /**
73
+ * Get Sendinblue lists.
74
+ *
75
+ * @return void
76
+ */
77
+ function sendinblue_lists() {
78
+ $lists = array();
79
+
80
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', false );
81
+
82
+ if ( ! $blossomthemes_email_newsletter_settings ) {
83
+ return $lists;
84
+ }
85
+
86
+ $api_key = isset( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) ? esc_attr( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) : '';
87
+
88
+ if ( ! $api_key ) {
89
+ return $lists;
90
+ }
91
+ // get lists.
92
+ $lists = get_transient( 'bten_sib_list_' . md5( $api_key ) );
93
+ if ( false === $lists || false == $lists ) {
94
+
95
+ $mailin = new Blossom_Sendinblue_API_Client();
96
+ $lists = array();
97
+ $list_data = $mailin->getAllLists();
98
+
99
+ if (!empty($list_data['lists'])) {
100
+ foreach ( $list_data['lists'] as $value ) {
101
+ if ( 'Temp - DOUBLE OPTIN' == $value['name'] ) {
102
+ $tempList = $value['id'];
103
+ update_option( 'bten_sib_temp_list', $tempList );
104
+ continue;
105
+ }
106
+ $lists[] = array(
107
+ 'id' => $value['id'],
108
+ 'name' => $value['name'],
109
+ );
110
+ }
111
+ }
112
+ }
113
+ if ( count( $lists ) > 0 ) {
114
+ set_transient( 'bten_sib_list_' . md5( $api_key ), $lists, 4 * HOUR_IN_SECONDS );
115
+ }
116
+ return $lists;
117
+ }
118
+
119
+ function convertkit_lists($apikey = '')
120
+ {
121
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
122
+ $list = array();
123
+ if( empty($apikey ) && isset( $blossomthemes_email_newsletter_settings['convertkit']['api-key'] ) && $blossomthemes_email_newsletter_settings['convertkit']['api-key'] !='' )
124
+ {
125
+ $apikey = $blossomthemes_email_newsletter_settings['convertkit']['api-key'];
126
+ }
127
+
128
+ $api = new Convertkit($apikey);
129
+
130
+ try {
131
+ $result = $api->getForms();
132
+
133
+ if (isset($result->forms)) {
134
+ foreach ($result->forms as $l) {
135
+ $list[$l->id] = array('name' => $l->name);
136
+ }
137
+ }
138
+ }
139
+ catch (Exception $e) {
140
+ echo $e->getMessage();
141
+ }
142
+
143
+ return $list;
144
+ }
145
+
146
+ /**
147
+ * Get Response API
148
+ *
149
+ */
150
+ function getresponse_lists($api_key = '')
151
+ {
152
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
153
+ $list = array();
154
+
155
+ if( empty($api_key ) && isset( $blossomthemes_email_newsletter_settings['getresponse']['api-key'] ) && $blossomthemes_email_newsletter_settings['getresponse']['api-key'] !='' )
156
+ {
157
+ $api_key = $blossomthemes_email_newsletter_settings['getresponse']['api-key']; //Place API key here
158
+ }
159
+
160
+ if(!empty($api_key)) {
161
+ $getres = new Blossomthemes_Email_Newsletter_GetResponse();
162
+ $list = $getres->getresponse_lists($api_key);
163
+ }
164
+ return $list;
165
+ }
166
+
167
+ /**
168
+ * ActiveCampaign API
169
+ *
170
+ */
171
+ function activecampaign_lists($api_key = '', $url = '')
172
+ {
173
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
174
+ $list = array();
175
+ if( empty($api_key) && empty($url) && isset($blossomthemes_email_newsletter_settings['activecampaign']['api-url']) && $blossomthemes_email_newsletter_settings['activecampaign']['api-url']!='' && isset($blossomthemes_email_newsletter_settings['activecampaign']['api-key']) && $blossomthemes_email_newsletter_settings['activecampaign']['api-key']!='' )
176
+ {
177
+ $api_key = $blossomthemes_email_newsletter_settings['activecampaign']['api-key']; //Place API key here
178
+ $url = $blossomthemes_email_newsletter_settings['activecampaign']['api-url'];
179
+ }
180
+
181
+ if(!empty($api_key) && !empty($url)){
182
+
183
+ $ac = new ActiveCampaign($url, $api_key);
184
+ try
185
+ {
186
+ $response = $ac->api( "list/list", array('ids' => 'all') );
187
+ // print_r($response);
188
+ if (is_object($response) && !empty($response) && $response->success==1) {
189
+ foreach ($response as $v) {
190
+ if(is_object($v)) {
191
+ $list[$v->id] = array('name' => $v->name);
192
+ }
193
+ }
194
+ }
195
+ elseif( is_object($response) && !empty($response) && $response->success==0 ){
196
+ echo $response->result_message;
197
+ }
198
+ else{
199
+ echo $response;
200
+ }
201
+
202
+ } catch (Exception $e){
203
+ echo $e->getMessage();
204
+ }
205
+
206
+ }
207
+ return $list;
208
+ }
209
+
210
+ function get_status($url)
211
+ {
212
+ // must set $url first.
213
+ $ch = curl_init();
214
+ curl_setopt($ch, CURLOPT_URL, $url);
215
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
216
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
217
+ // do your curl thing here
218
+ $data = curl_exec($ch);
219
+ $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
220
+ curl_close($ch);
221
+ return $http_status;
222
+ }
223
+
224
+ function blossomthemes_email_newsletter_settings_tabs() {
225
+
226
+ $tabs = array(
227
+ 'general' => 'general.php',
228
+ 'popup' => 'popup.php',
229
+ );
230
+ $tabs = apply_filters( 'blossomthemes_email_newsletter_settings_tabs', $tabs );
231
+ return $tabs;
232
+ }
233
+
234
+ function blossomthemes_email_newsletter_backend_settings()
235
+ { ?>
236
+ <div class="wrap">
237
+ <div class="btnb-header">
238
+ <h3><?php _e('Settings','blossomthemes-email-newsletter');?></h3>
239
+ </div>
240
+ <?php
241
+ if( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] ==true )
242
+ { ?>
243
+ <div id="setting-error-settings_updated" class="updated settings-error notice is-dismissible">
244
+ <p><strong><?php _e('Settings updated.','blossomthemes-email-newsletter');?></strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php _e('Dismiss this notice.','blossomthemes-email-newsletter');?></span></button>
245
+ </div>
246
+ <?php
247
+ }
248
+ ?>
249
+ <div id="tabs-container">
250
+ <ul class="tabs-menu">
251
+ <?php
252
+ $settings_tab = $this->blossomthemes_email_newsletter_settings_tabs();
253
+ $count = 0;
254
+ foreach ($settings_tab as $key => $value) {
255
+ $tab_label = preg_replace('/_/', ' ', $key);
256
+ ?>
257
+ <li <?php if($count==0){ ?>class="current"<?php } ?>><a href="<?php echo $key;?>"><?php echo $tab_label;?></a></li>
258
+ <?php $count++;
259
+ } ?>
260
+ </ul>
261
+ <div class="tab">
262
+ <form method="POST" name="form1" action="options.php" id="form1" class="btemn-settings-form">
263
+ <?php
264
+ settings_fields( 'blossomthemes_email_newsletter_settings' );
265
+ do_settings_sections( __FILE__ );
266
+
267
+ $counter = 0;
268
+ foreach ($settings_tab as $key => $value) { ?>
269
+ <div id="<?php echo $key;?>" class="tab-content" <?php if($counter==0){ ?> style="display: block;" <?php } else{ ?> style="display: none;" <?php } ?>>
270
+ <?php
271
+ include_once BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/tabs/'.$value;
272
+ ?>
273
+ </div>
274
+ <?php $counter++; }
275
+ ?>
276
+
277
+ <div class="blossomthemes_email_newsletter_settings-settings-submit">
278
+ <?php echo submit_button();?>
279
+ </div>
280
+ </form>
281
+ </div>
282
+ </div>
283
+ </div>
284
+ <?php
285
+ }
286
+
287
+ function bten_platform_settings($platform='')
288
+ {
289
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
290
+ switch ($platform) {
291
+ case 'mailchimp':
292
+ ob_start();
293
+ ?>
294
+ <div id="mailchimp" class="newsletter-settings<?php if( $platform == 'mailchimp' || !isset($platform) ){ echo ' current'; }?>">
295
+ <div class="blossomthemes-email-newsletter-wrap-field">
296
+ <label for="blossomthemes_email_newsletter_settings[mailchimp][api-key]"><?php _e('API Key : ','blossomthemes-email-newsletter');?></label>
297
+ <input type="text" id="bten_mailchimp_api_key" name="blossomthemes_email_newsletter_settings[mailchimp][api-key]" value="<?php echo isset($blossomthemes_email_newsletter_settings['mailchimp']['api-key']) ? esc_attr( $blossomthemes_email_newsletter_settings['mailchimp']['api-key'] ): '';?>">
298
+ <?php echo '<div class="blossomthemes-email-newsletter-note">'.sprintf( __( 'Get your API key %1$shere%2$s', 'blossomthemes-email-newsletter' ), '<a href="https://us15.admin.mailchimp.com/account/api/" target="_blank">','</a>' ).'</div>';?>
299
+ </div>
300
+ <div class="blossomthemes-email-newsletter-wrap-field">
301
+ <label for="blossomthemes_email_newsletter_settings[mailchimp][list-id]"><?php _e('List Id : ','blossomthemes-email-newsletter');?>
302
+ <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose the default list. If no groups/lists are selected in the newsletter posts, users will be subscribed to the list selected above.', 'blossomthemes-email-newsletter' ); ?>"><i class="far fa-question-circle"></i>
303
+ </span>
304
+ </label>
305
+ <?php
306
+ $data = $this->mailchimp_lists();
307
+ ?>
308
+ <div class="select-holder">
309
+ <select id="bten_mailchimp_list" name="blossomthemes_email_newsletter_settings[mailchimp][list-id]">
310
+ <?php $mailchimp_list = isset($blossomthemes_email_newsletter_settings['mailchimp']['list-id']) ? $blossomthemes_email_newsletter_settings['mailchimp']['list-id'] : '';
311
+ if( empty( $data['lists'] ) ){ ?>
312
+ <option value="-"><?php _e('No Lists Found','blossomthemes-email-newsletter');?></option>
313
+ <?php } else{
314
+ $max = max(array_keys($data['lists']));
315
+ for ($i=0; $i <= $max; $i++) { ?>
316
+ <option <?php selected( $mailchimp_list, esc_attr($data['lists'][$i]['id'] ) );?> value="<?php echo esc_attr($data['lists'][$i]['id']);?>"><?php echo esc_attr($data['lists'][$i]['name']);?></option>
317
+
318
+ <?php }} ?>
319
+ </select>
320
+ </div>
321
+ <input type="button" rel-id="bten_mailchimp_list" class="button bten_get_mailchimp_lists" name="" value="Grab Lists">
322
+
323
+ </div>
324
+ <div class="blossomthemes-email-newsletter-wrap-field">
325
+ <input type="checkbox" class="enable_notif_opt" name="blossomthemes_email_newsletter_settings[mailchimp][enable_notif]" <?php $j = isset( $blossomthemes_email_newsletter_settings['mailchimp']['enable_notif'] ) ? esc_attr( $blossomthemes_email_newsletter_settings['mailchimp']['enable_notif'] ): '0';?> id="blossomthemes_email_newsletter_settings[mailchimp][enable_notif]" value="<?php echo esc_attr($j);?>" <?php if($j=='1'){ echo "checked";}?>/>
326
+
327
+ <label for="blossomthemes_email_newsletter_settings[mailchimp][enable_notif]"><?php _e('Confirmation','blossomthemes-email-newsletter');?>
328
+ <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Check this box if you want subscribers to receive confirmation mail before they are added to list.', 'blossomthemes-email-newsletter' ); ?>">
329
+ <i class="far fa-question-circle"></i>
330
+ </span>
331
+ </label>
332
+ </div>
333
+ </div>
334
+ <?php
335
+ $output = ob_get_contents();
336
+ ob_end_clean();
337
+ return $output;
338
+ break;
339
+
340
+ case 'mailerlite':
341
+ ob_start();
342
+ ?>
343
+ <div id="mailerlite" class="newsletter-settings<?php if($platform == 'mailerlite'){ echo ' current'; }?>">
344
+ <div class="blossomthemes-email-newsletter-wrap-field">
345
+ <label for="blossomthemes_email_newsletter_settings[mailerlite][api-key]"><?php _e('API Key : ','blossomthemes-email-newsletter');?></label>
346
+ <input type="text" id="bten_mailerlite_api_key" name="blossomthemes_email_newsletter_settings[mailerlite][api-key]" value="<?php echo isset($blossomthemes_email_newsletter_settings['mailerlite']['api-key']) ? esc_attr( $blossomthemes_email_newsletter_settings['mailerlite']['api-key'] ): '';?>">
347
+ <?php echo '<div class="blossomthemes-email-newsletter-note">'.sprintf( __( 'Get your api key %1$shere%2$s', 'blossomthemes-email-newsletter' ), '<a href="https://app.mailerlite.com/subscribe/api" target="_blank">','</a>' ).'</div>';?>
348
+ </div>
349
+ <div class="blossomthemes-email-newsletter-wrap-field">
350
+ <label for="blossomthemes_email_newsletter_settings[mailerlite][list-id]"><?php _e('List Id : ','blossomthemes-email-newsletter');?>
351
+ <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose the default list. If no groups/lists are selected in the newsletter posts, users will be subscribed to the list selected above.', 'blossomthemes-email-newsletter' ); ?>"><i class="far fa-question-circle"></i>
352
+ </span>
353
+ </label>
354
+ <?php
355
+ $data = $this->mailerlite_lists();
356
+ ?>
357
+ <div class="select-holder">
358
+ <select id="bten_mailerlite_list" name="blossomthemes_email_newsletter_settings[mailerlite][list-id]">
359
+ <?php
360
+ $mailerlite_list = isset($blossomthemes_email_newsletter_settings['mailerlite']['list-id']) ? $blossomthemes_email_newsletter_settings['mailerlite']['list-id']: '';
361
+ if( empty( $data ) ){ ?>
362
+ <option value="-"><?php _e('No Lists Found','blossomthemes-email-newsletter');?></option>
363
+ <?php } else {
364
+ echo '<option>'. esc_html( 'Choose mailerlite list' ) .'</option>';
365
+ foreach ( $data as $listarray => $list ) { ?>
366
+ <option <?php selected( $mailerlite_list, esc_attr($list['id'] ) );?> value="<?php echo esc_attr($list['id']);?>"><?php echo esc_attr($list['name']);?></option>
367
+
368
+ <?php }
369
+ } ?>
370
+ </select>
371
+ </div>
372
+ <input type="button" rel-id="bten_mailerlite_list" class="button bten_get_mailerlite_lists" name="" value="Grab Lists">
373
+ </div>
374
+ </div>
375
+ <?php
376
+ $output = ob_get_contents();
377
+ ob_end_clean();
378
+ return $output;
379
+ break;
380
+
381
+ case 'convertkit':
382
+ ob_start();
383
+ ?>
384
+ <div id="convertkit" class="newsletter-settings<?php if($platform == 'convertkit'){ echo ' current'; }?>">
385
+ <div class="blossomthemes-email-newsletter-wrap-field">
386
+ <label for="blossomthemes_email_newsletter_settings[convertkit][api-key]"><?php _e('API Key : ','blossomthemes-email-newsletter');?></label>
387
+ <input type="text" id="bten_convertkit_api_key" name="blossomthemes_email_newsletter_settings[convertkit][api-key]" value="<?php echo isset($blossomthemes_email_newsletter_settings['convertkit']['api-key']) ? esc_attr( $blossomthemes_email_newsletter_settings['convertkit']['api-key'] ): '';?>">
388
+ </div>
389
+ <div class="blossomthemes-email-newsletter-wrap-field">
390
+ <label for="blossomthemes_email_newsletter_settings[convertkit][api-secret]"><?php _e('API Secret : ','blossomthemes-email-newsletter');?></label>
391
+ <input type="text" id="bten_convertkit_api_secret" name="blossomthemes_email_newsletter_settings[convertkit][api-secret]" value="<?php echo isset($blossomthemes_email_newsletter_settings['convertkit']['api-secret']) ? esc_attr( $blossomthemes_email_newsletter_settings['convertkit']['api-secret'] ): '';?>">
392
+ </div>
393
+ <div class="blossomthemes-email-newsletter-wrap-field">
394
+ <label for="blossomthemes_email_newsletter_settings[convertkit][list-id]"><?php _e('List Id : ','blossomthemes-email-newsletter');?>
395
+ <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose the default list. If no groups/lists are selected in the newsletter posts, users will be subscribed to the list selected above.', 'blossomthemes-email-newsletter' ); ?>"><i class="far fa-question-circle"></i>
396
+ </span>
397
+ </label>
398
+ <?php
399
+ $data = $this->convertkit_lists();
400
+ ?>
401
+ <div class="select-holder">
402
+ <select id="bten_convertkit_list" name="blossomthemes_email_newsletter_settings[convertkit][list-id]">
403
+ <?php $convertkit_list = isset( $blossomthemes_email_newsletter_settings['convertkit']['list-id'] ) ? $blossomthemes_email_newsletter_settings['convertkit']['list-id'] : '';
404
+ if( sizeof($data) < 1 ){ ?>
405
+ <option value="-"><?php _e('No Lists Found','blossomthemes-email-newsletter');?></option>
406
+ <?php } else{
407
+ foreach ($data as $key => $value) {
408
+ ?>
409
+ <option <?php selected( $convertkit_list, esc_attr($key) );?> value="<?php echo esc_attr($key);?>"><?php echo esc_attr($value['name']);?></option>
410
+ <?php }} ?>
411
+ </select>
412
+ </div>
413
+ <input type="button" rel-id="bten_convertkit_list" class="button bten_get_convertkit_lists" name="" value="Grab Lists">
414
+ </div>
415
+ </div>
416
+ <?php
417
+ $output = ob_get_contents();
418
+ ob_end_clean();
419
+ return $output;
420
+ break;
421
+
422
+ case 'getresponse':
423
+ ob_start();
424
+ ?>
425
+ <div id="getresponse" class="newsletter-settings<?php if($platform == 'getresponse'){ echo ' current'; }?>">
426
+ <div class="blossomthemes-email-newsletter-wrap-field">
427
+ <label for="blossomthemes_email_newsletter_settings[getresponse][api-key]"><?php _e('API Key : ','blossomthemes-email-newsletter');?></label>
428
+ <input type="text" id="bten_getresponse_api_key" name="blossomthemes_email_newsletter_settings[getresponse][api-key]" value="<?php echo isset($blossomthemes_email_newsletter_settings['getresponse']['api-key']) ? esc_attr( $blossomthemes_email_newsletter_settings['getresponse']['api-key'] ): '';?>">
429
+ </div>
430
+ <div class="blossomthemes-email-newsletter-wrap-field">
431
+ <label for="blossomthemes_email_newsletter_settings[getresponse][list-id]"><?php _e('List Id : ','blossomthemes-email-newsletter');?>
432
+ <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose the default list. If no groups/lists are selected in the newsletter posts, users will be subscribed to the list selected above.', 'blossomthemes-email-newsletter' ); ?>"><i class="far fa-question-circle"></i>
433
+ </span>
434
+ </label>
435
+ <?php
436
+ $data = $this->getresponse_lists();
437
+ ?>
438
+ <div class="select-holder">
439
+ <select id="bten_getresponse_list" name="blossomthemes_email_newsletter_settings[getresponse][list-id]">
440
+ <?php
441
+ $getresponse_list = isset($blossomthemes_email_newsletter_settings['getresponse']['list-id']) ? $blossomthemes_email_newsletter_settings['getresponse']['list-id'] : '';
442
+ if( empty($data) ){ ?>
443
+ <option value="-"><?php _e('No Lists Found','blossomthemes-email-newsletter');?></option>
444
+ <?php } else{ ?>
445
+ <option value=""><?php _e('Choose Campaign ID','blossomthemes-email-newsletter');?></option>
446
+ <?php
447
+ foreach ($data as $key => $value) {
448
+ ?>
449
+ <option <?php selected( $getresponse_list, esc_attr($key) );?> value="<?php echo esc_attr($key);?>"><?php echo esc_attr($value['name']);?></option>
450
+ <?php }} ?>
451
+ </select></div>
452
+ <input type="button" rel-id="bten_getresponse_list" class="button bten_get_getresponse_lists" name="" value="Grab Lists">
453
+ </div>
454
+ </div>
455
+ <?php
456
+ $output = ob_get_contents();
457
+ ob_end_clean();
458
+ return $output;
459
+ break;
460
+
461
+ case 'activecampaign':
462
+ ob_start();
463
+ ?>
464
+ <div id="activecampaign" class="newsletter-settings<?php if($platform == 'activecampaign'){ echo ' current'; }?>">
465
+ <div class="blossomthemes-email-newsletter-wrap-field">
466
+ <label for="blossomthemes_email_newsletter_settings[activecampaign][api-url]"><?php _e('API Url : ','blossomthemes-email-newsletter');?></label>
467
+ <input type="text" id="bten_activecampaign_api_url" name="blossomthemes_email_newsletter_settings[activecampaign][api-url]" value="<?php echo isset($blossomthemes_email_newsletter_settings['activecampaign']['api-url']) ? esc_attr( $blossomthemes_email_newsletter_settings['activecampaign']['api-url'] ): '';?>">
468
+ </div>
469
+ <div class="blossomthemes-email-newsletter-wrap-field">
470
+ <label for="blossomthemes_email_newsletter_settings[activecampaign][api-key]"><?php _e('API Key : ','blossomthemes-email-newsletter');?></label>
471
+ <input type="text" id="bten_activecampaign_api_key" name="blossomthemes_email_newsletter_settings[activecampaign][api-key]" value="<?php echo isset($blossomthemes_email_newsletter_settings['activecampaign']['api-key']) ? esc_attr( $blossomthemes_email_newsletter_settings['activecampaign']['api-key'] ): '';?>">
472
+ </div>
473
+ <div class="blossomthemes-email-newsletter-wrap-field">
474
+ <label for="blossomthemes_email_newsletter_settings[activecampaign][list-id]"><?php _e('List Id : ','blossomthemes-email-newsletter');?>
475
+ <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose the default list. If no groups/lists are selected in the newsletter posts, users will be subscribed to the list selected above.', 'blossomthemes-email-newsletter' ); ?>"><i class="far fa-question-circle"></i>
476
+ </span>
477
+ </label>
478
+ <?php
479
+ $data = $this->activecampaign_lists();
480
+ // print_r($data);
481
+ ?>
482
+ <div class="select-holder">
483
+ <select id="bten_activecampaign_list" name="blossomthemes_email_newsletter_settings[activecampaign][list-id]">
484
+ <?php
485
+ $activecampaign_list = isset( $blossomthemes_email_newsletter_settings['activecampaign']['list-id'] ) ? $blossomthemes_email_newsletter_settings['activecampaign']['list-id'] : '';
486
+ if( sizeof($data) < 1 ){ ?>
487
+ <option value="-"><?php _e('No Lists Found','blossomthemes-email-newsletter');?></option>
488
+ <?php } else{ ?>
489
+ <option value=""><?php _e('Choose Campaign ID','blossomthemes-email-newsletter');?></option>
490
+ <?php
491
+ foreach ($data as $key => $value) {
492
+ ?>
493
+ <option <?php selected( $activecampaign_list, esc_attr($key) );?> value="<?php echo esc_attr($key);?>"><?php echo esc_attr($value['name']);?></option>
494
+ <?php }} ?>
495
+ </select>
496
+ </div>
497
+ <input type="button" rel-id="bten_activecampaign_list" class="button bten_get_activecampaign_lists" name="" value="Grab Lists">
498
+ </div>
499
+ </div>
500
+ <?php
501
+ $output = ob_get_contents();
502
+ ob_end_clean();
503
+ return $output;
504
+ break;
505
+
506
+ case 'aweber':
507
+ ob_start();
508
+ ?>
509
+ <div id="aweber" class="newsletter-settings<?php if($platform == 'aweber'){ echo ' current'; }?>">
510
+
511
+ <?php
512
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
513
+ $bten_aw_auth_info = get_option('bten_aw_auth_info');
514
+
515
+ $appId = '9c213c43'; //Place APP ID here
516
+ $url = "https://auth.aweber.com/1.0/oauth/authorize_app/".$appId;
517
+ $status = $this->get_status($url);
518
+
519
+ if($status!=200)
520
+ {
521
+ echo '<div class="blossomthemes-email-newsletter-note">' . __( 'The APP ID does not seem to exist. Please enter a valid AWeber APP ID to connect to the mailing lists.', 'blossomthemes-email-newsletter' ).'</div>';
522
+ }
523
+ else
524
+ {
525
+ echo '<div id="bten_aweber_connect_div"'.($bten_aw_auth_info ? 'style="display:none;"': '').'>';
526
+ echo '<label>' .__('AWeber Connection : ','blossomthemes-email-newsletter'). '</label> ';
527
+ echo '<b>Step 1:</b> <a href="https://auth.aweber.com/1.0/oauth/authorize_app/'.$appId.'" target="_blank">Click here to get your authorization code.</a><br />';
528
+ echo '<b>Step 2:</b> Paste in your authorization code:<br />';
529
+ echo '<textarea id="bten_aweber_auth_code" rows="3"></textarea><br />';
530
+ echo '<input type="button" class="button-primary bten_aweber_auth" name="" value="Connect" />';
531
+ echo '</div>';
532
+
533
+ echo '<div id="bten_aweber_disconnect_div"'.($bten_aw_auth_info ? '': ' style="display:none;"').'>';
534
+ echo '<label>' .__('AWeber Connection : ','blossomthemes-email-newsletter'). '</label> ';
535
+ echo '<input type="button" class="button-primary bten_aweber_remove_auth" name="" value="Remove Connection" />';
536
+ echo '</div>';
537
+ ?>
538
+ <div class="blossomthemes-email-newsletter-wrap-field">
539
+ <label for="blossomthemes_email_newsletter_settings[aweber][list-id]"><?php _e('List Id : ','blossomthemes-email-newsletter');?>
540
+ <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose the default list. If no groups/lists are selected in the newsletter posts, users will be subscribed to the list selected above.', 'blossomthemes-email-newsletter' ); ?>">
541
+ <i class="far fa-question-circle"></i>
542
+ </span>
543
+ </label>
544
+ <div class="select-holder">
545
+ <select id="bten_aweber_list" name="blossomthemes_email_newsletter_settings[aweber][list-id]">
546
+ <?php
547
+ $aw = new Blossomthemes_Email_Newsletter_AWeber;
548
+ $aweber_list = isset($blossomthemes_email_newsletter_settings['aweber']['list-id']) ? $blossomthemes_email_newsletter_settings['aweber']['list-id'] : '';
549
+ $data = $aw->bten_get_aw_lists();
550
+ if( sizeof($data) < 1 ){ ?>
551
+ <option value="-"><?php _e('No Lists Found','blossomthemes-email-newsletter');?></option>
552
+ <?php } else{ ?>
553
+ <option value=""><?php _e('Choose Campaign ID','blossomthemes-email-newsletter');?></option>
554
+ <?php
555
+ foreach ($data as $key => $value) {
556
+ ?>
557
+ <option <?php selected( $aweber_list, esc_attr($key) );?> value="<?php echo esc_attr($key);?>"><?php echo esc_attr($value['name']);?></option>
558
+ <?php }} ?>
559
+ </select>
560
+ </div>
561
+ <input type="button" rel-id="bten_aweber_list" class="button bten_get_aweber_lists" name="" value="Grab Lists">
562
+ </div>
563
+ <?php
564
+ }
565
+
566
+ ?>
567
+ </div>
568
+ <?php
569
+ $output = ob_get_contents();
570
+ ob_end_clean();
571
+ return $output;
572
+ break;
573
+
574
+ case 'sendinblue' :
575
+ ob_start();
576
+ ?>
577
+ <div id="sendinblue-settings" class="newsletter-settings <?php echo 'sendinblue' === $platform ? esc_attr( 'current' ) : ''; ?>">
578
+ <div class="blossomthemes-email-newsletter-wrap-field">
579
+ <label for="blossomthemes_email_newsletter_settings[sendinblue][api-key]"><?php _e('API Key : ','blossomthemes-email-newsletter');?></label>
580
+ <input type="text" id="bten_sendinblue_api_key" name="blossomthemes_email_newsletter_settings[sendinblue][api-key]" value="<?php echo isset($blossomthemes_email_newsletter_settings['sendinblue']['api-key']) ? esc_attr( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ): '';?>">
581
+ <?php echo '<div class="blossomthemes-email-newsletter-note">'.sprintf( __( 'Get your API key %1$shere%2$s', 'blossomthemes-email-newsletter' ), '<a href="https://my.sendinblue.com/advanced/apikey/" target="_blank">','</a>' ).'</div>';?>
582
+ </div>
583
+ <div class="blossomthemes-email-newsletter-wrap-field">
584
+ <label for="blossomthemes_email_newsletter_settings[sendinblue][list-id]"><?php _e('List Id : ','blossomthemes-email-newsletter');?>
585
+ <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose the default list. If no groups/lists are selected in the newsletter posts, users will be subscribed to the list selected above.', 'blossomthemes-email-newsletter' ); ?>">
586
+ <i class="far fa-question-circle"></i>
587
+ </span>
588
+ </label>
589
+ <?php
590
+ $data = $this->sendinblue_lists();
591
+ ?>
592
+ <div class="select-holder">
593
+ <select id="bten_sendinblue_list" name="blossomthemes_email_newsletter_settings[sendinblue][list-id]">
594
+ <?php
595
+ $sendinblue_list = isset( $blossomthemes_email_newsletter_settings['sendinblue']['list-id'] ) ? $blossomthemes_email_newsletter_settings['sendinblue']['list-id'] : '' ;
596
+ if ( empty( $data ) ) { ?>
597
+ <option value="-">
598
+ <?php _e('No Lists Found','blossomthemes-email-newsletter');?>
599
+ </option>
600
+ <?php
601
+ } else {
602
+ echo '<option>'. esc_html( 'Choose sendinblue list' ) .'</option>';
603
+ foreach ( $data as $listarray => $list ) {
604
+ echo '<option '. selected( $sendinblue_list, $list['id'] ) .' value="'. esc_attr( $list['id'] ) .'" >'. esc_html( $list['name'] ) .'</option>';
605
+ }
606
+ }
607
+ ?>
608
+ </select>
609
+ </div>
610
+ <input type="button" rel-id="bten_sendinblue_list" class="button bten_get_sendinblue_lists" name="" value="<?php esc_attr_e( 'Grab Lists', 'blossomthemes-email-newsletter' ); ?>">
611
+ </div>
612
+ </div>
613
+ <?php
614
+ $output = ob_get_clean();
615
+ return $output;
616
+ break;
617
+
618
+ default:
619
+ ob_start();
620
+ ?>
621
+ <div id="mailchimp" class="newsletter-settings current">
622
+ <div class="blossomthemes-email-newsletter-wrap-field">
623
+ <label for="blossomthemes_email_newsletter_settings[mailchimp][api-key]"><?php _e('API Key : ','blossomthemes-email-newsletter');?></label>
624
+ <input type="text" id="bten_mailchimp_api_key" name="blossomthemes_email_newsletter_settings[mailchimp][api-key]" value="<?php echo isset($blossomthemes_email_newsletter_settings['mailchimp']['api-key']) ? esc_attr( $blossomthemes_email_newsletter_settings['mailchimp']['api-key'] ): '';?>">
625
+ <?php echo '<div class="blossomthemes-email-newsletter-note">'.sprintf( __( 'Get your API key %1$shere%2$s', 'blossomthemes-email-newsletter' ), '<a href="https://us15.admin.mailchimp.com/account/api/" target="_blank">','</a>' ).'</div>';?>
626
+ </div>
627
+ <div class="blossomthemes-email-newsletter-wrap-field">
628
+ <label for="blossomthemes_email_newsletter_settings[mailchimp][list-id]"><?php _e('List Id : ','blossomthemes-email-newsletter');?>
629
+ <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose the default list. If no groups/lists are selected in the newsletter posts, users will be subscribed to the list selected above.', 'blossomthemes-email-newsletter' ); ?>"><i class="far fa-question-circle"></i>
630
+ </span>
631
+ </label>
632
+ <?php
633
+ $data = $this->mailchimp_lists();
634
+ ?>
635
+ <div class="select-holder">
636
+ <select id="bten_mailchimp_list" name="blossomthemes_email_newsletter_settings[mailchimp][list-id]">
637
+ <?php $mailchimp_list = isset($blossomthemes_email_newsletter_settings['mailchimp']['list-id']) ? $blossomthemes_email_newsletter_settings['mailchimp']['list-id'] : '' ;
638
+ if( empty( $data['lists'] ) ){ ?>
639
+ <option value="-"><?php _e('No Lists Found','blossomthemes-email-newsletter');?></option>
640
+ <?php } else{
641
+ $max = max(array_keys($data['lists']));
642
+ for ($i=0; $i <= $max; $i++) { ?>
643
+ <option <?php selected( $mailchimp_list, esc_attr($data['lists'][$i]['id'] ) );?> value="<?php echo esc_attr($data['lists'][$i]['id']);?>"><?php echo esc_attr($data['lists'][$i]['name']);?></option>
644
+
645
+ <?php }} ?>
646
+ </select>
647
+ </div>
648
+ <input type="button" rel-id="bten_mailchimp_list" class="button bten_get_mailchimp_lists" name="" value="Grab Lists">
649
+ </div>
650
+ <div class="blossomthemes-email-newsletter-wrap-field">
651
+ <input type="checkbox" class="enable_notif_opt" name="blossomthemes_email_newsletter_settings[mailchimp][enable_notif]" <?php $j = isset( $blossomthemes_email_newsletter_settings['mailchimp']['enable_notif'] ) ? esc_attr( $blossomthemes_email_newsletter_settings['mailchimp']['enable_notif'] ): '0';?> id="blossomthemes_email_newsletter_settings[mailchimp][enable_notif]" value="<?php echo esc_attr($j);?>" <?php if($j=='1'){ echo "checked";}?>/>
652
+
653
+ <label for="blossomthemes_email_newsletter_settings[mailchimp][enable_notif]"><?php _e('Confirmation','blossomthemes-email-newsletter');?>
654
+ <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Check this box if you want subscribers to receive confirmation mail before they are added to list.', 'blossomthemes-email-newsletter' ); ?>">
655
+ <i class="far fa-question-circle"></i>
656
+ </span>
657
+ </label>
658
+ </div>
659
+ </div>
660
+ <?php
661
+ $output = ob_get_contents();
662
+ ob_end_clean();
663
+ return $output;
664
+ break;
665
+ }
666
+ }
667
+ }
668
+ new BlossomThemes_Email_Newsletter_Settings;
includes/class-blossomthemes-email-newsletter-shortcodes.php CHANGED
@@ -1,460 +1,461 @@
1
- <?php
2
- /**
3
- * Frontend view of the plugin.
4
- *
5
- * @package Blossomthemes_Email_Newsletter
6
- * @subpackage Blossomthemes_Email_Newsletter/includes
7
- * @author blossomthemes
8
- */
9
- class Blossomthemes_Email_Newsletter_Shortcodes {
10
-
11
- function __construct()
12
- {
13
- add_shortcode( 'BTEN', array( $this, 'blossomthemes_email_newsletter_shortcode_callback' ) );
14
- add_action( 'wp_ajax_subscription_response', array( $this, 'blossomthemes_email_newsletter_ajax_callback' ) );
15
- add_action( 'wp_ajax_nopriv_subscription_response', array( $this, 'blossomthemes_email_newsletter_ajax_callback' ) );
16
- }
17
-
18
- //function to generate shortcode
19
- function blossomthemes_email_newsletter_shortcode_callback( $atts, $content = "" )
20
- {
21
- $obj = new Blossomthemes_Email_Newsletter_Functions;
22
-
23
- $atts = shortcode_atts( array(
24
- 'id' => '',
25
- ), $atts, 'BTEN' );
26
- $atts['id'] = absint($atts['id']);
27
- $rrsb_bg = '';
28
- $rrsb_font = '';
29
- $blossomthemes_email_newsletter_setting = get_post_meta( $atts['id'], 'blossomthemes_email_newsletter_setting', true );
30
- $settings = get_option( 'blossomthemes_email_newsletter_settings', true );
31
- $rrsb_option = ! empty( $blossomthemes_email_newsletter_setting['appearance']['newsletter-bg-option'] ) ? sanitize_text_field( $blossomthemes_email_newsletter_setting['appearance']['newsletter-bg-option'] ) : 'bg-color';
32
-
33
- if( $rrsb_option == 'image' )
34
- {
35
- $overlay = isset( $blossomthemes_email_newsletter_setting['appearance']['overlay'] ) && $blossomthemes_email_newsletter_setting['appearance']['overlay'] == '1' ? ' has-overlay' : ' no-overlay';
36
- if( isset( $blossomthemes_email_newsletter_setting['appearance']['bg']) && $blossomthemes_email_newsletter_setting['appearance']['bg']!='' )
37
- {
38
- $attachment_id = $blossomthemes_email_newsletter_setting['appearance']['bg'];
39
- $newsletter_bio_img_size = apply_filters('bt_newsletter_img_size','full');
40
- $image_array = wp_get_attachment_image_src( $attachment_id, $newsletter_bio_img_size );
41
- $rrsb_bg = 'url('.$image_array[0].') no-repeat';
42
- }
43
- }
44
- else{
45
- if( isset( $blossomthemes_email_newsletter_setting['appearance']['bgcolor'] ) && $blossomthemes_email_newsletter_setting['appearance']['bgcolor']!='' )
46
- {
47
- $rrsb_bg = ! empty( $blossomthemes_email_newsletter_setting['appearance']['bgcolor'] ) ? sanitize_text_field( $blossomthemes_email_newsletter_setting['appearance']['bgcolor'] ) : apply_filters('bt_newsletter_bg_color','#ffffff');
48
- }
49
- elseif( isset( $settings['appearance']['bgcolor'] ) && $settings['appearance']['bgcolor']!='' )
50
- {
51
- $rrsb_bg = ! empty( $settings['appearance']['bgcolor'] ) ? sanitize_text_field( $settings['appearance']['bgcolor'] ) : apply_filters('bt_newsletter_bg_color','#ffffff');
52
- }
53
- }
54
- if( isset( $blossomthemes_email_newsletter_setting['appearance']['fontcolor'] ) && $blossomthemes_email_newsletter_setting['appearance']['fontcolor']!='' )
55
- {
56
- $rrsb_font = ! empty( $blossomthemes_email_newsletter_setting['appearance']['fontcolor'] ) ? sanitize_text_field( $blossomthemes_email_newsletter_setting['appearance']['fontcolor'] ) : apply_filters('bt_newsletter_font_color_setting','#ffffff');
57
- }
58
- elseif( isset( $settings['appearance']['fontcolor'] ) && $settings['appearance']['fontcolor']!='' )
59
- {
60
- $rrsb_font = ! empty( $settings['appearance']['fontcolor'] ) ? sanitize_text_field( $settings['appearance']['fontcolor'] ) : apply_filters('bt_newsletter_font_color_setting','#ffffff');
61
- }
62
-
63
- ob_start();
64
- ?>
65
- <div class="blossomthemes-email-newsletter-wrapper<?php if(isset($rrsb_option) && $rrsb_option == 'image'){ echo ' bg-img', $overlay;}?>" id="boxes-<?php echo esc_attr($atts['id']);?>" style="background: <?php echo esc_attr($rrsb_bg);?>; color: <?php echo esc_attr($rrsb_font);?> ">
66
-
67
- <?php $inner_wrap = apply_filters( 'bt_newsletter_shortcode_inner_wrap_display', false );
68
- if ( $inner_wrap ) {
69
- do_action( 'bt_newsletter_shortcode_inner_wrap_start' );
70
- } ?>
71
-
72
- <div class="text-holder" >
73
- <?php if( get_the_title( $atts['id'] ) ) { $title = get_the_title( $atts['id'] ); echo '<h3>'.esc_attr($title).'</h3>'; }?>
74
- <?php
75
- if( isset($blossomthemes_email_newsletter_setting['appearance']['note']) && $blossomthemes_email_newsletter_setting['appearance']['note']!='' )
76
- {
77
- $note = $blossomthemes_email_newsletter_setting['appearance']['note'];
78
- echo '<span>'.esc_attr($note).'</span>';
79
- }
80
- ?>
81
- </div>
82
- <form id="blossomthemes-email-newsletter-<?php echo esc_attr($atts['id']);?>" class="blossomthemes-email-newsletter-window-<?php echo esc_attr($atts['id']);?>">
83
- <?php
84
- $val = isset($blossomthemes_email_newsletter_setting['field']['select']) ? esc_attr($blossomthemes_email_newsletter_setting['field']['select']):'email';
85
- if( $val=='email' )
86
- {
87
- ?>
88
- <input type="text" name="subscribe-email" required="required" class="subscribe-email-<?php echo esc_attr($atts['id']);?>" value="" placeholder="<?php echo isset($blossomthemes_email_newsletter_setting['field']['email_placeholder']) && $blossomthemes_email_newsletter_setting['field']['email_placeholder'] !='' ? esc_attr($blossomthemes_email_newsletter_setting['field']['email_placeholder']): __('Your Email', 'blossomthemes-email-newsletter');?>">
89
- <?php
90
- }
91
- else{ ?>
92
- <input type="text" name="subscribe-fname" required="required" class="subscribe-fname-<?php echo esc_attr($atts['id']);?>" value="" placeholder="<?php echo isset($blossomthemes_email_newsletter_setting['field']['first_name_placeholder']) && $blossomthemes_email_newsletter_setting['field']['first_name_placeholder'] != '' ? esc_attr($blossomthemes_email_newsletter_setting['field']['first_name_placeholder']): __('Your Name', 'blossomthemes-email-newsletter');?>">
93
-
94
- <input type="text" name="subscribe-email" required="required" class="subscribe-email-<?php echo esc_attr($atts['id']);?>" value="" placeholder="<?php echo isset($blossomthemes_email_newsletter_setting['field']['email_placeholder']) && $blossomthemes_email_newsletter_setting['field']['email_placeholder'] != '' ? esc_attr($blossomthemes_email_newsletter_setting['field']['email_placeholder']): __('Your Email', 'blossomthemes-email-newsletter');?>">
95
- <?php
96
- }
97
- if( isset( $blossomthemes_email_newsletter_setting['appearance']['gdpr'] ) && $blossomthemes_email_newsletter_setting['appearance']['gdpr'] == '1' )
98
- {
99
- ?>
100
- <label for="subscribe-confirmation-<?php echo esc_attr($atts['id']);?>">
101
- <div class="subscribe-inner-wrap">
102
- <input type="checkbox" class="subscribe-confirmation-<?php echo esc_attr($atts['id']);?>" name="subscribe-confirmation" id="subscribe-confirmation-<?php echo esc_attr($atts['id']);?>" required/><span class="check-mark"></span>
103
- <span class="text">
104
- <?php
105
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
106
- $gdprmsg = isset($blossomthemes_email_newsletter_settings['gdpr-msg']) && $blossomthemes_email_newsletter_settings['gdpr-msg'] !='' ? $blossomthemes_email_newsletter_settings['gdpr-msg']: __('By checking this, you agree to our Privacy Policy.', 'blossomthemes-email-newsletter');
107
- echo wp_kses_post($gdprmsg);
108
- ?>
109
- </span>
110
- </div>
111
- </label>
112
- <?php
113
- }
114
- ?>
115
- <div id="loader-<?php echo esc_attr($atts['id']);?>" style="display: none">
116
- <div class="table">
117
- <div class="table-row">
118
- <div class="table-cell">
119
- <img src="<?php echo BLOSSOMTHEMES_EMAIL_NEWSLETTER_FILE_URL.'/public/css/loader.gif';?>">
120
- </div>
121
- </div>
122
- </div>
123
- </div>
124
- <input type="submit" name="subscribe-submit" class="subscribe-submit-<?php echo esc_attr($atts['id']);?>" value="<?php echo isset($blossomthemes_email_newsletter_setting['field']['submit_label']) && $blossomthemes_email_newsletter_setting['field']['submit_label'] !='' ? esc_attr($blossomthemes_email_newsletter_setting['field']['submit_label']): __('Subscribe', 'blossomthemes-email-newsletter');?>">
125
- <?php wp_nonce_field( 'subscription_response', 'bten_subscription_nonce_'.esc_attr($atts['id']).'' ); ?>
126
- </form>
127
-
128
- <?php $inner_wrap = apply_filters( 'bt_newsletter_shortcode_inner_wrap_display', false );
129
- if ( $inner_wrap ) {
130
- do_action( 'bt_newsletter_shortcode_inner_wrap_close' );
131
- } ?>
132
-
133
- <div class="bten-response" id="bten-response-<?php echo esc_attr($atts['id']);?>"><span></span></div>
134
- <div id="mask-<?php echo esc_attr($atts['id']);?>"></div>
135
- </div>
136
- <?php
137
- global $post;
138
- $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
139
- $style = '<style>
140
- #mask-'.esc_attr($atts['id']).' {
141
- position: fixed;
142
- width: 100%;
143
- height: 100%;
144
- left: 0;
145
- top: 0;
146
- z-index: 9000;
147
- background-color: #000;
148
- display: none;
149
- }
150
-
151
- #boxes-'.esc_attr($atts['id']).' #dialog {
152
- width: 750px;
153
- height: 300px;
154
- padding: 10px;
155
- background-color: #ffffff;
156
- font-family: "Segoe UI Light", sans-serif;
157
- font-size: 15pt;
158
- }
159
-
160
-
161
- #loader-'.esc_attr($atts['id']).' {
162
- position: absolute;
163
- top: 27%;
164
- left: 0;
165
- width: 100%;
166
- height: 80%;
167
- text-align: center;
168
- font-size: 50px;
169
- }
170
-
171
- #loader-'.esc_attr($atts['id']).' .table{
172
- display: table;
173
- width: 100%;
174
- height: 100%;
175
- }
176
-
177
- #loader-'.esc_attr($atts['id']).' .table-row{
178
- display: table-row;
179
- }
180
-
181
- #loader-'.esc_attr($atts['id']).' .table-cell{
182
- display: table-cell;
183
- vertical-align: middle;
184
- }
185
- </style>';
186
- echo $obj->bten_minify_css($style);
187
- // echo $style;
188
-
189
- $ajax =
190
- '<script>
191
- jQuery(document).ready(function() {
192
- jQuery(document).on("submit","form#blossomthemes-email-newsletter-'.esc_attr($atts['id']).'", function(e){
193
- e.preventDefault();
194
- jQuery(".subscribe-submit-'.esc_attr($atts['id']).'").attr("disabled", "disabled" );
195
- var email = jQuery(".subscribe-email-'.esc_attr($atts['id']).'").val();
196
- var fname = jQuery(".subscribe-fname-'.esc_attr($atts['id']).'").val();
197
- var confirmation = jQuery(".subscribe-confirmation-'.esc_attr($atts['id']).'").val();
198
- var sid = '.esc_attr($atts['id']).';
199
- var nonce = jQuery("#bten_subscription_nonce_'.esc_attr($atts['id']).'").val();
200
- jQuery.ajax({
201
- type : "post",
202
- dataType : "json",
203
- url : bten_ajax_data.ajaxurl,
204
- data : {action: "subscription_response", email : email, fname : fname, sid : sid, confirmation : confirmation, nonce : nonce},
205
- beforeSend: function(){
206
- jQuery("#loader-'.esc_attr($atts['id']).'").fadeIn(500);
207
- },
208
- success: function(response){
209
- jQuery(".subscribe-submit-'.esc_attr($atts['id']).'").attr("disabled", "disabled" );';
210
- $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
211
- $option = isset($bten_settings['thankyou-option']) ? esc_attr($bten_settings['thankyou-option']):'text';
212
- $ajax .='if(response.type === "success") {';
213
- if($option == 'text')
214
- {
215
- $ajax .= 'jQuery("#bten-response-'.esc_attr($atts['id']).' span").html(response.message);jQuery("#bten-response-'.esc_attr($atts['id']).'").fadeIn("slow").delay("3000").fadeOut("3000",function(){
216
- jQuery(".subscribe-submit-'.esc_attr($atts['id']).'").removeAttr("disabled", "disabled" );
217
- jQuery("form#blossomthemes-email-newsletter-'.esc_attr($atts['id']).'").find("input[type=text]").val("");
218
- jQuery("form#blossomthemes-email-newsletter-'.esc_attr($atts['id']).'").find("input[type=checkbox]").prop("checked", false);
219
- });';
220
- }
221
- else{
222
- $selected_page = isset($bten_settings['page'])?esc_attr($bten_settings['page']):'';
223
- $url = get_permalink($selected_page);
224
- $ajax.= 'window.location.href = "'.esc_url($url).'"';
225
- }
226
-
227
- $ajax.='}
228
- else{
229
- jQuery("#bten-response-'.esc_attr($atts['id']).' span").html(response.message);jQuery("#bten-response-'.esc_attr($atts['id']).'").fadeIn("slow").delay("3000").fadeOut("3000",function(){
230
- jQuery(".subscribe-submit-'.esc_attr($atts['id']).'").removeAttr("disabled", "disabled" );
231
- jQuery("form#blossomthemes-email-newsletter-'.esc_attr($atts['id']).'").find("input[type=text]").val("");
232
- jQuery("form#blossomthemes-email-newsletter-'.esc_attr($atts['id']).'").find("input[type=checkbox]").prop("checked", false);
233
-
234
- });
235
- }
236
- },
237
- complete: function(){
238
- jQuery("#loader-'.esc_attr($atts['id']).'").fadeOut(500);
239
- }
240
- });
241
- });
242
- });
243
- </script>';
244
- echo $obj->bten_minify_js($ajax);
245
- $output = ob_get_contents();
246
- ob_end_clean();
247
- return apply_filters( 'blossomthemes_newsletter_shortcode_filter', $output, $atts );
248
- }
249
-
250
- //function to generate ajax actions
251
- function blossomthemes_email_newsletter_ajax_callback()
252
- {
253
- if ( ! isset( $_POST['nonce'] )
254
- || ! wp_verify_nonce( $_POST['nonce'], 'subscription_response' )
255
- ) {
256
- $result['type'] = 'error';
257
- $result['message'] = __( 'Sorry, your nonce did not verify.', 'blossomthemes-email-newsletter' );
258
- echo json_encode( $result );
259
- exit;
260
- }
261
-
262
- $email = sanitize_email( $_POST['email'] );
263
- $fname = isset( $_POST['fname'] ) ? esc_attr( $_POST['fname'] ) : '';
264
- $lname = ' ';
265
-
266
- $arr['subscriber']['email'] = $email;
267
- $sid = intval( $_POST['sid'] );
268
- $to = $email;
269
-
270
- /*if ( !preg_match('/^[a-z A-Z]+$/', $fname ) ) {
271
- $result['type'] = 'error';
272
- $result['message'] = __( 'Please enter a valid name.', 'blossomthemes-email-newsletter' );
273
- echo json_encode( $result );
274
- exit;
275
- }*/
276
-
277
- if ( !is_email($to) ) {
278
- $result['type'] = 'error';
279
- $result['message'] = __( 'Please enter a valid email.', 'blossomthemes-email-newsletter' );
280
- echo json_encode( $result );
281
- exit;
282
- }
283
-
284
- $subject = 'Subscribe To Newsletter';
285
- $admin_email = get_option('admin_email');
286
- if( $admin_email != '')
287
- {
288
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
289
- $platform = $blossomthemes_email_newsletter_settings['platform'];
290
-
291
- if( $platform == 'mailerlite' )
292
- {
293
- $obj = new Blossomthemes_Email_Newsletter_Mailerlite;
294
- $response = $obj->bten_mailerlite_action($email, $sid, $fname);
295
- if( $response == 200 )
296
- {
297
- $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
298
- $result['type'] = 'success';
299
- $result['message'] = isset($bten_settings['msg']) ? $bten_settings['msg']: __('Successfully subscribed.', 'blossomthemes-email-newsletter');
300
- echo json_encode( $result );
301
- exit;
302
- }
303
-
304
- else{
305
-
306
- $result['type'] = 'error';
307
- $result['message'] = __( 'Error in subscription.', 'blossomthemes-email-newsletter' );
308
- echo json_encode( $result );
309
- exit;
310
- }
311
- }
312
-
313
- elseif( $platform == 'mailchimp' )
314
- {
315
- $obj = new Blossomthemes_Email_Newsletter_Mailchimp;
316
- $response = $obj->bten_mailchimp_action($email, $sid, $fname);
317
- if( $response == 200 )
318
- {
319
- $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
320
- if( isset($bten_settings['mailchimp']['enable_notif']) && $blossomthemes_email_newsletter_settings['mailchimp']['enable_notif'] =='1'){
321
- $result['type'] = 'success';
322
- $result['message'] = __( 'Please check your email for confirmation.', 'blossomthemes-email-newsletter' );
323
-
324
- echo json_encode( $result );
325
- exit;
326
- }
327
- else{
328
- $result['type'] = 'success';
329
- $result['message'] = isset($bten_settings['msg']) ? $bten_settings['msg']: 'Successfully subscribed.';
330
- echo json_encode( $result );
331
- exit;
332
- }
333
- }
334
-
335
- else{
336
- $result['type'] = 'error';
337
- $result['message'] = __( 'Error in subscription.', 'blossomthemes-email-newsletter' );
338
- echo json_encode( $result );
339
- exit;
340
- }
341
- }
342
-
343
- elseif( $platform == 'convertkit' )
344
- {
345
- $obj = new Blossomthemes_Email_Newsletter_Convertkit;
346
- $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
347
- $response = $obj->bten_convertkit_action($email,$sid,$fname,$lname);
348
- if( $response == 200 )
349
- {
350
- $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
351
- $result['type'] = 'success';
352
- $result['message'] = isset($bten_settings['msg']) ? $bten_settings['msg']: 'Successfully subscribed.';
353
- echo json_encode( $result );
354
- exit;
355
- }
356
-
357
- else{
358
- $result['type'] = 'error';
359
- $result['message'] = __( 'Error in subscription.', 'blossomthemes-email-newsletter' );
360
- echo json_encode( $result );
361
- exit;
362
- }
363
- }
364
-
365
- elseif( $platform == 'getresponse' )
366
- {
367
- $obj = new Blossomthemes_Email_Newsletter_GetResponse;
368
- $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
369
- $response = $obj->bten_getresponse_action($email, $sid, $fname);
370
- if( isset( $response['response'] ) && $response['response'] == 200 )
371
- {
372
- $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
373
- $result['type'] = 'success';
374
- $result['message'] = isset($bten_settings['msg']) ? $bten_settings['msg']: 'Successfully subscribed.';
375
-
376
- echo json_encode( $result );
377
- exit;
378
- }
379
-
380
- else{
381
- $result['type'] = 'error';
382
- $result['message'] = __( 'Error in subscription.', 'blossomthemes-email-newsletter' );
383
- $result['errorMessage'] = isset($response['log']['errorMessage']) ? $response['log']['errorMessage'] : '';
384
- echo json_encode( $result );
385
- exit;
386
- }
387
- }
388
- elseif( $platform == 'activecampaign' )
389
- {
390
- $obj = new Blossomthemes_Email_Newsletter_ActiveCampaign;
391
- $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
392
- $response = $obj->bten_activecampaign_action($email,$sid,$fname);
393
- if( $response['response'] == 200 )
394
- {
395
- $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
396
- $result['type'] = 'success';
397
- $result['message'] = isset($bten_settings['msg']) ? $bten_settings['msg']: 'Successfully subscribed.';
398
-
399
- echo json_encode( $result );
400
- exit;
401
- }
402
-
403
- else{
404
- $result['type'] = 'error';
405
- $result['message'] = __( 'Error in subscription.', 'blossomthemes-email-newsletter' );
406
- echo json_encode( $result );
407
- exit;
408
- }
409
- }
410
- elseif( $platform == 'aweber' )
411
- {
412
- $obj = new Blossomthemes_Email_Newsletter_AWeber;
413
- $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
414
- $response = $obj->bten_aweber_action($email, $sid, $fname);
415
- if( $response['status'] == true )
416
- {
417
- $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
418
- $result['type'] = 'success';
419
- $result['message'] = isset($bten_settings['msg']) ? $bten_settings['msg']: 'Successfully subscribed.';
420
-
421
- echo json_encode( $result );
422
- exit;
423
- }
424
-
425
- else{
426
- $result['type'] = 'error';
427
- $result['message'] = __( 'Error in subscription.', 'blossomthemes-email-newsletter' );
428
- echo json_encode( $result );
429
- exit;
430
- }
431
- } elseif( $platform === 'sendinblue' ) {
432
- $sendinblue_object = new Blossomthemes_Email_Newsletter_Sendinblue;
433
- $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
434
-
435
- $response = $sendinblue_object->action_form_submission( $email, $sid, $fname );
436
-
437
- if( 'success' === $response ) {
438
- $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
439
- $result['type'] = 'success';
440
- $result['message'] = isset($bten_settings['msg']) ? $bten_settings['msg']: 'Successfully subscribed.';
441
-
442
- echo json_encode( $result );
443
- exit;
444
- } else{
445
- $result['type'] = 'error';
446
- $result['message'] = __( 'Error in subscription.', 'blossomthemes-email-newsletter' );
447
- echo json_encode( $result );
448
- exit;
449
- }
450
- }
451
- else{
452
- $result['type'] = 'error';
453
- $result['message'] = isset($bten_settings['msg']) ? $bten_settings['msg']: 'Error in subscription. Please check the platform and API key used in the Settings.';
454
- echo json_encode( $result );
455
- exit;
456
- }
457
- }
458
- }
459
- }
 
460
  new Blossomthemes_Email_Newsletter_Shortcodes;
1
+ <?php
2
+ /**
3
+ * Frontend view of the plugin.
4
+ *
5
+ * @package Blossomthemes_Email_Newsletter
6
+ * @subpackage Blossomthemes_Email_Newsletter/includes
7
+ * @author blossomthemes
8
+ */
9
+ class Blossomthemes_Email_Newsletter_Shortcodes {
10
+
11
+ function __construct()
12
+ {
13
+ add_shortcode( 'BTEN', array( $this, 'blossomthemes_email_newsletter_shortcode_callback' ) );
14
+ add_action( 'wp_ajax_subscription_response', array( $this, 'blossomthemes_email_newsletter_ajax_callback' ) );
15
+ add_action( 'wp_ajax_nopriv_subscription_response', array( $this, 'blossomthemes_email_newsletter_ajax_callback' ) );
16
+ }
17
+
18
+ //function to generate shortcode
19
+ function blossomthemes_email_newsletter_shortcode_callback( $atts, $content = "" )
20
+ {
21
+ $obj = new Blossomthemes_Email_Newsletter_Functions;
22
+
23
+ $atts = shortcode_atts( array(
24
+ 'id' => '',
25
+ 'html_class' => ''
26
+ ), $atts, 'BTEN' );
27
+ $atts['id'] = absint($atts['id']);
28
+ $rrsb_bg = '';
29
+ $rrsb_font = '';
30
+ $blossomthemes_email_newsletter_setting = get_post_meta( $atts['id'], 'blossomthemes_email_newsletter_setting', true );
31
+ $settings = get_option( 'blossomthemes_email_newsletter_settings', true );
32
+ $rrsb_option = ! empty( $blossomthemes_email_newsletter_setting['appearance']['newsletter-bg-option'] ) ? sanitize_text_field( $blossomthemes_email_newsletter_setting['appearance']['newsletter-bg-option'] ) : 'bg-color';
33
+
34
+ if( $rrsb_option == 'image' )
35
+ {
36
+ $overlay = isset( $blossomthemes_email_newsletter_setting['appearance']['overlay'] ) && $blossomthemes_email_newsletter_setting['appearance']['overlay'] == '1' ? ' has-overlay' : ' no-overlay';
37
+ if( isset( $blossomthemes_email_newsletter_setting['appearance']['bg']) && $blossomthemes_email_newsletter_setting['appearance']['bg']!='' )
38
+ {
39
+ $attachment_id = $blossomthemes_email_newsletter_setting['appearance']['bg'];
40
+ $newsletter_bio_img_size = apply_filters('bt_newsletter_img_size','full');
41
+ $image_array = wp_get_attachment_image_src( $attachment_id, $newsletter_bio_img_size );
42
+ $rrsb_bg = 'url('.$image_array[0].') no-repeat';
43
+ }
44
+ }
45
+ else{
46
+ if( isset( $blossomthemes_email_newsletter_setting['appearance']['bgcolor'] ) && $blossomthemes_email_newsletter_setting['appearance']['bgcolor']!='' )
47
+ {
48
+ $rrsb_bg = ! empty( $blossomthemes_email_newsletter_setting['appearance']['bgcolor'] ) ? sanitize_text_field( $blossomthemes_email_newsletter_setting['appearance']['bgcolor'] ) : apply_filters('bt_newsletter_bg_color','#ffffff');
49
+ }
50
+ elseif( isset( $settings['appearance']['bgcolor'] ) && $settings['appearance']['bgcolor']!='' )
51
+ {
52
+ $rrsb_bg = ! empty( $settings['appearance']['bgcolor'] ) ? sanitize_text_field( $settings['appearance']['bgcolor'] ) : apply_filters('bt_newsletter_bg_color','#ffffff');
53
+ }
54
+ }
55
+ if( isset( $blossomthemes_email_newsletter_setting['appearance']['fontcolor'] ) && $blossomthemes_email_newsletter_setting['appearance']['fontcolor']!='' )
56
+ {
57
+ $rrsb_font = ! empty( $blossomthemes_email_newsletter_setting['appearance']['fontcolor'] ) ? sanitize_text_field( $blossomthemes_email_newsletter_setting['appearance']['fontcolor'] ) : apply_filters('bt_newsletter_font_color_setting','#ffffff');
58
+ }
59
+ elseif( isset( $settings['appearance']['fontcolor'] ) && $settings['appearance']['fontcolor']!='' )
60
+ {
61
+ $rrsb_font = ! empty( $settings['appearance']['fontcolor'] ) ? sanitize_text_field( $settings['appearance']['fontcolor'] ) : apply_filters('bt_newsletter_font_color_setting','#ffffff');
62
+ }
63
+
64
+ ob_start();
65
+ ?>
66
+ <div class="blossomthemes-email-newsletter-wrapper<?php if(isset($rrsb_option) && $rrsb_option == 'image'){ echo ' bg-img', $overlay;}?> <?php echo esc_attr( $atts['html_class'] ); ?>" id="boxes-<?php echo esc_attr($atts['id']);?>" style="background: <?php echo esc_attr($rrsb_bg);?>; color: <?php echo esc_attr($rrsb_font);?> ">
67
+
68
+ <?php $inner_wrap = apply_filters( 'bt_newsletter_shortcode_inner_wrap_display', false );
69
+ if ( $inner_wrap ) {
70
+ do_action( 'bt_newsletter_shortcode_inner_wrap_start' );
71
+ } ?>
72
+
73
+ <div class="text-holder" >
74
+ <?php if( get_the_title( $atts['id'] ) ) { $title = get_the_title( $atts['id'] ); echo '<h3>'.esc_attr($title).'</h3>'; }?>
75
+ <?php
76
+ if( isset($blossomthemes_email_newsletter_setting['appearance']['note']) && $blossomthemes_email_newsletter_setting['appearance']['note']!='' )
77
+ {
78
+ $note = $blossomthemes_email_newsletter_setting['appearance']['note'];
79
+ echo '<span>'.esc_attr($note).'</span>';
80
+ }
81
+ ?>
82
+ </div>
83
+ <form id="blossomthemes-email-newsletter-<?php echo esc_attr($atts['id']);?>" class="blossomthemes-email-newsletter-window-<?php echo esc_attr($atts['id']);?>">
84
+ <?php
85
+ $val = isset($blossomthemes_email_newsletter_setting['field']['select']) ? esc_attr($blossomthemes_email_newsletter_setting['field']['select']):'email';
86
+ if( $val=='email' )
87
+ {
88
+ ?>
89
+ <input type="text" name="subscribe-email" required="required" class="subscribe-email-<?php echo esc_attr($atts['id']);?>" value="" placeholder="<?php echo isset($blossomthemes_email_newsletter_setting['field']['email_placeholder']) && $blossomthemes_email_newsletter_setting['field']['email_placeholder'] !='' ? esc_attr($blossomthemes_email_newsletter_setting['field']['email_placeholder']): __('Your Email', 'blossomthemes-email-newsletter');?>">
90
+ <?php
91
+ }
92
+ else{ ?>
93
+ <input type="text" name="subscribe-fname" required="required" class="subscribe-fname-<?php echo esc_attr($atts['id']);?>" value="" placeholder="<?php echo isset($blossomthemes_email_newsletter_setting['field']['first_name_placeholder']) && $blossomthemes_email_newsletter_setting['field']['first_name_placeholder'] != '' ? esc_attr($blossomthemes_email_newsletter_setting['field']['first_name_placeholder']): __('Your Name', 'blossomthemes-email-newsletter');?>">
94
+
95
+ <input type="text" name="subscribe-email" required="required" class="subscribe-email-<?php echo esc_attr($atts['id']);?>" value="" placeholder="<?php echo isset($blossomthemes_email_newsletter_setting['field']['email_placeholder']) && $blossomthemes_email_newsletter_setting['field']['email_placeholder'] != '' ? esc_attr($blossomthemes_email_newsletter_setting['field']['email_placeholder']): __('Your Email', 'blossomthemes-email-newsletter');?>">
96
+ <?php
97
+ }
98
+ if( isset( $blossomthemes_email_newsletter_setting['appearance']['gdpr'] ) && $blossomthemes_email_newsletter_setting['appearance']['gdpr'] == '1' )
99
+ {
100
+ ?>
101
+ <label for="subscribe-confirmation-<?php echo esc_attr($atts['id']);?>">
102
+ <div class="subscribe-inner-wrap">
103
+ <input type="checkbox" class="subscribe-confirmation-<?php echo esc_attr($atts['id']);?>" name="subscribe-confirmation" id="subscribe-confirmation-<?php echo esc_attr($atts['id']);?>" required/><span class="check-mark"></span>
104
+ <span class="text">
105
+ <?php
106
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
107
+ $gdprmsg = isset($blossomthemes_email_newsletter_settings['gdpr-msg']) && $blossomthemes_email_newsletter_settings['gdpr-msg'] !='' ? $blossomthemes_email_newsletter_settings['gdpr-msg']: __('By checking this, you agree to our Privacy Policy.', 'blossomthemes-email-newsletter');
108
+ echo wp_kses_post($gdprmsg);
109
+ ?>
110
+ </span>
111
+ </div>
112
+ </label>
113
+ <?php
114
+ }
115
+ ?>
116
+ <div id="loader-<?php echo esc_attr($atts['id']);?>" style="display: none">
117
+ <div class="table">
118
+ <div class="table-row">
119
+ <div class="table-cell">
120
+ <img src="<?php echo BLOSSOMTHEMES_EMAIL_NEWSLETTER_FILE_URL.'/public/css/loader.gif';?>">
121
+ </div>
122
+ </div>
123
+ </div>
124
+ </div>
125
+ <input type="submit" name="subscribe-submit" class="subscribe-submit-<?php echo esc_attr($atts['id']);?>" value="<?php echo isset($blossomthemes_email_newsletter_setting['field']['submit_label']) && $blossomthemes_email_newsletter_setting['field']['submit_label'] !='' ? esc_attr($blossomthemes_email_newsletter_setting['field']['submit_label']): __('Subscribe', 'blossomthemes-email-newsletter');?>">
126
+ <?php wp_nonce_field( 'subscription_response', 'bten_subscription_nonce_'.esc_attr($atts['id']).'' ); ?>
127
+ </form>
128
+
129
+ <?php $inner_wrap = apply_filters( 'bt_newsletter_shortcode_inner_wrap_display', false );
130
+ if ( $inner_wrap ) {
131
+ do_action( 'bt_newsletter_shortcode_inner_wrap_close' );
132
+ } ?>
133
+
134
+ <div class="bten-response" id="bten-response-<?php echo esc_attr($atts['id']);?>"><span></span></div>
135
+ <div id="mask-<?php echo esc_attr($atts['id']);?>"></div>
136
+ </div>
137
+ <?php
138
+ global $post;
139
+ $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
140
+ $style = '<style>
141
+ #mask-'.esc_attr($atts['id']).' {
142
+ position: fixed;
143
+ width: 100%;
144
+ height: 100%;
145
+ left: 0;
146
+ top: 0;
147
+ z-index: 9000;
148
+ background-color: #000;
149
+ display: none;
150
+ }
151
+
152
+ #boxes-'.esc_attr($atts['id']).' #dialog {
153
+ width: 750px;
154
+ height: 300px;
155
+ padding: 10px;
156
+ background-color: #ffffff;
157
+ font-family: "Segoe UI Light", sans-serif;
158
+ font-size: 15pt;
159
+ }
160
+
161
+
162
+ #loader-'.esc_attr($atts['id']).' {
163
+ position: absolute;
164
+ top: 27%;
165
+ left: 0;
166
+ width: 100%;
167
+ height: 80%;
168
+ text-align: center;
169
+ font-size: 50px;
170
+ }
171
+
172
+ #loader-'.esc_attr($atts['id']).' .table{
173
+ display: table;
174
+ width: 100%;
175
+ height: 100%;
176
+ }
177
+
178
+ #loader-'.esc_attr($atts['id']).' .table-row{
179
+ display: table-row;
180
+ }
181
+
182
+ #loader-'.esc_attr($atts['id']).' .table-cell{
183
+ display: table-cell;
184
+ vertical-align: middle;
185
+ }
186
+ </style>';
187
+ echo $obj->bten_minify_css($style);
188
+ // echo $style;
189
+
190
+ $ajax =
191
+ '<script>
192
+ jQuery(document).ready(function() {
193
+ jQuery(document).on("submit","form#blossomthemes-email-newsletter-'.esc_attr($atts['id']).'", function(e){
194
+ e.preventDefault();
195
+ jQuery(".subscribe-submit-'.esc_attr($atts['id']).'").attr("disabled", "disabled" );
196
+ var email = jQuery(".subscribe-email-'.esc_attr($atts['id']).'").val();
197
+ var fname = jQuery(".subscribe-fname-'.esc_attr($atts['id']).'").val();
198
+ var confirmation = jQuery(".subscribe-confirmation-'.esc_attr($atts['id']).'").val();
199
+ var sid = '.esc_attr($atts['id']).';
200
+ var nonce = jQuery("#bten_subscription_nonce_'.esc_attr($atts['id']).'").val();
201
+ jQuery.ajax({
202
+ type : "post",
203
+ dataType : "json",
204
+ url : bten_ajax_data.ajaxurl,
205
+ data : {action: "subscription_response", email : email, fname : fname, sid : sid, confirmation : confirmation, nonce : nonce},
206
+ beforeSend: function(){
207
+ jQuery("#loader-'.esc_attr($atts['id']).'").fadeIn(500);
208
+ },
209
+ success: function(response){
210
+ jQuery(".subscribe-submit-'.esc_attr($atts['id']).'").attr("disabled", "disabled" );';
211
+ $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
212
+ $option = isset($bten_settings['thankyou-option']) ? esc_attr($bten_settings['thankyou-option']):'text';
213
+ $ajax .='if(response.type === "success") {';
214
+ if($option == 'text')
215
+ {
216
+ $ajax .= 'jQuery("#bten-response-'.esc_attr($atts['id']).' span").html(response.message);jQuery("#bten-response-'.esc_attr($atts['id']).'").fadeIn("slow").delay("3000").fadeOut("3000",function(){
217
+ jQuery(".subscribe-submit-'.esc_attr($atts['id']).'").removeAttr("disabled", "disabled" );
218
+ jQuery("form#blossomthemes-email-newsletter-'.esc_attr($atts['id']).'").find("input[type=text]").val("");
219
+ jQuery("form#blossomthemes-email-newsletter-'.esc_attr($atts['id']).'").find("input[type=checkbox]").prop("checked", false);
220
+ });';
221
+ }
222
+ else{
223
+ $selected_page = isset($bten_settings['page'])?esc_attr($bten_settings['page']):'';
224
+ $url = get_permalink($selected_page);
225
+ $ajax.= 'window.location.href = "'.esc_url($url).'"';
226
+ }
227
+
228
+ $ajax.='}
229
+ else{
230
+ jQuery("#bten-response-'.esc_attr($atts['id']).' span").html(response.message);jQuery("#bten-response-'.esc_attr($atts['id']).'").fadeIn("slow").delay("3000").fadeOut("3000",function(){
231
+ jQuery(".subscribe-submit-'.esc_attr($atts['id']).'").removeAttr("disabled", "disabled" );
232
+ jQuery("form#blossomthemes-email-newsletter-'.esc_attr($atts['id']).'").find("input[type=text]").val("");
233
+ jQuery("form#blossomthemes-email-newsletter-'.esc_attr($atts['id']).'").find("input[type=checkbox]").prop("checked", false);
234
+
235
+ });
236
+ }
237
+ },
238
+ complete: function(){
239
+ jQuery("#loader-'.esc_attr($atts['id']).'").fadeOut(500);
240
+ }
241
+ });
242
+ });
243
+ });
244
+ </script>';
245
+ echo $obj->bten_minify_js($ajax);
246
+ $output = ob_get_contents();
247
+ ob_end_clean();
248
+ return apply_filters( 'blossomthemes_newsletter_shortcode_filter', $output, $atts );
249
+ }
250
+
251
+ //function to generate ajax actions
252
+ function blossomthemes_email_newsletter_ajax_callback()
253
+ {
254
+ if ( ! isset( $_POST['nonce'] )
255
+ || ! wp_verify_nonce( $_POST['nonce'], 'subscription_response' )
256
+ ) {
257
+ $result['type'] = 'error';
258
+ $result['message'] = __( 'Sorry, your nonce did not verify.', 'blossomthemes-email-newsletter' );
259
+ echo json_encode( $result );
260
+ exit;
261
+ }
262
+
263
+ $email = sanitize_email( $_POST['email'] );
264
+ $fname = isset( $_POST['fname'] ) ? esc_attr( $_POST['fname'] ) : '';
265
+ $lname = ' ';
266
+
267
+ $arr['subscriber']['email'] = $email;
268
+ $sid = intval( $_POST['sid'] );
269
+ $to = $email;
270
+
271
+ /*if ( !preg_match('/^[a-z A-Z]+$/', $fname ) ) {
272
+ $result['type'] = 'error';
273
+ $result['message'] = __( 'Please enter a valid name.', 'blossomthemes-email-newsletter' );
274
+ echo json_encode( $result );
275
+ exit;
276
+ }*/
277
+
278
+ if ( !is_email($to) ) {
279
+ $result['type'] = 'error';
280
+ $result['message'] = __( 'Please enter a valid email.', 'blossomthemes-email-newsletter' );
281
+ echo json_encode( $result );
282
+ exit;
283
+ }
284
+
285
+ $subject = 'Subscribe To Newsletter';
286
+ $admin_email = get_option('admin_email');
287
+ if( $admin_email != '')
288
+ {
289
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
290
+ $platform = $blossomthemes_email_newsletter_settings['platform'];
291
+
292
+ if( $platform == 'mailerlite' )
293
+ {
294
+ $obj = new Blossomthemes_Email_Newsletter_Mailerlite;
295
+ $response = $obj->bten_mailerlite_action($email, $sid, $fname);
296
+ if( $response == 200 )
297
+ {
298
+ $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
299
+ $result['type'] = 'success';
300
+ $result['message'] = isset($bten_settings['msg']) ? $bten_settings['msg']: __('Successfully subscribed.', 'blossomthemes-email-newsletter');
301
+ echo json_encode( $result );
302
+ exit;
303
+ }
304
+
305
+ else{
306
+
307
+ $result['type'] = 'error';
308
+ $result['message'] = isset( $response ) ? $response : __( 'Error in subscription.', 'blossomthemes-email-newsletter' );
309
+ echo json_encode( $result );
310
+ exit;
311
+ }
312
+ }
313
+
314
+ elseif( $platform == 'mailchimp' )
315
+ {
316
+ $obj = new Blossomthemes_Email_Newsletter_Mailchimp;
317
+ $response = $obj->bten_mailchimp_action($email, $sid, $fname);
318
+ if( $response == 200 )
319
+ {
320
+ $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
321
+ if( isset($bten_settings['mailchimp']['enable_notif']) && $blossomthemes_email_newsletter_settings['mailchimp']['enable_notif'] =='1'){
322
+ $result['type'] = 'success';
323
+ $result['message'] = __( 'Please check your email for confirmation.', 'blossomthemes-email-newsletter' );
324
+
325
+ echo json_encode( $result );
326
+ exit;
327
+ }
328
+ else{
329
+ $result['type'] = 'success';
330
+ $result['message'] = isset($bten_settings['msg']) ? $bten_settings['msg']: 'Successfully subscribed.';
331
+ echo json_encode( $result );
332
+ exit;
333
+ }
334
+ }
335
+
336
+ else{
337
+ $result['type'] = 'error';
338
+ $result['message'] = __( 'Error in subscription.', 'blossomthemes-email-newsletter' );
339
+ echo json_encode( $result );
340
+ exit;
341
+ }
342
+ }
343
+
344
+ elseif( $platform == 'convertkit' )
345
+ {
346
+ $obj = new Blossomthemes_Email_Newsletter_Convertkit;
347
+ $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
348
+ $response = $obj->bten_convertkit_action($email,$sid,$fname,$lname);
349
+ if( $response == 200 )
350
+ {
351
+ $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
352
+ $result['type'] = 'success';
353
+ $result['message'] = isset($bten_settings['msg']) ? $bten_settings['msg']: 'Successfully subscribed.';
354
+ echo json_encode( $result );
355
+ exit;
356
+ }
357
+
358
+ else{
359
+ $result['type'] = 'error';
360
+ $result['message'] = __( 'Error in subscription.', 'blossomthemes-email-newsletter' );
361
+ echo json_encode( $result );
362
+ exit;
363
+ }
364
+ }
365
+
366
+ elseif( $platform == 'getresponse' )
367
+ {
368
+ $obj = new Blossomthemes_Email_Newsletter_GetResponse;
369
+ $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
370
+ $response = $obj->bten_getresponse_action($email, $sid, $fname);
371
+ if( isset( $response['response'] ) && $response['response'] == 200 )
372
+ {
373
+ $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
374
+ $result['type'] = 'success';
375
+ $result['message'] = isset($bten_settings['msg']) ? $bten_settings['msg']: 'Successfully subscribed.';
376
+
377
+ echo json_encode( $result );
378
+ exit;
379
+ }
380
+
381
+ else{
382
+ $result['type'] = 'error';
383
+ $result['message'] = __( 'Error in subscription.', 'blossomthemes-email-newsletter' );
384
+ $result['errorMessage'] = isset($response['log']['errorMessage']) ? $response['log']['errorMessage'] : '';
385
+ echo json_encode( $result );
386
+ exit;
387
+ }
388
+ }
389
+ elseif( $platform == 'activecampaign' )
390
+ {
391
+ $obj = new Blossomthemes_Email_Newsletter_ActiveCampaign;
392
+ $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
393
+ $response = $obj->bten_activecampaign_action($email,$sid,$fname);
394
+ if( $response['response'] == 200 )
395
+ {
396
+ $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
397
+ $result['type'] = 'success';
398
+ $result['message'] = isset($bten_settings['msg']) ? $bten_settings['msg']: 'Successfully subscribed.';
399
+
400
+ echo json_encode( $result );
401
+ exit;
402
+ }
403
+
404
+ else{
405
+ $result['type'] = 'error';
406
+ $result['message'] = __( 'Error in subscription.', 'blossomthemes-email-newsletter' );
407
+ echo json_encode( $result );
408
+ exit;
409
+ }
410
+ }
411
+ elseif( $platform == 'aweber' )
412
+ {
413
+ $obj = new Blossomthemes_Email_Newsletter_AWeber;
414
+ $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
415
+ $response = $obj->bten_aweber_action($email, $sid, $fname);
416
+ if( $response['status'] == true )
417
+ {
418
+ $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
419
+ $result['type'] = 'success';
420
+ $result['message'] = isset($bten_settings['msg']) ? $bten_settings['msg']: 'Successfully subscribed.';
421
+
422
+ echo json_encode( $result );
423
+ exit;
424
+ }
425
+
426
+ else{
427
+ $result['type'] = 'error';
428
+ $result['message'] = __( 'Error in subscription.', 'blossomthemes-email-newsletter' );
429
+ echo json_encode( $result );
430
+ exit;
431
+ }
432
+ } elseif( $platform === 'sendinblue' ) {
433
+ $sendinblue_object = new Blossomthemes_Email_Newsletter_Sendinblue;
434
+ $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
435
+
436
+ $response = $sendinblue_object->action_form_submission( $email, $sid, $fname );
437
+
438
+ if( 'success' === $response ) {
439
+ $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
440
+ $result['type'] = 'success';
441
+ $result['message'] = isset($bten_settings['msg']) ? $bten_settings['msg']: 'Successfully subscribed.';
442
+
443
+ echo json_encode( $result );
444
+ exit;
445
+ } else{
446
+ $result['type'] = 'error';
447
+ $result['message'] = __( 'Error in subscription.', 'blossomthemes-email-newsletter' );
448
+ echo json_encode( $result );
449
+ exit;
450
+ }
451
+ }
452
+ else{
453
+ $result['type'] = 'error';
454
+ $result['message'] = isset($bten_settings['msg']) ? $bten_settings['msg']: 'Error in subscription. Please check the platform and API key used in the Settings.';
455
+ echo json_encode( $result );
456
+ exit;
457
+ }
458
+ }
459
+ }
460
+ }
461
  new Blossomthemes_Email_Newsletter_Shortcodes;
includes/class-blossomthemes-email-newsletter.php CHANGED
@@ -1,356 +1,340 @@
1
- <?php
2
-
3
- /**
4
- * The file that defines the core plugin class
5
- *
6
- * A class definition that includes attributes and functions used across both the
7
- * public-facing side of the site and the admin area.
8
- *
9
- * @link https://blossomthemes.com
10
- * @since 2.0.0
11
- *
12
- * @package Blossomthemes_Email_Newsletter
13
- * @subpackage Blossomthemes_Email_Newsletter/includes
14
- */
15
-
16
- /**
17
- * The core plugin class.
18
- *
19
- * This is used to define internationalization, admin-specific hooks, and
20
- * public-facing site hooks.
21
- *
22
- * Also maintains the unique identifier of this plugin as well as the current
23
- * version of the plugin.
24
- *
25
- * @since 2.0.0
26
- * @package Blossomthemes_Email_Newsletter
27
- * @subpackage Blossomthemes_Email_Newsletter/includes
28
- * @author blossomthemes <blossomthemes.com>
29
- */
30
- class Blossomthemes_Email_Newsletter {
31
-
32
- /**
33
- * The loader that's responsible for maintaining and registering all hooks that power
34
- * the plugin.
35
- *
36
- * @since 2.0.0
37
- * @access protected
38
- * @var Blossomthemes_Email_Newsletter_Loader $loader Maintains and registers all hooks for the plugin.
39
- */
40
- protected $loader;
41
-
42
- /**
43
- * The unique identifier of this plugin.
44
- *
45
- * @since 2.0.0
46
- * @access protected
47
- * @var string $plugin_name The string used to uniquely identify this plugin.
48
- */
49
- protected $plugin_name;
50
-
51
- /**
52
- * The current version of the plugin.
53
- *
54
- * @since 2.0.0
55
- * @access protected
56
- * @var string $version The current version of the plugin.
57
- */
58
- protected $version;
59
-
60
- /**
61
- * Define the core functionality of the plugin.
62
- *
63
- * Set the plugin name and the plugin version that can be used throughout the plugin.
64
- * Load the dependencies, define the locale, and set the hooks for the admin area and
65
- * the public-facing side of the site.
66
- *
67
- * @since 2.0.0
68
- */
69
- public function __construct() {
70
-
71
- $this->plugin_name = 'blossomthemes-email-newsletter';
72
- $this->version = '2.0.0';
73
-
74
- $this->load_dependencies();
75
- $this->set_locale();
76
- $this->define_admin_hooks();
77
- $this->define_public_hooks();
78
-
79
- }
80
-
81
- /**
82
- * Load the required dependencies for this plugin.
83
- *
84
- * Include the following files that make up the plugin:
85
- *
86
- * - Blossomthemes_Email_Newsletter_Loader. Orchestrates the hooks of the plugin.
87
- * - Blossomthemes_Email_Newsletter_i18n. Defines internationalization functionality.
88
- * - Blossomthemes_Email_Newsletter_Admin. Defines all hooks for the admin area.
89
- * - Blossomthemes_Email_Newsletter_Public. Defines all hooks for the public side of the site.
90
- *
91
- * Create an instance of the loader which will be used to register the hooks
92
- * with WordPress.
93
- *
94
- * @since 2.0.0
95
- * @access private
96
- */
97
- private function load_dependencies() {
98
-
99
- /**
100
- * Add autoloader
101
- */
102
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'vendor/autoload.php';
103
-
104
- /**
105
- * The class responsible for orchestrating the actions and filters of the
106
- * core plugin.
107
- */
108
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-blossomthemes-email-newsletter-loader.php';
109
-
110
- /**
111
- * The class responsible for defining internationalization functionality
112
- * of the plugin.
113
- */
114
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-blossomthemes-email-newsletter-i18n.php';
115
-
116
- /**
117
- * The class responsible for defining all actions that occur in the admin area.
118
- */
119
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-blossomthemes-email-newsletter-admin.php';
120
-
121
- /**
122
- * The class responsible for defining all actions that occur in the public-facing
123
- * side of the site.
124
- */
125
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-blossomthemes-email-newsletter-public.php';
126
-
127
- /**
128
- * The class responsible for defining all actions that occur in the public-facing
129
- * side of the site.
130
- */
131
- require plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-blossomthemes-email-newsletter-settings.php';
132
-
133
- /**
134
- * The class responsible for general functions.
135
- *
136
- */
137
- require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-functions.php';
138
-
139
- /**
140
- * The class responsible for meta for subscription form.
141
- *
142
- */
143
- require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-form-meta.php';
144
-
145
- /**
146
- * The class responsible for mailerlite libraries.
147
- *
148
- */
149
- if (!class_exists('ML_Lists')) {
150
- require_once BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/libs/mailerlite_rest/ML_Lists.php';
151
- }
152
-
153
- /**
154
- * The class responsible for mailchimp libraries.
155
- *
156
- */
157
- if(!class_exists('MC_Lists')) {
158
- require_once BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/libs/mailchimp/MC_Lists.php';
159
- }
160
-
161
- /**
162
- * The class responsible for convertkit libraries.
163
- *
164
- */
165
- if (!class_exists('Convertkit')) {
166
- require_once BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/libs/convertkit/convertkit.php';
167
- }
168
-
169
- /**
170
- * The class responsible for doing mailerlite libraries.
171
- *
172
- */
173
- if (!class_exists('ML_Webforms')) {
174
- require_once BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/libs/mailerlite_rest/ML_Webforms.php';
175
- }
176
-
177
- /**
178
- * Get Sendinblue email newsletter controller.
179
- */
180
- require_once BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/libs/sendinblue/Blossom_Sendinblue_API_Client.php';
181
-
182
- /**
183
- * The class responsible for doing mailerlite actions.
184
- *
185
- */
186
- require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-mailerlite.php';
187
-
188
- require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/libs/activecampaign/ActiveCampaign.class.php';
189
-
190
- require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/libs/aweber/aweber_api.php';
191
- /**
192
- * The class responsible for doing mailchimp actions.
193
- *
194
- */
195
- require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-mailchimp.php';
196
-
197
- /**
198
- * The class responsible for doing convertkit actions.
199
- *
200
- */
201
- require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-convertkit.php';
202
-
203
- /**
204
- * The class responsible for doing GetResponse actions.
205
- *
206
- */
207
- require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-getresponse.php';
208
-
209
- /**
210
- * The class responsible for doing ActiveCampaign actions.
211
- *
212
- */
213
- require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-activecampaign.php';
214
-
215
- /**
216
- * The class responsible for doing AWeber actions.
217
- *
218
- */
219
- require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-aweber.php';
220
-
221
- /**
222
- * The class responsible for doing Sendinblue actions.
223
- *
224
- */
225
- require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-sendinblue.php';
226
-
227
- /**
228
- * The class responsible for generating shortcode.
229
- *
230
- */
231
- require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-shortcodes.php';
232
-
233
- /**
234
- * The class responsible for generating widget.
235
- *
236
- */
237
- require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/widgets/widget-blossomthemes-newsletter.php';
238
-
239
- /**
240
- * Privacy content and sections.
241
- *
242
- */
243
- require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/privacy-sections.php';
244
-
245
- /**
246
- * The class responsible for popup functions.
247
- *
248
- */
249
- require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-popup-functions.php';
250
-
251
-
252
- $this->loader = new Blossomthemes_Email_Newsletter_Loader();
253
-
254
- }
255
-
256
- /**
257
- * Define the locale for this plugin for internationalization.
258
- *
259
- * Uses the Blossomthemes_Email_Newsletter_i18n class in order to set the domain and to register the hook
260
- * with WordPress.
261
- *
262
- * @since 2.0.0
263
- * @access private
264
- */
265
- private function set_locale() {
266
-
267
- $plugin_i18n = new Blossomthemes_Email_Newsletter_i18n();
268
-
269
- $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
270
-
271
- }
272
-
273
- /**
274
- * Register all of the hooks related to the admin area functionality
275
- * of the plugin.
276
- *
277
- * @since 2.0.0
278
- * @access private
279
- */
280
- private function define_admin_hooks() {
281
-
282
- $plugin_admin = new Blossomthemes_Email_Newsletter_Admin( $this->get_plugin_name(), $this->get_version() );
283
-
284
- $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
285
- $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
286
- $this->loader->add_action( 'init', $plugin_admin, 'blossomthemes_register_form' );
287
- // $this->loader->add_action( 'init', $plugin_admin, 'blossomthemes_register_subscriber' );
288
- $this->loader->add_action( 'admin_menu', $plugin_admin, 'blossomthemes_email_newsletter_settings_page' );
289
- $this->loader->add_action( 'admin_init', $plugin_admin, 'blossomthemes_email_newsletter_register_settings' );
290
- // $this->loader->add_filter( 'manage_subscriber_posts_columns', $plugin_admin, 'blossomthemes_subscriber_cpt_columns');
291
- // $this->loader->add_action( 'manage_posts_custom_column' , $plugin_admin, 'blossomthemes_subscriber_custom_columns', 10, 2 );
292
- $this->loader->add_filter('manage_subscribe-form_posts_columns', $plugin_admin, 'set_subscribe_form_columns');
293
- $this->loader->add_action('manage_subscribe-form_posts_custom_column', $plugin_admin, 'set_subscribe_form_columns_content', 10, 2);
294
- $this->loader->add_action( 'admin_notices', $plugin_admin, 'bten_api_update_notice' );
295
- $this->loader->add_action('admin_init', $plugin_admin, 'bten_ignore_admin_notice');
296
-
297
- }
298
-
299
- /**
300
- * Register all of the hooks related to the public-facing functionality
301
- * of the plugin.
302
- *
303
- * @since 2.0.0
304
- * @access private
305
- */
306
- private function define_public_hooks() {
307
-
308
- $plugin_public = new Blossomthemes_Email_Newsletter_Public( $this->get_plugin_name(), $this->get_version() );
309
-
310
- $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
311
- $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
312
- $this->loader->add_filter( 'script_loader_tag', $plugin_public, 'blossom_email_newsletter_js_defer_files', 10 );
313
-
314
- }
315
-
316
- /**
317
- * Run the loader to execute all of the hooks with WordPress.
318
- *
319
- * @since 2.0.0
320
- */
321
- public function run() {
322
- $this->loader->run();
323
- }
324
-
325
- /**
326
- * The name of the plugin used to uniquely identify it within the context of
327
- * WordPress and to define internationalization functionality.
328
- *
329
- * @since 2.0.0
330
- * @return string The name of the plugin.
331
- */
332
- public function get_plugin_name() {
333
- return $this->plugin_name;
334
- }
335
-
336
- /**
337
- * The reference to the class that orchestrates the hooks with the plugin.
338
- *
339
- * @since 2.0.0
340
- * @return Blossomthemes_Email_Newsletter_Loader Orchestrates the hooks of the plugin.
341
- */
342
- public function get_loader() {
343
- return $this->loader;
344
- }
345
-
346
- /**
347
- * Retrieve the version number of the plugin.
348
- *
349
- * @since 2.0.0
350
- * @return string The version number of the plugin.
351
- */
352
- public function get_version() {
353
- return $this->version;
354
- }
355
-
356
- }
1
+ <?php
2
+
3
+ /**
4
+ * The file that defines the core plugin class
5
+ *
6
+ * A class definition that includes attributes and functions used across both the
7
+ * public-facing side of the site and the admin area.
8
+ *
9
+ * @link https://blossomthemes.com
10
+ * @since 2.0.0
11
+ *
12
+ * @package Blossomthemes_Email_Newsletter
13
+ * @subpackage Blossomthemes_Email_Newsletter/includes
14
+ */
15
+
16
+ /**
17
+ * The core plugin class.
18
+ *
19
+ * This is used to define internationalization, admin-specific hooks, and
20
+ * public-facing site hooks.
21
+ *
22
+ * Also maintains the unique identifier of this plugin as well as the current
23
+ * version of the plugin.
24
+ *
25
+ * @since 2.0.0
26
+ * @package Blossomthemes_Email_Newsletter
27
+ * @subpackage Blossomthemes_Email_Newsletter/includes
28
+ * @author blossomthemes <blossomthemes.com>
29
+ */
30
+ class Blossomthemes_Email_Newsletter {
31
+
32
+ /**
33
+ * The loader that's responsible for maintaining and registering all hooks that power
34
+ * the plugin.
35
+ *
36
+ * @since 2.0.0
37
+ * @access protected
38
+ * @var Blossomthemes_Email_Newsletter_Loader $loader Maintains and registers all hooks for the plugin.
39
+ */
40
+ protected $loader;
41
+
42
+ /**
43
+ * The unique identifier of this plugin.
44
+ *
45
+ * @since 2.0.0
46
+ * @access protected
47
+ * @var string $plugin_name The string used to uniquely identify this plugin.
48
+ */
49
+ protected $plugin_name;
50
+
51
+ /**
52
+ * The current version of the plugin.
53
+ *
54
+ * @since 2.0.0
55
+ * @access protected
56
+ * @var string $version The current version of the plugin.
57
+ */
58
+ protected $version;
59
+
60
+ /**
61
+ * Define the core functionality of the plugin.
62
+ *
63
+ * Set the plugin name and the plugin version that can be used throughout the plugin.
64
+ * Load the dependencies, define the locale, and set the hooks for the admin area and
65
+ * the public-facing side of the site.
66
+ *
67
+ * @since 2.0.0
68
+ */
69
+ public function __construct() {
70
+
71
+ $this->plugin_name = 'blossomthemes-email-newsletter';
72
+ $this->version = '2.0.0';
73
+
74
+ $this->load_dependencies();
75
+ $this->set_locale();
76
+ $this->define_admin_hooks();
77
+ $this->define_public_hooks();
78
+
79
+ }
80
+
81
+ /**
82
+ * Load the required dependencies for this plugin.
83
+ *
84
+ * Include the following files that make up the plugin:
85
+ *
86
+ * - Blossomthemes_Email_Newsletter_Loader. Orchestrates the hooks of the plugin.
87
+ * - Blossomthemes_Email_Newsletter_i18n. Defines internationalization functionality.
88
+ * - Blossomthemes_Email_Newsletter_Admin. Defines all hooks for the admin area.
89
+ * - Blossomthemes_Email_Newsletter_Public. Defines all hooks for the public side of the site.
90
+ *
91
+ * Create an instance of the loader which will be used to register the hooks
92
+ * with WordPress.
93
+ *
94
+ * @since 2.0.0
95
+ * @access private
96
+ */
97
+ private function load_dependencies() {
98
+
99
+ /**
100
+ * Add autoloader
101
+ */
102
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'vendor/autoload.php';
103
+
104
+ /**
105
+ * The class responsible for orchestrating the actions and filters of the
106
+ * core plugin.
107
+ */
108
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-blossomthemes-email-newsletter-loader.php';
109
+
110
+ /**
111
+ * The class responsible for defining internationalization functionality
112
+ * of the plugin.
113
+ */
114
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-blossomthemes-email-newsletter-i18n.php';
115
+
116
+ /**
117
+ * The class responsible for defining all actions that occur in the admin area.
118
+ */
119
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-blossomthemes-email-newsletter-admin.php';
120
+
121
+ /**
122
+ * The class responsible for defining all actions that occur in the public-facing
123
+ * side of the site.
124
+ */
125
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-blossomthemes-email-newsletter-public.php';
126
+
127
+ /**
128
+ * The class responsible for defining all actions that occur in the public-facing
129
+ * side of the site.
130
+ */
131
+ require plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-blossomthemes-email-newsletter-settings.php';
132
+
133
+ /**
134
+ * The class responsible for general functions.
135
+ *
136
+ */
137
+ require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-functions.php';
138
+
139
+ /**
140
+ * The class responsible for meta for subscription form.
141
+ *
142
+ */
143
+ require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-form-meta.php';
144
+
145
+ /**
146
+ * The class responsible for mailchimp libraries.
147
+ *
148
+ */
149
+ if(!class_exists('MC_Lists')) {
150
+ require_once BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/libs/mailchimp/MC_Lists.php';
151
+ }
152
+
153
+ /**
154
+ * The class responsible for convertkit libraries.
155
+ *
156
+ */
157
+ if (!class_exists('Convertkit')) {
158
+ require_once BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/libs/convertkit/convertkit.php';
159
+ }
160
+
161
+ /**
162
+ * Get Sendinblue email newsletter controller.
163
+ */
164
+ require_once BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/libs/sendinblue/Blossom_Sendinblue_API_Client.php';
165
+
166
+ /**
167
+ * The class responsible for doing mailerlite actions.
168
+ *
169
+ */
170
+ require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-mailerlite.php';
171
+
172
+ require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/libs/activecampaign/ActiveCampaign.class.php';
173
+
174
+ require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/libs/aweber/aweber_api.php';
175
+ /**
176
+ * The class responsible for doing mailchimp actions.
177
+ *
178
+ */
179
+ require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-mailchimp.php';
180
+
181
+ /**
182
+ * The class responsible for doing convertkit actions.
183
+ *
184
+ */
185
+ require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-convertkit.php';
186
+
187
+ /**
188
+ * The class responsible for doing GetResponse actions.
189
+ *
190
+ */
191
+ require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-getresponse.php';
192
+
193
+ /**
194
+ * The class responsible for doing ActiveCampaign actions.
195
+ *
196
+ */
197
+ require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-activecampaign.php';
198
+
199
+ /**
200
+ * The class responsible for doing AWeber actions.
201
+ *
202
+ */
203
+ require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-aweber.php';
204
+
205
+ /**
206
+ * The class responsible for doing Sendinblue actions.
207
+ *
208
+ */
209
+ require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-sendinblue.php';
210
+
211
+ /**
212
+ * The class responsible for generating shortcode.
213
+ *
214
+ */
215
+ require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-shortcodes.php';
216
+
217
+ /**
218
+ * The class responsible for generating widget.
219
+ *
220
+ */
221
+ require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/widgets/widget-blossomthemes-newsletter.php';
222
+
223
+ /**
224
+ * Privacy content and sections.
225
+ *
226
+ */
227
+ require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/privacy-sections.php';
228
+
229
+ /**
230
+ * The class responsible for popup functions.
231
+ *
232
+ */
233
+ require BLOSSOMTHEMES_EMAIL_NEWSLETTER_BASE_PATH . '/includes/class-blossomthemes-email-newsletter-popup-functions.php';
234
+
235
+
236
+ $this->loader = new Blossomthemes_Email_Newsletter_Loader();
237
+
238
+ }
239
+
240
+ /**
241
+ * Define the locale for this plugin for internationalization.
242
+ *
243
+ * Uses the Blossomthemes_Email_Newsletter_i18n class in order to set the domain and to register the hook
244
+ * with WordPress.
245
+ *
246
+ * @since 2.0.0
247
+ * @access private
248
+ */
249
+ private function set_locale() {
250
+
251
+ $plugin_i18n = new Blossomthemes_Email_Newsletter_i18n();
252
+
253
+ $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
254
+
255
+ }
256
+
257
+ /**
258
+ * Register all of the hooks related to the admin area functionality
259
+ * of the plugin.
260
+ *
261
+ * @since 2.0.0
262
+ * @access private
263
+ */
264
+ private function define_admin_hooks() {
265
+
266
+ $plugin_admin = new Blossomthemes_Email_Newsletter_Admin( $this->get_plugin_name(), $this->get_version() );
267
+
268
+ $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
269
+ $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
270
+ $this->loader->add_action( 'init', $plugin_admin, 'blossomthemes_register_form' );
271
+ // $this->loader->add_action( 'init', $plugin_admin, 'blossomthemes_register_subscriber' );
272
+ $this->loader->add_action( 'admin_menu', $plugin_admin, 'blossomthemes_email_newsletter_settings_page' );
273
+ $this->loader->add_action( 'admin_init', $plugin_admin, 'blossomthemes_email_newsletter_register_settings' );
274
+ // $this->loader->add_filter( 'manage_subscriber_posts_columns', $plugin_admin, 'blossomthemes_subscriber_cpt_columns');
275
+ // $this->loader->add_action( 'manage_posts_custom_column' , $plugin_admin, 'blossomthemes_subscriber_custom_columns', 10, 2 );
276
+ $this->loader->add_filter('manage_subscribe-form_posts_columns', $plugin_admin, 'set_subscribe_form_columns');
277
+ $this->loader->add_action('manage_subscribe-form_posts_custom_column', $plugin_admin, 'set_subscribe_form_columns_content', 10, 2);
278
+ $this->loader->add_action( 'admin_notices', $plugin_admin, 'bten_api_update_notice' );
279
+ $this->loader->add_action('admin_init', $plugin_admin, 'bten_ignore_admin_notice');
280
+
281
+ }
282
+
283
+ /**
284
+ * Register all of the hooks related to the public-facing functionality
285
+ * of the plugin.
286
+ *
287
+ * @since 2.0.0
288
+ * @access private
289
+ */
290
+ private function define_public_hooks() {
291
+
292
+ $plugin_public = new Blossomthemes_Email_Newsletter_Public( $this->get_plugin_name(), $this->get_version() );
293
+
294
+ $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
295
+ $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
296
+ $this->loader->add_filter( 'script_loader_tag', $plugin_public, 'blossom_email_newsletter_js_defer_files', 10 );
297
+
298
+ }
299
+
300
+ /**
301
+ * Run the loader to execute all of the hooks with WordPress.
302
+ *
303
+ * @since 2.0.0
304
+ */
305
+ public function run() {
306
+ $this->loader->run();
307
+ }
308
+
309
+ /**
310
+ * The name of the plugin used to uniquely identify it within the context of
311
+ * WordPress and to define internationalization functionality.
312
+ *
313
+ * @since 2.0.0
314
+ * @return string The name of the plugin.
315
+ */
316
+ public function get_plugin_name() {
317
+ return $this->plugin_name;
318
+ }
319
+
320
+ /**
321
+ * The reference to the class that orchestrates the hooks with the plugin.
322
+ *
323
+ * @since 2.0.0
324
+ * @return Blossomthemes_Email_Newsletter_Loader Orchestrates the hooks of the plugin.
325
+ */
326
+ public function get_loader() {
327
+ return $this->loader;
328
+ }
329
+
330
+ /**
331
+ * Retrieve the version number of the plugin.
332
+ *
333
+ * @since 2.0.0
334
+ * @return string The version number of the plugin.
335
+ */
336
+ public function get_version() {
337
+ return $this->version;
338
+ }
339
+
340
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/libs/mailerlite_rest/ML_Campaigns.php DELETED
@@ -1,55 +0,0 @@
1
- <?php
2
-
3
- require_once dirname(__FILE__) . '/base/ML_Rest.php';
4
-
5
- class ML_Campaigns extends ML_Rest
6
- {
7
- function __construct($api_key)
8
- {
9
- $this->name = 'campaigns';
10
-
11
- parent::__construct($api_key);
12
- }
13
-
14
- function getRecipients()
15
- {
16
- $this->path .= 'recipients/';
17
-
18
- return $this->execute('GET');
19
- }
20
-
21
- function getOpens()
22
- {
23
- $this->path .= 'opens/';
24
-
25
- return $this->execute('GET');
26
- }
27
-
28
- function getClicks()
29
- {
30
- $this->path .= 'clicks/';
31
-
32
- return $this->execute('GET');
33
- }
34
-
35
- function getUnsubscribes()
36
- {
37
- $this->path .= 'unsubscribes/';
38
-
39
- return $this->execute('GET');
40
- }
41
-
42
- function getBounces()
43
- {
44
- $this->path .= 'bounces/';
45
-
46
- return $this->execute('GET');
47
- }
48
-
49
- function getJunk()
50
- {
51
- $this->path .= 'junks/';
52
-
53
- return $this->execute('GET');
54
- }
55
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/libs/mailerlite_rest/ML_Lists.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
-
3
- require_once dirname(__FILE__) . '/base/ML_Rest.php';
4
-
5
- class ML_Lists extends ML_Rest
6
- {
7
- function __construct($api_key)
8
- {
9
- $this->name = 'lists';
10
-
11
- parent::__construct($api_key);
12
- }
13
-
14
- function getActive()
15
- {
16
- $this->path .= 'active/';
17
-
18
- return $this->execute('GET');
19
- }
20
-
21
- function getUnsubscribed()
22
- {
23
- $this->path .= 'unsubscribed/';
24
-
25
- return $this->execute('GET');
26
- }
27
-
28
- function getBounced()
29
- {
30
- $this->path .= 'bounced/';
31
-
32
- return $this->execute('GET');
33
- }
34
-
35
- function getFields()
36
- {
37
- $this->path .= 'fields/';
38
- return $this->execute('GET');
39
- }
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/libs/mailerlite_rest/ML_Subscribers.php DELETED
@@ -1,57 +0,0 @@
1
- <?php
2
-
3
- require_once dirname(__FILE__) . '/base/ML_Rest.php';
4
-
5
- class ML_Subscribers extends ML_Rest
6
- {
7
- public function __construct($api_key)
8
- {
9
- $this->name = 'subscribers';
10
-
11
- parent::__construct($api_key);
12
- }
13
-
14
- function add($subscriber = null, $resubscribe = 0)
15
- {
16
- $subscriber['resubscribe'] = $resubscribe;
17
-
18
- return $this->execute('POST', $subscriber);
19
- }
20
-
21
- function addAll($subscribers, $resubscribe = 0)
22
- {
23
- $data['resubscribe'] = $resubscribe;
24
-
25
- $data['subscribers'] = $subscribers;
26
-
27
- $this->path .= 'import/';
28
-
29
- return $this->execute('POST', $data);
30
- }
31
-
32
- function get($email = null, $history = 0)
33
- {
34
- $this->setId(null);
35
-
36
- $this->path .= '?email=' . urlencode($email);
37
-
38
- if ($history)
39
- $this->path .= '&history=1';
40
-
41
- return $this->execute('GET');
42
- }
43
-
44
- function remove($email = null)
45
- {
46
- $this->path .= '?email=' . urlencode($email);
47
-
48
- return $this->execute('DELETE');
49
- }
50
-
51
- function unsubscribe($email)
52
- {
53
- $this->path .= 'unsubscribe/?email=' . urlencode($email);
54
-
55
- return $this->execute('POST');
56
- }
57
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/libs/mailerlite_rest/ML_Webforms.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
-
3
- require_once dirname(__FILE__) . '/base/ML_Rest.php';
4
-
5
- class ML_Webforms extends ML_Rest
6
- {
7
- function __construct($api_key)
8
- {
9
- $this->name = 'webforms';
10
-
11
- parent::__construct($api_key);
12
- }
13
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/libs/mailerlite_rest/base/ML_Rest.php DELETED
@@ -1,59 +0,0 @@
1
- <?php
2
-
3
- require_once dirname(__FILE__) . '/ML_Rest_Base.php';
4
-
5
- class ML_Rest extends ML_Rest_Base
6
- {
7
- var $name = '';
8
-
9
- var $id = null;
10
-
11
- function __construct($api_key)
12
- {
13
- parent::__construct();
14
-
15
- $this->apiKey = $api_key;
16
-
17
- $this->path = $this->url . $this->name . '/';
18
- }
19
-
20
- function setId($id)
21
- {
22
- $this->id = $id;
23
-
24
- if ($this->id)
25
- $this->path = $this->url . $this->name . '/' . $id . '/';
26
- else
27
- $this->path = $this->url . $this->name . '/';
28
-
29
- return $this;
30
- }
31
-
32
- function getAll()
33
- {
34
- return $this->execute('GET');
35
- }
36
-
37
- function get($data = null)
38
- {
39
- if (!$this->id)
40
- throw new InvalidArgumentException('ID is not set.');
41
-
42
- return $this->execute('GET');
43
- }
44
-
45
- function add($data = null)
46
- {
47
- return $this->execute('POST', $data);
48
- }
49
-
50
- function put($data = null)
51
- {
52
- return $this->execute('PUT', $data);
53
- }
54
-
55
- function remove($data = null)
56
- {
57
- return $this->execute('DELETE');
58
- }
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/libs/mailerlite_rest/base/ML_Rest_Base.php DELETED
@@ -1,234 +0,0 @@
1
- <?php
2
-
3
- class ML_Rest_Base
4
- {
5
- protected $url;
6
- protected $verb;
7
- protected $requestBody;
8
- protected $requestLength;
9
- protected $username;
10
- protected $password;
11
- protected $acceptType;
12
- protected $responseBody;
13
- protected $responseInfo;
14
-
15
- protected $apiKey = '';
16
- protected $path = '';
17
-
18
- private $curlError = false;
19
-
20
- public function __construct($url = 'https://app.mailerlite.com/api/v1/', $verb = 'GET')
21
- {
22
- $this->url = $url;
23
- $this->verb = $verb;
24
- $this->requestLength = 0;
25
- $this->username = null;
26
- $this->password = null;
27
- $this->acceptType = 'application/json';
28
- $this->responseBody = null;
29
- $this->responseInfo = null;
30
- }
31
-
32
- public function flush()
33
- {
34
- $this->requestBody = null;
35
- $this->requestLength = 0;
36
- $this->verb = 'GET';
37
- $this->responseBody = null;
38
- $this->responseInfo = null;
39
- }
40
-
41
- public function execute($method = null, $data = null)
42
- {
43
- $ch = curl_init();
44
- $this->setAuth($ch);
45
-
46
- if ($method)
47
- $this->verb = $method;
48
-
49
- $this->requestBody = $data;
50
-
51
- $this->buildPostBody();
52
-
53
- try {
54
- switch (strtoupper($this->verb)) {
55
- case 'GET':
56
- $this->executeGet($ch);
57
- break;
58
- case 'POST':
59
- $this->executePost($ch);
60
- break;
61
- case 'PUT':
62
- $this->executePut($ch);
63
- break;
64
- case 'DELETE':
65
- $this->executeDelete($ch);
66
- break;
67
- default:
68
- throw new InvalidArgumentException('Current verb (' . $this->verb . ') is an invalid REST verb.');
69
- }
70
- } catch (InvalidArgumentException $e) {
71
- curl_close($ch);
72
- throw $e;
73
- } catch (Exception $e) {
74
- curl_close($ch);
75
- throw $e;
76
- }
77
-
78
- return $this->responseBody;
79
- }
80
-
81
- public function buildPostBody()
82
- {
83
- $data = $this->requestBody;
84
-
85
- $data['apiKey'] = $this->apiKey;
86
-
87
- if (!is_array($data)) {
88
- throw new InvalidArgumentException('Invalid data input for postBody. Array expected');
89
- }
90
-
91
- $data = http_build_query($data, '', '&');
92
- $this->requestBody = $data;
93
- }
94
-
95
- protected function executeGet($ch)
96
- {
97
- $this->path .= (strpos($this->path, '?') === false ? '?' : '&') . $this->requestBody;
98
-
99
- $this->doExecute($ch);
100
- }
101
-
102
- protected function executePost($ch)
103
- {
104
- curl_setopt($ch, CURLOPT_POSTFIELDS, $this->requestBody);
105
- curl_setopt($ch, CURLOPT_POST, 1);
106
-
107
- $this->doExecute($ch);
108
- }
109
-
110
- protected function executePut($ch)
111
- {
112
- $this->requestLength = strlen($this->requestBody);
113
-
114
- $fh = fopen('php://memory', 'rw');
115
- fwrite($fh, $this->requestBody);
116
- rewind($fh);
117
-
118
- curl_setopt($ch, CURLOPT_INFILE, $fh);
119
- curl_setopt($ch, CURLOPT_INFILESIZE, $this->requestLength);
120
- curl_setopt($ch, CURLOPT_PUT, true);
121
-
122
- $this->doExecute($ch);
123
-
124
- fclose($fh);
125
- }
126
-
127
- protected function executeDelete($ch)
128
- {
129
- $this->path .= (strpos($this->path, '?') === false ? '?' : '&') . $this->requestBody;
130
-
131
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
132
-
133
- $this->doExecute($ch);
134
- }
135
-
136
- protected function doExecute(&$curlHandle)
137
- {
138
- $this->setCurlOpts($curlHandle);
139
- $this->responseBody = curl_exec($curlHandle);
140
-
141
- if ($this->responseBody === false) {
142
- $this->responseBody = 'CURL errno: '.curl_errno($curlHandle).', CURL error: '.curl_error($curlHandle);
143
- $this->curlError = true;
144
- }
145
-
146
- $this->responseInfo = curl_getinfo($curlHandle);
147
-
148
- curl_close($curlHandle);
149
- }
150
-
151
- protected function setCurlOpts(&$curlHandle)
152
- {
153
- curl_setopt($curlHandle, CURLOPT_TIMEOUT, 30);
154
- curl_setopt($curlHandle, CURLOPT_URL, $this->path);
155
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
156
- curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array('Accept: ' . $this->acceptType));
157
-
158
- curl_setopt($curlHandle, CURLOPT_SSL_VERIFYHOST, false);
159
- curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, false);
160
- }
161
-
162
- public function hasCurlError()
163
- {
164
- return $this->curlError;
165
- }
166
-
167
- protected function setAuth(&$curlHandle)
168
- {
169
- if ($this->username !== null && $this->password !== null) {
170
- curl_setopt($curlHandle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
171
- curl_setopt($curlHandle, CURLOPT_USERPWD, $this->username . ':' . $this->password);
172
- }
173
- }
174
-
175
- public function getAcceptType()
176
- {
177
- return $this->acceptType;
178
- }
179
-
180
- public function setAcceptType($acceptType)
181
- {
182
- $this->acceptType = $acceptType;
183
- }
184
-
185
- public function getPassword()
186
- {
187
- return $this->password;
188
- }
189
-
190
- public function setPassword($password)
191
- {
192
- $this->password = $password;
193
- }
194
-
195
- public function getResponseBody()
196
- {
197
- return $this->responseBody;
198
- }
199
-
200
- public function getResponseInfo()
201
- {
202
- return $this->responseInfo;
203
- }
204
-
205
- public function getUrl()
206
- {
207
- return $this->url;
208
- }
209
-
210
- public function setUrl($url)
211
- {
212
- $this->url = $url;
213
- }
214
-
215
- public function getUsername()
216
- {
217
- return $this->username;
218
- }
219
-
220
- public function setUsername($username)
221
- {
222
- $this->username = $username;
223
- }
224
-
225
- public function getVerb()
226
- {
227
- return $this->verb;
228
- }
229
-
230
- public function setVerb($verb)
231
- {
232
- $this->verb = $verb;
233
- }
234
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/libs/sendinblue/Blossom_Sendinblue_API_Client.php CHANGED
@@ -1,316 +1,316 @@
1
- <?php
2
- /**
3
- * Send in blue API Client.
4
- */
5
- class Blossom_Sendinblue_API_Client {
6
- const API_BASE_URL = 'https://api.sendinblue.com/v3';
7
- const HTTP_METHOD_GET = 'GET';
8
- const HTTP_METHOD_POST = 'POST';
9
- const HTTP_METHOD_PUT = 'PUT';
10
- const HTTP_METHOD_DELETE = 'DELETE';
11
- const CAMPAIGN_TYPE_EMAIL = 'email';
12
- const CAMPAIGN_TYPE_SMS = 'sms';
13
- const RESPONSE_CODE_OK = 200;
14
- const RESPONSE_CODE_CREATED = 201;
15
- const RESPONSE_CODE_ACCEPTED = 202;
16
-
17
- private $apiKey;
18
- private $lastResponseCode;
19
-
20
- /**
21
- * Blossom_Sendinblue_Api_Client constructor.
22
- */
23
- public function __construct()
24
- {
25
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', false );
26
-
27
- $this->apiKey = isset( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) ? esc_attr( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) : '';
28
- }
29
-
30
- /**
31
- * @return mixed
32
- */
33
- public function getAccount()
34
- {
35
- return $this->get('/account');
36
- }
37
-
38
- /**
39
- * @return mixed
40
- */
41
- public function getAttributes()
42
- {
43
- return $this->get("/contacts/attributes");
44
- }
45
-
46
- /**
47
- * @param $type ,$name,$data
48
- * @return mixed
49
- */
50
- public function createAttribute($type, $name, $data)
51
- {
52
- return $this->post("/contacts/attributes/" . $type . "/" . $name, $data);
53
- }
54
-
55
- /**
56
- * @param $id
57
- * @return mixed
58
- */
59
- public function getEmailTemplate($id)
60
- {
61
- return $this->get("/smtp/templates/" . $id);
62
- }
63
-
64
- /**
65
- * @param string $type
66
- * @param array $data
67
- * @return array
68
- */
69
- public function getAllCampaignsByType($type = self::CAMPAIGN_TYPE_EMAIL, $data = [])
70
- {
71
- $campaigns = [];
72
-
73
- if (!isset($data['offset'])) {
74
- $data['offset'] = 0;
75
- }
76
-
77
- do {
78
- if ($type === self::CAMPAIGN_TYPE_SMS) {
79
- $response = $this->getSmsCampaigns($data);
80
- } else {
81
- $response = $this->getEmailCampaigns($data);
82
- }
83
-
84
- if (isset($response['campaigns']) && is_array($response['campaigns'])) {
85
- $campaigns = array_merge($campaigns, $response['campaigns']);
86
- $data['offset']++;
87
- }
88
- } while (!empty($response['campaigns']));
89
-
90
- return $campaigns;
91
- }
92
-
93
- /**
94
- * @param $data
95
- * @return mixed
96
- */
97
- public function getEmailCampaigns($data)
98
- {
99
- return $this->get("/emailCampaigns", $data);
100
- }
101
-
102
- /**
103
- * @param $data
104
- * @return mixed
105
- */
106
- public function getSmsCampaigns($data)
107
- {
108
- return $this->get("/smsCampaigns", $data);
109
- }
110
-
111
- /**
112
- * @param $data
113
- * @return mixed
114
- */
115
- public function getEmailTemplates($data)
116
- {
117
- return $this->get("/smtp/templates", $data);
118
- }
119
-
120
- /**
121
- * @param $data
122
- * @return mixed
123
- */
124
- public function sendEmail($data)
125
- {
126
- return $this->post("/smtp/email", $data);
127
- }
128
-
129
- /**
130
- * @param $id ,$data
131
- * @return mixed
132
- */
133
- public function sendTransactionalTemplate($id, $data)
134
- {
135
- return $this->post("/smtp/templates/" . $id . "/send", $data);
136
- }
137
-
138
- /**
139
- * @param $email
140
- * @return mixed
141
- */
142
- public function getUser($email)
143
- {
144
- return $this->get("/contacts/" . urlencode($email));
145
- }
146
-
147
- /**
148
- * @param $data
149
- * @return mixed
150
- */
151
- public function createUser($data)
152
- {
153
- return $this->post("/contacts", $data);
154
- }
155
-
156
- /**
157
- * @return mixed
158
- */
159
- public function getSenders()
160
- {
161
- return $this->get("/senders");
162
- }
163
-
164
- /**
165
- * @param $email ,$data
166
- * @return mixed
167
- */
168
- public function updateUser($email, $data)
169
- {
170
- return $this->put("/contacts/" . $email, $data);
171
- }
172
-
173
- /**
174
- * @param $data
175
- * @return mixed
176
- */
177
- public function createList($data)
178
- {
179
- return $this->post("/contacts/lists", $data);
180
- }
181
-
182
- /**
183
- * @param $data
184
- * @return mixed
185
- */
186
- public function getLists($data)
187
- {
188
- return $this->get("/contacts/lists", $data);
189
- }
190
-
191
- /**
192
- * @param $data
193
- * @return mixed
194
- */
195
- public function getAllLists()
196
- {
197
- $lists = array("lists" => array(), "count" => 0);
198
- $offset = 0;
199
- $limit = 50;
200
- do {
201
- $list_data = $this->getLists(array('limit' => $limit, 'offset' => $offset));
202
- if (isset($list_data["lists"]) && is_array($list_data["lists"])) {
203
- $lists["lists"] = array_merge($lists["lists"], $list_data["lists"]);
204
- $offset += 50;
205
- $lists["count"] = $list_data["count"];
206
- }
207
- } while (!empty($lists['lists']) && count($lists["lists"]) < $list_data["count"]);
208
-
209
- return $lists;
210
- }
211
-
212
- /**
213
- * @param $data
214
- * @return mixed
215
- */
216
- public function importContacts($data)
217
- {
218
- return $this->post('/contacts/import', $data);
219
- }
220
-
221
- /**
222
- * @param $endpoint
223
- * @param array $parameters
224
- * @return mixed
225
- */
226
- public function get($endpoint, $parameters = [])
227
- {
228
- if ($parameters) {
229
- foreach ($parameters as $key => $parameter) {
230
- if (is_bool($parameter)) {
231
- // http_build_query converts bool to int
232
- $parameters[$key] = $parameter ? 'true' : 'false';
233
- }
234
- }
235
- $endpoint .= '?' . http_build_query($parameters);
236
- }
237
- return $this->makeHttpRequest(self::HTTP_METHOD_GET, $endpoint);
238
- }
239
-
240
- /**
241
- * @param $endpoint
242
- * @param array $data
243
- * @return mixed
244
- */
245
- public function post($endpoint, $data = [])
246
- {
247
- return $this->makeHttpRequest(self::HTTP_METHOD_POST, $endpoint, $data);
248
- }
249
-
250
- /**
251
- * @param $endpoint
252
- * @param array $data
253
- * @return mixed
254
- */
255
- public function put($endpoint, $data = [])
256
- {
257
- return $this->makeHttpRequest(self::HTTP_METHOD_PUT, $endpoint, $data);
258
- }
259
-
260
- /**
261
- * @param $method
262
- * @param $endpoint
263
- * @param array $body
264
- * @return mixed
265
- */
266
- private function makeHttpRequest($method, $endpoint, $body = [])
267
- {
268
- $url = self::API_BASE_URL . $endpoint;
269
-
270
- $args = [
271
- 'timeout' => 10000,
272
- 'method' => $method,
273
- 'headers' => [
274
- 'api-key' => $this->apiKey,
275
- 'Content-Type' => 'application/json'
276
- ],
277
- ];
278
-
279
- if ($method != self::HTTP_METHOD_GET && $method != self::HTTP_METHOD_DELETE) {
280
- if (isset($body['listIds'])) {
281
- $body['listIds'] = $this->getListsIds($body['listIds']);
282
- }
283
- if (isset($body['unlinkListIds'])) {
284
- $body['unlinkListIds'] = $this->getListsIds($body['unlinkListIds']);
285
- }
286
- $args['body'] = wp_json_encode($body);
287
- }
288
-
289
- $response = wp_remote_request($url, $args);
290
- $this->lastResponseCode = wp_remote_retrieve_response_code($response);
291
-
292
- if (is_wp_error($response)) {
293
- $data = [
294
- 'code' => $response->get_error_code(),
295
- 'message' => $response->get_error_message()
296
- ];
297
- } else {
298
- $data = json_decode(wp_remote_retrieve_body($response), true);
299
- }
300
-
301
- return $data;
302
- }
303
-
304
- private function getListsIds($listIds)
305
- {
306
- return array_unique(array_values(array_map('intval', (array)$listIds)));
307
- }
308
-
309
- /**
310
- * @return int
311
- */
312
- public function getLastResponseCode()
313
- {
314
- return $this->lastResponseCode;
315
- }
316
- }
1
+ <?php
2
+ /**
3
+ * Send in blue API Client.
4
+ */
5
+ class Blossom_Sendinblue_API_Client {
6
+ const API_BASE_URL = 'https://api.sendinblue.com/v3';
7
+ const HTTP_METHOD_GET = 'GET';
8
+ const HTTP_METHOD_POST = 'POST';
9
+ const HTTP_METHOD_PUT = 'PUT';
10
+ const HTTP_METHOD_DELETE = 'DELETE';
11
+ const CAMPAIGN_TYPE_EMAIL = 'email';
12
+ const CAMPAIGN_TYPE_SMS = 'sms';
13
+ const RESPONSE_CODE_OK = 200;
14
+ const RESPONSE_CODE_CREATED = 201;
15
+ const RESPONSE_CODE_ACCEPTED = 202;
16
+
17
+ private $apiKey;
18
+ private $lastResponseCode;
19
+
20
+ /**
21
+ * Blossom_Sendinblue_Api_Client constructor.
22
+ */
23
+ public function __construct()
24
+ {
25
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', false );
26
+
27
+ $this->apiKey = isset( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) ? esc_attr( $blossomthemes_email_newsletter_settings['sendinblue']['api-key'] ) : '';
28
+ }
29
+
30
+ /**
31
+ * @return mixed
32
+ */
33
+ public function getAccount()
34
+ {
35
+ return $this->get('/account');
36
+ }
37
+
38
+ /**
39
+ * @return mixed
40
+ */
41
+ public function getAttributes()
42
+ {
43
+ return $this->get("/contacts/attributes");
44
+ }
45
+
46
+ /**
47
+ * @param $type ,$name,$data
48
+ * @return mixed
49
+ */
50
+ public function createAttribute($type, $name, $data)
51
+ {
52
+ return $this->post("/contacts/attributes/" . $type . "/" . $name, $data);
53
+ }
54
+
55
+ /**
56
+ * @param $id
57
+ * @return mixed
58
+ */
59
+ public function getEmailTemplate($id)
60
+ {
61
+ return $this->get("/smtp/templates/" . $id);
62
+ }
63
+
64
+ /**
65
+ * @param string $type
66
+ * @param array $data
67
+ * @return array
68
+ */
69
+ public function getAllCampaignsByType($type = self::CAMPAIGN_TYPE_EMAIL, $data = [])
70
+ {
71
+ $campaigns = [];
72
+
73
+ if (!isset($data['offset'])) {
74
+ $data['offset'] = 0;
75
+ }
76
+
77
+ do {
78
+ if ($type === self::CAMPAIGN_TYPE_SMS) {
79
+ $response = $this->getSmsCampaigns($data);
80
+ } else {
81
+ $response = $this->getEmailCampaigns($data);
82
+ }
83
+
84
+ if (isset($response['campaigns']) && is_array($response['campaigns'])) {
85
+ $campaigns = array_merge($campaigns, $response['campaigns']);
86
+ $data['offset']++;
87
+ }
88
+ } while (!empty($response['campaigns']));
89
+
90
+ return $campaigns;
91
+ }
92
+
93
+ /**
94
+ * @param $data
95
+ * @return mixed
96
+ */
97
+ public function getEmailCampaigns($data)
98
+ {
99
+ return $this->get("/emailCampaigns", $data);
100
+ }
101
+
102
+ /**
103
+ * @param $data
104
+ * @return mixed
105
+ */
106
+ public function getSmsCampaigns($data)
107
+ {
108
+ return $this->get("/smsCampaigns", $data);
109
+ }
110
+
111
+ /**
112
+ * @param $data
113
+ * @return mixed
114
+ */
115
+ public function getEmailTemplates($data)
116
+ {
117
+ return $this->get("/smtp/templates", $data);
118
+ }
119
+
120
+ /**
121
+ * @param $data
122
+ * @return mixed
123
+ */
124
+ public function sendEmail($data)
125
+ {
126
+ return $this->post("/smtp/email", $data);
127
+ }
128
+
129
+ /**
130
+ * @param $id ,$data
131
+ * @return mixed
132
+ */
133
+ public function sendTransactionalTemplate($id, $data)
134
+ {
135
+ return $this->post("/smtp/templates/" . $id . "/send", $data);
136
+ }
137
+
138
+ /**
139
+ * @param $email
140
+ * @return mixed
141
+ */
142
+ public function getUser($email)
143
+ {
144
+ return $this->get("/contacts/" . urlencode($email));
145
+ }
146
+
147
+ /**
148
+ * @param $data
149
+ * @return mixed
150
+ */
151
+ public function createUser($data)
152
+ {
153
+ return $this->post("/contacts", $data);
154
+ }
155
+
156
+ /**
157
+ * @return mixed
158
+ */
159
+ public function getSenders()
160
+ {
161
+ return $this->get("/senders");
162
+ }
163
+
164
+ /**
165
+ * @param $email ,$data
166
+ * @return mixed
167
+ */
168
+ public function updateUser($email, $data)
169
+ {
170
+ return $this->put("/contacts/" . $email, $data);
171
+ }
172
+
173
+ /**
174
+ * @param $data
175
+ * @return mixed
176
+ */
177
+ public function createList($data)
178
+ {
179
+ return $this->post("/contacts/lists", $data);
180
+ }
181
+
182
+ /**
183
+ * @param $data
184
+ * @return mixed
185
+ */
186
+ public function getLists($data)
187
+ {
188
+ return $this->get("/contacts/lists", $data);
189
+ }
190
+
191
+ /**
192
+ * @param $data
193
+ * @return mixed
194
+ */
195
+ public function getAllLists()
196
+ {
197
+ $lists = array("lists" => array(), "count" => 0);
198
+ $offset = 0;
199
+ $limit = 50;
200
+ do {
201
+ $list_data = $this->getLists(array('limit' => $limit, 'offset' => $offset));
202
+ if (isset($list_data["lists"]) && is_array($list_data["lists"])) {
203
+ $lists["lists"] = array_merge($lists["lists"], $list_data["lists"]);
204
+ $offset += 50;
205
+ $lists["count"] = $list_data["count"];
206
+ }
207
+ } while (!empty($lists['lists']) && count($lists["lists"]) < $list_data["count"]);
208
+
209
+ return $lists;
210
+ }
211
+
212
+ /**
213
+ * @param $data
214
+ * @return mixed
215
+ */
216
+ public function importContacts($data)
217
+ {
218
+ return $this->post('/contacts/import', $data);
219
+ }
220
+
221
+ /**
222
+ * @param $endpoint
223
+ * @param array $parameters
224
+ * @return mixed
225
+ */
226
+ public function get($endpoint, $parameters = [])
227
+ {
228
+ if ($parameters) {
229
+ foreach ($parameters as $key => $parameter) {
230
+ if (is_bool($parameter)) {
231
+ // http_build_query converts bool to int
232
+ $parameters[$key] = $parameter ? 'true' : 'false';
233
+ }
234
+ }
235
+ $endpoint .= '?' . http_build_query($parameters);
236
+ }
237
+ return $this->makeHttpRequest(self::HTTP_METHOD_GET, $endpoint);
238
+ }
239
+
240
+ /**
241
+ * @param $endpoint
242
+ * @param array $data
243
+ * @return mixed
244
+ */
245
+ public function post($endpoint, $data = [])
246
+ {
247
+ return $this->makeHttpRequest(self::HTTP_METHOD_POST, $endpoint, $data);
248
+ }
249
+
250
+ /**
251
+ * @param $endpoint
252
+ * @param array $data
253
+ * @return mixed
254
+ */
255
+ public function put($endpoint, $data = [])
256
+ {
257
+ return $this->makeHttpRequest(self::HTTP_METHOD_PUT, $endpoint, $data);
258
+ }
259
+
260
+ /**
261
+ * @param $method
262
+ * @param $endpoint
263
+ * @param array $body
264
+ * @return mixed
265
+ */
266
+ private function makeHttpRequest($method, $endpoint, $body = [])
267
+ {
268
+ $url = self::API_BASE_URL . $endpoint;
269
+
270
+ $args = [
271
+ 'timeout' => 10000,
272
+ 'method' => $method,
273
+ 'headers' => [
274
+ 'api-key' => $this->apiKey,
275
+ 'Content-Type' => 'application/json'
276
+ ],
277
+ ];
278
+
279
+ if ($method != self::HTTP_METHOD_GET && $method != self::HTTP_METHOD_DELETE) {
280
+ if (isset($body['listIds'])) {
281
+ $body['listIds'] = $this->getListsIds($body['listIds']);
282
+ }
283
+ if (isset($body['unlinkListIds'])) {
284
+ $body['unlinkListIds'] = $this->getListsIds($body['unlinkListIds']);
285
+ }
286
+ $args['body'] = wp_json_encode($body);
287
+ }
288
+
289
+ $response = wp_remote_request($url, $args);
290
+ $this->lastResponseCode = wp_remote_retrieve_response_code($response);
291
+
292
+ if (is_wp_error($response)) {
293
+ $data = [
294
+ 'code' => $response->get_error_code(),
295
+ 'message' => $response->get_error_message()
296
+ ];
297
+ } else {
298
+ $data = json_decode(wp_remote_retrieve_body($response), true);
299
+ }
300
+
301
+ return $data;
302
+ }
303
+
304
+ private function getListsIds($listIds)
305
+ {
306
+ return array_unique(array_values(array_map('intval', (array)$listIds)));
307
+ }
308
+
309
+ /**
310
+ * @return int
311
+ */
312
+ public function getLastResponseCode()
313
+ {
314
+ return $this->lastResponseCode;
315
+ }
316
+ }
includes/setting/form-list-meta.php CHANGED
@@ -1,132 +1,132 @@
1
- <?php
2
- $blossomthemes_email_newsletter_setting = get_option( 'blossomthemes_email_newsletter_settings', true );
3
- $BlossomThemes_Email_Newsletters_lists = get_post_meta( get_the_ID(),'blossomthemes_email_newsletter_setting', true );
4
- if(isset($blossomthemes_email_newsletter_setting['platform']) && $blossomthemes_email_newsletter_setting['platform']!='')
5
- {
6
- $platform = $blossomthemes_email_newsletter_setting['platform'];
7
- $obj = new BlossomThemes_Email_Newsletter_Settings;
8
- if ($platform == 'mailerlite' && isset($blossomthemes_email_newsletter_setting['mailerlite']['api-key']) && $blossomthemes_email_newsletter_setting['mailerlite']['api-key']!='')
9
- {
10
- $data = $obj->mailerlite_lists();
11
- if( isset( $data['Results'] ) )
12
- {
13
- $max = max(array_keys($data['Results']));
14
- for ($i=0; $i <= $max; $i++) {
15
- $id = $data['Results'][$i]['id']?>
16
- <div class="newsletter-list">
17
- <input <?php $j = isset( $BlossomThemes_Email_Newsletters_lists['mailerlite']['list-id'][$id] ) ? esc_attr( $BlossomThemes_Email_Newsletters_lists['mailerlite']['list-id'][$id] ): '0';?> value="<?php echo esc_attr($j);?>" <?php if($j=='1'){ echo "checked";}?> class="mailerlite-lists" type="checkbox" id="blossomthemes_email_newsletter_setting[mailerlite][list-id][<?php echo $id;?>]" name="blossomthemes_email_newsletter_setting[mailerlite][list-id][<?php echo $id;?>]"><label for="blossomthemes_email_newsletter_setting[mailerlite][list-id][<?php echo $id;?>]"><?php echo esc_attr($data['Results'][$i]['name']);?></label>
18
- </div>
19
- <?php
20
- }
21
- }
22
- ?>
23
- <div class="blossomthemes-email-newsletter-note"><?php _e( 'Users will be subscribed to the groups selected above. If no groups are selected then the group selected in the plugin settings page will be used as a default group.', 'blossomthemes-email-newsletter' ); ?></div>
24
- <?php
25
- }
26
-
27
- if ($platform == 'mailchimp' && isset($blossomthemes_email_newsletter_setting['mailchimp']['api-key']) && $blossomthemes_email_newsletter_setting['mailchimp']['api-key']!='' )
28
- {
29
- $data = $obj->mailchimp_lists();
30
- if( isset( $data['lists'] ) ){
31
- $max = max(array_keys($data['lists']));
32
- for ($i=0; $i <= $max; $i++) {
33
- $id = $data['lists'][$i]['id']?>
34
- <div class="newsletter-list">
35
- <input <?php $j = isset( $BlossomThemes_Email_Newsletters_lists['mailchimp']['list-id'][$id] ) ? esc_attr( $BlossomThemes_Email_Newsletters_lists['mailchimp']['list-id'][$id] ): '0';?> value="<?php echo esc_attr($j);?>" <?php if($j=='1'){ echo "checked";}?> class="mailerlite-lists" type="checkbox" id="blossomthemes_email_newsletter_setting[mailchimp][list-id][<?php echo $id;?>]" name="blossomthemes_email_newsletter_setting[mailchimp][list-id][<?php echo $id;?>]"><label for="blossomthemes_email_newsletter_setting[mailchimp][list-id][<?php echo $id;?>]"><?php echo esc_attr($data['lists'][$i]['name']);?></label>
36
- </div>
37
- <?php
38
- }
39
- }
40
- ?>
41
- <div class="blossomthemes-email-newsletter-note"><?php _e( 'Users will be subscribed to the groups selected above. If no groups are selected then the group selected in the plugin settings page will be used as a default group.', 'blossomthemes-email-newsletter' ); ?></div>
42
- <?php
43
- }
44
-
45
- if ($platform == 'convertkit' && isset($blossomthemes_email_newsletter_setting['convertkit']['api-key']) && $blossomthemes_email_newsletter_setting['convertkit']['api-key']!='')
46
- {
47
- $data = $obj->convertkit_lists();
48
- foreach ($data as $key => $value){
49
- $id = $key;?>
50
- <div class="newsletter-list">
51
- <input <?php $j = isset( $BlossomThemes_Email_Newsletters_lists['convertkit']['list-id'][$id] ) ? esc_attr( $BlossomThemes_Email_Newsletters_lists['convertkit']['list-id'][$id] ): '0';?> value="<?php echo esc_attr($j);?>" <?php if($j=='1'){ echo "checked";}?> class="mailerlite-lists" type="checkbox" id="blossomthemes_email_newsletter_setting[convertkit][list-id][<?php echo $id;?>]" name="blossomthemes_email_newsletter_setting[convertkit][list-id][<?php echo $id;?>]"><label for="blossomthemes_email_newsletter_setting[convertkit][list-id][<?php echo $id;?>]"><?php echo esc_attr($value['name']);?></label>
52
- </div>
53
- <?php
54
- }
55
- ?>
56
- <div class="blossomthemes-email-newsletter-note"><?php _e( 'Users will be subscribed to the groups selected above. If no groups are selected then the group selected in the plugin settings page will be used as a default group.', 'blossomthemes-email-newsletter' ); ?></div>
57
- <?php
58
- }
59
-
60
- if ($platform == 'getresponse' && isset($blossomthemes_email_newsletter_setting['getresponse']['api-key']) && $blossomthemes_email_newsletter_setting['getresponse']['api-key']!='')
61
- {
62
- $data = $obj->getresponse_lists();
63
- $i = 0;
64
- foreach ($data as $key => $value){
65
- $id = $key;?>
66
- <div class="newsletter-list">
67
- <input <?php $j = isset( $BlossomThemes_Email_Newsletters_lists['getresponse']['list-id'][$id] ) ? esc_attr( $BlossomThemes_Email_Newsletters_lists['getresponse']['list-id'][$id] ): '';?> value="<?php echo esc_attr( $id ) ?>" class="getresponse-lists" type="checkbox" id="blossomthemes_email_newsletter_setting[getresponse][list-id][<?php echo $id;?>]" name="blossomthemes_email_newsletter_setting[getresponse][list-id][<?php echo $id;?>]" <?php echo checked($j,$id);?>><label for="blossomthemes_email_newsletter_setting[getresponse][list-id][<?php echo $id;?>]"><?php echo esc_attr($value['name']);?></label>
68
- </div>
69
- <?php
70
- $i++;
71
- }
72
- ?>
73
- <div class="blossomthemes-email-newsletter-note"><?php _e( 'Users will be subscribed to the groups selected above. If no groups are selected then the group selected in the plugin settings page will be used as a default group.', 'blossomthemes-email-newsletter' ); ?></div>
74
- <?php
75
- }
76
-
77
- if ($platform == 'activecampaign' && $blossomthemes_email_newsletter_setting['activecampaign']['api-url']!='' && $blossomthemes_email_newsletter_setting['activecampaign']['api-key']!='')
78
- {
79
- $data = $obj->activecampaign_lists();
80
- foreach ($data as $key => $value)
81
- {
82
- $id = $key;?>
83
- <div class="newsletter-list">
84
- <input <?php $j = isset( $BlossomThemes_Email_Newsletters_lists['activecampaign']['list-id'][$id] ) ? esc_attr( $BlossomThemes_Email_Newsletters_lists['activecampaign']['list-id'][$id] ): '0';?> value="<?php echo esc_attr($j);?>" <?php if($j=='1'){ echo "checked";}?> class="mailerlite-lists" type="checkbox" id="blossomthemes_email_newsletter_setting[activecampaign][list-id][<?php echo $id;?>]" name="blossomthemes_email_newsletter_setting[activecampaign][list-id][<?php echo $id;?>]"><label for="blossomthemes_email_newsletter_setting[activecampaign][list-id][<?php echo $id;?>]"><?php echo esc_attr($value['name']);?></label>
85
- </div>
86
- <?php
87
- }
88
- ?>
89
- <div class="blossomthemes-email-newsletter-note"><?php _e( 'Users will be subscribed to the groups selected above. If no groups are selected then the group selected in the plugin settings page will be used as a default group.', 'blossomthemes-email-newsletter' ); ?></div>
90
- <?php
91
- }
92
-
93
- if ($platform == 'aweber' && isset($blossomthemes_email_newsletter_setting['aweber']['app-id']) && $blossomthemes_email_newsletter_setting['aweber']['app-id']!='')
94
- {
95
- $aw = new Blossomthemes_Email_Newsletter_AWeber;
96
- $data = $aw->bten_get_aw_lists();
97
- foreach ($data as $key => $value)
98
- {
99
- $id = $key;?>
100
- <div class="newsletter-list">
101
- <input <?php $j = isset( $BlossomThemes_Email_Newsletters_lists['aweber']['list-id'][$id] ) ? esc_attr( $BlossomThemes_Email_Newsletters_lists['aweber']['list-id'][$id] ): '0';?> value="<?php echo esc_attr($j);?>" <?php if($j=='1'){ echo "checked";}?> class="mailerlite-lists" type="checkbox" id="blossomthemes_email_newsletter_setting[aweber][list-id][<?php echo $id;?>]" name="blossomthemes_email_newsletter_setting[aweber][list-id][<?php echo $id;?>]"><label for="blossomthemes_email_newsletter_setting[aweber][list-id][<?php echo $id;?>]"><?php echo esc_attr($value['name']);?></label>
102
- </div>
103
- <?php
104
- }
105
- ?>
106
- <div class="blossomthemes-email-newsletter-note"><?php _e( 'Users will be subscribed to the groups selected above. If no groups are selected then the group selected in the plugin settings page will be used as a default group.', 'blossomthemes-email-newsletter' ); ?></div>
107
- <?php
108
- }
109
-
110
- if ($platform == 'sendinblue' && isset($blossomthemes_email_newsletter_setting['sendinblue']['api-key']) && $blossomthemes_email_newsletter_setting['sendinblue']['api-key']!='') {
111
-
112
- $sendinblue = new Blossomthemes_Email_Newsletter_Sendinblue;
113
- $lists = $sendinblue->get_lists();
114
-
115
- if ( ! empty( $lists ) ) {
116
- foreach( $lists as $key => $list ) {
117
- $cheched_val = isset( $BlossomThemes_Email_Newsletters_lists['sendinblue']['list-id'][$list['id']] ) ? esc_attr( $BlossomThemes_Email_Newsletters_lists['sendinblue']['list-id'][$list['id']] ) : 'no';
118
- ?>
119
- <div class="newsletter-list">
120
- <input <?php checked( $cheched_val, $list['id'] ); ?> value="<?php echo esc_attr( $list['id'] ); ?>" id="btn_sendinblue_list_<?php echo esc_attr( $list['id'] ); ?>" name="blossomthemes_email_newsletter_setting[sendinblue][list-id][<?php echo esc_attr( $list['id'] );?>]" type="checkbox">
121
- <label for="btn_sendinblue_list_<?php echo esc_attr( $list['id'] ); ?>"><?php echo esc_html( $list['name'] ); ?></label>
122
- </div>
123
- <?php
124
- }
125
- } else {
126
- esc_html_e( 'Lists not available to fetch from your sendinblue account.', 'blossomthemes-email-newsletter' );
127
- }
128
-
129
- }
130
-
131
- }?>
132
  <div class="blossomthemes-email-newsletter-note"><?php echo sprintf( __('Please put your valid API key for the respective platform in %1$s BlossomThemes Email Newsletter > Settings > API Key %2$s if no groups/lists are displayed here.', 'blossomthemes-email-newsletter' ),'<b>','</b>'); ?></div>
1
+ <?php
2
+ $blossomthemes_email_newsletter_setting = get_option( 'blossomthemes_email_newsletter_settings', true );
3
+ $BlossomThemes_Email_Newsletters_lists = get_post_meta( get_the_ID(),'blossomthemes_email_newsletter_setting', true );
4
+ if(isset($blossomthemes_email_newsletter_setting['platform']) && $blossomthemes_email_newsletter_setting['platform']!='')
5
+ {
6
+ $platform = $blossomthemes_email_newsletter_setting['platform'];
7
+ $obj = new BlossomThemes_Email_Newsletter_Settings;
8
+ if ($platform == 'mailerlite' && isset($blossomthemes_email_newsletter_setting['mailerlite']['api-key']) && $blossomthemes_email_newsletter_setting['mailerlite']['api-key']!='')
9
+ {
10
+ $data = $obj->mailerlite_lists();
11
+ if( ! empty( $data ) ) {
12
+ foreach ( $data as $listarray => $list ) {
13
+ $id = $list['id'];
14
+ $j = isset( $BlossomThemes_Email_Newsletters_lists['mailerlite']['list-id'][$id] ) ? esc_attr( $BlossomThemes_Email_Newsletters_lists['mailerlite']['list-id'][$id] ): '0';
15
+ ?>
16
+ <div class="newsletter-list">
17
+ <input value="<?php echo esc_attr($j);?>" <?php if($j=='1'){ echo "checked";}?> class="mailerlite-lists" type="checkbox" id="blossomthemes_email_newsletter_setting[mailerlite][list-id][<?php echo $id;?>]" name="blossomthemes_email_newsletter_setting[mailerlite][list-id][<?php echo $id;?>]"><label for="blossomthemes_email_newsletter_setting[mailerlite][list-id][<?php echo $id;?>]"><?php echo esc_attr($list['name']);?></label>
18
+ </div>
19
+ <?php
20
+ }
21
+ }
22
+ ?>
23
+ <div class="blossomthemes-email-newsletter-note"><?php _e( 'Users will be subscribed to the groups selected above. If no groups are selected then the group selected in the plugin settings page will be used as a default group.', 'blossomthemes-email-newsletter' ); ?></div>
24
+ <?php
25
+ }
26
+
27
+ if ($platform == 'mailchimp' && isset($blossomthemes_email_newsletter_setting['mailchimp']['api-key']) && $blossomthemes_email_newsletter_setting['mailchimp']['api-key']!='' )
28
+ {
29
+ $data = $obj->mailchimp_lists();
30
+ if( isset( $data['lists'] ) ){
31
+ $max = max(array_keys($data['lists']));
32
+ for ($i=0; $i <= $max; $i++) {
33
+ $id = $data['lists'][$i]['id']?>
34
+ <div class="newsletter-list">
35
+ <input <?php $j = isset( $BlossomThemes_Email_Newsletters_lists['mailchimp']['list-id'][$id] ) ? esc_attr( $BlossomThemes_Email_Newsletters_lists['mailchimp']['list-id'][$id] ): '0';?> value="<?php echo esc_attr($j);?>" <?php if($j=='1'){ echo "checked";}?> class="mailerlite-lists" type="checkbox" id="blossomthemes_email_newsletter_setting[mailchimp][list-id][<?php echo $id;?>]" name="blossomthemes_email_newsletter_setting[mailchimp][list-id][<?php echo $id;?>]"><label for="blossomthemes_email_newsletter_setting[mailchimp][list-id][<?php echo $id;?>]"><?php echo esc_attr($data['lists'][$i]['name']);?></label>
36
+ </div>
37
+ <?php
38
+ }
39
+ }
40
+ ?>
41
+ <div class="blossomthemes-email-newsletter-note"><?php _e( 'Users will be subscribed to the groups selected above. If no groups are selected then the group selected in the plugin settings page will be used as a default group.', 'blossomthemes-email-newsletter' ); ?></div>
42
+ <?php
43
+ }
44
+
45
+ if ($platform == 'convertkit' && isset($blossomthemes_email_newsletter_setting['convertkit']['api-key']) && $blossomthemes_email_newsletter_setting['convertkit']['api-key']!='')
46
+ {
47
+ $data = $obj->convertkit_lists();
48
+ foreach ($data as $key => $value){
49
+ $id = $key;?>
50
+ <div class="newsletter-list">
51
+ <input <?php $j = isset( $BlossomThemes_Email_Newsletters_lists['convertkit']['list-id'][$id] ) ? esc_attr( $BlossomThemes_Email_Newsletters_lists['convertkit']['list-id'][$id] ): '0';?> value="<?php echo esc_attr($j);?>" <?php if($j=='1'){ echo "checked";}?> class="mailerlite-lists" type="checkbox" id="blossomthemes_email_newsletter_setting[convertkit][list-id][<?php echo $id;?>]" name="blossomthemes_email_newsletter_setting[convertkit][list-id][<?php echo $id;?>]"><label for="blossomthemes_email_newsletter_setting[convertkit][list-id][<?php echo $id;?>]"><?php echo esc_attr($value['name']);?></label>
52
+ </div>
53
+ <?php
54
+ }
55
+ ?>
56
+ <div class="blossomthemes-email-newsletter-note"><?php _e( 'Users will be subscribed to the groups selected above. If no groups are selected then the group selected in the plugin settings page will be used as a default group.', 'blossomthemes-email-newsletter' ); ?></div>
57
+ <?php
58
+ }
59
+
60
+ if ($platform == 'getresponse' && isset($blossomthemes_email_newsletter_setting['getresponse']['api-key']) && $blossomthemes_email_newsletter_setting['getresponse']['api-key']!='')
61
+ {
62
+ $data = $obj->getresponse_lists();
63
+ $i = 0;
64
+ foreach ($data as $key => $value){
65
+ $id = $key;?>
66
+ <div class="newsletter-list">
67
+ <input <?php $j = isset( $BlossomThemes_Email_Newsletters_lists['getresponse']['list-id'][$id] ) ? esc_attr( $BlossomThemes_Email_Newsletters_lists['getresponse']['list-id'][$id] ): '';?> value="<?php echo esc_attr( $id ) ?>" class="getresponse-lists" type="checkbox" id="blossomthemes_email_newsletter_setting[getresponse][list-id][<?php echo $id;?>]" name="blossomthemes_email_newsletter_setting[getresponse][list-id][<?php echo $id;?>]" <?php echo checked($j,$id);?>><label for="blossomthemes_email_newsletter_setting[getresponse][list-id][<?php echo $id;?>]"><?php echo esc_attr($value['name']);?></label>
68
+ </div>
69
+ <?php
70
+ $i++;
71
+ }
72
+ ?>
73
+ <div class="blossomthemes-email-newsletter-note"><?php _e( 'Users will be subscribed to the groups selected above. If no groups are selected then the group selected in the plugin settings page will be used as a default group.', 'blossomthemes-email-newsletter' ); ?></div>
74
+ <?php
75
+ }
76
+
77
+ if ($platform == 'activecampaign' && $blossomthemes_email_newsletter_setting['activecampaign']['api-url']!='' && $blossomthemes_email_newsletter_setting['activecampaign']['api-key']!='')
78
+ {
79
+ $data = $obj->activecampaign_lists();
80
+ foreach ($data as $key => $value)
81
+ {
82
+ $id = $key;?>
83
+ <div class="newsletter-list">
84
+ <input <?php $j = isset( $BlossomThemes_Email_Newsletters_lists['activecampaign']['list-id'][$id] ) ? esc_attr( $BlossomThemes_Email_Newsletters_lists['activecampaign']['list-id'][$id] ): '0';?> value="<?php echo esc_attr($j);?>" <?php if($j=='1'){ echo "checked";}?> class="mailerlite-lists" type="checkbox" id="blossomthemes_email_newsletter_setting[activecampaign][list-id][<?php echo $id;?>]" name="blossomthemes_email_newsletter_setting[activecampaign][list-id][<?php echo $id;?>]"><label for="blossomthemes_email_newsletter_setting[activecampaign][list-id][<?php echo $id;?>]"><?php echo esc_attr($value['name']);?></label>
85
+ </div>
86
+ <?php
87
+ }
88
+ ?>
89
+ <div class="blossomthemes-email-newsletter-note"><?php _e( 'Users will be subscribed to the groups selected above. If no groups are selected then the group selected in the plugin settings page will be used as a default group.', 'blossomthemes-email-newsletter' ); ?></div>
90
+ <?php
91
+ }
92
+
93
+ if ($platform == 'aweber' && isset($blossomthemes_email_newsletter_setting['aweber']['app-id']) && $blossomthemes_email_newsletter_setting['aweber']['app-id']!='')
94
+ {
95
+ $aw = new Blossomthemes_Email_Newsletter_AWeber;
96
+ $data = $aw->bten_get_aw_lists();
97
+ foreach ($data as $key => $value)
98
+ {
99
+ $id = $key;?>
100
+ <div class="newsletter-list">
101
+ <input <?php $j = isset( $BlossomThemes_Email_Newsletters_lists['aweber']['list-id'][$id] ) ? esc_attr( $BlossomThemes_Email_Newsletters_lists['aweber']['list-id'][$id] ): '0';?> value="<?php echo esc_attr($j);?>" <?php if($j=='1'){ echo "checked";}?> class="mailerlite-lists" type="checkbox" id="blossomthemes_email_newsletter_setting[aweber][list-id][<?php echo $id;?>]" name="blossomthemes_email_newsletter_setting[aweber][list-id][<?php echo $id;?>]"><label for="blossomthemes_email_newsletter_setting[aweber][list-id][<?php echo $id;?>]"><?php echo esc_attr($value['name']);?></label>
102
+ </div>
103
+ <?php
104
+ }
105
+ ?>
106
+ <div class="blossomthemes-email-newsletter-note"><?php _e( 'Users will be subscribed to the groups selected above. If no groups are selected then the group selected in the plugin settings page will be used as a default group.', 'blossomthemes-email-newsletter' ); ?></div>
107
+ <?php
108
+ }
109
+
110
+ if ($platform == 'sendinblue' && isset($blossomthemes_email_newsletter_setting['sendinblue']['api-key']) && $blossomthemes_email_newsletter_setting['sendinblue']['api-key']!='') {
111
+
112
+ $sendinblue = new Blossomthemes_Email_Newsletter_Sendinblue;
113
+ $lists = $sendinblue->get_lists();
114
+
115
+ if ( ! empty( $lists ) ) {
116
+ foreach( $lists as $key => $list ) {
117
+ $cheched_val = isset( $BlossomThemes_Email_Newsletters_lists['sendinblue']['list-id'][$list['id']] ) ? esc_attr( $BlossomThemes_Email_Newsletters_lists['sendinblue']['list-id'][$list['id']] ) : 'no';
118
+ ?>
119
+ <div class="newsletter-list">
120
+ <input <?php checked( $cheched_val, $list['id'] ); ?> value="<?php echo esc_attr( $list['id'] ); ?>" id="btn_sendinblue_list_<?php echo esc_attr( $list['id'] ); ?>" name="blossomthemes_email_newsletter_setting[sendinblue][list-id][<?php echo esc_attr( $list['id'] );?>]" type="checkbox">
121
+ <label for="btn_sendinblue_list_<?php echo esc_attr( $list['id'] ); ?>"><?php echo esc_html( $list['name'] ); ?></label>
122
+ </div>
123
+ <?php
124
+ }
125
+ } else {
126
+ esc_html_e( 'Lists not available to fetch from your sendinblue account.', 'blossomthemes-email-newsletter' );
127
+ }
128
+
129
+ }
130
+
131
+ }?>
132
  <div class="blossomthemes-email-newsletter-note"><?php echo sprintf( __('Please put your valid API key for the respective platform in %1$s BlossomThemes Email Newsletter > Settings > API Key %2$s if no groups/lists are displayed here.', 'blossomthemes-email-newsletter' ),'<b>','</b>'); ?></div>
includes/tabs/general.php CHANGED
@@ -1,114 +1,114 @@
1
- <?php
2
-
3
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
4
- $platform = isset($blossomthemes_email_newsletter_settings['platform']) ? $blossomthemes_email_newsletter_settings['platform'] : '';
5
- $selected_page = isset($blossomthemes_email_newsletter_settings['page'])?esc_attr($blossomthemes_email_newsletter_settings['page']):'';
6
- ?>
7
- <div class="blossomthemes-email-newsletter-settings-platform">
8
- <label for="blossomthemes_email_newsletter_settings[platform]"><?php _e('Platform : ','blossomthemes-email-newsletter');?>
9
- <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose your newsletter platform.','blossomthemes-email-newsletter'); ?>">
10
- <i class="far fa-question-circle"></i>
11
- </span>
12
- </label>
13
-
14
- <div class="select-holder">
15
- <select id="platform-select" name="blossomthemes_email_newsletter_settings[platform]">
16
- <option value="sendinblue" <?php selected($platform,'sendinblue');?>><?php _e('Sendinblue', 'blossomthemes-email-newsletter'); ?></option>
17
- <option value="mailchimp" <?php selected($platform,'mailchimp');?>><?php _e('Mailchimp', 'blossomthemes-email-newsletter');?></option>
18
- <option value="mailerlite" <?php selected($platform,'mailerlite');?>><?php _e('Mailerlite', 'blossomthemes-email-newsletter'); ?></option>
19
- <option value="convertkit" <?php selected($platform,'convertkit');?>><?php _e('ConvertKit', 'blossomthemes-email-newsletter'); ?></option>
20
- <option value="getresponse" <?php selected($platform,'getresponse');?>><?php _e('GetReponse', 'blossomthemes-email-newsletter'); ?></option>
21
- <option value="activecampaign" <?php selected($platform,'activecampaign');?>><?php _e('ActiveCampaign', 'blossomthemes-email-newsletter'); ?></option>
22
- <option value="aweber" <?php selected($platform,'aweber');?>><?php _e('AWeber', 'blossomthemes-email-newsletter'); ?></option>
23
- </select>
24
- </div>
25
-
26
- </div>
27
- <div id="platform-switch-holder">
28
- <?php
29
- $platform_settings = new BlossomThemes_Email_Newsletter_Settings;
30
- echo $platform_settings->bten_platform_settings($platform);
31
- ?>
32
- </div>
33
- <div id="ajax-loader" style="display: none">
34
- <div class="table">
35
- <div class="table-row">
36
- <div class="table-cell">
37
- <img src="<?php echo BLOSSOMTHEMES_EMAIL_NEWSLETTER_FILE_URL.'/public/css/loader.gif';?>">
38
- </div>
39
- </div>
40
- </div>
41
- </div>
42
-
43
- <div class="bten-color-wrap form-bg-color">
44
- <div class="form-bg-color">
45
- <label for="blossomthemes_email_newsletter_settings[appearance][bgcolor]"><?php _e('Background Color: ','blossomthemes-email-newsletter');?></label>
46
- <input type="text" class="blossomthemes-email-newsletter-color-form" id="blossomthemes_email_newsletter_settings[appearance][bgcolor]" name="blossomthemes_email_newsletter_settings[appearance][bgcolor]" value="<?php echo isset($blossomthemes_email_newsletter_settings['appearance']['bgcolor']) ? esc_attr($blossomthemes_email_newsletter_settings['appearance']['bgcolor']):apply_filters('bt_newsletter_bg_color_setting','#ffffff')?>">
47
- </div>
48
- </div>
49
-
50
- <div class="bten-color-wrap font-bg-color">
51
- <div class="font-bg-color">
52
- <label for="blossomthemes_email_newsletter_settings[appearance][fontcolor]"><?php _e('Font Color: ','blossomthemes-email-newsletter');?></label>
53
- <input type="text" class="blossomthemes-email-newsletter-color-form" id="blossomthemes_email_newsletter_settings[appearance][fontcolor]" name="blossomthemes_email_newsletter_settings[appearance][fontcolor]" value="<?php echo isset($blossomthemes_email_newsletter_settings['appearance']['fontcolor']) ? esc_attr($blossomthemes_email_newsletter_settings['appearance']['fontcolor']):apply_filters('bt_newsletter_font_color_setting','#ffffff')?>">
54
- </div>
55
- </div>
56
-
57
- <div class="success-msg-option">
58
- <label><?php _e('Display Successful Subscription Message From:','blossomthemes-email-newsletter');?>
59
- <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Set how to show the confirmation message to the subscribers after successful subscription.', 'blossomthemes-email-newsletter' ); ?>"><i class="far fa-question-circle"></i>
60
- </span>
61
- </label>
62
- <?php
63
- $option = isset($blossomthemes_email_newsletter_settings['thankyou-option']) ? esc_attr($blossomthemes_email_newsletter_settings['thankyou-option']):'text';?><br>
64
-
65
- <div class="success-msg-option-text">
66
- <label><?php _e('Popup text','blossomthemes-email-newsletter');?><input class="newsletter-success-option" type="radio" name="blossomthemes_email_newsletter_settings[thankyou-option]" value="text" <?php if( $option == 'text' ) echo 'checked'; ?>><span class="check-mark"></span></label>
67
-
68
- <div class="blossomthemes-email-newsletter-settings-wrap message">
69
- <label for="blossomthemes_email_newsletter_settings[msg]"><?php _e('Success Message : ','blossomthemes-email-newsletter');?>
70
- <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Set what message to show when the subscriber is successfully subscribed.', 'blossomthemes-email-newsletter' ); ?>">
71
- <i class="far fa-question-circle"></i>
72
- </span>
73
- </label>
74
- <textarea name="blossomthemes_email_newsletter_settings[msg]" id="blossomthemes_email_newsletter_settings[msg]"><?php echo isset($blossomthemes_email_newsletter_settings['msg']) ? esc_attr( $blossomthemes_email_newsletter_settings['msg']): 'Successfully subscribed.';?></textarea>
75
- </div>
76
-
77
- <div class="blossomthemes-email-newsletter-settings-wrap message">
78
- <label for="blossomthemes_email_newsletter_settings[gdpr-msg]"><?php _e('GDPR Message : ','blossomthemes-email-newsletter');?>
79
- <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Set GDPR message to show on the subscription form.', 'blossomthemes-email-newsletter' ); ?>">
80
- <i class="far fa-question-circle"></i>
81
- </span>
82
- </label>
83
- <textarea name="blossomthemes_email_newsletter_settings[gdpr-msg]" id="blossomthemes_email_newsletter_settings[gdpr-msg]"><?php echo isset($blossomthemes_email_newsletter_settings['gdpr-msg']) ? wp_kses_post($blossomthemes_email_newsletter_settings['gdpr-msg']): 'By checking this, you agree to our Privacy Policy.';?></textarea>
84
-
85
- </div>
86
- </div>
87
-
88
- <div class="success-msg-option-page">
89
- <label><?php _e('Page','blossomthemes-email-newsletter');?><input class="newsletter-success-option" type="radio" name="blossomthemes_email_newsletter_settings[thankyou-option]" value="page" <?php if( $option == 'page' ) echo 'checked'; ?>><span class="check-mark"></span></label>
90
- <div class="blossomthemes-email-newsletter-settings-wrap page">
91
- <label for="blossomthemes_email_newsletter_settings[page]"><?php _e('Thank You Page : ','blossomthemes-email-newsletter');?>
92
- <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Set the page user will be redirected to after successful subscription.', 'blossomthemes-email-newsletter' ); ?>">
93
- <i class="far fa-question-circle"></i>
94
- </span>
95
- </label>
96
- <div class="select-holder">
97
- <select name="blossomthemes_email_newsletter_settings[page]">
98
- <option selected="selected" disabled="disabled" value=""><?php esc_attr_e( 'Select page', 'blossomthemes-email-newsletter' ) ; ?></option>
99
- <?php
100
- $pages = get_pages();
101
- foreach ( $pages as $page ) {
102
- $option = '<option value="' . $page->ID . '" ';
103
- $option .= ( $page->ID == $selected_page ) ? 'selected="selected"' : '';
104
- $option .= '>';
105
- $option .= $page->post_title;
106
- $option .= '</option>';
107
- echo $option;
108
- }
109
- ?>
110
- </select>
111
- </div>
112
- </div>
113
- </div>
114
- </div>
1
+ <?php
2
+
3
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
4
+ $platform = isset($blossomthemes_email_newsletter_settings['platform']) ? $blossomthemes_email_newsletter_settings['platform'] : '';
5
+ $selected_page = isset($blossomthemes_email_newsletter_settings['page'])?esc_attr($blossomthemes_email_newsletter_settings['page']):'';
6
+ ?>
7
+ <div class="blossomthemes-email-newsletter-settings-platform">
8
+ <label for="blossomthemes_email_newsletter_settings[platform]"><?php _e('Platform : ','blossomthemes-email-newsletter');?>
9
+ <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Choose your newsletter platform.','blossomthemes-email-newsletter'); ?>">
10
+ <i class="far fa-question-circle"></i>
11
+ </span>
12
+ </label>
13
+
14
+ <div class="select-holder">
15
+ <select id="platform-select" name="blossomthemes_email_newsletter_settings[platform]">
16
+ <option value="sendinblue" <?php selected($platform,'sendinblue');?>><?php _e('Sendinblue', 'blossomthemes-email-newsletter'); ?></option>
17
+ <option value="mailchimp" <?php selected($platform,'mailchimp');?>><?php _e('Mailchimp', 'blossomthemes-email-newsletter');?></option>
18
+ <option value="mailerlite" <?php selected($platform,'mailerlite');?>><?php _e('Mailerlite', 'blossomthemes-email-newsletter'); ?></option>
19
+ <option value="convertkit" <?php selected($platform,'convertkit');?>><?php _e('ConvertKit', 'blossomthemes-email-newsletter'); ?></option>
20
+ <option value="getresponse" <?php selected($platform,'getresponse');?>><?php _e('GetReponse', 'blossomthemes-email-newsletter'); ?></option>
21
+ <option value="activecampaign" <?php selected($platform,'activecampaign');?>><?php _e('ActiveCampaign', 'blossomthemes-email-newsletter'); ?></option>
22
+ <option value="aweber" <?php selected($platform,'aweber');?>><?php _e('AWeber', 'blossomthemes-email-newsletter'); ?></option>
23
+ </select>
24
+ </div>
25
+
26
+ </div>
27
+ <div id="platform-switch-holder">
28
+ <?php
29
+ $platform_settings = new BlossomThemes_Email_Newsletter_Settings;
30
+ echo $platform_settings->bten_platform_settings($platform);
31
+ ?>
32
+ </div>
33
+ <div id="ajax-loader" style="display: none">
34
+ <div class="table">
35
+ <div class="table-row">
36
+ <div class="table-cell">
37
+ <img src="<?php echo BLOSSOMTHEMES_EMAIL_NEWSLETTER_FILE_URL.'/public/css/loader.gif';?>">
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </div>
42
+
43
+ <div class="bten-color-wrap form-bg-color">
44
+ <div class="form-bg-color">
45
+ <label for="blossomthemes_email_newsletter_settings[appearance][bgcolor]"><?php _e('Background Color: ','blossomthemes-email-newsletter');?></label>
46
+ <input type="text" class="blossomthemes-email-newsletter-color-form" id="blossomthemes_email_newsletter_settings[appearance][bgcolor]" name="blossomthemes_email_newsletter_settings[appearance][bgcolor]" value="<?php echo isset($blossomthemes_email_newsletter_settings['appearance']['bgcolor']) ? esc_attr($blossomthemes_email_newsletter_settings['appearance']['bgcolor']):apply_filters('bt_newsletter_bg_color_setting','#ffffff')?>">
47
+ </div>
48
+ </div>
49
+
50
+ <div class="bten-color-wrap font-bg-color">
51
+ <div class="font-bg-color">
52
+ <label for="blossomthemes_email_newsletter_settings[appearance][fontcolor]"><?php _e('Font Color: ','blossomthemes-email-newsletter');?></label>
53
+ <input type="text" class="blossomthemes-email-newsletter-color-form" id="blossomthemes_email_newsletter_settings[appearance][fontcolor]" name="blossomthemes_email_newsletter_settings[appearance][fontcolor]" value="<?php echo isset($blossomthemes_email_newsletter_settings['appearance']['fontcolor']) ? esc_attr($blossomthemes_email_newsletter_settings['appearance']['fontcolor']):apply_filters('bt_newsletter_font_color_setting','#ffffff')?>">
54
+ </div>
55
+ </div>
56
+
57
+ <div class="success-msg-option">
58
+ <label><?php _e('Display Successful Subscription Message From:','blossomthemes-email-newsletter');?>
59
+ <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Set how to show the confirmation message to the subscribers after successful subscription.', 'blossomthemes-email-newsletter' ); ?>"><i class="far fa-question-circle"></i>
60
+ </span>
61
+ </label>
62
+ <?php
63
+ $option = isset($blossomthemes_email_newsletter_settings['thankyou-option']) ? esc_attr($blossomthemes_email_newsletter_settings['thankyou-option']):'text';?><br>
64
+
65
+ <div class="success-msg-option-text">
66
+ <label><?php _e('Popup text','blossomthemes-email-newsletter');?><input class="newsletter-success-option" type="radio" name="blossomthemes_email_newsletter_settings[thankyou-option]" value="text" <?php if( $option == 'text' ) echo 'checked'; ?>><span class="check-mark"></span></label>
67
+
68
+ <div class="blossomthemes-email-newsletter-settings-wrap message">
69
+ <label for="blossomthemes_email_newsletter_settings[msg]"><?php _e('Success Message : ','blossomthemes-email-newsletter');?>
70
+ <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Set what message to show when the subscriber is successfully subscribed.', 'blossomthemes-email-newsletter' ); ?>">
71
+ <i class="far fa-question-circle"></i>
72
+ </span>
73
+ </label>
74
+ <textarea name="blossomthemes_email_newsletter_settings[msg]" id="blossomthemes_email_newsletter_settings[msg]"><?php echo isset($blossomthemes_email_newsletter_settings['msg']) ? esc_attr( $blossomthemes_email_newsletter_settings['msg']): 'Successfully subscribed.';?></textarea>
75
+ </div>
76
+
77
+ <div class="blossomthemes-email-newsletter-settings-wrap message">
78
+ <label for="blossomthemes_email_newsletter_settings[gdpr-msg]"><?php _e('GDPR Message : ','blossomthemes-email-newsletter');?>
79
+ <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Set GDPR message to show on the subscription form.', 'blossomthemes-email-newsletter' ); ?>">
80
+ <i class="far fa-question-circle"></i>
81
+ </span>
82
+ </label>
83
+ <textarea name="blossomthemes_email_newsletter_settings[gdpr-msg]" id="blossomthemes_email_newsletter_settings[gdpr-msg]"><?php echo isset($blossomthemes_email_newsletter_settings['gdpr-msg']) ? wp_kses_post($blossomthemes_email_newsletter_settings['gdpr-msg']): 'By checking this, you agree to our Privacy Policy.';?></textarea>
84
+
85
+ </div>
86
+ </div>
87
+
88
+ <div class="success-msg-option-page">
89
+ <label><?php _e('Page','blossomthemes-email-newsletter');?><input class="newsletter-success-option" type="radio" name="blossomthemes_email_newsletter_settings[thankyou-option]" value="page" <?php if( $option == 'page' ) echo 'checked'; ?>><span class="check-mark"></span></label>
90
+ <div class="blossomthemes-email-newsletter-settings-wrap page">
91
+ <label for="blossomthemes_email_newsletter_settings[page]"><?php _e('Thank You Page : ','blossomthemes-email-newsletter');?>
92
+ <span class="blossomthemes-email-newsletter-tooltip" title="<?php esc_html_e( 'Set the page user will be redirected to after successful subscription.', 'blossomthemes-email-newsletter' ); ?>">
93
+ <i class="far fa-question-circle"></i>
94
+ </span>
95
+ </label>
96
+ <div class="select-holder">
97
+ <select name="blossomthemes_email_newsletter_settings[page]">
98
+ <option selected="selected" disabled="disabled" value=""><?php esc_attr_e( 'Select page', 'blossomthemes-email-newsletter' ) ; ?></option>
99
+ <?php
100
+ $pages = get_pages();
101
+ foreach ( $pages as $page ) {
102
+ $option = '<option value="' . $page->ID . '" ';
103
+ $option .= ( $page->ID == $selected_page ) ? 'selected="selected"' : '';
104
+ $option .= '>';
105
+ $option .= $page->post_title;
106
+ $option .= '</option>';
107
+ echo $option;
108
+ }
109
+ ?>
110
+ </select>
111
+ </div>
112
+ </div>
113
+ </div>
114
+ </div>
includes/widgets/widget-blossomthemes-newsletter.php CHANGED
@@ -1,375 +1,379 @@
1
- <?php
2
- /**
3
- * Widget Featured
4
- *
5
- * @package Rttk
6
- */
7
-
8
- // register widget
9
- function blossomthemes_email_newsletter_featured_widget() {
10
- register_widget( 'BlossomThemes_Email_Newsletter_Widget' );
11
- }
12
- add_action( 'widgets_init', 'blossomthemes_email_newsletter_featured_widget' );
13
-
14
- /**
15
- * Adds BlossomThemes_Email_Newsletter_Widget widget.
16
- */
17
- class BlossomThemes_Email_Newsletter_Widget extends WP_Widget {
18
-
19
- /**
20
- * Register widget with WordPress.
21
- */
22
- function __construct() {
23
- parent::__construct(
24
- 'blossomthemes_email_newsletter_widget', // Base ID
25
- __( 'BlossomThemes: Email Newsletter Widget', 'blossomthemes-email-newsletter' ), // Name
26
- array( 'description' => __( 'A Newsletter Widget to add Email Subscription Form to your website.', 'blossomthemes-email-newsletter' ), ) // Args
27
- );
28
- }
29
-
30
- /**
31
- * Front-end display of widget.
32
- *
33
- * @see WP_Widget::widget()
34
- *
35
- * @param array $args Widget arguments.
36
- * @param array $instance Saved values from database.
37
- */
38
- public function widget( $args, $instance ) {
39
- global $post;
40
- $obj = new Blossomthemes_Email_Newsletter_Functions;
41
- $title = !empty( $instance['title'] ) ? $instance['title'] :'';
42
- $newsletter = !empty( $instance['newsletter'] ) ? $instance['newsletter'] : '' ;
43
- $image = !empty( $instance['image'] ) ? $instance['image'] : '' ;
44
- $gdpr = !empty( $instance['gdpr'] ) ? $instance['gdpr'] :'';
45
-
46
- if( isset( $image ) && $image!='' )
47
- {
48
- $icon_img_size = apply_filters( 'bten_icon_header_img_size', 'full' );
49
- }
50
-
51
- echo $args['before_widget'];
52
- ob_start();
53
- if( $title ) echo $args['before_title'] . apply_filters( 'widget_title', $title, $instance, $this->id_base ) . $args['after_title'];
54
- if( $newsletter == '' )
55
- {
56
- return;
57
- }
58
-
59
- $atts['id'] = absint($newsletter);
60
- $blossomthemes_email_newsletter_setting = get_post_meta( $atts['id'], 'blossomthemes_email_newsletter_setting', true );
61
- $settings = get_option( 'blossomthemes_email_newsletter_settings', true );
62
- $rrsb_fc = '';
63
- if( isset( $blossomthemes_email_newsletter_setting['appearance']['fontcolor'] ) && $blossomthemes_email_newsletter_setting['appearance']['fontcolor']!='' )
64
- {
65
- $rrsb_fc = ! empty( $blossomthemes_email_newsletter_setting['appearance']['fontcolor'] ) ? sanitize_text_field( $blossomthemes_email_newsletter_setting['appearance']['fontcolor'] ) : apply_filters('bt_newsletter_font_color_setting','#ffffff');
66
- }
67
- elseif( isset( $settings['appearance']['fontcolor'] ) && $settings['appearance']['fontcolor']!='' )
68
- {
69
- $rrsb_fc = ! empty( $settings['appearance']['fontcolor'] ) ? sanitize_text_field( $settings['appearance']['fontcolor'] ) : apply_filters('bt_newsletter_font_color_setting','#ffffff');
70
- }
71
- $rrsb_sc = isset( $blossomthemes_email_newsletter_setting['appearance']['submitcolor'] ) ? esc_attr( $blossomthemes_email_newsletter_setting['appearance']['submitcolor'] ): '';
72
- $rrsb_shc = isset( $blossomthemes_email_newsletter_setting['appearance']['submithovercolor'] ) ? esc_attr($blossomthemes_email_newsletter_setting['appearance']['submithovercolor']) : '';
73
- $rrsb_stc = isset( $blossomthemes_email_newsletter_setting['appearance']['submittextcolor'] ) ? esc_attr( $blossomthemes_email_newsletter_setting['appearance']['submittextcolor'] ) : '';
74
- $rrsb_sthc = isset( $blossomthemes_email_newsletter_setting['appearance']['submittexthovercolor'] ) ? esc_attr( $blossomthemes_email_newsletter_setting['appearance']['submittexthovercolor'] ) : '';
75
- $rrsb_bg = '';
76
- $rrsb_option = ! empty( $blossomthemes_email_newsletter_setting['appearance']['newsletter-bg-option'] ) ? sanitize_text_field( $blossomthemes_email_newsletter_setting['appearance']['newsletter-bg-option'] ) : 'bg-color';
77
- if( $rrsb_option == 'image' )
78
- {
79
- $overlay = isset( $blossomthemes_email_newsletter_setting['appearance']['overlay'] ) && $blossomthemes_email_newsletter_setting['appearance']['overlay'] == '1' ? ' has-overlay' : ' no-overlay';
80
- if( isset( $blossomthemes_email_newsletter_setting['appearance']['bg']) && $blossomthemes_email_newsletter_setting['appearance']['bg']!='' )
81
- {
82
- $attachment_id = $blossomthemes_email_newsletter_setting['appearance']['bg'];
83
- $newsletter_bio_img_size = apply_filters('bt_newsletter_img_size','full');
84
- $image_array = wp_get_attachment_image_src( $attachment_id, $newsletter_bio_img_size );
85
- $rrsb_bg = 'url('.$image_array[0].') no-repeat';
86
- }
87
- }
88
- else{
89
- if( isset( $blossomthemes_email_newsletter_setting['appearance']['bgcolor'] ) && $blossomthemes_email_newsletter_setting['appearance']['bgcolor']!='' )
90
- {
91
- $rrsb_bg = ! empty( $blossomthemes_email_newsletter_setting['appearance']['bgcolor'] ) ? sanitize_text_field( $blossomthemes_email_newsletter_setting['appearance']['bgcolor'] ) : apply_filters('bt_newsletter_bg_color','#ffffff');
92
- }
93
- elseif( isset( $settings['appearance']['bgcolor'] ) && $settings['appearance']['bgcolor']!='' )
94
- {
95
- $rrsb_bg = ! empty( $settings['appearance']['bgcolor'] ) ? sanitize_text_field( $settings['appearance']['bgcolor'] ) : apply_filters('bt_newsletter_bg_color','#ffffff');
96
- }
97
- }
98
- // ob_start();
99
-
100
- ?>
101
- <div class="blossomthemes-email-newsletter-wrapper<?php if(isset($blossomthemes_email_newsletter_setting['appearance']['newsletter-bg-option']) && $blossomthemes_email_newsletter_setting['appearance']['newsletter-bg-option'] == 'image'){ echo ' bg-img', $overlay; }?>" id="boxes-<?php echo esc_attr($atts['id']);?>" style="background: <?php echo esc_attr($rrsb_bg);?>; color:<?php echo esc_attr($rrsb_fc);?>;">
102
-
103
- <?php $inner_wrap = apply_filters( 'bt_newsletter_widget_inner_wrap_display', false );
104
- if ( $inner_wrap ) {
105
- do_action( 'bt_newsletter_widget_inner_wrap_start' );
106
- } ?>
107
-
108
- <?php if( isset( $image ) && $image!='' ) { ?>
109
- <div class="img-holder">
110
- <?php echo wp_get_attachment_image( $image, $icon_img_size, false,
111
- array( 'alt' => esc_attr( $title )));
112
- ?>
113
- </div>
114
- <?php } ?>
115
- <div class="text-holder" >
116
- <?php if( get_the_title( $atts['id'] ) ) { $title = get_the_title( $atts['id'] ); echo '<h3>'.esc_attr($title).'</h3>'; }?>
117
- <?php
118
- if( isset($blossomthemes_email_newsletter_setting['appearance']['note']) && $blossomthemes_email_newsletter_setting['appearance']['note']!='' )
119
- {
120
- $note = $blossomthemes_email_newsletter_setting['appearance']['note'];
121
- echo '<span>'.esc_attr($note).'</span>';
122
- }
123
- ?>
124
- </div>
125
- <form id="blossomthemes-email-newsletter-<?php echo esc_attr($atts['id']);?>" class="blossomthemes-email-newsletter-window-<?php echo esc_attr($atts['id']);?>">
126
- <?php
127
- $val = isset($blossomthemes_email_newsletter_setting['field']['select']) ? esc_attr($blossomthemes_email_newsletter_setting['field']['select']):'email';
128
- if( $val=='email' )
129
- {
130
- ?>
131
- <input type="text" name="subscribe-email" class="subscribe-email-<?php echo esc_attr($atts['id']);?>" value="" placeholder="<?php echo isset($blossomthemes_email_newsletter_setting['field']['email_placeholder']) ? esc_attr($blossomthemes_email_newsletter_setting['field']['email_placeholder']):'Your Email';?>">
132
- <?php
133
- }
134
- else{ ?>
135
- <input type="text" name="subscribe-fname" required="required" class="subscribe-fname-<?php echo esc_attr($atts['id']);?>" value="" placeholder="<?php echo isset($blossomthemes_email_newsletter_setting['field']['first_name_placeholder']) ? esc_attr($blossomthemes_email_newsletter_setting['field']['first_name_placeholder']):'Your Name';?>">
136
- <input type="text" name="subscribe-email" required="required" class="subscribe-email-<?php echo esc_attr($atts['id']);?>" value="" placeholder="<?php echo isset($blossomthemes_email_newsletter_setting['field']['email_placeholder']) ? esc_attr($blossomthemes_email_newsletter_setting['field']['email_placeholder']):'Your Email';?>">
137
- <?php
138
- }
139
- if(isset($gdpr) && $gdpr!='')
140
- {
141
- ?>
142
- <label for="subscribe-confirmation-<?php echo esc_attr($atts['id']);?>">
143
- <div class="subscribe-inner-wrap">
144
- <input type="checkbox" class="subscribe-confirmation-<?php echo esc_attr($atts['id']);?>" name="subscribe-confirmation" id="subscribe-confirmation-<?php echo esc_attr($atts['id']);?>" required/><span class="check-mark"></span>
145
- <span class="text">
146
- <?php
147
- $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
148
- $gdprmsg = isset($blossomthemes_email_newsletter_settings['gdpr-msg']) ? $blossomthemes_email_newsletter_settings['gdpr-msg']: 'By checking this, you agree to our Privacy Policy.';
149
- echo wp_kses_post($gdprmsg);
150
- ?>
151
- </span>
152
- </div>
153
- </label>
154
- <?php
155
- }
156
- ?>
157
- <div id="loader-<?php echo esc_attr($atts['id']);?>" style="display: none">
158
- <div class="table">
159
- <div class="table-row">
160
- <div class="table-cell">
161
- <img src="<?php echo BLOSSOMTHEMES_EMAIL_NEWSLETTER_FILE_URL.'/public/css/loader.gif';?>">
162
- </div>
163
- </div>
164
- </div>
165
- </div>
166
- <input type="submit" name="subscribe-submit" class="subscribe-submit-<?php echo esc_attr($atts['id']);?>" value="<?php echo isset($blossomthemes_email_newsletter_setting['field']['submit_label']) ? esc_attr($blossomthemes_email_newsletter_setting['field']['submit_label']):'Subscribe';?>">
167
- <?php wp_nonce_field( 'subscription_response', 'bten_subscription_nonce_'.esc_attr($atts['id']).'' ); ?>
168
- </form>
169
- <div class="bten-response" id="bten-response-<?php echo esc_attr($atts['id']);?>"><span></span></div>
170
- <div id="mask-<?php echo esc_attr($atts['id']);?>"></div>
171
-
172
- <?php $inner_wrap = apply_filters( 'bt_newsletter_widget_inner_wrap_display', false );
173
- if ( $inner_wrap ) {
174
- do_action( 'bt_newsletter_widget_inner_wrap_close' );
175
- } ?>
176
- </div>
177
- <?php
178
-
179
- global $post;
180
- $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
181
- $style = '<style>
182
- #mask-'.esc_attr($atts['id']).' {
183
- position: fixed;
184
- width: 100%;
185
- height: 100%;
186
- left: 0;
187
- top: 0;
188
- z-index: 9000;
189
- background-color: #000;
190
- display: none;
191
- }
192
-
193
- #boxes-'.esc_attr($atts['id']).' #dialog {
194
- width: 750px;
195
- height: 300px;
196
- padding: 10px;
197
- background-color: #ffffff;
198
- font-family: "Segoe UI Light", sans-serif;
199
- font-size: 15pt;
200
- }
201
-
202
- #blossomthemes-email-newsletter-'.esc_attr($atts['id']).' input.subscribe-submit-'.esc_attr($atts['id']).'{
203
- color: '.$rrsb_stc.';
204
- background: '.$rrsb_sc.';
205
- }
206
-
207
- #blossomthemes-email-newsletter-'.esc_attr($atts['id']).' input.subscribe-submit-'.esc_attr($atts['id']).':hover{
208
- color: '.$rrsb_sthc.';
209
- background: '.$rrsb_shc.';
210
- }
211
- #loader-'.esc_attr($atts['id']).' {
212
- position: absolute;
213
- top: 27%;
214
- left: 0;
215
- width: 100%;
216
- height: 80%;
217
- text-align: center;
218
- font-size: 50px;
219
- }
220
-
221
- #loader-'.esc_attr($atts['id']).' .table{
222
- display: table;
223
- width: 100%;
224
- height: 100%;
225
- }
226
-
227
- #loader-'.esc_attr($atts['id']).' .table-row{
228
- display: table-row;
229
- }
230
-
231
- #loader-'.esc_attr($atts['id']).' .table-cell{
232
- display: table-cell;
233
- vertical-align: middle;
234
- }
235
- </style>';
236
- echo $obj->bten_minify_css($style);
237
- // echo $style;
238
-
239
- $ajax =
240
- '<script>
241
- jQuery(document).ready(function() {
242
- jQuery(document).on("submit","form#blossomthemes-email-newsletter-'.esc_attr($atts['id']).'", function(e){
243
- e.preventDefault();
244
- jQuery(".subscribe-submit-'.esc_attr($atts['id']).'").attr("disabled", "disabled" );
245
- var email = jQuery(".subscribe-email-'.esc_attr($atts['id']).'").val();
246
- var fname = jQuery(".subscribe-fname-'.esc_attr($atts['id']).'").val();
247
- var sid = '.esc_attr($atts['id']).';
248
- var nonce = jQuery("#bten_subscription_nonce_'.esc_attr($atts['id']).'").val();
249
- jQuery.ajax({
250
- type : "post",
251
- dataType : "json",
252
- url : bten_ajax_data.ajaxurl,
253
- data : {action: "subscription_response", email : email, fname : fname, sid : sid, nonce : nonce},
254
- beforeSend: function(){
255
- jQuery("#loader-'.esc_attr($atts['id']).'").fadeIn(500);
256
- },
257
- success: function(response){
258
- jQuery(".subscribe-submit-'.esc_attr($atts['id']).'").attr("disabled", "disabled" );';
259
- $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
260
- $option = isset($bten_settings['thankyou-option']) ? esc_attr($bten_settings['thankyou-option']):'text';
261
- $ajax .='if(response.type === "success") {';
262
- if($option == 'text')
263
- {
264
- $ajax .= 'jQuery("#bten-response-'.esc_attr($atts['id']).' span").html(response.message);jQuery("#bten-response-'.esc_attr($atts['id']).'").fadeIn("slow").delay("3000").fadeOut("3000",function(){
265
- jQuery(".subscribe-submit-'.esc_attr($atts['id']).'").removeAttr("disabled", "disabled" );
266
- jQuery("form#blossomthemes-email-newsletter-'.esc_attr($atts['id']).'").find("input[type=text]").val("");
267
- });';
268
- }
269
- else{
270
- $selected_page = isset($bten_settings['page'])?esc_attr($bten_settings['page']):'';
271
- $url = get_permalink($selected_page);
272
- $ajax.= 'window.location.href = "'.esc_url($url).'"';
273
- }
274
-
275
- $ajax.='}
276
- else{
277
- jQuery("#bten-response-'.esc_attr($atts['id']).' span").html(response.message);jQuery("#bten-response-'.esc_attr($atts['id']).'").fadeIn("slow").delay("3000").fadeOut("3000",function(){
278
- jQuery(".subscribe-submit-'.esc_attr($atts['id']).'").removeAttr("disabled", "disabled" );
279
- jQuery("form#blossomthemes-email-newsletter-'.esc_attr($atts['id']).'").find("input[type=text]").val("");
280
- });
281
- }
282
- },
283
- complete: function(){
284
- jQuery("#loader-'.esc_attr($atts['id']).'").fadeOut(500);
285
- }
286
- });
287
- });
288
- });
289
- </script>';
290
- echo $obj->bten_minify_js($ajax);
291
- $html = ob_get_clean();
292
- echo apply_filters( 'widget_blossomthemes_newsletter', $html, $args, $title, $image );
293
- echo $args['after_widget'];
294
- }
295
-
296
- /**
297
- * Back-end widget form.
298
- *
299
- * @see WP_Widget::form()
300
- *
301
- * @param array $instance Previously saved values from database.
302
- */
303
- public function form( $instance ) {
304
-
305
- $obj = new Blossomthemes_Email_Newsletter_Functions;
306
- $title = !empty( $instance['title'] ) ? $instance['title'] : '';
307
- $gdpr = !empty( $instance['gdpr'] ) ? $instance['gdpr'] : '';
308
- $newsletter = !empty( $instance['newsletter'] ) ? $instance['newsletter'] : '' ;
309
- $image = !empty( $instance['image'] ) ? $instance['image'] : '' ;
310
- $postlist[0] = array(
311
- 'value' => 0,
312
- 'label' => __('--Choose--', 'blossomthemes-email-newsletter'),
313
- );
314
- $arg = array( 'posts_per_page' => -1, 'post_type' => array( 'subscribe-form' ) );
315
- $posts = get_posts($arg);
316
-
317
- foreach( $posts as $p ){
318
- $postlist[$p->ID] = array(
319
- 'value' => $p->ID,
320
- 'label' => $p->post_title
321
- );
322
- }
323
- ?>
324
- <p>
325
- <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title', 'blossomthemes-email-newsletter' ); ?></label>
326
- <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
327
- </p>
328
-
329
- <p>
330
- <label for="<?php echo esc_attr( $this->get_field_id( 'newsletter' ) ); ?>"><?php esc_html_e( 'Newsletter', 'blossomthemes-email-newsletter' ); ?></label>
331
- <select name="<?php echo esc_attr( $this->get_field_name( 'newsletter' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'newsletter' ) ); ?>" class="widefat">
332
- <?php
333
- foreach ( $postlist as $single_post ) { ?>
334
- <option value="<?php echo $single_post['value']; ?>" id="<?php echo esc_attr( $this->get_field_id( $single_post['label'] ) ); ?>" <?php selected( $single_post['value'], $newsletter ); ?>><?php echo $single_post['label']; ?></option>
335
- <?php } ?>
336
- </select>
337
- <span id="footer-thankyou">
338
- <?php
339
- $bold = '<b>';
340
- $boldclose = '</b>'; echo sprintf( __( 'To create a new newsletter form, go to %1$sBlossomThemes Email Newsletters > Add New%2$s','blossomthemes-email-newsletter'),$bold, $boldclose);?>
341
- </span>
342
- </p>
343
- <p>
344
- <label for="<?php echo esc_attr( $this->get_field_id( 'gdpr' ) ); ?>"><?php esc_html_e( 'Enable GDPR', 'blossomthemes-email-newsletter' ); ?></label>
345
- <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'gdpr' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'gdpr' ) ); ?>" type="checkbox" value="1" <?php echo checked($gdpr,1);?> />
346
- </p>
347
- <?php
348
-
349
- $obj->blossomthemes_email_newsletter_companion_get_image_field($this->get_field_id( 'image' ), $this->get_field_name( 'image' ), $image, __( 'Upload Newsletter Icon', 'blossomthemes-email-newsletter' ));
350
-
351
- }
352
-
353
- /**
354
- * Sanitize widget form values as they are saved.
355
- *
356
- * @see WP_Widget::update()
357
- *
358
- * @param array $new_instance Values just sent to be saved.
359
- * @param array $old_instance Previously saved values from database.
360
- *
361
- * @return array Updated safe values to be saved.
362
- */
363
- public function update( $new_instance, $old_instance ) {
364
- $instance = array();
365
-
366
- $instance['title'] = ! empty( $new_instance['title'] ) ? sanitize_text_field( $new_instance['title'] ) : '';
367
- $instance['newsletter'] = ! empty( $new_instance['newsletter'] ) ? absint( $new_instance['newsletter'] ) : 1;
368
- $instance['image'] = ! empty( $new_instance['image'] ) ? absint( $new_instance['image'] ) : '';
369
- $instance['gdpr'] = !empty( $new_instance['gdpr'] ) ? $new_instance['gdpr'] : '';
370
-
371
-
372
- return $instance;
373
- }
374
-
 
 
 
 
375
  } // class BlossomThemes_Email_Newsletter_Widget
1
+ <?php
2
+ /**
3
+ * Widget Featured
4
+ *
5
+ * @package Rttk
6
+ */
7
+
8
+ // register widget
9
+ function blossomthemes_email_newsletter_featured_widget() {
10
+ register_widget( 'BlossomThemes_Email_Newsletter_Widget' );
11
+ }
12
+ add_action( 'widgets_init', 'blossomthemes_email_newsletter_featured_widget' );
13
+
14
+ /**
15
+ * Adds BlossomThemes_Email_Newsletter_Widget widget.
16
+ */
17
+ class BlossomThemes_Email_Newsletter_Widget extends WP_Widget {
18
+
19
+ /**
20
+ * Register widget with WordPress.
21
+ */
22
+ function __construct() {
23
+ parent::__construct(
24
+ 'blossomthemes_email_newsletter_widget', // Base ID
25
+ __( 'BlossomThemes: Email Newsletter Widget', 'blossomthemes-email-newsletter' ), // Name
26
+ array( 'description' => __( 'A Newsletter Widget to add Email Subscription Form to your website.', 'blossomthemes-email-newsletter' ), ) // Args
27
+ );
28
+ }
29
+
30
+ /**
31
+ * Front-end display of widget.
32
+ *
33
+ * @see WP_Widget::widget()
34
+ *
35
+ * @param array $args Widget arguments.
36
+ * @param array $instance Saved values from database.
37
+ */
38
+ public function widget( $args, $instance ) {
39
+ if ( ! isset( $instance['newsletter'] ) ) {
40
+ // Display nothing if called in backend.
41
+ return;
42
+ }
43
+ global $post;
44
+ $obj = new Blossomthemes_Email_Newsletter_Functions;
45
+ $title = !empty( $instance['title'] ) ? $instance['title'] :'';
46
+ $newsletter = !empty( $instance['newsletter'] ) ? $instance['newsletter'] : '' ;
47
+ $image = !empty( $instance['image'] ) ? $instance['image'] : '' ;
48
+ $gdpr = !empty( $instance['gdpr'] ) ? $instance['gdpr'] :'';
49
+
50
+ if( isset( $image ) && $image!='' )
51
+ {
52
+ $icon_img_size = apply_filters( 'bten_icon_header_img_size', 'full' );
53
+ }
54
+
55
+ echo $args['before_widget'];
56
+ ob_start();
57
+ if( $title ) echo $args['before_title'] . apply_filters( 'widget_title', $title, $instance, $this->id_base ) . $args['after_title'];
58
+ if( $newsletter == '' )
59
+ {
60
+ return;
61
+ }
62
+
63
+ $atts['id'] = absint($newsletter);
64
+ $blossomthemes_email_newsletter_setting = get_post_meta( $atts['id'], 'blossomthemes_email_newsletter_setting', true );
65
+ $settings = get_option( 'blossomthemes_email_newsletter_settings', true );
66
+ $rrsb_fc = '';
67
+ if( isset( $blossomthemes_email_newsletter_setting['appearance']['fontcolor'] ) && $blossomthemes_email_newsletter_setting['appearance']['fontcolor']!='' )
68
+ {
69
+ $rrsb_fc = ! empty( $blossomthemes_email_newsletter_setting['appearance']['fontcolor'] ) ? sanitize_text_field( $blossomthemes_email_newsletter_setting['appearance']['fontcolor'] ) : apply_filters('bt_newsletter_font_color_setting','#ffffff');
70
+ }
71
+ elseif( isset( $settings['appearance']['fontcolor'] ) && $settings['appearance']['fontcolor']!='' )
72
+ {
73
+ $rrsb_fc = ! empty( $settings['appearance']['fontcolor'] ) ? sanitize_text_field( $settings['appearance']['fontcolor'] ) : apply_filters('bt_newsletter_font_color_setting','#ffffff');
74
+ }
75
+ $rrsb_sc = isset( $blossomthemes_email_newsletter_setting['appearance']['submitcolor'] ) ? esc_attr( $blossomthemes_email_newsletter_setting['appearance']['submitcolor'] ): '';
76
+ $rrsb_shc = isset( $blossomthemes_email_newsletter_setting['appearance']['submithovercolor'] ) ? esc_attr($blossomthemes_email_newsletter_setting['appearance']['submithovercolor']) : '';
77
+ $rrsb_stc = isset( $blossomthemes_email_newsletter_setting['appearance']['submittextcolor'] ) ? esc_attr( $blossomthemes_email_newsletter_setting['appearance']['submittextcolor'] ) : '';
78
+ $rrsb_sthc = isset( $blossomthemes_email_newsletter_setting['appearance']['submittexthovercolor'] ) ? esc_attr( $blossomthemes_email_newsletter_setting['appearance']['submittexthovercolor'] ) : '';
79
+ $rrsb_bg = '';
80
+ $rrsb_option = ! empty( $blossomthemes_email_newsletter_setting['appearance']['newsletter-bg-option'] ) ? sanitize_text_field( $blossomthemes_email_newsletter_setting['appearance']['newsletter-bg-option'] ) : 'bg-color';
81
+ if( $rrsb_option == 'image' )
82
+ {
83
+ $overlay = isset( $blossomthemes_email_newsletter_setting['appearance']['overlay'] ) && $blossomthemes_email_newsletter_setting['appearance']['overlay'] == '1' ? ' has-overlay' : ' no-overlay';
84
+ if( isset( $blossomthemes_email_newsletter_setting['appearance']['bg']) && $blossomthemes_email_newsletter_setting['appearance']['bg']!='' )
85
+ {
86
+ $attachment_id = $blossomthemes_email_newsletter_setting['appearance']['bg'];
87
+ $newsletter_bio_img_size = apply_filters('bt_newsletter_img_size','full');
88
+ $image_array = wp_get_attachment_image_src( $attachment_id, $newsletter_bio_img_size );
89
+ $rrsb_bg = 'url('.$image_array[0].') no-repeat';
90
+ }
91
+ }
92
+ else{
93
+ if( isset( $blossomthemes_email_newsletter_setting['appearance']['bgcolor'] ) && $blossomthemes_email_newsletter_setting['appearance']['bgcolor']!='' )
94
+ {
95
+ $rrsb_bg = ! empty( $blossomthemes_email_newsletter_setting['appearance']['bgcolor'] ) ? sanitize_text_field( $blossomthemes_email_newsletter_setting['appearance']['bgcolor'] ) : apply_filters('bt_newsletter_bg_color','#ffffff');
96
+ }
97
+ elseif( isset( $settings['appearance']['bgcolor'] ) && $settings['appearance']['bgcolor']!='' )
98
+ {
99
+ $rrsb_bg = ! empty( $settings['appearance']['bgcolor'] ) ? sanitize_text_field( $settings['appearance']['bgcolor'] ) : apply_filters('bt_newsletter_bg_color','#ffffff');
100
+ }
101
+ }
102
+ // ob_start();
103
+
104
+ ?>
105
+ <div class="blossomthemes-email-newsletter-wrapper<?php if(isset($blossomthemes_email_newsletter_setting['appearance']['newsletter-bg-option']) && $blossomthemes_email_newsletter_setting['appearance']['newsletter-bg-option'] == 'image'){ echo ' bg-img', $overlay; }?>" id="boxes-<?php echo esc_attr($atts['id']);?>" style="background: <?php echo esc_attr($rrsb_bg);?>; color:<?php echo esc_attr($rrsb_fc);?>;">
106
+
107
+ <?php $inner_wrap = apply_filters( 'bt_newsletter_widget_inner_wrap_display', false );
108
+ if ( $inner_wrap ) {
109
+ do_action( 'bt_newsletter_widget_inner_wrap_start' );
110
+ } ?>
111
+
112
+ <?php if( isset( $image ) && $image!='' ) { ?>
113
+ <div class="img-holder">
114
+ <?php echo wp_get_attachment_image( $image, $icon_img_size, false,
115
+ array( 'alt' => esc_attr( $title )));
116
+ ?>
117
+ </div>
118
+ <?php } ?>
119
+ <div class="text-holder" >
120
+ <?php if( get_the_title( $atts['id'] ) ) { $title = get_the_title( $atts['id'] ); echo '<h3>'.esc_attr($title).'</h3>'; }?>
121
+ <?php
122
+ if( isset($blossomthemes_email_newsletter_setting['appearance']['note']) && $blossomthemes_email_newsletter_setting['appearance']['note']!='' )
123
+ {
124
+ $note = $blossomthemes_email_newsletter_setting['appearance']['note'];
125
+ echo '<span>'.esc_attr($note).'</span>';
126
+ }
127
+ ?>
128
+ </div>
129
+ <form id="blossomthemes-email-newsletter-<?php echo esc_attr($atts['id']);?>" class="blossomthemes-email-newsletter-window-<?php echo esc_attr($atts['id']);?>">
130
+ <?php
131
+ $val = isset($blossomthemes_email_newsletter_setting['field']['select']) ? esc_attr($blossomthemes_email_newsletter_setting['field']['select']):'email';
132
+ if( $val=='email' )
133
+ {
134
+ ?>
135
+ <input type="text" name="subscribe-email" class="subscribe-email-<?php echo esc_attr($atts['id']);?>" value="" placeholder="<?php echo isset($blossomthemes_email_newsletter_setting['field']['email_placeholder']) ? esc_attr($blossomthemes_email_newsletter_setting['field']['email_placeholder']):'Your Email';?>">
136
+ <?php
137
+ }
138
+ else{ ?>
139
+ <input type="text" name="subscribe-fname" required="required" class="subscribe-fname-<?php echo esc_attr($atts['id']);?>" value="" placeholder="<?php echo isset($blossomthemes_email_newsletter_setting['field']['first_name_placeholder']) ? esc_attr($blossomthemes_email_newsletter_setting['field']['first_name_placeholder']):'Your Name';?>">
140
+ <input type="text" name="subscribe-email" required="required" class="subscribe-email-<?php echo esc_attr($atts['id']);?>" value="" placeholder="<?php echo isset($blossomthemes_email_newsletter_setting['field']['email_placeholder']) ? esc_attr($blossomthemes_email_newsletter_setting['field']['email_placeholder']):'Your Email';?>">
141
+ <?php
142
+ }
143
+ if(isset($gdpr) && $gdpr!='')
144
+ {
145
+ ?>
146
+ <label for="subscribe-confirmation-<?php echo esc_attr($atts['id']);?>">
147
+ <div class="subscribe-inner-wrap">
148
+ <input type="checkbox" class="subscribe-confirmation-<?php echo esc_attr($atts['id']);?>" name="subscribe-confirmation" id="subscribe-confirmation-<?php echo esc_attr($atts['id']);?>" required/><span class="check-mark"></span>
149
+ <span class="text">
150
+ <?php
151
+ $blossomthemes_email_newsletter_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
152
+ $gdprmsg = isset($blossomthemes_email_newsletter_settings['gdpr-msg']) ? $blossomthemes_email_newsletter_settings['gdpr-msg']: 'By checking this, you agree to our Privacy Policy.';
153
+ echo wp_kses_post($gdprmsg);
154
+ ?>
155
+ </span>
156
+ </div>
157
+ </label>
158
+ <?php
159
+ }
160
+ ?>
161
+ <div id="loader-<?php echo esc_attr($atts['id']);?>" style="display: none">
162
+ <div class="table">
163
+ <div class="table-row">
164
+ <div class="table-cell">
165
+ <img src="<?php echo BLOSSOMTHEMES_EMAIL_NEWSLETTER_FILE_URL.'/public/css/loader.gif';?>">
166
+ </div>
167
+ </div>
168
+ </div>
169
+ </div>
170
+ <input type="submit" name="subscribe-submit" class="subscribe-submit-<?php echo esc_attr($atts['id']);?>" value="<?php echo isset($blossomthemes_email_newsletter_setting['field']['submit_label']) ? esc_attr($blossomthemes_email_newsletter_setting['field']['submit_label']):'Subscribe';?>">
171
+ <?php wp_nonce_field( 'subscription_response', 'bten_subscription_nonce_'.esc_attr($atts['id']).'' ); ?>
172
+ </form>
173
+ <div class="bten-response" id="bten-response-<?php echo esc_attr($atts['id']);?>"><span></span></div>
174
+ <div id="mask-<?php echo esc_attr($atts['id']);?>"></div>
175
+
176
+ <?php $inner_wrap = apply_filters( 'bt_newsletter_widget_inner_wrap_display', false );
177
+ if ( $inner_wrap ) {
178
+ do_action( 'bt_newsletter_widget_inner_wrap_close' );
179
+ } ?>
180
+ </div>
181
+ <?php
182
+
183
+ global $post;
184
+ $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
185
+ $style = '<style>
186
+ #mask-'.esc_attr($atts['id']).' {
187
+ position: fixed;
188
+ width: 100%;
189
+ height: 100%;
190
+ left: 0;
191
+ top: 0;
192
+ z-index: 9000;
193
+ background-color: #000;
194
+ display: none;
195
+ }
196
+
197
+ #boxes-'.esc_attr($atts['id']).' #dialog {
198
+ width: 750px;
199
+ height: 300px;
200
+ padding: 10px;
201
+ background-color: #ffffff;
202
+ font-family: "Segoe UI Light", sans-serif;
203
+ font-size: 15pt;
204
+ }
205
+
206
+ #blossomthemes-email-newsletter-'.esc_attr($atts['id']).' input.subscribe-submit-'.esc_attr($atts['id']).'{
207
+ color: '.$rrsb_stc.';
208
+ background: '.$rrsb_sc.';
209
+ }
210
+
211
+ #blossomthemes-email-newsletter-'.esc_attr($atts['id']).' input.subscribe-submit-'.esc_attr($atts['id']).':hover{
212
+ color: '.$rrsb_sthc.';
213
+ background: '.$rrsb_shc.';
214
+ }
215
+ #loader-'.esc_attr($atts['id']).' {
216
+ position: absolute;
217
+ top: 27%;
218
+ left: 0;
219
+ width: 100%;
220
+ height: 80%;
221
+ text-align: center;
222
+ font-size: 50px;
223
+ }
224
+
225
+ #loader-'.esc_attr($atts['id']).' .table{
226
+ display: table;
227
+ width: 100%;
228
+ height: 100%;
229
+ }
230
+
231
+ #loader-'.esc_attr($atts['id']).' .table-row{
232
+ display: table-row;
233
+ }
234
+
235
+ #loader-'.esc_attr($atts['id']).' .table-cell{
236
+ display: table-cell;
237
+ vertical-align: middle;
238
+ }
239
+ </style>';
240
+ echo $obj->bten_minify_css($style);
241
+ // echo $style;
242
+
243
+ $ajax =
244
+ '<script>
245
+ jQuery(document).ready(function() {
246
+ jQuery(document).on("submit","form#blossomthemes-email-newsletter-'.esc_attr($atts['id']).'", function(e){
247
+ e.preventDefault();
248
+ jQuery(".subscribe-submit-'.esc_attr($atts['id']).'").attr("disabled", "disabled" );
249
+ var email = jQuery(".subscribe-email-'.esc_attr($atts['id']).'").val();
250
+ var fname = jQuery(".subscribe-fname-'.esc_attr($atts['id']).'").val();
251
+ var sid = '.esc_attr($atts['id']).';
252
+ var nonce = jQuery("#bten_subscription_nonce_'.esc_attr($atts['id']).'").val();
253
+ jQuery.ajax({
254
+ type : "post",
255
+ dataType : "json",
256
+ url : bten_ajax_data.ajaxurl,
257
+ data : {action: "subscription_response", email : email, fname : fname, sid : sid, nonce : nonce},
258
+ beforeSend: function(){
259
+ jQuery("#loader-'.esc_attr($atts['id']).'").fadeIn(500);
260
+ },
261
+ success: function(response){
262
+ jQuery(".subscribe-submit-'.esc_attr($atts['id']).'").attr("disabled", "disabled" );';
263
+ $bten_settings = get_option( 'blossomthemes_email_newsletter_settings', true );
264
+ $option = isset($bten_settings['thankyou-option']) ? esc_attr($bten_settings['thankyou-option']):'text';
265
+ $ajax .='if(response.type === "success") {';
266
+ if($option == 'text')
267
+ {
268
+ $ajax .= 'jQuery("#bten-response-'.esc_attr($atts['id']).' span").html(response.message);jQuery("#bten-response-'.esc_attr($atts['id']).'").fadeIn("slow").delay("3000").fadeOut("3000",function(){
269
+ jQuery(".subscribe-submit-'.esc_attr($atts['id']).'").removeAttr("disabled", "disabled" );
270
+ jQuery("form#blossomthemes-email-newsletter-'.esc_attr($atts['id']).'").find("input[type=text]").val("");
271
+ });';
272
+ }
273
+ else{
274
+ $selected_page = isset($bten_settings['page'])?esc_attr($bten_settings['page']):'';
275
+ $url = get_permalink($selected_page);
276
+ $ajax.= 'window.location.href = "'.esc_url($url).'"';
277
+ }
278
+
279
+ $ajax.='}
280
+ else{
281
+ jQuery("#bten-response-'.esc_attr($atts['id']).' span").html(response.message);jQuery("#bten-response-'.esc_attr($atts['id']).'").fadeIn("slow").delay("3000").fadeOut("3000",function(){
282
+ jQuery(".subscribe-submit-'.esc_attr($atts['id']).'").removeAttr("disabled", "disabled" );
283
+ jQuery("form#blossomthemes-email-newsletter-'.esc_attr($atts['id']).'").find("input[type=text]").val("");
284
+ });
285
+ }
286
+ },
287
+ complete: function(){
288
+ jQuery("#loader-'.esc_attr($atts['id']).'").fadeOut(500);
289
+ }
290
+ });
291
+ });
292
+ });
293
+ </script>';
294
+ echo $obj->bten_minify_js($ajax);
295
+ $html = ob_get_clean();
296
+ echo apply_filters( 'widget_blossomthemes_newsletter', $html, $args, $title, $image );
297
+ echo $args['after_widget'];
298
+ }
299
+
300
+ /**
301
+ * Back-end widget form.
302
+ *
303
+ * @see WP_Widget::form()
304
+ *
305
+ * @param array $instance Previously saved values from database.
306
+ */
307
+ public function form( $instance ) {
308
+
309
+ $obj = new Blossomthemes_Email_Newsletter_Functions;
310
+ $title = !empty( $instance['title'] ) ? $instance['title'] : '';
311
+ $gdpr = !empty( $instance['gdpr'] ) ? $instance['gdpr'] : '';
312
+ $newsletter = !empty( $instance['newsletter'] ) ? $instance['newsletter'] : '' ;
313
+ $image = !empty( $instance['image'] ) ? $instance['image'] : '' ;
314
+ $postlist[0] = array(
315
+ 'value' => 0,
316
+ 'label' => __('--Choose--', 'blossomthemes-email-newsletter'),
317
+ );
318
+ $arg = array( 'posts_per_page' => -1, 'post_type' => array( 'subscribe-form' ) );
319
+ $posts = get_posts($arg);
320
+
321
+ foreach( $posts as $p ){
322
+ $postlist[$p->ID] = array(
323
+ 'value' => $p->ID,
324
+ 'label' => $p->post_title
325
+ );
326
+ }
327
+ ?>
328
+ <p>
329
+ <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title', 'blossomthemes-email-newsletter' ); ?></label>
330
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
331
+ </p>
332
+
333
+ <p>
334
+ <label for="<?php echo esc_attr( $this->get_field_id( 'newsletter' ) ); ?>"><?php esc_html_e( 'Newsletter', 'blossomthemes-email-newsletter' ); ?></label>
335
+ <select name="<?php echo esc_attr( $this->get_field_name( 'newsletter' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'newsletter' ) ); ?>" class="widefat">
336
+ <?php
337
+ foreach ( $postlist as $single_post ) { ?>
338
+ <option value="<?php echo $single_post['value']; ?>" id="<?php echo esc_attr( $this->get_field_id( $single_post['label'] ) ); ?>" <?php selected( $single_post['value'], $newsletter ); ?>><?php echo $single_post['label']; ?></option>
339
+ <?php } ?>
340
+ </select>
341
+ <span id="footer-thankyou">
342
+ <?php
343
+ $bold = '<b>';
344
+ $boldclose = '</b>'; echo sprintf( __( 'To create a new newsletter form, go to %1$sBlossomThemes Email Newsletters > Add New%2$s','blossomthemes-email-newsletter'),$bold, $boldclose);?>
345
+ </span>
346
+ </p>
347
+ <p>
348
+ <label for="<?php echo esc_attr( $this->get_field_id( 'gdpr' ) ); ?>"><?php esc_html_e( 'Enable GDPR', 'blossomthemes-email-newsletter' ); ?></label>
349
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'gdpr' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'gdpr' ) ); ?>" type="checkbox" value="1" <?php echo checked($gdpr,1);?> />
350
+ </p>
351
+ <?php
352
+
353
+ $obj->blossomthemes_email_newsletter_companion_get_image_field($this->get_field_id( 'image' ), $this->get_field_name( 'image' ), $image, __( 'Upload Newsletter Icon', 'blossomthemes-email-newsletter' ));
354
+
355
+ }
356
+
357
+ /**
358
+ * Sanitize widget form values as they are saved.
359
+ *
360
+ * @see WP_Widget::update()
361
+ *
362
+ * @param array $new_instance Values just sent to be saved.
363
+ * @param array $old_instance Previously saved values from database.
364
+ *
365
+ * @return array Updated safe values to be saved.
366
+ */
367
+ public function update( $new_instance, $old_instance ) {
368
+ $instance = array();
369
+
370
+ $instance['title'] = ! empty( $new_instance['title'] ) ? sanitize_text_field( $new_instance['title'] ) : '';
371
+ $instance['newsletter'] = ! empty( $new_instance['newsletter'] ) ? absint( $new_instance['newsletter'] ) : 1;
372
+ $instance['image'] = ! empty( $new_instance['image'] ) ? absint( $new_instance['image'] ) : '';
373
+ $instance['gdpr'] = !empty( $new_instance['gdpr'] ) ? $new_instance['gdpr'] : '';
374
+
375
+
376
+ return $instance;
377
+ }
378
+
379
  } // class BlossomThemes_Email_Newsletter_Widget
languages/blossomthemes-email-newsletter.pot CHANGED
@@ -1,14 +1,14 @@
1
- # Copyright (C) 2021 blossomthemes
2
  # This file is distributed under the GPL-2.0+.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: BlossomThemes Email Newsletter 2.1.6\n"
6
  "Report-Msgid-Bugs-To: \n"
7
- "POT-Creation-Date: 2021-03-25 11:15:12+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2021-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: WP Travel Engine\n"
13
  "Language-Team: \n"
14
  "X-Poedit-KeywordsList: "
@@ -131,154 +131,154 @@ msgstr ""
131
  msgid "Remove Image"
132
  msgstr ""
133
 
134
- #: includes/class-blossomthemes-email-newsletter-settings.php:226
135
  msgid "Settings"
136
  msgstr ""
137
 
138
- #: includes/class-blossomthemes-email-newsletter-settings.php:232
139
  msgid "Settings updated."
140
  msgstr ""
141
 
142
- #: includes/class-blossomthemes-email-newsletter-settings.php:232
143
  msgid "Dismiss this notice."
144
  msgstr ""
145
 
146
- #: includes/class-blossomthemes-email-newsletter-settings.php:284
147
- #: includes/class-blossomthemes-email-newsletter-settings.php:333
148
- #: includes/class-blossomthemes-email-newsletter-settings.php:372
149
- #: includes/class-blossomthemes-email-newsletter-settings.php:413
150
- #: includes/class-blossomthemes-email-newsletter-settings.php:456
151
- #: includes/class-blossomthemes-email-newsletter-settings.php:565
152
- #: includes/class-blossomthemes-email-newsletter-settings.php:609
153
  msgid "API Key : "
154
  msgstr ""
155
 
156
- #: includes/class-blossomthemes-email-newsletter-settings.php:286
157
- #: includes/class-blossomthemes-email-newsletter-settings.php:567
158
- #: includes/class-blossomthemes-email-newsletter-settings.php:611
159
  msgid "Get your API key %1$shere%2$s"
160
  msgstr ""
161
 
162
- #: includes/class-blossomthemes-email-newsletter-settings.php:289
163
- #: includes/class-blossomthemes-email-newsletter-settings.php:338
164
- #: includes/class-blossomthemes-email-newsletter-settings.php:380
165
- #: includes/class-blossomthemes-email-newsletter-settings.php:417
166
- #: includes/class-blossomthemes-email-newsletter-settings.php:460
167
- #: includes/class-blossomthemes-email-newsletter-settings.php:525
168
- #: includes/class-blossomthemes-email-newsletter-settings.php:570
169
- #: includes/class-blossomthemes-email-newsletter-settings.php:614
170
  msgid "List Id : "
171
  msgstr ""
172
 
173
- #: includes/class-blossomthemes-email-newsletter-settings.php:290
174
- #: includes/class-blossomthemes-email-newsletter-settings.php:339
175
- #: includes/class-blossomthemes-email-newsletter-settings.php:381
176
- #: includes/class-blossomthemes-email-newsletter-settings.php:418
177
- #: includes/class-blossomthemes-email-newsletter-settings.php:461
178
- #: includes/class-blossomthemes-email-newsletter-settings.php:526
179
- #: includes/class-blossomthemes-email-newsletter-settings.php:571
180
- #: includes/class-blossomthemes-email-newsletter-settings.php:615
181
  msgid ""
182
  "Choose the default list. If no groups/lists are selected in the newsletter "
183
  "posts, users will be subscribed to the list selected above."
184
  msgstr ""
185
 
186
- #: includes/class-blossomthemes-email-newsletter-settings.php:300
187
- #: includes/class-blossomthemes-email-newsletter-settings.php:349
188
- #: includes/class-blossomthemes-email-newsletter-settings.php:391
189
- #: includes/class-blossomthemes-email-newsletter-settings.php:429
190
- #: includes/class-blossomthemes-email-newsletter-settings.php:473
191
- #: includes/class-blossomthemes-email-newsletter-settings.php:537
192
- #: includes/class-blossomthemes-email-newsletter-settings.php:584
193
- #: includes/class-blossomthemes-email-newsletter-settings.php:625
194
  msgid "No Lists Found"
195
  msgstr ""
196
 
197
- #: includes/class-blossomthemes-email-newsletter-settings.php:315
198
- #: includes/class-blossomthemes-email-newsletter-settings.php:639
199
  msgid "Confirmation"
200
  msgstr ""
201
 
202
- #: includes/class-blossomthemes-email-newsletter-settings.php:316
203
- #: includes/class-blossomthemes-email-newsletter-settings.php:640
204
  msgid ""
205
  "Check this box if you want subscribers to receive confirmation mail before "
206
  "they are added to list."
207
  msgstr ""
208
 
209
- #: includes/class-blossomthemes-email-newsletter-settings.php:335
210
  msgid "Get your api key %1$shere%2$s"
211
  msgstr ""
212
 
213
- #: includes/class-blossomthemes-email-newsletter-settings.php:376
214
  msgid "API Secret : "
215
  msgstr ""
216
 
217
- #: includes/class-blossomthemes-email-newsletter-settings.php:431
218
- #: includes/class-blossomthemes-email-newsletter-settings.php:475
219
- #: includes/class-blossomthemes-email-newsletter-settings.php:539
220
  msgid "Choose Campaign ID"
221
  msgstr ""
222
 
223
- #: includes/class-blossomthemes-email-newsletter-settings.php:452
224
  msgid "API Url : "
225
  msgstr ""
226
 
227
- #: includes/class-blossomthemes-email-newsletter-settings.php:507
228
  msgid ""
229
  "The APP ID does not seem to exist. Please enter a valid AWeber APP ID to "
230
  "connect to the mailing lists."
231
  msgstr ""
232
 
233
- #: includes/class-blossomthemes-email-newsletter-settings.php:512
234
- #: includes/class-blossomthemes-email-newsletter-settings.php:520
235
  msgid "AWeber Connection : "
236
  msgstr ""
237
 
238
- #: includes/class-blossomthemes-email-newsletter-settings.php:596
239
  msgid "Grab Lists"
240
  msgstr ""
241
 
242
- #: includes/class-blossomthemes-email-newsletter-shortcodes.php:88
243
- #: includes/class-blossomthemes-email-newsletter-shortcodes.php:94
244
  msgid "Your Email"
245
  msgstr ""
246
 
247
- #: includes/class-blossomthemes-email-newsletter-shortcodes.php:92
248
  msgid "Your Name"
249
  msgstr ""
250
 
251
- #: includes/class-blossomthemes-email-newsletter-shortcodes.php:106
252
  msgid "By checking this, you agree to our Privacy Policy."
253
  msgstr ""
254
 
255
- #: includes/class-blossomthemes-email-newsletter-shortcodes.php:124
256
  msgid "Subscribe"
257
  msgstr ""
258
 
259
- #: includes/class-blossomthemes-email-newsletter-shortcodes.php:257
260
  msgid "Sorry, your nonce did not verify."
261
  msgstr ""
262
 
263
- #: includes/class-blossomthemes-email-newsletter-shortcodes.php:279
264
  msgid "Please enter a valid email."
265
  msgstr ""
266
 
267
- #: includes/class-blossomthemes-email-newsletter-shortcodes.php:299
268
  msgid "Successfully subscribed."
269
  msgstr ""
270
 
271
- #: includes/class-blossomthemes-email-newsletter-shortcodes.php:307
272
- #: includes/class-blossomthemes-email-newsletter-shortcodes.php:337
273
- #: includes/class-blossomthemes-email-newsletter-shortcodes.php:359
274
- #: includes/class-blossomthemes-email-newsletter-shortcodes.php:382
275
- #: includes/class-blossomthemes-email-newsletter-shortcodes.php:405
276
- #: includes/class-blossomthemes-email-newsletter-shortcodes.php:427
277
- #: includes/class-blossomthemes-email-newsletter-shortcodes.php:446
278
  msgid "Error in subscription."
279
  msgstr ""
280
 
281
- #: includes/class-blossomthemes-email-newsletter-shortcodes.php:322
282
  msgid "Please check your email for confirmation."
283
  msgstr ""
284
 
@@ -548,29 +548,29 @@ msgstr ""
548
  msgid "A Newsletter Widget to add Email Subscription Form to your website."
549
  msgstr ""
550
 
551
- #: includes/widgets/widget-blossomthemes-newsletter.php:312
552
  msgid "--Choose--"
553
  msgstr ""
554
 
555
- #: includes/widgets/widget-blossomthemes-newsletter.php:325
556
  msgid "Title"
557
  msgstr ""
558
 
559
- #: includes/widgets/widget-blossomthemes-newsletter.php:330
560
  msgid "Newsletter"
561
  msgstr ""
562
 
563
- #: includes/widgets/widget-blossomthemes-newsletter.php:340
564
  msgid ""
565
  "To create a new newsletter form, go to %1$sBlossomThemes Email Newsletters "
566
  "> Add New%2$s"
567
  msgstr ""
568
 
569
- #: includes/widgets/widget-blossomthemes-newsletter.php:344
570
  msgid "Enable GDPR"
571
  msgstr ""
572
 
573
- #: includes/widgets/widget-blossomthemes-newsletter.php:349
574
  msgid "Upload Newsletter Icon"
575
  msgstr ""
576
 
1
+ # Copyright (C) 2022 blossomthemes
2
  # This file is distributed under the GPL-2.0+.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: BlossomThemes Email Newsletter 2.1.7\n"
6
  "Report-Msgid-Bugs-To: \n"
7
+ "POT-Creation-Date: 2022-01-27 11:03:15+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2022-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: WP Travel Engine\n"
13
  "Language-Team: \n"
14
  "X-Poedit-KeywordsList: "
131
  msgid "Remove Image"
132
  msgstr ""
133
 
134
+ #: includes/class-blossomthemes-email-newsletter-settings.php:238
135
  msgid "Settings"
136
  msgstr ""
137
 
138
+ #: includes/class-blossomthemes-email-newsletter-settings.php:244
139
  msgid "Settings updated."
140
  msgstr ""
141
 
142
+ #: includes/class-blossomthemes-email-newsletter-settings.php:244
143
  msgid "Dismiss this notice."
144
  msgstr ""
145
 
146
+ #: includes/class-blossomthemes-email-newsletter-settings.php:296
147
+ #: includes/class-blossomthemes-email-newsletter-settings.php:345
148
+ #: includes/class-blossomthemes-email-newsletter-settings.php:386
149
+ #: includes/class-blossomthemes-email-newsletter-settings.php:427
150
+ #: includes/class-blossomthemes-email-newsletter-settings.php:470
151
+ #: includes/class-blossomthemes-email-newsletter-settings.php:579
152
+ #: includes/class-blossomthemes-email-newsletter-settings.php:623
153
  msgid "API Key : "
154
  msgstr ""
155
 
156
+ #: includes/class-blossomthemes-email-newsletter-settings.php:298
157
+ #: includes/class-blossomthemes-email-newsletter-settings.php:581
158
+ #: includes/class-blossomthemes-email-newsletter-settings.php:625
159
  msgid "Get your API key %1$shere%2$s"
160
  msgstr ""
161
 
162
+ #: includes/class-blossomthemes-email-newsletter-settings.php:301
163
+ #: includes/class-blossomthemes-email-newsletter-settings.php:350
164
+ #: includes/class-blossomthemes-email-newsletter-settings.php:394
165
+ #: includes/class-blossomthemes-email-newsletter-settings.php:431
166
+ #: includes/class-blossomthemes-email-newsletter-settings.php:474
167
+ #: includes/class-blossomthemes-email-newsletter-settings.php:539
168
+ #: includes/class-blossomthemes-email-newsletter-settings.php:584
169
+ #: includes/class-blossomthemes-email-newsletter-settings.php:628
170
  msgid "List Id : "
171
  msgstr ""
172
 
173
+ #: includes/class-blossomthemes-email-newsletter-settings.php:302
174
+ #: includes/class-blossomthemes-email-newsletter-settings.php:351
175
+ #: includes/class-blossomthemes-email-newsletter-settings.php:395
176
+ #: includes/class-blossomthemes-email-newsletter-settings.php:432
177
+ #: includes/class-blossomthemes-email-newsletter-settings.php:475
178
+ #: includes/class-blossomthemes-email-newsletter-settings.php:540
179
+ #: includes/class-blossomthemes-email-newsletter-settings.php:585
180
+ #: includes/class-blossomthemes-email-newsletter-settings.php:629
181
  msgid ""
182
  "Choose the default list. If no groups/lists are selected in the newsletter "
183
  "posts, users will be subscribed to the list selected above."
184
  msgstr ""
185
 
186
+ #: includes/class-blossomthemes-email-newsletter-settings.php:312
187
+ #: includes/class-blossomthemes-email-newsletter-settings.php:362
188
+ #: includes/class-blossomthemes-email-newsletter-settings.php:405
189
+ #: includes/class-blossomthemes-email-newsletter-settings.php:443
190
+ #: includes/class-blossomthemes-email-newsletter-settings.php:487
191
+ #: includes/class-blossomthemes-email-newsletter-settings.php:551
192
+ #: includes/class-blossomthemes-email-newsletter-settings.php:598
193
+ #: includes/class-blossomthemes-email-newsletter-settings.php:639
194
  msgid "No Lists Found"
195
  msgstr ""
196
 
197
+ #: includes/class-blossomthemes-email-newsletter-settings.php:327
198
+ #: includes/class-blossomthemes-email-newsletter-settings.php:653
199
  msgid "Confirmation"
200
  msgstr ""
201
 
202
+ #: includes/class-blossomthemes-email-newsletter-settings.php:328
203
+ #: includes/class-blossomthemes-email-newsletter-settings.php:654
204
  msgid ""
205
  "Check this box if you want subscribers to receive confirmation mail before "
206
  "they are added to list."
207
  msgstr ""
208
 
209
+ #: includes/class-blossomthemes-email-newsletter-settings.php:347
210
  msgid "Get your api key %1$shere%2$s"
211
  msgstr ""
212
 
213
+ #: includes/class-blossomthemes-email-newsletter-settings.php:390
214
  msgid "API Secret : "
215
  msgstr ""
216
 
217
+ #: includes/class-blossomthemes-email-newsletter-settings.php:445
218
+ #: includes/class-blossomthemes-email-newsletter-settings.php:489
219
+ #: includes/class-blossomthemes-email-newsletter-settings.php:553
220
  msgid "Choose Campaign ID"
221
  msgstr ""
222
 
223
+ #: includes/class-blossomthemes-email-newsletter-settings.php:466
224
  msgid "API Url : "
225
  msgstr ""
226
 
227
+ #: includes/class-blossomthemes-email-newsletter-settings.php:521
228
  msgid ""
229
  "The APP ID does not seem to exist. Please enter a valid AWeber APP ID to "
230
  "connect to the mailing lists."
231
  msgstr ""
232
 
233
+ #: includes/class-blossomthemes-email-newsletter-settings.php:526
234
+ #: includes/class-blossomthemes-email-newsletter-settings.php:534
235
  msgid "AWeber Connection : "
236
  msgstr ""
237
 
238
+ #: includes/class-blossomthemes-email-newsletter-settings.php:610
239
  msgid "Grab Lists"
240
  msgstr ""
241
 
242
+ #: includes/class-blossomthemes-email-newsletter-shortcodes.php:89
243
+ #: includes/class-blossomthemes-email-newsletter-shortcodes.php:95
244
  msgid "Your Email"
245
  msgstr ""
246
 
247
+ #: includes/class-blossomthemes-email-newsletter-shortcodes.php:93
248
  msgid "Your Name"
249
  msgstr ""
250
 
251
+ #: includes/class-blossomthemes-email-newsletter-shortcodes.php:107
252
  msgid "By checking this, you agree to our Privacy Policy."
253
  msgstr ""
254
 
255
+ #: includes/class-blossomthemes-email-newsletter-shortcodes.php:125
256
  msgid "Subscribe"
257
  msgstr ""
258
 
259
+ #: includes/class-blossomthemes-email-newsletter-shortcodes.php:258
260
  msgid "Sorry, your nonce did not verify."
261
  msgstr ""
262
 
263
+ #: includes/class-blossomthemes-email-newsletter-shortcodes.php:280
264
  msgid "Please enter a valid email."
265
  msgstr ""
266
 
267
+ #: includes/class-blossomthemes-email-newsletter-shortcodes.php:300
268
  msgid "Successfully subscribed."
269
  msgstr ""
270
 
271
+ #: includes/class-blossomthemes-email-newsletter-shortcodes.php:308
272
+ #: includes/class-blossomthemes-email-newsletter-shortcodes.php:338
273
+ #: includes/class-blossomthemes-email-newsletter-shortcodes.php:360
274
+ #: includes/class-blossomthemes-email-newsletter-shortcodes.php:383
275
+ #: includes/class-blossomthemes-email-newsletter-shortcodes.php:406
276
+ #: includes/class-blossomthemes-email-newsletter-shortcodes.php:428
277
+ #: includes/class-blossomthemes-email-newsletter-shortcodes.php:447
278
  msgid "Error in subscription."
279
  msgstr ""
280
 
281
+ #: includes/class-blossomthemes-email-newsletter-shortcodes.php:323
282
  msgid "Please check your email for confirmation."
283
  msgstr ""
284
 
548
  msgid "A Newsletter Widget to add Email Subscription Form to your website."
549
  msgstr ""
550
 
551
+ #: includes/widgets/widget-blossomthemes-newsletter.php:316
552
  msgid "--Choose--"
553
  msgstr ""
554
 
555
+ #: includes/widgets/widget-blossomthemes-newsletter.php:329
556
  msgid "Title"
557
  msgstr ""
558
 
559
+ #: includes/widgets/widget-blossomthemes-newsletter.php:334
560
  msgid "Newsletter"
561
  msgstr ""
562
 
563
+ #: includes/widgets/widget-blossomthemes-newsletter.php:344
564
  msgid ""
565
  "To create a new newsletter form, go to %1$sBlossomThemes Email Newsletters "
566
  "> Add New%2$s"
567
  msgstr ""
568
 
569
+ #: includes/widgets/widget-blossomthemes-newsletter.php:348
570
  msgid "Enable GDPR"
571
  msgstr ""
572
 
573
+ #: includes/widgets/widget-blossomthemes-newsletter.php:353
574
  msgid "Upload Newsletter Icon"
575
  msgstr ""
576
 
vendor/clue/stream-filter/CHANGELOG.md ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Changelog
2
+
3
+ ## 1.5.0 (2020-10-02)
4
+
5
+ * Feature: Improve performance by using global imports.
6
+ (#38 by @clue)
7
+
8
+ * Improve API documentation and add support / sponsorship info.
9
+ (#30 by @clue and #35 by @SimonFrings)
10
+
11
+ * Improve test suite and add `.gitattributes` to exclude dev files from exports.
12
+ Prepare PHP 8 support, update to PHPUnit 9 and simplify test matrix.
13
+ (#32 and #37 by @clue and #34 and #36 by @SimonFrings)
14
+
15
+ ## 1.4.1 (2019-04-09)
16
+
17
+ * Fix: Check if the function is declared before declaring it.
18
+ (#23 by @Niko9911)
19
+
20
+ * Improve test suite to also test against PHP 7.2 and
21
+ add test for base64 encoding and decoding filters.
22
+ (#22 by @arubacao and #25 by @Nyholm and @clue)
23
+
24
+ ## 1.4.0 (2017-08-18)
25
+
26
+ * Feature / Fix: The `fun()` function does not pass filter parameter `null`
27
+ to underlying `stream_filter_append()` by default
28
+ (#15 by @Nyholm)
29
+
30
+ Certain filters (such as `convert.quoted-printable-encode`) do not accept
31
+ a filter parameter at all. If no explicit filter parameter is given, we no
32
+ longer pass a default `null` value.
33
+
34
+ ```php
35
+ $encode = Filter\fun('convert.quoted-printable-encode');
36
+ assert('t=C3=A4st' === $encode('täst'));
37
+ ```
38
+
39
+ * Add examples and improve documentation
40
+ (#13 and #20 by @clue and #18 by @Nyholm)
41
+
42
+ * Improve test suite by adding PHPUnit to require-dev,
43
+ fix HHVM build for now again and ignore future HHVM build errors,
44
+ lock Travis distro so new future defaults will not break the build
45
+ and test on PHP 7.1
46
+ (#12, #14 and #19 by @clue and #16 by @Nyholm)
47
+
48
+ ## 1.3.0 (2015-11-08)
49
+
50
+ * Feature: Support accessing built-in filters as callbacks
51
+ (#5 by @clue)
52
+
53
+ ```php
54
+ $fun = Filter\fun('zlib.deflate');
55
+
56
+ $ret = $fun('hello') . $fun('world') . $fun();
57
+ assert('helloworld' === gzinflate($ret));
58
+ ```
59
+
60
+ ## 1.2.0 (2015-10-23)
61
+
62
+ * Feature: Invoke close event when closing filter (flush buffer)
63
+ (#9 by @clue)
64
+
65
+ ## 1.1.0 (2015-10-22)
66
+
67
+ * Feature: Abort filter operation when catching an Exception
68
+ (#10 by @clue)
69
+
70
+ * Feature: Additional safeguards to prevent filter state corruption
71
+ (#7 by @clue)
72
+
73
+ ## 1.0.0 (2015-10-18)
74
+
75
+ * First tagged release
vendor/clue/stream-filter/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Christian Lück
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is furnished
10
+ to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
vendor/clue/stream-filter/README.md ADDED
@@ -0,0 +1,323 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # clue/stream-filter [![Build Status](https://travis-ci.org/clue/php-stream-filter.svg?branch=master)](https://travis-ci.org/clue/php-stream-filter)
2
+
3
+ A simple and modern approach to stream filtering in PHP
4
+
5
+ **Table of contents**
6
+
7
+ * [Why?](#why)
8
+ * [Support us](#support-us)
9
+ * [Usage](#usage)
10
+ * [append()](#append)
11
+ * [prepend()](#prepend)
12
+ * [fun()](#fun)
13
+ * [remove()](#remove)
14
+ * [Install](#install)
15
+ * [Tests](#tests)
16
+ * [License](#license)
17
+
18
+ ## Why?
19
+
20
+ PHP's stream filtering system is great!
21
+
22
+ It offers very powerful stream filtering options and comes with a useful set of built-in filters.
23
+ These filters can be used to easily and efficiently perform various transformations on-the-fly, such as:
24
+
25
+ * read from a gzip'ed input file,
26
+ * transcode from ISO-8859-1 (Latin1) to UTF-8,
27
+ * write to a bzip output file
28
+ * and much more.
29
+
30
+ But let's face it:
31
+ Its API is [*difficult to work with*](https://www.php.net/manual/en/php-user-filter.filter.php)
32
+ and its documentation is [*subpar*](https://stackoverflow.com/questions/27103269/what-is-a-bucket-brigade).
33
+ This combined means its powerful features are often neglected.
34
+
35
+ This project aims to make these features more accessible to a broader audience.
36
+ * **Lightweight, SOLID design** -
37
+ Provides a thin abstraction that is [*just good enough*](https://en.wikipedia.org/wiki/Principle_of_good_enough)
38
+ and does not get in your way.
39
+ Custom filters require trivial effort.
40
+ * **Good test coverage** -
41
+ Comes with an automated tests suite and is regularly tested in the *real world*
42
+
43
+ ## Support us
44
+
45
+ We invest a lot of time developing, maintaining and updating our awesome
46
+ open-source projects. You can help us sustain this high-quality of our work by
47
+ [becoming a sponsor on GitHub](https://github.com/sponsors/clue). Sponsors get
48
+ numerous benefits in return, see our [sponsoring page](https://github.com/sponsors/clue)
49
+ for details.
50
+
51
+ Let's take these projects to the next level together! 🚀
52
+
53
+ ## Usage
54
+
55
+ This lightweight library consists only of a few simple functions.
56
+ All functions reside under the `Clue\StreamFilter` namespace.
57
+
58
+ The below examples assume you use an import statement similar to this:
59
+
60
+ ```php
61
+ use Clue\StreamFilter as Filter;
62
+
63
+ Filter\append(…);
64
+ ```
65
+
66
+ Alternatively, you can also refer to them with their fully-qualified name:
67
+
68
+ ```php
69
+ \Clue\StreamFilter\append(…);
70
+ ```
71
+
72
+ As of PHP 5.6+ you can also import each required function into your code like this:
73
+
74
+ ```php
75
+ use function Clue\StreamFilter\append;
76
+
77
+ append(…);
78
+ ```
79
+
80
+ ### append()
81
+
82
+ The `append(resource<stream> $stream, callable $callback, int $read_write = STREAM_FILTER_ALL): resource<stream filter>` function can be used to
83
+ append a filter callback to the given stream.
84
+
85
+ Each stream can have a list of filters attached.
86
+ This function appends a filter to the end of this list.
87
+
88
+ If the given filter can not be added, it throws an `Exception`.
89
+
90
+ The `$stream` can be any valid stream resource, such as:
91
+
92
+ ```php
93
+ $stream = fopen('demo.txt', 'w+');
94
+ ```
95
+
96
+ The `$callback` should be a valid callable function which accepts
97
+ an individual chunk of data and should return the updated chunk:
98
+
99
+ ```php
100
+ $filter = Filter\append($stream, function ($chunk) {
101
+ // will be called each time you read or write a $chunk to/from the stream
102
+ return $chunk;
103
+ });
104
+ ```
105
+
106
+ As such, you can also use native PHP functions or any other `callable`:
107
+
108
+ ```php
109
+ Filter\append($stream, 'strtoupper');
110
+
111
+ // will write "HELLO" to the underlying stream
112
+ fwrite($stream, 'hello');
113
+ ```
114
+
115
+ If the `$callback` accepts invocation without parameters,
116
+ then this signature will be invoked once ending (flushing) the filter:
117
+
118
+ ```php
119
+ Filter\append($stream, function ($chunk = null) {
120
+ if ($chunk === null) {
121
+ // will be called once ending the filter
122
+ return 'end';
123
+ }
124
+ // will be called each time you read or write a $chunk to/from the stream
125
+ return $chunk;
126
+ });
127
+
128
+ fclose($stream);
129
+ ```
130
+
131
+ > Note: Legacy PHP versions (PHP < 5.4) do not support passing additional data
132
+ from the end signal handler if the stream is being closed.
133
+
134
+ If your callback throws an `Exception`, then the filter process will be aborted.
135
+ In order to play nice with PHP's stream handling,
136
+ the `Exception` will be transformed to a PHP warning instead:
137
+
138
+ ```php
139
+ Filter\append($stream, function ($chunk) {
140
+ throw new \RuntimeException('Unexpected chunk');
141
+ });
142
+
143
+ // raises an E_USER_WARNING with "Error invoking filter: Unexpected chunk"
144
+ fwrite($stream, 'hello');
145
+ ```
146
+
147
+ The optional `$read_write` parameter can be used to only invoke the `$callback`
148
+ when either writing to the stream or only when reading from the stream:
149
+
150
+ ```php
151
+ Filter\append($stream, function ($chunk) {
152
+ // will be called each time you write to the stream
153
+ return $chunk;
154
+ }, STREAM_FILTER_WRITE);
155
+
156
+ Filter\append($stream, function ($chunk) {
157
+ // will be called each time you read from the stream
158
+ return $chunk;
159
+ }, STREAM_FILTER_READ);
160
+ ```
161
+
162
+ This function returns a filter resource which can be passed to [`remove()`](#remove).
163
+
164
+ > Note that once a filter has been added to stream, the stream can no longer be passed to
165
+ > [`stream_select()`](https://www.php.net/manual/en/function.stream-select.php)
166
+ > (and family).
167
+ >
168
+ > > Warning: stream_select(): cannot cast a filtered stream on this system in {file} on line {line}
169
+ >
170
+ > This is due to limitations of PHP's stream filter support, as it can no longer reliably
171
+ > tell when the underlying stream resource is actually ready.
172
+ > As an alternative, consider calling `stream_select()` on the unfiltered stream and
173
+ > then pass the unfiltered data through the [`fun()`](#fun) function.
174
+
175
+ ### prepend()
176
+
177
+ The `prepend(resource<stream> $stream, callable $callback, int $read_write = STREAM_FILTER_ALL): resource<stream filter>` function can be used to
178
+ prepend a filter callback to the given stream.
179
+
180
+ Each stream can have a list of filters attached.
181
+ This function prepends a filter to the start of this list.
182
+
183
+ If the given filter can not be added, it throws an `Exception`.
184
+
185
+ ```php
186
+ $filter = Filter\prepend($stream, function ($chunk) {
187
+ // will be called each time you read or write a $chunk to/from the stream
188
+ return $chunk;
189
+ });
190
+ ```
191
+
192
+ This function returns a filter resource which can be passed to [`remove()`](#remove).
193
+
194
+ Except for the position in the list of filters, this function behaves exactly
195
+ like the [`append()`](#append) function.
196
+ For more details about its behavior, see also the [`append()`](#append) function.
197
+
198
+ ### fun()
199
+
200
+ The `fun(string $filter, mixed $parameters = null): callable` function can be used to
201
+ create a filter function which uses the given built-in `$filter`.
202
+
203
+ PHP comes with a useful set of [built-in filters](https://www.php.net/manual/en/filters.php).
204
+ Using `fun()` makes accessing these as easy as passing an input string to filter
205
+ and getting the filtered output string.
206
+
207
+ ```php
208
+ $fun = Filter\fun('string.rot13');
209
+
210
+ assert('grfg' === $fun('test'));
211
+ assert('test' === $fun($fun('test'));
212
+ ```
213
+
214
+ Please note that not all filter functions may be available depending
215
+ on installed PHP extensions and the PHP version in use.
216
+ In particular, [HHVM](https://hhvm.com/) may not offer the same filter functions
217
+ or parameters as Zend PHP.
218
+ Accessing an unknown filter function will result in a `RuntimeException`:
219
+
220
+ ```php
221
+ Filter\fun('unknown'); // throws RuntimeException
222
+ ```
223
+
224
+ Some filters may accept or require additional filter parameters – most
225
+ filters do not require filter parameters.
226
+ If given, the optional `$parameters` argument will be passed to the
227
+ underlying filter handler as-is.
228
+ In particular, note how *not passing* this parameter at all differs from
229
+ explicitly passing a `null` value (which many filters do not accept).
230
+ Please refer to the individual filter definition for more details.
231
+ For example, the `string.strip_tags` filter can be invoked like this:
232
+
233
+ ```php
234
+ $fun = Filter\fun('string.strip_tags', '<a><b>');
235
+
236
+ $ret = $fun('<b>h<br>i</b>');
237
+ assert('<b>hi</b>' === $ret);
238
+ ```
239
+
240
+ Under the hood, this function allocates a temporary memory stream, so it's
241
+ recommended to clean up the filter function after use.
242
+ Also, some filter functions (in particular the
243
+ [zlib compression filters](https://www.php.net/manual/en/filters.compression.php))
244
+ may use internal buffers and may emit a final data chunk on close.
245
+ The filter function can be closed by invoking without any arguments:
246
+
247
+ ```php
248
+ $fun = Filter\fun('zlib.deflate');
249
+
250
+ $ret = $fun('hello') . $fun('world') . $fun();
251
+ assert('helloworld' === gzinflate($ret));
252
+ ```
253
+
254
+ The filter function must not be used anymore after it has been closed.
255
+ Doing so will result in a `RuntimeException`:
256
+
257
+ ```php
258
+ $fun = Filter\fun('string.rot13');
259
+ $fun();
260
+
261
+ $fun('test'); // throws RuntimeException
262
+ ```
263
+
264
+ > Note: If you're using the zlib compression filters, then you should be wary
265
+ about engine inconsistencies between different PHP versions and HHVM.
266
+ These inconsistencies exist in the underlying PHP engines and there's little we
267
+ can do about this in this library.
268
+ [Our test suite](tests/) contains several test cases that exhibit these issues.
269
+ If you feel some test case is missing or outdated, we're happy to accept PRs! :)
270
+
271
+ ### remove()
272
+
273
+ The `remove(resource<stream filter> $filter): bool` function can be used to
274
+ remove a filter previously added via [`append()`](#append) or [`prepend()`](#prepend).
275
+
276
+ ```php
277
+ $filter = Filter\append($stream, function () {
278
+ // …
279
+ });
280
+ Filter\remove($filter);
281
+ ```
282
+
283
+ ## Install
284
+
285
+ The recommended way to install this library is [through Composer](https://getcomposer.org).
286
+ [New to Composer?](https://getcomposer.org/doc/00-intro.md)
287
+
288
+ This project follows [SemVer](https://semver.org/).
289
+ This will install the latest supported version:
290
+
291
+ ```bash
292
+ $ composer require clue/stream-filter:^1.5
293
+ ```
294
+
295
+ See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
296
+
297
+ This project aims to run on any platform and thus does not require any PHP
298
+ extensions and supports running on legacy PHP 5.3 through current PHP 7+ and
299
+ HHVM.
300
+ It's *highly recommended to use PHP 7+* for this project.
301
+ Older PHP versions may suffer from a number of inconsistencies documented above.
302
+
303
+ ## Tests
304
+
305
+ To run the test suite, you first need to clone this repo and then install all
306
+ dependencies [through Composer](https://getcomposer.org):
307
+
308
+ ```bash
309
+ $ composer install
310
+ ```
311
+
312
+ To run the test suite, go to the project root and run:
313
+
314
+ ```bash
315
+ $ php vendor/bin/phpunit
316
+ ```
317
+
318
+ ## License
319
+
320
+ This project is released under the permissive [MIT license](LICENSE).
321
+
322
+ > Did you know that I offer custom development services and issuing invoices for
323
+ sponsorships of releases and for contributions? Contact me (@clue) for details.
vendor/clue/stream-filter/composer.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "clue/stream-filter",
3
+ "description": "A simple and modern approach to stream filtering in PHP",
4
+ "keywords": ["stream", "callback", "filter", "php_user_filter", "stream_filter_append", "stream_filter_register", "bucket brigade"],
5
+ "homepage": "https://github.com/clue/php-stream-filter",
6
+ "license": "MIT",
7
+ "authors": [
8
+ {
9
+ "name": "Christian Lück",
10
+ "email": "christian@clue.engineering"
11
+ }
12
+ ],
13
+ "require": {
14
+ "php": ">=5.3"
15
+ },
16
+ "require-dev": {
17
+ "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36"
18
+ },
19
+ "autoload": {
20
+ "psr-4": { "Clue\\StreamFilter\\": "src/" },
21
+ "files": [ "src/functions_include.php" ]
22
+ },
23
+ "autoload-dev": {
24
+ "psr-4": { "Clue\\Tests\\StreamFilter\\": "tests/" }
25
+ }
26
+ }
vendor/clue/stream-filter/src/CallbackFilter.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Clue\StreamFilter;
4
+
5
+ /**
6
+ * @internal
7
+ * @see append()
8
+ * @see prepend()
9
+ */
10
+ class CallbackFilter extends \php_user_filter
11
+ {
12
+ private $callback;
13
+ private $closed = true;
14
+ private $supportsClose = false;
15
+
16
+ public function onCreate()
17
+ {
18
+ $this->closed = false;
19
+
20
+ if (!\is_callable($this->params)) {
21
+ throw new \InvalidArgumentException('No valid callback parameter given to stream_filter_(append|prepend)');
22
+ }
23
+ $this->callback = $this->params;
24
+
25
+ // callback supports end event if it accepts invocation without arguments
26
+ $ref = new \ReflectionFunction($this->callback);
27
+ $this->supportsClose = ($ref->getNumberOfRequiredParameters() === 0);
28
+
29
+ return true;
30
+ }
31
+
32
+ public function onClose()
33
+ {
34
+ $this->closed = true;
35
+
36
+ // callback supports closing and is not already closed
37
+ if ($this->supportsClose) {
38
+ $this->supportsClose = false;
39
+ // invoke without argument to signal end and discard resulting buffer
40
+ try {
41
+ \call_user_func($this->callback);
42
+ } catch (\Exception $ignored) {
43
+ // this might be called during engine shutdown, so it's not safe
44
+ // to raise any errors or exceptions here
45
+ // trigger_error('Error closing filter: ' . $ignored->getMessage(), E_USER_WARNING);
46
+ }
47
+ }
48
+
49
+ $this->callback = null;
50
+ }
51
+
52
+ public function filter($in, $out, &$consumed, $closing)
53
+ {
54
+ // concatenate whole buffer from input brigade
55
+ $data = '';
56
+ while ($bucket = \stream_bucket_make_writeable($in)) {
57
+ $consumed += $bucket->datalen;
58
+ $data .= $bucket->data;
59
+ }
60
+
61
+ // skip processing callback that already ended
62
+ if ($this->closed) {
63
+ return \PSFS_FEED_ME;
64
+ }
65
+
66
+ // only invoke filter function if buffer is not empty
67
+ // this may skip flushing a closing filter
68
+ if ($data !== '') {
69
+ try {
70
+ $data = \call_user_func($this->callback, $data);
71
+ } catch (\Exception $e) {
72
+ // exception should mark filter as closed
73
+ $this->onClose();
74
+ \trigger_error('Error invoking filter: ' . $e->getMessage(), \E_USER_WARNING);
75
+
76
+ return \PSFS_ERR_FATAL;
77
+ }
78
+ }
79
+
80
+ // mark filter as closed after processing closing chunk
81
+ if ($closing) {
82
+ $this->closed = true;
83
+
84
+ // callback supports closing and is not already closed
85
+ if ($this->supportsClose) {
86
+ $this->supportsClose = false;
87
+
88
+ // invoke without argument to signal end and append resulting buffer
89
+ try {
90
+ $data .= \call_user_func($this->callback);
91
+ } catch (\Exception $e) {
92
+ \trigger_error('Error ending filter: ' . $e->getMessage(), \E_USER_WARNING);
93
+
94
+ return \PSFS_ERR_FATAL;
95
+ }
96
+ }
97
+ }
98
+
99
+ if ($data !== '') {
100
+ // create a new bucket for writing the resulting buffer to the output brigade
101
+ // reusing an existing bucket turned out to be bugged in some environments (ancient PHP versions and HHVM)
102
+ $bucket = @\stream_bucket_new($this->stream, $data);
103
+
104
+ // legacy PHP versions (PHP < 5.4) do not support passing data from the event signal handler
105
+ // because closing the stream invalidates the stream and its stream bucket brigade before
106
+ // invoking the filter close handler.
107
+ if ($bucket !== false) {
108
+ \stream_bucket_append($out, $bucket);
109
+ }
110
+ }
111
+
112
+ return \PSFS_PASS_ON;
113
+ }
114
+ }
vendor/clue/stream-filter/src/functions.php ADDED
@@ -0,0 +1,327 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Clue\StreamFilter;
4
+
5
+ /**
6
+ * Append a filter callback to the given stream.
7
+ *
8
+ * Each stream can have a list of filters attached.
9
+ * This function appends a filter to the end of this list.
10
+ *
11
+ * If the given filter can not be added, it throws an `Exception`.
12
+ *
13
+ * The `$stream` can be any valid stream resource, such as:
14
+ *
15
+ * ```php
16
+ * $stream = fopen('demo.txt', 'w+');
17
+ * ```
18
+ *
19
+ * The `$callback` should be a valid callable function which accepts
20
+ * an individual chunk of data and should return the updated chunk:
21
+ *
22
+ * ```php
23
+ * $filter = Filter\append($stream, function ($chunk) {
24
+ * // will be called each time you read or write a $chunk to/from the stream
25
+ * return $chunk;
26
+ * });
27
+ * ```
28
+ *
29
+ * As such, you can also use native PHP functions or any other `callable`:
30
+ *
31
+ * ```php
32
+ * Filter\append($stream, 'strtoupper');
33
+ *
34
+ * // will write "HELLO" to the underlying stream
35
+ * fwrite($stream, 'hello');
36
+ * ```
37
+ *
38
+ * If the `$callback` accepts invocation without parameters,
39
+ * then this signature will be invoked once ending (flushing) the filter:
40
+ *
41
+ * ```php
42
+ * Filter\append($stream, function ($chunk = null) {
43
+ * if ($chunk === null) {
44
+ * // will be called once ending the filter
45
+ * return 'end';
46
+ * }
47
+ * // will be called each time you read or write a $chunk to/from the stream
48
+ * return $chunk;
49
+ * });
50
+ *
51
+ * fclose($stream);
52
+ * ```
53
+ *
54
+ * > Note: Legacy PHP versions (PHP < 5.4) do not support passing additional data
55
+ * from the end signal handler if the stream is being closed.
56
+ *
57
+ * If your callback throws an `Exception`, then the filter process will be aborted.
58
+ * In order to play nice with PHP's stream handling,
59
+ * the `Exception` will be transformed to a PHP warning instead:
60
+ *
61
+ * ```php
62
+ * Filter\append($stream, function ($chunk) {
63
+ * throw new \RuntimeException('Unexpected chunk');
64
+ * });
65
+ *
66
+ * // raises an E_USER_WARNING with "Error invoking filter: Unexpected chunk"
67
+ * fwrite($stream, 'hello');
68
+ * ```
69
+ *
70
+ * The optional `$read_write` parameter can be used to only invoke the `$callback`
71
+ * when either writing to the stream or only when reading from the stream:
72
+ *
73
+ * ```php
74
+ * Filter\append($stream, function ($chunk) {
75
+ * // will be called each time you write to the stream
76
+ * return $chunk;
77
+ * }, STREAM_FILTER_WRITE);
78
+ *
79
+ * Filter\append($stream, function ($chunk) {
80
+ * // will be called each time you read from the stream
81
+ * return $chunk;
82
+ * }, STREAM_FILTER_READ);
83
+ * ```
84
+ *
85
+ * This function returns a filter resource which can be passed to [`remove()`](#remove).
86
+ *
87
+ * > Note that once a filter has been added to stream, the stream can no longer be passed to
88
+ * > [`stream_select()`](https://www.php.net/manual/en/function.stream-select.php)
89
+ * > (and family).
90
+ * >
91
+ * > > Warning: stream_select(): cannot cast a filtered stream on this system in {file} on line {line}
92
+ * >
93
+ * > This is due to limitations of PHP's stream filter support, as it can no longer reliably
94
+ * > tell when the underlying stream resource is actually ready.
95
+ * > As an alternative, consider calling `stream_select()` on the unfiltered stream and
96
+ * > then pass the unfiltered data through the [`fun()`](#fun) function.
97
+ *
98
+ * @param resource $stream
99
+ * @param callable $callback
100
+ * @param int $read_write
101
+ * @return resource filter resource which can be used for `remove()`
102
+ * @throws \Exception on error
103
+ * @uses stream_filter_append()
104
+ */
105
+ function append($stream, $callback, $read_write = STREAM_FILTER_ALL)
106
+ {
107
+ $ret = @\stream_filter_append($stream, register(), $read_write, $callback);
108
+
109
+ // PHP 8 throws above on type errors, older PHP and memory issues can throw here
110
+ // @codeCoverageIgnoreStart
111
+ if ($ret === false) {
112
+ $error = \error_get_last() + array('message' => '');
113
+ throw new \RuntimeException('Unable to append filter: ' . $error['message']);
114
+ }
115
+ // @codeCoverageIgnoreEnd
116
+
117
+ return $ret;
118
+ }
119
+
120
+ /**
121
+ * Prepend a filter callback to the given stream.
122
+ *
123
+ * Each stream can have a list of filters attached.
124
+ * This function prepends a filter to the start of this list.
125
+ *
126
+ * If the given filter can not be added, it throws an `Exception`.
127
+ *
128
+ * ```php
129
+ * $filter = Filter\prepend($stream, function ($chunk) {
130
+ * // will be called each time you read or write a $chunk to/from the stream
131
+ * return $chunk;
132
+ * });
133
+ * ```
134
+ *
135
+ * This function returns a filter resource which can be passed to [`remove()`](#remove).
136
+ *
137
+ * Except for the position in the list of filters, this function behaves exactly
138
+ * like the [`append()`](#append) function.
139
+ * For more details about its behavior, see also the [`append()`](#append) function.
140
+ *
141
+ * @param resource $stream
142
+ * @param callable $callback
143
+ * @param int $read_write
144
+ * @return resource filter resource which can be used for `remove()`
145
+ * @throws \Exception on error
146
+ * @uses stream_filter_prepend()
147
+ */
148
+ function prepend($stream, $callback, $read_write = STREAM_FILTER_ALL)
149
+ {
150
+ $ret = @\stream_filter_prepend($stream, register(), $read_write, $callback);
151
+
152
+ // PHP 8 throws above on type errors, older PHP and memory issues can throw here
153
+ // @codeCoverageIgnoreStart
154
+ if ($ret === false) {
155
+ $error = \error_get_last() + array('message' => '');
156
+ throw new \RuntimeException('Unable to prepend filter: ' . $error['message']);
157
+ }
158
+ // @codeCoverageIgnoreEnd
159
+
160
+ return $ret;
161
+ }
162
+
163
+ /**
164
+ * Create a filter function which uses the given built-in `$filter`.
165
+ *
166
+ * PHP comes with a useful set of [built-in filters](https://www.php.net/manual/en/filters.php).
167
+ * Using `fun()` makes accessing these as easy as passing an input string to filter
168
+ * and getting the filtered output string.
169
+ *
170
+ * ```php
171
+ * $fun = Filter\fun('string.rot13');
172
+ *
173
+ * assert('grfg' === $fun('test'));
174
+ * assert('test' === $fun($fun('test'));
175
+ * ```
176
+ *
177
+ * Please note that not all filter functions may be available depending
178
+ * on installed PHP extensions and the PHP version in use.
179
+ * In particular, [HHVM](https://hhvm.com/) may not offer the same filter functions
180
+ * or parameters as Zend PHP.
181
+ * Accessing an unknown filter function will result in a `RuntimeException`:
182
+ *
183
+ * ```php
184
+ * Filter\fun('unknown'); // throws RuntimeException
185
+ * ```
186
+ *
187
+ * Some filters may accept or require additional filter parameters – most
188
+ * filters do not require filter parameters.
189
+ * If given, the optional `$parameters` argument will be passed to the
190
+ * underlying filter handler as-is.
191
+ * In particular, note how *not passing* this parameter at all differs from
192
+ * explicitly passing a `null` value (which many filters do not accept).
193
+ * Please refer to the individual filter definition for more details.
194
+ * For example, the `string.strip_tags` filter can be invoked like this:
195
+ *
196
+ * ```php
197
+ * $fun = Filter\fun('string.strip_tags', '<a><b>');
198
+ *
199
+ * $ret = $fun('<b>h<br>i</b>');
200
+ * assert('<b>hi</b>' === $ret);
201
+ * ```
202
+ *
203
+ * Under the hood, this function allocates a temporary memory stream, so it's
204
+ * recommended to clean up the filter function after use.
205
+ * Also, some filter functions (in particular the
206
+ * [zlib compression filters](https://www.php.net/manual/en/filters.compression.php))
207
+ * may use internal buffers and may emit a final data chunk on close.
208
+ * The filter function can be closed by invoking without any arguments:
209
+ *
210
+ * ```php
211
+ * $fun = Filter\fun('zlib.deflate');
212
+ *
213
+ * $ret = $fun('hello') . $fun('world') . $fun();
214
+ * assert('helloworld' === gzinflate($ret));
215
+ * ```
216
+ *
217
+ * The filter function must not be used anymore after it has been closed.
218
+ * Doing so will result in a `RuntimeException`:
219
+ *
220
+ * ```php
221
+ * $fun = Filter\fun('string.rot13');
222
+ * $fun();
223
+ *
224
+ * $fun('test'); // throws RuntimeException
225
+ * ```
226
+ *
227
+ * > Note: If you're using the zlib compression filters, then you should be wary
228
+ * about engine inconsistencies between different PHP versions and HHVM.
229
+ * These inconsistencies exist in the underlying PHP engines and there's little we
230
+ * can do about this in this library.
231
+ * [Our test suite](tests/) contains several test cases that exhibit these issues.
232
+ * If you feel some test case is missing or outdated, we're happy to accept PRs! :)
233
+ *
234
+ * @param string $filter built-in filter name. See stream_get_filters() or http://php.net/manual/en/filters.php
235
+ * @param mixed $parameters (optional) parameters to pass to the built-in filter as-is
236
+ * @return callable a filter callback which can be append()'ed or prepend()'ed
237
+ * @throws \RuntimeException on error
238
+ * @link http://php.net/manual/en/filters.php
239
+ * @see stream_get_filters()
240
+ * @see append()
241
+ */
242
+ function fun($filter, $parameters = null)
243
+ {
244
+ $fp = \fopen('php://memory', 'w');
245
+ if (\func_num_args() === 1) {
246
+ $filter = @\stream_filter_append($fp, $filter, \STREAM_FILTER_WRITE);
247
+ } else {
248
+ $filter = @\stream_filter_append($fp, $filter, \STREAM_FILTER_WRITE, $parameters);
249
+ }
250
+
251
+ if ($filter === false) {
252
+ \fclose($fp);
253
+ $error = \error_get_last() + array('message' => '');
254
+ throw new \RuntimeException('Unable to access built-in filter: ' . $error['message']);
255
+ }
256
+
257
+ // append filter function which buffers internally
258
+ $buffer = '';
259
+ append($fp, function ($chunk) use (&$buffer) {
260
+ $buffer .= $chunk;
261
+
262
+ // always return empty string in order to skip actually writing to stream resource
263
+ return '';
264
+ }, \STREAM_FILTER_WRITE);
265
+
266
+ $closed = false;
267
+
268
+ return function ($chunk = null) use ($fp, $filter, &$buffer, &$closed) {
269
+ if ($closed) {
270
+ throw new \RuntimeException('Unable to perform operation on closed stream');
271
+ }
272
+ if ($chunk === null) {
273
+ $closed = true;
274
+ $buffer = '';
275
+ \fclose($fp);
276
+ return $buffer;
277
+ }
278
+ // initialize buffer and invoke filters by attempting to write to stream
279
+ $buffer = '';
280
+ \fwrite($fp, $chunk);
281
+
282
+ // buffer now contains everything the filter function returned
283
+ return $buffer;
284
+ };
285
+ }
286
+
287
+ /**
288
+ * Remove a filter previously added via `append()` or `prepend()`.
289
+ *
290
+ * ```php
291
+ * $filter = Filter\append($stream, function () {
292
+ * // …
293
+ * });
294
+ * Filter\remove($filter);
295
+ * ```
296
+ *
297
+ * @param resource $filter
298
+ * @return bool true on success or false on error
299
+ * @throws \RuntimeException on error
300
+ * @uses stream_filter_remove()
301
+ */
302
+ function remove($filter)
303
+ {
304
+ if (@\stream_filter_remove($filter) === false) {
305
+ // PHP 8 throws above on type errors, older PHP and memory issues can throw here
306
+ $error = \error_get_last();
307
+ throw new \RuntimeException('Unable to remove filter: ' . $error['message']);
308
+ }
309
+ }
310
+
311
+ /**
312
+ * Registers the callback filter and returns the resulting filter name
313
+ *
314
+ * There should be little reason to call this function manually.
315
+ *
316
+ * @return string filter name
317
+ * @uses CallbackFilter
318
+ */
319
+ function register()
320
+ {
321
+ static $registered = null;
322
+ if ($registered === null) {
323
+ $registered = 'stream-callback';
324
+ \stream_filter_register($registered, __NAMESPACE__ . '\CallbackFilter');
325
+ }
326
+ return $registered;
327
+ }
vendor/clue/stream-filter/src/functions_include.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // @codeCoverageIgnoreStart
4
+ if (!\function_exists('Clue\\StreamFilter\\append')) {
5
+ require __DIR__ . '/functions.php';
6
+ }
vendor/composer/ClassLoader.php CHANGED
@@ -37,8 +37,8 @@ namespace Composer\Autoload;
37
  *
38
  * @author Fabien Potencier <fabien@symfony.com>
39
  * @author Jordi Boggiano <j.boggiano@seld.be>
40
- * @see http://www.php-fig.org/psr/psr-0/
41
- * @see http://www.php-fig.org/psr/psr-4/
42
  */
43
  class ClassLoader
44
  {
@@ -60,7 +60,7 @@ class ClassLoader
60
  public function getPrefixes()
61
  {
62
  if (!empty($this->prefixesPsr0)) {
63
- return call_user_func_array('array_merge', $this->prefixesPsr0);
64
  }
65
 
66
  return array();
37
  *
38
  * @author Fabien Potencier <fabien@symfony.com>
39
  * @author Jordi Boggiano <j.boggiano@seld.be>
40
+ * @see https://www.php-fig.org/psr/psr-0/
41
+ * @see https://www.php-fig.org/psr/psr-4/
42
  */
43
  class ClassLoader
44
  {
60
  public function getPrefixes()
61
  {
62
  if (!empty($this->prefixesPsr0)) {
63
+ return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
64
  }
65
 
66
  return array();
vendor/composer/InstalledVersions.php ADDED
@@ -0,0 +1,504 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+ namespace Composer;
14
+
15
+ use Composer\Semver\VersionParser;
16
+
17
+
18
+
19
+
20
+
21
+
22
+ class InstalledVersions
23
+ {
24
+ private static $installed = array (
25
+ 'root' =>
26
+ array (
27
+ 'pretty_version' => 'dev-master',
28
+ 'version' => 'dev-master',
29
+ 'aliases' =>
30
+ array (
31
+ ),
32
+ 'reference' => '4f5f67af3cd2f2e144cd7d76325094c837319921',
33
+ 'name' => '__root__',
34
+ ),
35
+ 'versions' =>
36
+ array (
37
+ '__root__' =>
38
+ array (
39
+ 'pretty_version' => 'dev-master',
40
+ 'version' => 'dev-master',
41
+ 'aliases' =>
42
+ array (
43
+ ),
44
+ 'reference' => '4f5f67af3cd2f2e144cd7d76325094c837319921',
45
+ ),
46
+ 'clue/stream-filter' =>
47
+ array (
48
+ 'pretty_version' => 'v1.5.0',
49
+ 'version' => '1.5.0.0',
50
+ 'aliases' =>
51
+ array (
52
+ ),
53
+ 'reference' => 'aeb7d8ea49c7963d3b581378955dbf5bc49aa320',
54
+ ),
55
+ 'getresponse/sdk-php' =>
56
+ array (
57
+ 'pretty_version' => '2.0.0',
58
+ 'version' => '2.0.0.0',
59
+ 'aliases' =>
60
+ array (
61
+ ),
62
+ 'reference' => '752529f6e310513c711d1c9a92d3c5c4c059dcad',
63
+ ),
64
+ 'getresponse/sdk-php-client' =>
65
+ array (
66
+ 'pretty_version' => '1.1.1',
67
+ 'version' => '1.1.1.0',
68
+ 'aliases' =>
69
+ array (
70
+ ),
71
+ 'reference' => 'a9ec8b20a72b8b6366adec04068f20541aa9d648',
72
+ ),
73
+ 'guzzlehttp/guzzle' =>
74
+ array (
75
+ 'pretty_version' => '6.5.5',
76
+ 'version' => '6.5.5.0',
77
+ 'aliases' =>
78
+ array (
79
+ ),
80
+ 'reference' => '9d4290de1cfd701f38099ef7e183b64b4b7b0c5e',
81
+ ),
82
+ 'guzzlehttp/promises' =>
83
+ array (
84
+ 'pretty_version' => '1.5.1',
85
+ 'version' => '1.5.1.0',
86
+ 'aliases' =>
87
+ array (
88
+ ),
89
+ 'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da',
90
+ ),
91
+ 'guzzlehttp/psr7' =>
92
+ array (
93
+ 'pretty_version' => '1.8.3',
94
+ 'version' => '1.8.3.0',
95
+ 'aliases' =>
96
+ array (
97
+ ),
98
+ 'reference' => '1afdd860a2566ed3c2b0b4a3de6e23434a79ec85',
99
+ ),
100
+ 'mailerlite/mailerlite-api-v2-php-sdk' =>
101
+ array (
102
+ 'pretty_version' => '0.3.2',
103
+ 'version' => '0.3.2.0',
104
+ 'aliases' =>
105
+ array (
106
+ ),
107
+ 'reference' => '9fb6b8adb3b0dd9eb964ba5169b229516c73fd78',
108
+ ),
109
+ 'nyholm/psr7' =>
110
+ array (
111
+ 'pretty_version' => '1.4.1',
112
+ 'version' => '1.4.1.0',
113
+ 'aliases' =>
114
+ array (
115
+ ),
116
+ 'reference' => '2212385b47153ea71b1c1b1374f8cb5e4f7892ec',
117
+ ),
118
+ 'php-http/async-client-implementation' =>
119
+ array (
120
+ 'provided' =>
121
+ array (
122
+ 0 => '1.0',
123
+ ),
124
+ ),
125
+ 'php-http/client-common' =>
126
+ array (
127
+ 'pretty_version' => '2.5.0',
128
+ 'version' => '2.5.0.0',
129
+ 'aliases' =>
130
+ array (
131
+ ),
132
+ 'reference' => 'd135751167d57e27c74de674d6a30cef2dc8e054',
133
+ ),
134
+ 'php-http/client-implementation' =>
135
+ array (
136
+ 'provided' =>
137
+ array (
138
+ 0 => '1.0',
139
+ ),
140
+ ),
141
+ 'php-http/discovery' =>
142
+ array (
143
+ 'pretty_version' => '1.14.1',
144
+ 'version' => '1.14.1.0',
145
+ 'aliases' =>
146
+ array (
147
+ ),
148
+ 'reference' => 'de90ab2b41d7d61609f504e031339776bc8c7223',
149
+ ),
150
+ 'php-http/guzzle6-adapter' =>
151
+ array (
152
+ 'pretty_version' => 'v2.0.2',
153
+ 'version' => '2.0.2.0',
154
+ 'aliases' =>
155
+ array (
156
+ ),
157
+ 'reference' => '9d1a45eb1c59f12574552e81fb295e9e53430a56',
158
+ ),
159
+ 'php-http/httplug' =>
160
+ array (
161
+ 'pretty_version' => '2.2.0',
162
+ 'version' => '2.2.0.0',
163
+ 'aliases' =>
164
+ array (
165
+ ),
166
+ 'reference' => '191a0a1b41ed026b717421931f8d3bd2514ffbf9',
167
+ ),
168
+ 'php-http/message' =>
169
+ array (
170
+ 'pretty_version' => '1.12.0',
171
+ 'version' => '1.12.0.0',
172
+ 'aliases' =>
173
+ array (
174
+ ),
175
+ 'reference' => '39eb7548be982a81085fe5a6e2a44268cd586291',
176
+ ),
177
+ 'php-http/message-factory' =>
178
+ array (
179
+ 'pretty_version' => 'v1.0.2',
180
+ 'version' => '1.0.2.0',
181
+ 'aliases' =>
182
+ array (
183
+ ),
184
+ 'reference' => 'a478cb11f66a6ac48d8954216cfed9aa06a501a1',
185
+ ),
186
+ 'php-http/message-factory-implementation' =>
187
+ array (
188
+ 'provided' =>
189
+ array (
190
+ 0 => '1.0',
191
+ ),
192
+ ),
193
+ 'php-http/promise' =>
194
+ array (
195
+ 'pretty_version' => '1.1.0',
196
+ 'version' => '1.1.0.0',
197
+ 'aliases' =>
198
+ array (
199
+ ),
200
+ 'reference' => '4c4c1f9b7289a2ec57cde7f1e9762a5789506f88',
201
+ ),
202
+ 'psr/http-client' =>
203
+ array (
204
+ 'pretty_version' => '1.0.1',
205
+ 'version' => '1.0.1.0',
206
+ 'aliases' =>
207
+ array (
208
+ ),
209
+ 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621',
210
+ ),
211
+ 'psr/http-client-implementation' =>
212
+ array (
213
+ 'provided' =>
214
+ array (
215
+ 0 => '1.0',
216
+ ),
217
+ ),
218
+ 'psr/http-factory' =>
219
+ array (
220
+ 'pretty_version' => '1.0.1',
221
+ 'version' => '1.0.1.0',
222
+ 'aliases' =>
223
+ array (
224
+ ),
225
+ 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be',
226
+ ),
227
+ 'psr/http-factory-implementation' =>
228
+ array (
229
+ 'provided' =>
230
+ array (
231
+ 0 => '1.0',
232
+ ),
233
+ ),
234
+ 'psr/http-message' =>
235
+ array (
236
+ 'pretty_version' => '1.0.1',
237
+ 'version' => '1.0.1.0',
238
+ 'aliases' =>
239
+ array (
240
+ ),
241
+ 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363',
242
+ ),
243
+ 'psr/http-message-implementation' =>
244
+ array (
245
+ 'provided' =>
246
+ array (
247
+ 0 => '1.0',
248
+ ),
249
+ ),
250
+ 'psr/log' =>
251
+ array (
252
+ 'pretty_version' => '1.1.4',
253
+ 'version' => '1.1.4.0',
254
+ 'aliases' =>
255
+ array (
256
+ ),
257
+ 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
258
+ ),
259
+ 'ralouphie/getallheaders' =>
260
+ array (
261
+ 'pretty_version' => '3.0.3',
262
+ 'version' => '3.0.3.0',
263
+ 'aliases' =>
264
+ array (
265
+ ),
266
+ 'reference' => '120b605dfeb996808c31b6477290a714d356e822',
267
+ ),
268
+ 'symfony/deprecation-contracts' =>
269
+ array (
270
+ 'pretty_version' => 'v2.5.0',
271
+ 'version' => '2.5.0.0',
272
+ 'aliases' =>
273
+ array (
274
+ ),
275
+ 'reference' => '6f981ee24cf69ee7ce9736146d1c57c2780598a8',
276
+ ),
277
+ 'symfony/options-resolver' =>
278
+ array (
279
+ 'pretty_version' => 'v5.4.0',
280
+ 'version' => '5.4.0.0',
281
+ 'aliases' =>
282
+ array (
283
+ ),
284
+ 'reference' => 'b0fb78576487af19c500aaddb269fd36701d4847',
285
+ ),
286
+ 'symfony/polyfill-intl-idn' =>
287
+ array (
288
+ 'pretty_version' => 'v1.24.0',
289
+ 'version' => '1.24.0.0',
290
+ 'aliases' =>
291
+ array (
292
+ ),
293
+ 'reference' => '749045c69efb97c70d25d7463abba812e91f3a44',
294
+ ),
295
+ 'symfony/polyfill-intl-normalizer' =>
296
+ array (
297
+ 'pretty_version' => 'v1.24.0',
298
+ 'version' => '1.24.0.0',
299
+ 'aliases' =>
300
+ array (
301
+ ),
302
+ 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8',
303
+ ),
304
+ 'symfony/polyfill-php72' =>
305
+ array (
306
+ 'pretty_version' => 'v1.24.0',
307
+ 'version' => '1.24.0.0',
308
+ 'aliases' =>
309
+ array (
310
+ ),
311
+ 'reference' => '9a142215a36a3888e30d0a9eeea9766764e96976',
312
+ ),
313
+ 'symfony/polyfill-php73' =>
314
+ array (
315
+ 'pretty_version' => 'v1.24.0',
316
+ 'version' => '1.24.0.0',
317
+ 'aliases' =>
318
+ array (
319
+ ),
320
+ 'reference' => 'cc5db0e22b3cb4111010e48785a97f670b350ca5',
321
+ ),
322
+ 'symfony/polyfill-php80' =>
323
+ array (
324
+ 'pretty_version' => 'v1.24.0',
325
+ 'version' => '1.24.0.0',
326
+ 'aliases' =>
327
+ array (
328
+ ),
329
+ 'reference' => '57b712b08eddb97c762a8caa32c84e037892d2e9',
330
+ ),
331
+ ),
332
+ );
333
+
334
+
335
+
336
+
337
+
338
+
339
+
340
+ public static function getInstalledPackages()
341
+ {
342
+ return array_keys(self::$installed['versions']);
343
+ }
344
+
345
+
346
+
347
+
348
+
349
+
350
+
351
+
352
+
353
+ public static function isInstalled($packageName)
354
+ {
355
+ return isset(self::$installed['versions'][$packageName]);
356
+ }
357
+
358
+
359
+
360
+
361
+
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+
370
+
371
+ public static function satisfies(VersionParser $parser, $packageName, $constraint)
372
+ {
373
+ $constraint = $parser->parseConstraints($constraint);
374
+ $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
375
+
376
+ return $provided->matches($constraint);
377
+ }
378
+
379
+
380
+
381
+
382
+
383
+
384
+
385
+
386
+
387
+
388
+ public static function getVersionRanges($packageName)
389
+ {
390
+ if (!isset(self::$installed['versions'][$packageName])) {
391
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
392
+ }
393
+
394
+ $ranges = array();
395
+ if (isset(self::$installed['versions'][$packageName]['pretty_version'])) {
396
+ $ranges[] = self::$installed['versions'][$packageName]['pretty_version'];
397
+ }
398
+ if (array_key_exists('aliases', self::$installed['versions'][$packageName])) {
399
+ $ranges = array_merge($ranges, self::$installed['versions'][$packageName]['aliases']);
400
+ }
401
+ if (array_key_exists('replaced', self::$installed['versions'][$packageName])) {
402
+ $ranges = array_merge($ranges, self::$installed['versions'][$packageName]['replaced']);
403
+ }
404
+ if (array_key_exists('provided', self::$installed['versions'][$packageName])) {
405
+ $ranges = array_merge($ranges, self::$installed['versions'][$packageName]['provided']);
406
+ }
407
+
408
+ return implode(' || ', $ranges);
409
+ }
410
+
411
+
412
+
413
+
414
+
415
+ public static function getVersion($packageName)
416
+ {
417
+ if (!isset(self::$installed['versions'][$packageName])) {
418
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
419
+ }
420
+
421
+ if (!isset(self::$installed['versions'][$packageName]['version'])) {
422
+ return null;
423
+ }
424
+
425
+ return self::$installed['versions'][$packageName]['version'];
426
+ }
427
+
428
+
429
+
430
+
431
+
432
+ public static function getPrettyVersion($packageName)
433
+ {
434
+ if (!isset(self::$installed['versions'][$packageName])) {
435
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
436
+ }
437
+
438
+ if (!isset(self::$installed['versions'][$packageName]['pretty_version'])) {
439
+ return null;
440
+ }
441
+
442
+ return self::$installed['versions'][$packageName]['pretty_version'];
443
+ }
444
+
445
+
446
+
447
+
448
+
449
+ public static function getReference($packageName)
450
+ {
451
+ if (!isset(self::$installed['versions'][$packageName])) {
452
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
453
+ }
454
+
455
+ if (!isset(self::$installed['versions'][$packageName]['reference'])) {
456
+ return null;
457
+ }
458
+
459
+ return self::$installed['versions'][$packageName]['reference'];
460
+ }
461
+
462
+
463
+
464
+
465
+
466
+ public static function getRootPackage()
467
+ {
468
+ return self::$installed['root'];
469
+ }
470
+
471
+
472
+
473
+
474
+
475
+
476
+
477
+ public static function getRawData()
478
+ {
479
+ return self::$installed;
480
+ }
481
+
482
+
483
+
484
+
485
+
486
+
487
+
488
+
489
+
490
+
491
+
492
+
493
+
494
+
495
+
496
+
497
+
498
+
499
+
500
+ public static function reload($data)
501
+ {
502
+ self::$installed = $data;
503
+ }
504
+ }
vendor/composer/autoload_classmap.php CHANGED
@@ -6,4 +6,11 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
 
 
 
 
 
 
9
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
10
+ 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
11
+ 'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
12
+ 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
13
+ 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
14
+ 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
15
+ 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
16
  );
vendor/composer/autoload_files.php CHANGED
@@ -8,4 +8,14 @@ $baseDir = dirname($vendorDir);
8
  return array(
9
  '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
10
  'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
 
 
 
 
 
 
 
 
 
 
11
  );
8
  return array(
9
  '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
10
  'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
11
+ 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
12
+ 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
13
+ '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',
14
+ '9c67151ae59aff4788964ce8eb2a0f43' => $vendorDir . '/clue/stream-filter/src/functions_include.php',
15
+ 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
16
+ '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
17
+ 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php',
18
+ '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
19
+ '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
20
+ '8cff32064859f4559445b89279f3199c' => $vendorDir . '/php-http/message/src/filters.php',
21
  );
vendor/composer/autoload_psr4.php CHANGED
@@ -6,11 +6,29 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
 
 
 
 
 
9
  'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
10
- 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'),
 
 
 
 
 
 
 
 
 
11
  'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
 
 
12
  'Getresponse\\Sdk\\Test\\' => array($vendorDir . '/getresponse/sdk-php/tests'),
13
  'Getresponse\\Sdk\\Client\\Test\\' => array($vendorDir . '/getresponse/sdk-php-client/tests'),
14
  'Getresponse\\Sdk\\Client\\' => array($vendorDir . '/getresponse/sdk-php-client/src'),
15
  'Getresponse\\Sdk\\' => array($vendorDir . '/getresponse/sdk-php/src'),
 
16
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
10
+ 'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'),
11
+ 'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'),
12
+ 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'),
13
+ 'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'),
14
+ 'Symfony\\Component\\OptionsResolver\\' => array($vendorDir . '/symfony/options-resolver'),
15
  'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
16
+ 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
17
+ 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
18
+ 'Nyholm\\Psr7\\' => array($vendorDir . '/nyholm/psr7/src'),
19
+ 'MailerLiteApi\\' => array($vendorDir . '/mailerlite/mailerlite-api-v2-php-sdk/src'),
20
+ 'Http\\Promise\\' => array($vendorDir . '/php-http/promise/src'),
21
+ 'Http\\Message\\' => array($vendorDir . '/php-http/message/src', $vendorDir . '/php-http/message-factory/src'),
22
+ 'Http\\Discovery\\' => array($vendorDir . '/php-http/discovery/src'),
23
+ 'Http\\Client\\Common\\' => array($vendorDir . '/php-http/client-common/src'),
24
+ 'Http\\Client\\' => array($vendorDir . '/php-http/httplug/src'),
25
+ 'Http\\Adapter\\Guzzle6\\' => array($vendorDir . '/php-http/guzzle6-adapter/src'),
26
  'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
27
+ 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
28
+ 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
29
  'Getresponse\\Sdk\\Test\\' => array($vendorDir . '/getresponse/sdk-php/tests'),
30
  'Getresponse\\Sdk\\Client\\Test\\' => array($vendorDir . '/getresponse/sdk-php-client/tests'),
31
  'Getresponse\\Sdk\\Client\\' => array($vendorDir . '/getresponse/sdk-php-client/src'),
32
  'Getresponse\\Sdk\\' => array($vendorDir . '/getresponse/sdk-php/src'),
33
+ 'Clue\\StreamFilter\\' => array($vendorDir . '/clue/stream-filter/src'),
34
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitb8f4ea876dfcb65b37f311a00ef3bbe6
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,17 @@ class ComposerAutoloaderInitb8f4ea876dfcb65b37f311a00ef3bbe6
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInitb8f4ea876dfcb65b37f311a00ef3bbe6', 'loadClassLoader'), true, true);
 
 
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInitb8f4ea876dfcb65b37f311a00ef3bbe6', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
- require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInitb8f4ea876dfcb65b37f311a00ef3bbe6::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +53,19 @@ class ComposerAutoloaderInitb8f4ea876dfcb65b37f311a00ef3bbe6
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInitb8f4ea876dfcb65b37f311a00ef3bbe6::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequireb8f4ea876dfcb65b37f311a00ef3bbe6($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequireb8f4ea876dfcb65b37f311a00ef3bbe6($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit6258e4072a667a28fb1a2657c127a26b
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ require __DIR__ . '/platform_check.php';
26
+
27
+ spl_autoload_register(array('ComposerAutoloaderInit6258e4072a667a28fb1a2657c127a26b', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
29
+ spl_autoload_unregister(array('ComposerAutoloaderInit6258e4072a667a28fb1a2657c127a26b', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
+ require __DIR__ . '/autoload_static.php';
34
 
35
+ call_user_func(\Composer\Autoload\ComposerStaticInit6258e4072a667a28fb1a2657c127a26b::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
53
  $loader->register(true);
54
 
55
  if ($useStaticLoader) {
56
+ $includeFiles = Composer\Autoload\ComposerStaticInit6258e4072a667a28fb1a2657c127a26b::$files;
57
  } else {
58
  $includeFiles = require __DIR__ . '/autoload_files.php';
59
  }
60
  foreach ($includeFiles as $fileIdentifier => $file) {
61
+ composerRequire6258e4072a667a28fb1a2657c127a26b($fileIdentifier, $file);
62
  }
63
 
64
  return $loader;
65
  }
66
  }
67
 
68
+ function composerRequire6258e4072a667a28fb1a2657c127a26b($fileIdentifier, $file)
69
  {
70
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
71
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,42 +4,155 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitb8f4ea876dfcb65b37f311a00ef3bbe6
8
  {
9
  public static $files = array (
10
  '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
11
  'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php',
 
 
 
 
 
 
 
 
 
 
12
  );
13
 
14
  public static $prefixLengthsPsr4 = array (
 
 
 
 
 
 
 
 
 
15
  'P' =>
16
  array (
17
  'Psr\\Log\\' => 8,
18
  'Psr\\Http\\Message\\' => 17,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  ),
20
  'G' =>
21
  array (
22
  'GuzzleHttp\\Psr7\\' => 16,
 
 
23
  'Getresponse\\Sdk\\Test\\' => 21,
24
  'Getresponse\\Sdk\\Client\\Test\\' => 28,
25
  'Getresponse\\Sdk\\Client\\' => 23,
26
  'Getresponse\\Sdk\\' => 16,
27
  ),
 
 
 
 
28
  );
29
 
30
  public static $prefixDirsPsr4 = array (
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  'Psr\\Log\\' =>
32
  array (
33
  0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
34
  ),
35
  'Psr\\Http\\Message\\' =>
36
  array (
37
- 0 => __DIR__ . '/..' . '/psr/http-message/src',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  ),
39
  'GuzzleHttp\\Psr7\\' =>
40
  array (
41
  0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src',
42
  ),
 
 
 
 
 
 
 
 
43
  'Getresponse\\Sdk\\Test\\' =>
44
  array (
45
  0 => __DIR__ . '/..' . '/getresponse/sdk-php/tests',
@@ -56,13 +169,28 @@ class ComposerStaticInitb8f4ea876dfcb65b37f311a00ef3bbe6
56
  array (
57
  0 => __DIR__ . '/..' . '/getresponse/sdk-php/src',
58
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  );
60
 
61
  public static function getInitializer(ClassLoader $loader)
62
  {
63
  return \Closure::bind(function () use ($loader) {
64
- $loader->prefixLengthsPsr4 = ComposerStaticInitb8f4ea876dfcb65b37f311a00ef3bbe6::$prefixLengthsPsr4;
65
- $loader->prefixDirsPsr4 = ComposerStaticInitb8f4ea876dfcb65b37f311a00ef3bbe6::$prefixDirsPsr4;
 
66
 
67
  }, null, ClassLoader::class);
68
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit6258e4072a667a28fb1a2657c127a26b
8
  {
9
  public static $files = array (
10
  '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
11
  'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php',
12
+ 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
13
+ 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
14
+ '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
15
+ '9c67151ae59aff4788964ce8eb2a0f43' => __DIR__ . '/..' . '/clue/stream-filter/src/functions_include.php',
16
+ 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
17
+ '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
18
+ 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php',
19
+ '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
20
+ '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
21
+ '8cff32064859f4559445b89279f3199c' => __DIR__ . '/..' . '/php-http/message/src/filters.php',
22
  );
23
 
24
  public static $prefixLengthsPsr4 = array (
25
+ 'S' =>
26
+ array (
27
+ 'Symfony\\Polyfill\\Php80\\' => 23,
28
+ 'Symfony\\Polyfill\\Php73\\' => 23,
29
+ 'Symfony\\Polyfill\\Php72\\' => 23,
30
+ 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33,
31
+ 'Symfony\\Polyfill\\Intl\\Idn\\' => 26,
32
+ 'Symfony\\Component\\OptionsResolver\\' => 34,
33
+ ),
34
  'P' =>
35
  array (
36
  'Psr\\Log\\' => 8,
37
  'Psr\\Http\\Message\\' => 17,
38
+ 'Psr\\Http\\Client\\' => 16,
39
+ ),
40
+ 'N' =>
41
+ array (
42
+ 'Nyholm\\Psr7\\' => 12,
43
+ ),
44
+ 'M' =>
45
+ array (
46
+ 'MailerLiteApi\\' => 14,
47
+ ),
48
+ 'H' =>
49
+ array (
50
+ 'Http\\Promise\\' => 13,
51
+ 'Http\\Message\\' => 13,
52
+ 'Http\\Discovery\\' => 15,
53
+ 'Http\\Client\\Common\\' => 19,
54
+ 'Http\\Client\\' => 12,
55
+ 'Http\\Adapter\\Guzzle6\\' => 21,
56
  ),
57
  'G' =>
58
  array (
59
  'GuzzleHttp\\Psr7\\' => 16,
60
+ 'GuzzleHttp\\Promise\\' => 19,
61
+ 'GuzzleHttp\\' => 11,
62
  'Getresponse\\Sdk\\Test\\' => 21,
63
  'Getresponse\\Sdk\\Client\\Test\\' => 28,
64
  'Getresponse\\Sdk\\Client\\' => 23,
65
  'Getresponse\\Sdk\\' => 16,
66
  ),
67
+ 'C' =>
68
+ array (
69
+ 'Clue\\StreamFilter\\' => 18,
70
+ ),
71
  );
72
 
73
  public static $prefixDirsPsr4 = array (
74
+ 'Symfony\\Polyfill\\Php80\\' =>
75
+ array (
76
+ 0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
77
+ ),
78
+ 'Symfony\\Polyfill\\Php73\\' =>
79
+ array (
80
+ 0 => __DIR__ . '/..' . '/symfony/polyfill-php73',
81
+ ),
82
+ 'Symfony\\Polyfill\\Php72\\' =>
83
+ array (
84
+ 0 => __DIR__ . '/..' . '/symfony/polyfill-php72',
85
+ ),
86
+ 'Symfony\\Polyfill\\Intl\\Normalizer\\' =>
87
+ array (
88
+ 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer',
89
+ ),
90
+ 'Symfony\\Polyfill\\Intl\\Idn\\' =>
91
+ array (
92
+ 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-idn',
93
+ ),
94
+ 'Symfony\\Component\\OptionsResolver\\' =>
95
+ array (
96
+ 0 => __DIR__ . '/..' . '/symfony/options-resolver',
97
+ ),
98
  'Psr\\Log\\' =>
99
  array (
100
  0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
101
  ),
102
  'Psr\\Http\\Message\\' =>
103
  array (
104
+ 0 => __DIR__ . '/..' . '/psr/http-factory/src',
105
+ 1 => __DIR__ . '/..' . '/psr/http-message/src',
106
+ ),
107
+ 'Psr\\Http\\Client\\' =>
108
+ array (
109
+ 0 => __DIR__ . '/..' . '/psr/http-client/src',
110
+ ),
111
+ 'Nyholm\\Psr7\\' =>
112
+ array (
113
+ 0 => __DIR__ . '/..' . '/nyholm/psr7/src',
114
+ ),
115
+ 'MailerLiteApi\\' =>
116
+ array (
117
+ 0 => __DIR__ . '/..' . '/mailerlite/mailerlite-api-v2-php-sdk/src',
118
+ ),
119
+ 'Http\\Promise\\' =>
120
+ array (
121
+ 0 => __DIR__ . '/..' . '/php-http/promise/src',
122
+ ),
123
+ 'Http\\Message\\' =>
124
+ array (
125
+ 0 => __DIR__ . '/..' . '/php-http/message/src',
126
+ 1 => __DIR__ . '/..' . '/php-http/message-factory/src',
127
+ ),
128
+ 'Http\\Discovery\\' =>
129
+ array (
130
+ 0 => __DIR__ . '/..' . '/php-http/discovery/src',
131
+ ),
132
+ 'Http\\Client\\Common\\' =>
133
+ array (
134
+ 0 => __DIR__ . '/..' . '/php-http/client-common/src',
135
+ ),
136
+ 'Http\\Client\\' =>
137
+ array (
138
+ 0 => __DIR__ . '/..' . '/php-http/httplug/src',
139
+ ),
140
+ 'Http\\Adapter\\Guzzle6\\' =>
141
+ array (
142
+ 0 => __DIR__ . '/..' . '/php-http/guzzle6-adapter/src',
143
  ),
144
  'GuzzleHttp\\Psr7\\' =>
145
  array (
146
  0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src',
147
  ),
148
+ 'GuzzleHttp\\Promise\\' =>
149
+ array (
150
+ 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src',
151
+ ),
152
+ 'GuzzleHttp\\' =>
153
+ array (
154
+ 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
155
+ ),
156
  'Getresponse\\Sdk\\Test\\' =>
157
  array (
158
  0 => __DIR__ . '/..' . '/getresponse/sdk-php/tests',
169
  array (
170
  0 => __DIR__ . '/..' . '/getresponse/sdk-php/src',
171
  ),
172
+ 'Clue\\StreamFilter\\' =>
173
+ array (
174
+ 0 => __DIR__ . '/..' . '/clue/stream-filter/src',
175
+ ),
176
+ );
177
+
178
+ public static $classMap = array (
179
+ 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
180
+ 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
181
+ 'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
182
+ 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
183
+ 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
184
+ 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
185
+ 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
186
  );
187
 
188
  public static function getInitializer(ClassLoader $loader)
189
  {
190
  return \Closure::bind(function () use ($loader) {
191
+ $loader->prefixLengthsPsr4 = ComposerStaticInit6258e4072a667a28fb1a2657c127a26b::$prefixLengthsPsr4;
192
+ $loader->prefixDirsPsr4 = ComposerStaticInit6258e4072a667a28fb1a2657c127a26b::$prefixDirsPsr4;
193
+ $loader->classMap = ComposerStaticInit6258e4072a667a28fb1a2657c127a26b::$classMap;
194
 
195
  }, null, ClassLoader::class);
196
  }
vendor/composer/installed.json CHANGED
@@ -1,328 +1,1892 @@
1
- [
2
- {
3
- "name": "getresponse/sdk-php",
4
- "version": "2.0.0",
5
- "version_normalized": "2.0.0.0",
6
- "source": {
7
- "type": "git",
8
- "url": "https://github.com/GetResponse/sdk-php.git",
9
- "reference": "752529f6e310513c711d1c9a92d3c5c4c059dcad"
10
- },
11
- "dist": {
12
- "type": "zip",
13
- "url": "https://api.github.com/repos/GetResponse/sdk-php/zipball/752529f6e310513c711d1c9a92d3c5c4c059dcad",
14
- "reference": "752529f6e310513c711d1c9a92d3c5c4c059dcad",
15
- "shasum": ""
16
- },
17
- "require": {
18
- "getresponse/sdk-php-client": "^1.0"
19
- },
20
- "require-dev": {
21
- "phpunit/phpunit": "^4.8 || ^5.0"
22
- },
23
- "time": "2020-03-05T14:12:03+00:00",
24
- "type": "library",
25
- "installation-source": "dist",
26
- "autoload": {
27
- "psr-4": {
28
- "Getresponse\\Sdk\\": "src/",
29
- "Getresponse\\Sdk\\Test\\": "tests/"
30
- }
31
- },
32
- "notification-url": "https://packagist.org/downloads/",
33
- "license": [
34
- "MIT"
35
- ],
36
- "authors": [
37
- {
38
- "name": "GetResponse DevTeam"
39
- }
40
- ],
41
- "description": "SDK for all public GetResponse products",
42
- "support": {
43
- "email": "getresponse-devzone@cs.getresponse.com",
44
- "issues": "https://github.com/GetResponse/sdk-php/issues",
45
- "source": "https://github.com/GetResponse/sdk-php/tree/2.0.0"
46
- }
47
- },
48
- {
49
- "name": "getresponse/sdk-php-client",
50
- "version": "1.1.0",
51
- "version_normalized": "1.1.0.0",
52
- "source": {
53
- "type": "git",
54
- "url": "https://github.com/GetResponse/sdk-php-client.git",
55
- "reference": "3d9a7b5b27c01f3ca46c4fdf0b39e25cb1347724"
56
- },
57
- "dist": {
58
- "type": "zip",
59
- "url": "https://api.github.com/repos/GetResponse/sdk-php-client/zipball/3d9a7b5b27c01f3ca46c4fdf0b39e25cb1347724",
60
- "reference": "3d9a7b5b27c01f3ca46c4fdf0b39e25cb1347724",
61
- "shasum": ""
62
- },
63
- "require": {
64
- "guzzlehttp/psr7": "^1.4",
65
- "php": ">=5.5",
66
- "psr/log": "^1.0"
 
 
 
 
67
  },
68
- "require-dev": {
69
- "humbug/humbug": "~1.0@dev",
70
- "php-mock/php-mock": "^1.0 || ^2.0",
71
- "phpunit/phpunit": "^4.8 || ^5.7"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  },
73
- "time": "2019-11-14T13:04:06+00:00",
74
- "type": "library",
75
- "installation-source": "dist",
76
- "autoload": {
77
- "psr-4": {
78
- "Getresponse\\Sdk\\Client\\": "src/",
79
- "Getresponse\\Sdk\\Client\\Test\\": "tests/"
80
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  },
82
- "notification-url": "https://packagist.org/downloads/",
83
- "license": [
84
- "MIT"
85
- ],
86
- "authors": [
87
- {
88
- "name": "GetResponse DevTeam"
89
- }
90
- ],
91
- "description": "GetResponse SDK client for all public GetResponse product",
92
- "support": {
93
- "email": "getresponse-devzone@cs.getresponse.com",
94
- "issues": "https://github.com/GetResponse/sdk-php-client/issues",
95
- "source": "https://github.com/GetResponse/sdk-php-client/tree/1.1.0"
96
- }
97
- },
98
- {
99
- "name": "guzzlehttp/psr7",
100
- "version": "1.7.0",
101
- "version_normalized": "1.7.0.0",
102
- "source": {
103
- "type": "git",
104
- "url": "https://github.com/guzzle/psr7.git",
105
- "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  },
107
- "dist": {
108
- "type": "zip",
109
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3",
110
- "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3",
111
- "shasum": ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  },
113
- "require": {
114
- "php": ">=5.4.0",
115
- "psr/http-message": "~1.0",
116
- "ralouphie/getallheaders": "^2.0.5 || ^3.0.0"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  },
118
- "provide": {
119
- "psr/http-message-implementation": "1.0"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  },
121
- "require-dev": {
122
- "ext-zlib": "*",
123
- "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  },
125
- "suggest": {
126
- "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  },
128
- "time": "2020-09-30T07:37:11+00:00",
129
- "type": "library",
130
- "extra": {
131
- "branch-alias": {
132
- "dev-master": "1.7-dev"
133
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  },
135
- "installation-source": "dist",
136
- "autoload": {
137
- "psr-4": {
138
- "GuzzleHttp\\Psr7\\": "src/"
139
- },
140
- "files": [
141
- "src/functions_include.php"
142
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  },
144
- "notification-url": "https://packagist.org/downloads/",
145
- "license": [
146
- "MIT"
147
- ],
148
- "authors": [
149
- {
150
- "name": "Michael Dowling",
151
- "email": "mtdowling@gmail.com",
152
- "homepage": "https://github.com/mtdowling"
153
- },
154
- {
155
- "name": "Tobias Schultze",
156
- "homepage": "https://github.com/Tobion"
157
- }
158
- ],
159
- "description": "PSR-7 message implementation that also provides common utility methods",
160
- "keywords": [
161
- "http",
162
- "message",
163
- "psr-7",
164
- "request",
165
- "response",
166
- "stream",
167
- "uri",
168
- "url"
169
- ],
170
- "support": {
171
- "issues": "https://github.com/guzzle/psr7/issues",
172
- "source": "https://github.com/guzzle/psr7/tree/1.7.0"
173
- }
174
- },
175
- {
176
- "name": "psr/http-message",
177
- "version": "1.0.1",
178
- "version_normalized": "1.0.1.0",
179
- "source": {
180
- "type": "git",
181
- "url": "https://github.com/php-fig/http-message.git",
182
- "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  },
184
- "dist": {
185
- "type": "zip",
186
- "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
187
- "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
188
- "shasum": ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  },
190
- "require": {
191
- "php": ">=5.3.0"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  },
193
- "time": "2016-08-06T14:39:51+00:00",
194
- "type": "library",
195
- "extra": {
196
- "branch-alias": {
197
- "dev-master": "1.0.x-dev"
198
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  },
200
- "installation-source": "dist",
201
- "autoload": {
202
- "psr-4": {
203
- "Psr\\Http\\Message\\": "src/"
204
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
  },
206
- "notification-url": "https://packagist.org/downloads/",
207
- "license": [
208
- "MIT"
209
- ],
210
- "authors": [
211
- {
212
- "name": "PHP-FIG",
213
- "homepage": "http://www.php-fig.org/"
214
- }
215
- ],
216
- "description": "Common interface for HTTP messages",
217
- "homepage": "https://github.com/php-fig/http-message",
218
- "keywords": [
219
- "http",
220
- "http-message",
221
- "psr",
222
- "psr-7",
223
- "request",
224
- "response"
225
- ],
226
- "support": {
227
- "source": "https://github.com/php-fig/http-message/tree/master"
228
- }
229
- },
230
- {
231
- "name": "psr/log",
232
- "version": "1.1.3",
233
- "version_normalized": "1.1.3.0",
234
- "source": {
235
- "type": "git",
236
- "url": "https://github.com/php-fig/log.git",
237
- "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  },
239
- "dist": {
240
- "type": "zip",
241
- "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
242
- "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
243
- "shasum": ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  },
245
- "require": {
246
- "php": ">=5.3.0"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  },
248
- "time": "2020-03-23T09:12:05+00:00",
249
- "type": "library",
250
- "extra": {
251
- "branch-alias": {
252
- "dev-master": "1.1.x-dev"
253
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
  },
255
- "installation-source": "dist",
256
- "autoload": {
257
- "psr-4": {
258
- "Psr\\Log\\": "Psr/Log/"
259
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  },
261
- "notification-url": "https://packagist.org/downloads/",
262
- "license": [
263
- "MIT"
264
- ],
265
- "authors": [
266
- {
267
- "name": "PHP-FIG",
268
- "homepage": "http://www.php-fig.org/"
269
- }
270
- ],
271
- "description": "Common interface for logging libraries",
272
- "homepage": "https://github.com/php-fig/log",
273
- "keywords": [
274
- "log",
275
- "psr",
276
- "psr-3"
277
- ],
278
- "support": {
279
- "source": "https://github.com/php-fig/log/tree/1.1.3"
280
- }
281
- },
282
- {
283
- "name": "ralouphie/getallheaders",
284
- "version": "3.0.3",
285
- "version_normalized": "3.0.3.0",
286
- "source": {
287
- "type": "git",
288
- "url": "https://github.com/ralouphie/getallheaders.git",
289
- "reference": "120b605dfeb996808c31b6477290a714d356e822"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  },
291
- "dist": {
292
- "type": "zip",
293
- "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
294
- "reference": "120b605dfeb996808c31b6477290a714d356e822",
295
- "shasum": ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
296
  },
297
- "require": {
298
- "php": ">=5.6"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  },
300
- "require-dev": {
301
- "php-coveralls/php-coveralls": "^2.1",
302
- "phpunit/phpunit": "^5 || ^6.5"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303
  },
304
- "time": "2019-03-08T08:55:37+00:00",
305
- "type": "library",
306
- "installation-source": "dist",
307
- "autoload": {
308
- "files": [
309
- "src/getallheaders.php"
310
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
311
  },
312
- "notification-url": "https://packagist.org/downloads/",
313
- "license": [
314
- "MIT"
315
- ],
316
- "authors": [
317
- {
318
- "name": "Ralph Khattar",
319
- "email": "ralph.khattar@gmail.com"
320
- }
321
- ],
322
- "description": "A polyfill for getallheaders.",
323
- "support": {
324
- "issues": "https://github.com/ralouphie/getallheaders/issues",
325
- "source": "https://github.com/ralouphie/getallheaders/tree/develop"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
326
  }
327
- }
328
- ]
 
 
1
+ {
2
+ "packages": [
3
+ {
4
+ "name": "clue/stream-filter",
5
+ "version": "v1.5.0",
6
+ "version_normalized": "1.5.0.0",
7
+ "source": {
8
+ "type": "git",
9
+ "url": "https://github.com/clue/stream-filter.git",
10
+ "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320"
11
+ },
12
+ "dist": {
13
+ "type": "zip",
14
+ "url": "https://api.github.com/repos/clue/stream-filter/zipball/aeb7d8ea49c7963d3b581378955dbf5bc49aa320",
15
+ "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320",
16
+ "shasum": ""
17
+ },
18
+ "require": {
19
+ "php": ">=5.3"
20
+ },
21
+ "require-dev": {
22
+ "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36"
23
+ },
24
+ "time": "2020-10-02T12:38:20+00:00",
25
+ "type": "library",
26
+ "installation-source": "dist",
27
+ "autoload": {
28
+ "psr-4": {
29
+ "Clue\\StreamFilter\\": "src/"
30
+ },
31
+ "files": [
32
+ "src/functions_include.php"
33
+ ]
34
+ },
35
+ "notification-url": "https://packagist.org/downloads/",
36
+ "license": [
37
+ "MIT"
38
+ ],
39
+ "authors": [
40
+ {
41
+ "name": "Christian Lück",
42
+ "email": "christian@clue.engineering"
43
+ }
44
+ ],
45
+ "description": "A simple and modern approach to stream filtering in PHP",
46
+ "homepage": "https://github.com/clue/php-stream-filter",
47
+ "keywords": [
48
+ "bucket brigade",
49
+ "callback",
50
+ "filter",
51
+ "php_user_filter",
52
+ "stream",
53
+ "stream_filter_append",
54
+ "stream_filter_register"
55
+ ],
56
+ "support": {
57
+ "issues": "https://github.com/clue/stream-filter/issues",
58
+ "source": "https://github.com/clue/stream-filter/tree/v1.5.0"
59
+ },
60
+ "funding": [
61
+ {
62
+ "url": "https://clue.engineering/support",
63
+ "type": "custom"
64
+ },
65
+ {
66
+ "url": "https://github.com/clue",
67
+ "type": "github"
68
+ }
69
+ ],
70
+ "install-path": "../clue/stream-filter"
71
  },
72
+ {
73
+ "name": "getresponse/sdk-php",
74
+ "version": "2.0.0",
75
+ "version_normalized": "2.0.0.0",
76
+ "source": {
77
+ "type": "git",
78
+ "url": "https://github.com/GetResponse/sdk-php.git",
79
+ "reference": "752529f6e310513c711d1c9a92d3c5c4c059dcad"
80
+ },
81
+ "dist": {
82
+ "type": "zip",
83
+ "url": "https://api.github.com/repos/GetResponse/sdk-php/zipball/752529f6e310513c711d1c9a92d3c5c4c059dcad",
84
+ "reference": "752529f6e310513c711d1c9a92d3c5c4c059dcad",
85
+ "shasum": ""
86
+ },
87
+ "require": {
88
+ "getresponse/sdk-php-client": "^1.0"
89
+ },
90
+ "require-dev": {
91
+ "phpunit/phpunit": "^4.8 || ^5.0"
92
+ },
93
+ "time": "2020-03-05T14:12:03+00:00",
94
+ "type": "library",
95
+ "installation-source": "dist",
96
+ "autoload": {
97
+ "psr-4": {
98
+ "Getresponse\\Sdk\\": "src/",
99
+ "Getresponse\\Sdk\\Test\\": "tests/"
100
+ }
101
+ },
102
+ "notification-url": "https://packagist.org/downloads/",
103
+ "license": [
104
+ "MIT"
105
+ ],
106
+ "authors": [
107
+ {
108
+ "name": "GetResponse DevTeam"
109
+ }
110
+ ],
111
+ "description": "SDK for all public GetResponse products",
112
+ "support": {
113
+ "email": "getresponse-devzone@cs.getresponse.com",
114
+ "issues": "https://github.com/GetResponse/sdk-php/issues",
115
+ "source": "https://github.com/GetResponse/sdk-php/tree/2.0.0"
116
+ },
117
+ "install-path": "../getresponse/sdk-php"
118
  },
119
+ {
120
+ "name": "getresponse/sdk-php-client",
121
+ "version": "1.1.1",
122
+ "version_normalized": "1.1.1.0",
123
+ "source": {
124
+ "type": "git",
125
+ "url": "https://github.com/GetResponse/sdk-php-client.git",
126
+ "reference": "a9ec8b20a72b8b6366adec04068f20541aa9d648"
127
+ },
128
+ "dist": {
129
+ "type": "zip",
130
+ "url": "https://api.github.com/repos/GetResponse/sdk-php-client/zipball/a9ec8b20a72b8b6366adec04068f20541aa9d648",
131
+ "reference": "a9ec8b20a72b8b6366adec04068f20541aa9d648",
132
+ "shasum": ""
133
+ },
134
+ "require": {
135
+ "guzzlehttp/psr7": "^1.4",
136
+ "php": ">=5.5",
137
+ "psr/log": "^1.0"
138
+ },
139
+ "require-dev": {
140
+ "humbug/humbug": "~1.0@dev",
141
+ "php-mock/php-mock": "^1.0 || ^2.0",
142
+ "phpunit/phpunit": "^4.8 || ^5.7"
143
+ },
144
+ "time": "2021-03-22T14:29:50+00:00",
145
+ "type": "library",
146
+ "installation-source": "dist",
147
+ "autoload": {
148
+ "psr-4": {
149
+ "Getresponse\\Sdk\\Client\\": "src/",
150
+ "Getresponse\\Sdk\\Client\\Test\\": "tests/"
151
+ }
152
+ },
153
+ "notification-url": "https://packagist.org/downloads/",
154
+ "license": [
155
+ "MIT"
156
+ ],
157
+ "authors": [
158
+ {
159
+ "name": "GetResponse DevTeam"
160
+ }
161
+ ],
162
+ "description": "GetResponse SDK client for all public GetResponse product",
163
+ "support": {
164
+ "email": "getresponse-devzone@cs.getresponse.com",
165
+ "issues": "https://github.com/GetResponse/sdk-php-client/issues",
166
+ "source": "https://github.com/GetResponse/sdk-php-client/tree/1.1.1"
167
+ },
168
+ "install-path": "../getresponse/sdk-php-client"
169
  },
170
+ {
171
+ "name": "guzzlehttp/guzzle",
172
+ "version": "6.5.5",
173
+ "version_normalized": "6.5.5.0",
174
+ "source": {
175
+ "type": "git",
176
+ "url": "https://github.com/guzzle/guzzle.git",
177
+ "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e"
178
+ },
179
+ "dist": {
180
+ "type": "zip",
181
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
182
+ "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
183
+ "shasum": ""
184
+ },
185
+ "require": {
186
+ "ext-json": "*",
187
+ "guzzlehttp/promises": "^1.0",
188
+ "guzzlehttp/psr7": "^1.6.1",
189
+ "php": ">=5.5",
190
+ "symfony/polyfill-intl-idn": "^1.17.0"
191
+ },
192
+ "require-dev": {
193
+ "ext-curl": "*",
194
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
195
+ "psr/log": "^1.1"
196
+ },
197
+ "suggest": {
198
+ "psr/log": "Required for using the Log middleware"
199
+ },
200
+ "time": "2020-06-16T21:01:06+00:00",
201
+ "type": "library",
202
+ "extra": {
203
+ "branch-alias": {
204
+ "dev-master": "6.5-dev"
205
+ }
206
+ },
207
+ "installation-source": "dist",
208
+ "autoload": {
209
+ "psr-4": {
210
+ "GuzzleHttp\\": "src/"
211
+ },
212
+ "files": [
213
+ "src/functions_include.php"
214
+ ]
215
+ },
216
+ "notification-url": "https://packagist.org/downloads/",
217
+ "license": [
218
+ "MIT"
219
+ ],
220
+ "authors": [
221
+ {
222
+ "name": "Michael Dowling",
223
+ "email": "mtdowling@gmail.com",
224
+ "homepage": "https://github.com/mtdowling"
225
+ }
226
+ ],
227
+ "description": "Guzzle is a PHP HTTP client library",
228
+ "homepage": "http://guzzlephp.org/",
229
+ "keywords": [
230
+ "client",
231
+ "curl",
232
+ "framework",
233
+ "http",
234
+ "http client",
235
+ "rest",
236
+ "web service"
237
+ ],
238
+ "support": {
239
+ "issues": "https://github.com/guzzle/guzzle/issues",
240
+ "source": "https://github.com/guzzle/guzzle/tree/6.5"
241
+ },
242
+ "install-path": "../guzzlehttp/guzzle"
243
  },
244
+ {
245
+ "name": "guzzlehttp/promises",
246
+ "version": "1.5.1",
247
+ "version_normalized": "1.5.1.0",
248
+ "source": {
249
+ "type": "git",
250
+ "url": "https://github.com/guzzle/promises.git",
251
+ "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da"
252
+ },
253
+ "dist": {
254
+ "type": "zip",
255
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
256
+ "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
257
+ "shasum": ""
258
+ },
259
+ "require": {
260
+ "php": ">=5.5"
261
+ },
262
+ "require-dev": {
263
+ "symfony/phpunit-bridge": "^4.4 || ^5.1"
264
+ },
265
+ "time": "2021-10-22T20:56:57+00:00",
266
+ "type": "library",
267
+ "extra": {
268
+ "branch-alias": {
269
+ "dev-master": "1.5-dev"
270
+ }
271
+ },
272
+ "installation-source": "dist",
273
+ "autoload": {
274
+ "psr-4": {
275
+ "GuzzleHttp\\Promise\\": "src/"
276
+ },
277
+ "files": [
278
+ "src/functions_include.php"
279
+ ]
280
+ },
281
+ "notification-url": "https://packagist.org/downloads/",
282
+ "license": [
283
+ "MIT"
284
+ ],
285
+ "authors": [
286
+ {
287
+ "name": "Graham Campbell",
288
+ "email": "hello@gjcampbell.co.uk",
289
+ "homepage": "https://github.com/GrahamCampbell"
290
+ },
291
+ {
292
+ "name": "Michael Dowling",
293
+ "email": "mtdowling@gmail.com",
294
+ "homepage": "https://github.com/mtdowling"
295
+ },
296
+ {
297
+ "name": "Tobias Nyholm",
298
+ "email": "tobias.nyholm@gmail.com",
299
+ "homepage": "https://github.com/Nyholm"
300
+ },
301
+ {
302
+ "name": "Tobias Schultze",
303
+ "email": "webmaster@tubo-world.de",
304
+ "homepage": "https://github.com/Tobion"
305
+ }
306
+ ],
307
+ "description": "Guzzle promises library",
308
+ "keywords": [
309
+ "promise"
310
+ ],
311
+ "support": {
312
+ "issues": "https://github.com/guzzle/promises/issues",
313
+ "source": "https://github.com/guzzle/promises/tree/1.5.1"
314
+ },
315
+ "funding": [
316
+ {
317
+ "url": "https://github.com/GrahamCampbell",
318
+ "type": "github"
319
+ },
320
+ {
321
+ "url": "https://github.com/Nyholm",
322
+ "type": "github"
323
+ },
324
+ {
325
+ "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises",
326
+ "type": "tidelift"
327
+ }
328
+ ],
329
+ "install-path": "../guzzlehttp/promises"
330
  },
331
+ {
332
+ "name": "guzzlehttp/psr7",
333
+ "version": "1.8.3",
334
+ "version_normalized": "1.8.3.0",
335
+ "source": {
336
+ "type": "git",
337
+ "url": "https://github.com/guzzle/psr7.git",
338
+ "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85"
339
+ },
340
+ "dist": {
341
+ "type": "zip",
342
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/1afdd860a2566ed3c2b0b4a3de6e23434a79ec85",
343
+ "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85",
344
+ "shasum": ""
345
+ },
346
+ "require": {
347
+ "php": ">=5.4.0",
348
+ "psr/http-message": "~1.0",
349
+ "ralouphie/getallheaders": "^2.0.5 || ^3.0.0"
350
+ },
351
+ "provide": {
352
+ "psr/http-message-implementation": "1.0"
353
+ },
354
+ "require-dev": {
355
+ "ext-zlib": "*",
356
+ "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10"
357
+ },
358
+ "suggest": {
359
+ "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
360
+ },
361
+ "time": "2021-10-05T13:56:00+00:00",
362
+ "type": "library",
363
+ "extra": {
364
+ "branch-alias": {
365
+ "dev-master": "1.7-dev"
366
+ }
367
+ },
368
+ "installation-source": "dist",
369
+ "autoload": {
370
+ "psr-4": {
371
+ "GuzzleHttp\\Psr7\\": "src/"
372
+ },
373
+ "files": [
374
+ "src/functions_include.php"
375
+ ]
376
+ },
377
+ "notification-url": "https://packagist.org/downloads/",
378
+ "license": [
379
+ "MIT"
380
+ ],
381
+ "authors": [
382
+ {
383
+ "name": "Graham Campbell",
384
+ "email": "hello@gjcampbell.co.uk",
385
+ "homepage": "https://github.com/GrahamCampbell"
386
+ },
387
+ {
388
+ "name": "Michael Dowling",
389
+ "email": "mtdowling@gmail.com",
390
+ "homepage": "https://github.com/mtdowling"
391
+ },
392
+ {
393
+ "name": "George Mponos",
394
+ "email": "gmponos@gmail.com",
395
+ "homepage": "https://github.com/gmponos"
396
+ },
397
+ {
398
+ "name": "Tobias Nyholm",
399
+ "email": "tobias.nyholm@gmail.com",
400
+ "homepage": "https://github.com/Nyholm"
401
+ },
402
+ {
403
+ "name": "Márk Sági-Kazár",
404
+ "email": "mark.sagikazar@gmail.com",
405
+ "homepage": "https://github.com/sagikazarmark"
406
+ },
407
+ {
408
+ "name": "Tobias Schultze",
409
+ "email": "webmaster@tubo-world.de",
410
+ "homepage": "https://github.com/Tobion"
411
+ }
412
+ ],
413
+ "description": "PSR-7 message implementation that also provides common utility methods",
414
+ "keywords": [
415
+ "http",
416
+ "message",
417
+ "psr-7",
418
+ "request",
419
+ "response",
420
+ "stream",
421
+ "uri",
422
+ "url"
423
+ ],
424
+ "support": {
425
+ "issues": "https://github.com/guzzle/psr7/issues",
426
+ "source": "https://github.com/guzzle/psr7/tree/1.8.3"
427
+ },
428
+ "funding": [
429
+ {
430
+ "url": "https://github.com/GrahamCampbell",
431
+ "type": "github"
432
+ },
433
+ {
434
+ "url": "https://github.com/Nyholm",
435
+ "type": "github"
436
+ },
437
+ {
438
+ "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7",
439
+ "type": "tidelift"
440
+ }
441
+ ],
442
+ "install-path": "../guzzlehttp/psr7"
443
  },
444
+ {
445
+ "name": "mailerlite/mailerlite-api-v2-php-sdk",
446
+ "version": "0.3.2",
447
+ "version_normalized": "0.3.2.0",
448
+ "source": {
449
+ "type": "git",
450
+ "url": "https://github.com/mailerlite/mailerlite-api-v2-php-sdk.git",
451
+ "reference": "9fb6b8adb3b0dd9eb964ba5169b229516c73fd78"
452
+ },
453
+ "dist": {
454
+ "type": "zip",
455
+ "url": "https://api.github.com/repos/mailerlite/mailerlite-api-v2-php-sdk/zipball/9fb6b8adb3b0dd9eb964ba5169b229516c73fd78",
456
+ "reference": "9fb6b8adb3b0dd9eb964ba5169b229516c73fd78",
457
+ "shasum": ""
458
+ },
459
+ "require": {
460
+ "ext-json": "*",
461
+ "nyholm/psr7": "^1.0",
462
+ "php": "^7.1 || ^8.0",
463
+ "php-http/client-common": "^2.0",
464
+ "php-http/discovery": "^1.7"
465
+ },
466
+ "require-dev": {
467
+ "php-http/guzzle6-adapter": "^2.0",
468
+ "phpunit/phpunit": "6.* | 7.* | 8.* | 9.*"
469
+ },
470
+ "time": "2021-08-11T08:24:13+00:00",
471
+ "type": "library",
472
+ "installation-source": "dist",
473
+ "autoload": {
474
+ "psr-4": {
475
+ "MailerLiteApi\\": "src"
476
+ }
477
+ },
478
+ "notification-url": "https://packagist.org/downloads/",
479
+ "license": [
480
+ "MIT"
481
+ ],
482
+ "description": "MailerLite API v2 PHP SDK",
483
+ "homepage": "https://github.com/mailerlite/mailerlite-api-v2-php-sdk",
484
+ "keywords": [
485
+ "email",
486
+ "mailerlite",
487
+ "marketing",
488
+ "sdk"
489
+ ],
490
+ "support": {
491
+ "issues": "https://github.com/mailerlite/mailerlite-api-v2-php-sdk/issues",
492
+ "source": "https://github.com/mailerlite/mailerlite-api-v2-php-sdk/tree/0.3.2"
493
+ },
494
+ "install-path": "../mailerlite/mailerlite-api-v2-php-sdk"
495
  },
496
+ {
497
+ "name": "nyholm/psr7",
498
+ "version": "1.4.1",
499
+ "version_normalized": "1.4.1.0",
500
+ "source": {
501
+ "type": "git",
502
+ "url": "https://github.com/Nyholm/psr7.git",
503
+ "reference": "2212385b47153ea71b1c1b1374f8cb5e4f7892ec"
504
+ },
505
+ "dist": {
506
+ "type": "zip",
507
+ "url": "https://api.github.com/repos/Nyholm/psr7/zipball/2212385b47153ea71b1c1b1374f8cb5e4f7892ec",
508
+ "reference": "2212385b47153ea71b1c1b1374f8cb5e4f7892ec",
509
+ "shasum": ""
510
+ },
511
+ "require": {
512
+ "php": ">=7.1",
513
+ "php-http/message-factory": "^1.0",
514
+ "psr/http-factory": "^1.0",
515
+ "psr/http-message": "^1.0"
516
+ },
517
+ "provide": {
518
+ "psr/http-factory-implementation": "1.0",
519
+ "psr/http-message-implementation": "1.0"
520
+ },
521
+ "require-dev": {
522
+ "http-interop/http-factory-tests": "^0.9",
523
+ "php-http/psr7-integration-tests": "^1.0",
524
+ "phpunit/phpunit": "^7.5 || 8.5 || 9.4",
525
+ "symfony/error-handler": "^4.4"
526
+ },
527
+ "time": "2021-07-02T08:32:20+00:00",
528
+ "type": "library",
529
+ "extra": {
530
+ "branch-alias": {
531
+ "dev-master": "1.4-dev"
532
+ }
533
+ },
534
+ "installation-source": "dist",
535
+ "autoload": {
536
+ "psr-4": {
537
+ "Nyholm\\Psr7\\": "src/"
538
+ }
539
+ },
540
+ "notification-url": "https://packagist.org/downloads/",
541
+ "license": [
542
+ "MIT"
543
+ ],
544
+ "authors": [
545
+ {
546
+ "name": "Tobias Nyholm",
547
+ "email": "tobias.nyholm@gmail.com"
548
+ },
549
+ {
550
+ "name": "Martijn van der Ven",
551
+ "email": "martijn@vanderven.se"
552
+ }
553
+ ],
554
+ "description": "A fast PHP7 implementation of PSR-7",
555
+ "homepage": "https://tnyholm.se",
556
+ "keywords": [
557
+ "psr-17",
558
+ "psr-7"
559
+ ],
560
+ "support": {
561
+ "issues": "https://github.com/Nyholm/psr7/issues",
562
+ "source": "https://github.com/Nyholm/psr7/tree/1.4.1"
563
+ },
564
+ "funding": [
565
+ {
566
+ "url": "https://github.com/Zegnat",
567
+ "type": "github"
568
+ },
569
+ {
570
+ "url": "https://github.com/nyholm",
571
+ "type": "github"
572
+ }
573
+ ],
574
+ "install-path": "../nyholm/psr7"
575
  },
576
+ {
577
+ "name": "php-http/client-common",
578
+ "version": "2.5.0",
579
+ "version_normalized": "2.5.0.0",
580
+ "source": {
581
+ "type": "git",
582
+ "url": "https://github.com/php-http/client-common.git",
583
+ "reference": "d135751167d57e27c74de674d6a30cef2dc8e054"
584
+ },
585
+ "dist": {
586
+ "type": "zip",
587
+ "url": "https://api.github.com/repos/php-http/client-common/zipball/d135751167d57e27c74de674d6a30cef2dc8e054",
588
+ "reference": "d135751167d57e27c74de674d6a30cef2dc8e054",
589
+ "shasum": ""
590
+ },
591
+ "require": {
592
+ "php": "^7.1 || ^8.0",
593
+ "php-http/httplug": "^2.0",
594
+ "php-http/message": "^1.6",
595
+ "php-http/message-factory": "^1.0",
596
+ "psr/http-client": "^1.0",
597
+ "psr/http-factory": "^1.0",
598
+ "psr/http-message": "^1.0",
599
+ "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0",
600
+ "symfony/polyfill-php80": "^1.17"
601
+ },
602
+ "require-dev": {
603
+ "doctrine/instantiator": "^1.1",
604
+ "guzzlehttp/psr7": "^1.4",
605
+ "nyholm/psr7": "^1.2",
606
+ "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1",
607
+ "phpspec/prophecy": "^1.10.2",
608
+ "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3"
609
+ },
610
+ "suggest": {
611
+ "ext-json": "To detect JSON responses with the ContentTypePlugin",
612
+ "ext-libxml": "To detect XML responses with the ContentTypePlugin",
613
+ "php-http/cache-plugin": "PSR-6 Cache plugin",
614
+ "php-http/logger-plugin": "PSR-3 Logger plugin",
615
+ "php-http/stopwatch-plugin": "Symfony Stopwatch plugin"
616
+ },
617
+ "time": "2021-11-26T15:01:24+00:00",
618
+ "type": "library",
619
+ "extra": {
620
+ "branch-alias": {
621
+ "dev-master": "2.3.x-dev"
622
+ }
623
+ },
624
+ "installation-source": "dist",
625
+ "autoload": {
626
+ "psr-4": {
627
+ "Http\\Client\\Common\\": "src/"
628
+ }
629
+ },
630
+ "notification-url": "https://packagist.org/downloads/",
631
+ "license": [
632
+ "MIT"
633
+ ],
634
+ "authors": [
635
+ {
636
+ "name": "Márk Sági-Kazár",
637
+ "email": "mark.sagikazar@gmail.com"
638
+ }
639
+ ],
640
+ "description": "Common HTTP Client implementations and tools for HTTPlug",
641
+ "homepage": "http://httplug.io",
642
+ "keywords": [
643
+ "client",
644
+ "common",
645
+ "http",
646
+ "httplug"
647
+ ],
648
+ "support": {
649
+ "issues": "https://github.com/php-http/client-common/issues",
650
+ "source": "https://github.com/php-http/client-common/tree/2.5.0"
651
+ },
652
+ "install-path": "../php-http/client-common"
653
  },
654
+ {
655
+ "name": "php-http/discovery",
656
+ "version": "1.14.1",
657
+ "version_normalized": "1.14.1.0",
658
+ "source": {
659
+ "type": "git",
660
+ "url": "https://github.com/php-http/discovery.git",
661
+ "reference": "de90ab2b41d7d61609f504e031339776bc8c7223"
662
+ },
663
+ "dist": {
664
+ "type": "zip",
665
+ "url": "https://api.github.com/repos/php-http/discovery/zipball/de90ab2b41d7d61609f504e031339776bc8c7223",
666
+ "reference": "de90ab2b41d7d61609f504e031339776bc8c7223",
667
+ "shasum": ""
668
+ },
669
+ "require": {
670
+ "php": "^7.1 || ^8.0"
671
+ },
672
+ "conflict": {
673
+ "nyholm/psr7": "<1.0"
674
+ },
675
+ "require-dev": {
676
+ "graham-campbell/phpspec-skip-example-extension": "^5.0",
677
+ "php-http/httplug": "^1.0 || ^2.0",
678
+ "php-http/message-factory": "^1.0",
679
+ "phpspec/phpspec": "^5.1 || ^6.1",
680
+ "puli/composer-plugin": "1.0.0-beta10"
681
+ },
682
+ "suggest": {
683
+ "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories"
684
+ },
685
+ "time": "2021-09-18T07:57:46+00:00",
686
+ "type": "library",
687
+ "extra": {
688
+ "branch-alias": {
689
+ "dev-master": "1.9-dev"
690
+ }
691
+ },
692
+ "installation-source": "dist",
693
+ "autoload": {
694
+ "psr-4": {
695
+ "Http\\Discovery\\": "src/"
696
+ }
697
+ },
698
+ "notification-url": "https://packagist.org/downloads/",
699
+ "license": [
700
+ "MIT"
701
+ ],
702
+ "authors": [
703
+ {
704
+ "name": "Márk Sági-Kazár",
705
+ "email": "mark.sagikazar@gmail.com"
706
+ }
707
+ ],
708
+ "description": "Finds installed HTTPlug implementations and PSR-7 message factories",
709
+ "homepage": "http://php-http.org",
710
+ "keywords": [
711
+ "adapter",
712
+ "client",
713
+ "discovery",
714
+ "factory",
715
+ "http",
716
+ "message",
717
+ "psr7"
718
+ ],
719
+ "support": {
720
+ "issues": "https://github.com/php-http/discovery/issues",
721
+ "source": "https://github.com/php-http/discovery/tree/1.14.1"
722
+ },
723
+ "install-path": "../php-http/discovery"
724
  },
725
+ {
726
+ "name": "php-http/guzzle6-adapter",
727
+ "version": "v2.0.2",
728
+ "version_normalized": "2.0.2.0",
729
+ "source": {
730
+ "type": "git",
731
+ "url": "https://github.com/php-http/guzzle6-adapter.git",
732
+ "reference": "9d1a45eb1c59f12574552e81fb295e9e53430a56"
733
+ },
734
+ "dist": {
735
+ "type": "zip",
736
+ "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/9d1a45eb1c59f12574552e81fb295e9e53430a56",
737
+ "reference": "9d1a45eb1c59f12574552e81fb295e9e53430a56",
738
+ "shasum": ""
739
+ },
740
+ "require": {
741
+ "guzzlehttp/guzzle": "^6.0",
742
+ "php": "^7.1 || ^8.0",
743
+ "php-http/httplug": "^2.0",
744
+ "psr/http-client": "^1.0"
745
+ },
746
+ "provide": {
747
+ "php-http/async-client-implementation": "1.0",
748
+ "php-http/client-implementation": "1.0",
749
+ "psr/http-client-implementation": "1.0"
750
+ },
751
+ "require-dev": {
752
+ "ext-curl": "*",
753
+ "php-http/client-integration-tests": "^2.0 || ^3.0",
754
+ "phpunit/phpunit": "^7.4 || ^8.4"
755
+ },
756
+ "time": "2021-03-02T10:52:33+00:00",
757
+ "type": "library",
758
+ "extra": {
759
+ "branch-alias": {
760
+ "dev-master": "2.x-dev"
761
+ }
762
+ },
763
+ "installation-source": "dist",
764
+ "autoload": {
765
+ "psr-4": {
766
+ "Http\\Adapter\\Guzzle6\\": "src/"
767
+ }
768
+ },
769
+ "notification-url": "https://packagist.org/downloads/",
770
+ "license": [
771
+ "MIT"
772
+ ],
773
+ "authors": [
774
+ {
775
+ "name": "David de Boer",
776
+ "email": "david@ddeboer.nl"
777
+ },
778
+ {
779
+ "name": "Márk Sági-Kazár",
780
+ "email": "mark.sagikazar@gmail.com"
781
+ }
782
+ ],
783
+ "description": "Guzzle 6 HTTP Adapter",
784
+ "homepage": "http://httplug.io",
785
+ "keywords": [
786
+ "Guzzle",
787
+ "http"
788
+ ],
789
+ "support": {
790
+ "issues": "https://github.com/php-http/guzzle6-adapter/issues",
791
+ "source": "https://github.com/php-http/guzzle6-adapter/tree/v2.0.2"
792
+ },
793
+ "install-path": "../php-http/guzzle6-adapter"
794
  },
795
+ {
796
+ "name": "php-http/httplug",
797
+ "version": "2.2.0",
798
+ "version_normalized": "2.2.0.0",
799
+ "source": {
800
+ "type": "git",
801
+ "url": "https://github.com/php-http/httplug.git",
802
+ "reference": "191a0a1b41ed026b717421931f8d3bd2514ffbf9"
803
+ },
804
+ "dist": {
805
+ "type": "zip",
806
+ "url": "https://api.github.com/repos/php-http/httplug/zipball/191a0a1b41ed026b717421931f8d3bd2514ffbf9",
807
+ "reference": "191a0a1b41ed026b717421931f8d3bd2514ffbf9",
808
+ "shasum": ""
809
+ },
810
+ "require": {
811
+ "php": "^7.1 || ^8.0",
812
+ "php-http/promise": "^1.1",
813
+ "psr/http-client": "^1.0",
814
+ "psr/http-message": "^1.0"
815
+ },
816
+ "require-dev": {
817
+ "friends-of-phpspec/phpspec-code-coverage": "^4.1",
818
+ "phpspec/phpspec": "^5.1 || ^6.0"
819
+ },
820
+ "time": "2020-07-13T15:43:23+00:00",
821
+ "type": "library",
822
+ "extra": {
823
+ "branch-alias": {
824
+ "dev-master": "2.x-dev"
825
+ }
826
+ },
827
+ "installation-source": "dist",
828
+ "autoload": {
829
+ "psr-4": {
830
+ "Http\\Client\\": "src/"
831
+ }
832
+ },
833
+ "notification-url": "https://packagist.org/downloads/",
834
+ "license": [
835
+ "MIT"
836
+ ],
837
+ "authors": [
838
+ {
839
+ "name": "Eric GELOEN",
840
+ "email": "geloen.eric@gmail.com"
841
+ },
842
+ {
843
+ "name": "Márk Sági-Kazár",
844
+ "email": "mark.sagikazar@gmail.com",
845
+ "homepage": "https://sagikazarmark.hu"
846
+ }
847
+ ],
848
+ "description": "HTTPlug, the HTTP client abstraction for PHP",
849
+ "homepage": "http://httplug.io",
850
+ "keywords": [
851
+ "client",
852
+ "http"
853
+ ],
854
+ "support": {
855
+ "issues": "https://github.com/php-http/httplug/issues",
856
+ "source": "https://github.com/php-http/httplug/tree/master"
857
+ },
858
+ "install-path": "../php-http/httplug"
859
  },
860
+ {
861
+ "name": "php-http/message",
862
+ "version": "1.12.0",
863
+ "version_normalized": "1.12.0.0",
864
+ "source": {
865
+ "type": "git",
866
+ "url": "https://github.com/php-http/message.git",
867
+ "reference": "39eb7548be982a81085fe5a6e2a44268cd586291"
868
+ },
869
+ "dist": {
870
+ "type": "zip",
871
+ "url": "https://api.github.com/repos/php-http/message/zipball/39eb7548be982a81085fe5a6e2a44268cd586291",
872
+ "reference": "39eb7548be982a81085fe5a6e2a44268cd586291",
873
+ "shasum": ""
874
+ },
875
+ "require": {
876
+ "clue/stream-filter": "^1.5",
877
+ "php": "^7.1 || ^8.0",
878
+ "php-http/message-factory": "^1.0.2",
879
+ "psr/http-message": "^1.0"
880
+ },
881
+ "provide": {
882
+ "php-http/message-factory-implementation": "1.0"
883
+ },
884
+ "require-dev": {
885
+ "ergebnis/composer-normalize": "^2.6",
886
+ "ext-zlib": "*",
887
+ "guzzlehttp/psr7": "^1.0",
888
+ "laminas/laminas-diactoros": "^2.0",
889
+ "phpspec/phpspec": "^5.1 || ^6.3",
890
+ "slim/slim": "^3.0"
891
+ },
892
+ "suggest": {
893
+ "ext-zlib": "Used with compressor/decompressor streams",
894
+ "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories",
895
+ "laminas/laminas-diactoros": "Used with Diactoros Factories",
896
+ "slim/slim": "Used with Slim Framework PSR-7 implementation"
897
+ },
898
+ "time": "2021-08-29T09:13:12+00:00",
899
+ "type": "library",
900
+ "extra": {
901
+ "branch-alias": {
902
+ "dev-master": "1.10-dev"
903
+ }
904
+ },
905
+ "installation-source": "dist",
906
+ "autoload": {
907
+ "psr-4": {
908
+ "Http\\Message\\": "src/"
909
+ },
910
+ "files": [
911
+ "src/filters.php"
912
+ ]
913
+ },
914
+ "notification-url": "https://packagist.org/downloads/",
915
+ "license": [
916
+ "MIT"
917
+ ],
918
+ "authors": [
919
+ {
920
+ "name": "Márk Sági-Kazár",
921
+ "email": "mark.sagikazar@gmail.com"
922
+ }
923
+ ],
924
+ "description": "HTTP Message related tools",
925
+ "homepage": "http://php-http.org",
926
+ "keywords": [
927
+ "http",
928
+ "message",
929
+ "psr-7"
930
+ ],
931
+ "support": {
932
+ "issues": "https://github.com/php-http/message/issues",
933
+ "source": "https://github.com/php-http/message/tree/1.12.0"
934
+ },
935
+ "install-path": "../php-http/message"
936
  },
937
+ {
938
+ "name": "php-http/message-factory",
939
+ "version": "v1.0.2",
940
+ "version_normalized": "1.0.2.0",
941
+ "source": {
942
+ "type": "git",
943
+ "url": "https://github.com/php-http/message-factory.git",
944
+ "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1"
945
+ },
946
+ "dist": {
947
+ "type": "zip",
948
+ "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1",
949
+ "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1",
950
+ "shasum": ""
951
+ },
952
+ "require": {
953
+ "php": ">=5.4",
954
+ "psr/http-message": "^1.0"
955
+ },
956
+ "time": "2015-12-19T14:08:53+00:00",
957
+ "type": "library",
958
+ "extra": {
959
+ "branch-alias": {
960
+ "dev-master": "1.0-dev"
961
+ }
962
+ },
963
+ "installation-source": "dist",
964
+ "autoload": {
965
+ "psr-4": {
966
+ "Http\\Message\\": "src/"
967
+ }
968
+ },
969
+ "notification-url": "https://packagist.org/downloads/",
970
+ "license": [
971
+ "MIT"
972
+ ],
973
+ "authors": [
974
+ {
975
+ "name": "Márk Sági-Kazár",
976
+ "email": "mark.sagikazar@gmail.com"
977
+ }
978
+ ],
979
+ "description": "Factory interfaces for PSR-7 HTTP Message",
980
+ "homepage": "http://php-http.org",
981
+ "keywords": [
982
+ "factory",
983
+ "http",
984
+ "message",
985
+ "stream",
986
+ "uri"
987
+ ],
988
+ "support": {
989
+ "issues": "https://github.com/php-http/message-factory/issues",
990
+ "source": "https://github.com/php-http/message-factory/tree/master"
991
+ },
992
+ "install-path": "../php-http/message-factory"
993
  },
994
+ {
995
+ "name": "php-http/promise",
996
+ "version": "1.1.0",
997
+ "version_normalized": "1.1.0.0",
998
+ "source": {
999
+ "type": "git",
1000
+ "url": "https://github.com/php-http/promise.git",
1001
+ "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88"
1002
+ },
1003
+ "dist": {
1004
+ "type": "zip",
1005
+ "url": "https://api.github.com/repos/php-http/promise/zipball/4c4c1f9b7289a2ec57cde7f1e9762a5789506f88",
1006
+ "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88",
1007
+ "shasum": ""
1008
+ },
1009
+ "require": {
1010
+ "php": "^7.1 || ^8.0"
1011
+ },
1012
+ "require-dev": {
1013
+ "friends-of-phpspec/phpspec-code-coverage": "^4.3.2",
1014
+ "phpspec/phpspec": "^5.1.2 || ^6.2"
1015
+ },
1016
+ "time": "2020-07-07T09:29:14+00:00",
1017
+ "type": "library",
1018
+ "extra": {
1019
+ "branch-alias": {
1020
+ "dev-master": "1.1-dev"
1021
+ }
1022
+ },
1023
+ "installation-source": "dist",
1024
+ "autoload": {
1025
+ "psr-4": {
1026
+ "Http\\Promise\\": "src/"
1027
+ }
1028
+ },
1029
+ "notification-url": "https://packagist.org/downloads/",
1030
+ "license": [
1031
+ "MIT"
1032
+ ],
1033
+ "authors": [
1034
+ {
1035
+ "name": "Joel Wurtz",
1036
+ "email": "joel.wurtz@gmail.com"
1037
+ },
1038
+ {
1039
+ "name": "Márk Sági-Kazár",
1040
+ "email": "mark.sagikazar@gmail.com"
1041
+ }
1042
+ ],
1043
+ "description": "Promise used for asynchronous HTTP requests",
1044
+ "homepage": "http://httplug.io",
1045
+ "keywords": [
1046
+ "promise"
1047
+ ],
1048
+ "support": {
1049
+ "issues": "https://github.com/php-http/promise/issues",
1050
+ "source": "https://github.com/php-http/promise/tree/1.1.0"
1051
+ },
1052
+ "install-path": "../php-http/promise"
1053
  },
1054
+ {
1055
+ "name": "psr/http-client",
1056
+ "version": "1.0.1",
1057
+ "version_normalized": "1.0.1.0",
1058
+ "source": {
1059
+ "type": "git",
1060
+ "url": "https://github.com/php-fig/http-client.git",
1061
+ "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
1062
+ },
1063
+ "dist": {
1064
+ "type": "zip",
1065
+ "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
1066
+ "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
1067
+ "shasum": ""
1068
+ },
1069
+ "require": {
1070
+ "php": "^7.0 || ^8.0",
1071
+ "psr/http-message": "^1.0"
1072
+ },
1073
+ "time": "2020-06-29T06:28:15+00:00",
1074
+ "type": "library",
1075
+ "extra": {
1076
+ "branch-alias": {
1077
+ "dev-master": "1.0.x-dev"
1078
+ }
1079
+ },
1080
+ "installation-source": "dist",
1081
+ "autoload": {
1082
+ "psr-4": {
1083
+ "Psr\\Http\\Client\\": "src/"
1084
+ }
1085
+ },
1086
+ "notification-url": "https://packagist.org/downloads/",
1087
+ "license": [
1088
+ "MIT"
1089
+ ],
1090
+ "authors": [
1091
+ {
1092
+ "name": "PHP-FIG",
1093
+ "homepage": "http://www.php-fig.org/"
1094
+ }
1095
+ ],
1096
+ "description": "Common interface for HTTP clients",
1097
+ "homepage": "https://github.com/php-fig/http-client",
1098
+ "keywords": [
1099
+ "http",
1100
+ "http-client",
1101
+ "psr",
1102
+ "psr-18"
1103
+ ],
1104
+ "support": {
1105
+ "source": "https://github.com/php-fig/http-client/tree/master"
1106
+ },
1107
+ "install-path": "../psr/http-client"
1108
  },
1109
+ {
1110
+ "name": "psr/http-factory",
1111
+ "version": "1.0.1",
1112
+ "version_normalized": "1.0.1.0",
1113
+ "source": {
1114
+ "type": "git",
1115
+ "url": "https://github.com/php-fig/http-factory.git",
1116
+ "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be"
1117
+ },
1118
+ "dist": {
1119
+ "type": "zip",
1120
+ "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
1121
+ "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
1122
+ "shasum": ""
1123
+ },
1124
+ "require": {
1125
+ "php": ">=7.0.0",
1126
+ "psr/http-message": "^1.0"
1127
+ },
1128
+ "time": "2019-04-30T12:38:16+00:00",
1129
+ "type": "library",
1130
+ "extra": {
1131
+ "branch-alias": {
1132
+ "dev-master": "1.0.x-dev"
1133
+ }
1134
+ },
1135
+ "installation-source": "dist",
1136
+ "autoload": {
1137
+ "psr-4": {
1138
+ "Psr\\Http\\Message\\": "src/"
1139
+ }
1140
+ },
1141
+ "notification-url": "https://packagist.org/downloads/",
1142
+ "license": [
1143
+ "MIT"
1144
+ ],
1145
+ "authors": [
1146
+ {
1147
+ "name": "PHP-FIG",
1148
+ "homepage": "http://www.php-fig.org/"
1149
+ }
1150
+ ],
1151
+ "description": "Common interfaces for PSR-7 HTTP message factories",
1152
+ "keywords": [
1153
+ "factory",
1154
+ "http",
1155
+ "message",
1156
+ "psr",
1157
+ "psr-17",
1158
+ "psr-7",
1159
+ "request",
1160
+ "response"
1161
+ ],
1162
+ "support": {
1163
+ "source": "https://github.com/php-fig/http-factory/tree/master"
1164
+ },
1165
+ "install-path": "../psr/http-factory"
1166
  },
1167
+ {
1168
+ "name": "psr/http-message",
1169
+ "version": "1.0.1",
1170
+ "version_normalized": "1.0.1.0",
1171
+ "source": {
1172
+ "type": "git",
1173
+ "url": "https://github.com/php-fig/http-message.git",
1174
+ "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
1175
+ },
1176
+ "dist": {
1177
+ "type": "zip",
1178
+ "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
1179
+ "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
1180
+ "shasum": ""
1181
+ },
1182
+ "require": {
1183
+ "php": ">=5.3.0"
1184
+ },
1185
+ "time": "2016-08-06T14:39:51+00:00",
1186
+ "type": "library",
1187
+ "extra": {
1188
+ "branch-alias": {
1189
+ "dev-master": "1.0.x-dev"
1190
+ }
1191
+ },
1192
+ "installation-source": "dist",
1193
+ "autoload": {
1194
+ "psr-4": {
1195
+ "Psr\\Http\\Message\\": "src/"
1196
+ }
1197
+ },
1198
+ "notification-url": "https://packagist.org/downloads/",
1199
+ "license": [
1200
+ "MIT"
1201
+ ],
1202
+ "authors": [
1203
+ {
1204
+ "name": "PHP-FIG",
1205
+ "homepage": "http://www.php-fig.org/"
1206
+ }
1207
+ ],
1208
+ "description": "Common interface for HTTP messages",
1209
+ "homepage": "https://github.com/php-fig/http-message",
1210
+ "keywords": [
1211
+ "http",
1212
+ "http-message",
1213
+ "psr",
1214
+ "psr-7",
1215
+ "request",
1216
+ "response"
1217
+ ],
1218
+ "support": {
1219
+ "source": "https://github.com/php-fig/http-message/tree/master"
1220
+ },
1221
+ "install-path": "../psr/http-message"
1222
  },
1223
+ {
1224
+ "name": "psr/log",
1225
+ "version": "1.1.4",
1226
+ "version_normalized": "1.1.4.0",
1227
+ "source": {
1228
+ "type": "git",
1229
+ "url": "https://github.com/php-fig/log.git",
1230
+ "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
1231
+ },
1232
+ "dist": {
1233
+ "type": "zip",
1234
+ "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
1235
+ "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
1236
+ "shasum": ""
1237
+ },
1238
+ "require": {
1239
+ "php": ">=5.3.0"
1240
+ },
1241
+ "time": "2021-05-03T11:20:27+00:00",
1242
+ "type": "library",
1243
+ "extra": {
1244
+ "branch-alias": {
1245
+ "dev-master": "1.1.x-dev"
1246
+ }
1247
+ },
1248
+ "installation-source": "dist",
1249
+ "autoload": {
1250
+ "psr-4": {
1251
+ "Psr\\Log\\": "Psr/Log/"
1252
+ }
1253
+ },
1254
+ "notification-url": "https://packagist.org/downloads/",
1255
+ "license": [
1256
+ "MIT"
1257
+ ],
1258
+ "authors": [
1259
+ {
1260
+ "name": "PHP-FIG",
1261
+ "homepage": "https://www.php-fig.org/"
1262
+ }
1263
+ ],
1264
+ "description": "Common interface for logging libraries",
1265
+ "homepage": "https://github.com/php-fig/log",
1266
+ "keywords": [
1267
+ "log",
1268
+ "psr",
1269
+ "psr-3"
1270
+ ],
1271
+ "support": {
1272
+ "source": "https://github.com/php-fig/log/tree/1.1.4"
1273
+ },
1274
+ "install-path": "../psr/log"
1275
  },
1276
+ {
1277
+ "name": "ralouphie/getallheaders",
1278
+ "version": "3.0.3",
1279
+ "version_normalized": "3.0.3.0",
1280
+ "source": {
1281
+ "type": "git",
1282
+ "url": "https://github.com/ralouphie/getallheaders.git",
1283
+ "reference": "120b605dfeb996808c31b6477290a714d356e822"
1284
+ },
1285
+ "dist": {
1286
+ "type": "zip",
1287
+ "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
1288
+ "reference": "120b605dfeb996808c31b6477290a714d356e822",
1289
+ "shasum": ""
1290
+ },
1291
+ "require": {
1292
+ "php": ">=5.6"
1293
+ },
1294
+ "require-dev": {
1295
+ "php-coveralls/php-coveralls": "^2.1",
1296
+ "phpunit/phpunit": "^5 || ^6.5"
1297
+ },
1298
+ "time": "2019-03-08T08:55:37+00:00",
1299
+ "type": "library",
1300
+ "installation-source": "dist",
1301
+ "autoload": {
1302
+ "files": [
1303
+ "src/getallheaders.php"
1304
+ ]
1305
+ },
1306
+ "notification-url": "https://packagist.org/downloads/",
1307
+ "license": [
1308
+ "MIT"
1309
+ ],
1310
+ "authors": [
1311
+ {
1312
+ "name": "Ralph Khattar",
1313
+ "email": "ralph.khattar@gmail.com"
1314
+ }
1315
+ ],
1316
+ "description": "A polyfill for getallheaders.",
1317
+ "support": {
1318
+ "issues": "https://github.com/ralouphie/getallheaders/issues",
1319
+ "source": "https://github.com/ralouphie/getallheaders/tree/develop"
1320
+ },
1321
+ "install-path": "../ralouphie/getallheaders"
1322
  },
1323
+ {
1324
+ "name": "symfony/deprecation-contracts",
1325
+ "version": "v2.5.0",
1326
+ "version_normalized": "2.5.0.0",
1327
+ "source": {
1328
+ "type": "git",
1329
+ "url": "https://github.com/symfony/deprecation-contracts.git",
1330
+ "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8"
1331
+ },
1332
+ "dist": {
1333
+ "type": "zip",
1334
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8",
1335
+ "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8",
1336
+ "shasum": ""
1337
+ },
1338
+ "require": {
1339
+ "php": ">=7.1"
1340
+ },
1341
+ "time": "2021-07-12T14:48:14+00:00",
1342
+ "type": "library",
1343
+ "extra": {
1344
+ "branch-alias": {
1345
+ "dev-main": "2.5-dev"
1346
+ },
1347
+ "thanks": {
1348
+ "name": "symfony/contracts",
1349
+ "url": "https://github.com/symfony/contracts"
1350
+ }
1351
+ },
1352
+ "installation-source": "dist",
1353
+ "autoload": {
1354
+ "files": [
1355
+ "function.php"
1356
+ ]
1357
+ },
1358
+ "notification-url": "https://packagist.org/downloads/",
1359
+ "license": [
1360
+ "MIT"
1361
+ ],
1362
+ "authors": [
1363
+ {
1364
+ "name": "Nicolas Grekas",
1365
+ "email": "p@tchwork.com"
1366
+ },
1367
+ {
1368
+ "name": "Symfony Community",
1369
+ "homepage": "https://symfony.com/contributors"
1370
+ }
1371
+ ],
1372
+ "description": "A generic function and convention to trigger deprecation notices",
1373
+ "homepage": "https://symfony.com",
1374
+ "support": {
1375
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0"
1376
+ },
1377
+ "funding": [
1378
+ {
1379
+ "url": "https://symfony.com/sponsor",
1380
+ "type": "custom"
1381
+ },
1382
+ {
1383
+ "url": "https://github.com/fabpot",
1384
+ "type": "github"
1385
+ },
1386
+ {
1387
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
1388
+ "type": "tidelift"
1389
+ }
1390
+ ],
1391
+ "install-path": "../symfony/deprecation-contracts"
1392
  },
1393
+ {
1394
+ "name": "symfony/options-resolver",
1395
+ "version": "v5.4.0",
1396
+ "version_normalized": "5.4.0.0",
1397
+ "source": {
1398
+ "type": "git",
1399
+ "url": "https://github.com/symfony/options-resolver.git",
1400
+ "reference": "b0fb78576487af19c500aaddb269fd36701d4847"
1401
+ },
1402
+ "dist": {
1403
+ "type": "zip",
1404
+ "url": "https://api.github.com/repos/symfony/options-resolver/zipball/b0fb78576487af19c500aaddb269fd36701d4847",
1405
+ "reference": "b0fb78576487af19c500aaddb269fd36701d4847",
1406
+ "shasum": ""
1407
+ },
1408
+ "require": {
1409
+ "php": ">=7.2.5",
1410
+ "symfony/deprecation-contracts": "^2.1|^3",
1411
+ "symfony/polyfill-php73": "~1.0",
1412
+ "symfony/polyfill-php80": "^1.16"
1413
+ },
1414
+ "time": "2021-11-23T10:19:22+00:00",
1415
+ "type": "library",
1416
+ "installation-source": "dist",
1417
+ "autoload": {
1418
+ "psr-4": {
1419
+ "Symfony\\Component\\OptionsResolver\\": ""
1420
+ },
1421
+ "exclude-from-classmap": [
1422
+ "/Tests/"
1423
+ ]
1424
+ },
1425
+ "notification-url": "https://packagist.org/downloads/",
1426
+ "license": [
1427
+ "MIT"
1428
+ ],
1429
+ "authors": [
1430
+ {
1431
+ "name": "Fabien Potencier",
1432
+ "email": "fabien@symfony.com"
1433
+ },
1434
+ {
1435
+ "name": "Symfony Community",
1436
+ "homepage": "https://symfony.com/contributors"
1437
+ }
1438
+ ],
1439
+ "description": "Provides an improved replacement for the array_replace PHP function",
1440
+ "homepage": "https://symfony.com",
1441
+ "keywords": [
1442
+ "config",
1443
+ "configuration",
1444
+ "options"
1445
+ ],
1446
+ "support": {
1447
+ "source": "https://github.com/symfony/options-resolver/tree/v5.4.0"
1448
+ },
1449
+ "funding": [
1450
+ {
1451
+ "url": "https://symfony.com/sponsor",
1452
+ "type": "custom"
1453
+ },
1454
+ {
1455
+ "url": "https://github.com/fabpot",
1456
+ "type": "github"
1457
+ },
1458
+ {
1459
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
1460
+ "type": "tidelift"
1461
+ }
1462
+ ],
1463
+ "install-path": "../symfony/options-resolver"
1464
  },
1465
+ {
1466
+ "name": "symfony/polyfill-intl-idn",
1467
+ "version": "v1.24.0",
1468
+ "version_normalized": "1.24.0.0",
1469
+ "source": {
1470
+ "type": "git",
1471
+ "url": "https://github.com/symfony/polyfill-intl-idn.git",
1472
+ "reference": "749045c69efb97c70d25d7463abba812e91f3a44"
1473
+ },
1474
+ "dist": {
1475
+ "type": "zip",
1476
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/749045c69efb97c70d25d7463abba812e91f3a44",
1477
+ "reference": "749045c69efb97c70d25d7463abba812e91f3a44",
1478
+ "shasum": ""
1479
+ },
1480
+ "require": {
1481
+ "php": ">=7.1",
1482
+ "symfony/polyfill-intl-normalizer": "^1.10",
1483
+ "symfony/polyfill-php72": "^1.10"
1484
+ },
1485
+ "suggest": {
1486
+ "ext-intl": "For best performance"
1487
+ },
1488
+ "time": "2021-09-14T14:02:44+00:00",
1489
+ "type": "library",
1490
+ "extra": {
1491
+ "branch-alias": {
1492
+ "dev-main": "1.23-dev"
1493
+ },
1494
+ "thanks": {
1495
+ "name": "symfony/polyfill",
1496
+ "url": "https://github.com/symfony/polyfill"
1497
+ }
1498
+ },
1499
+ "installation-source": "dist",
1500
+ "autoload": {
1501
+ "psr-4": {
1502
+ "Symfony\\Polyfill\\Intl\\Idn\\": ""
1503
+ },
1504
+ "files": [
1505
+ "bootstrap.php"
1506
+ ]
1507
+ },
1508
+ "notification-url": "https://packagist.org/downloads/",
1509
+ "license": [
1510
+ "MIT"
1511
+ ],
1512
+ "authors": [
1513
+ {
1514
+ "name": "Laurent Bassin",
1515
+ "email": "laurent@bassin.info"
1516
+ },
1517
+ {
1518
+ "name": "Trevor Rowbotham",
1519
+ "email": "trevor.rowbotham@pm.me"
1520
+ },
1521
+ {
1522
+ "name": "Symfony Community",
1523
+ "homepage": "https://symfony.com/contributors"
1524
+ }
1525
+ ],
1526
+ "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions",
1527
+ "homepage": "https://symfony.com",
1528
+ "keywords": [
1529
+ "compatibility",
1530
+ "idn",
1531
+ "intl",
1532
+ "polyfill",
1533
+ "portable",
1534
+ "shim"
1535
+ ],
1536
+ "support": {
1537
+ "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.24.0"
1538
+ },
1539
+ "funding": [
1540
+ {
1541
+ "url": "https://symfony.com/sponsor",
1542
+ "type": "custom"
1543
+ },
1544
+ {
1545
+ "url": "https://github.com/fabpot",
1546
+ "type": "github"
1547
+ },
1548
+ {
1549
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
1550
+ "type": "tidelift"
1551
+ }
1552
+ ],
1553
+ "install-path": "../symfony/polyfill-intl-idn"
1554
  },
1555
+ {
1556
+ "name": "symfony/polyfill-intl-normalizer",
1557
+ "version": "v1.24.0",
1558
+ "version_normalized": "1.24.0.0",
1559
+ "source": {
1560
+ "type": "git",
1561
+ "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
1562
+ "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8"
1563
+ },
1564
+ "dist": {
1565
+ "type": "zip",
1566
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8",
1567
+ "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8",
1568
+ "shasum": ""
1569
+ },
1570
+ "require": {
1571
+ "php": ">=7.1"
1572
+ },
1573
+ "suggest": {
1574
+ "ext-intl": "For best performance"
1575
+ },
1576
+ "time": "2021-02-19T12:13:01+00:00",
1577
+ "type": "library",
1578
+ "extra": {
1579
+ "branch-alias": {
1580
+ "dev-main": "1.23-dev"
1581
+ },
1582
+ "thanks": {
1583
+ "name": "symfony/polyfill",
1584
+ "url": "https://github.com/symfony/polyfill"
1585
+ }
1586
+ },
1587
+ "installation-source": "dist",
1588
+ "autoload": {
1589
+ "psr-4": {
1590
+ "Symfony\\Polyfill\\Intl\\Normalizer\\": ""
1591
+ },
1592
+ "files": [
1593
+ "bootstrap.php"
1594
+ ],
1595
+ "classmap": [
1596
+ "Resources/stubs"
1597
+ ]
1598
+ },
1599
+ "notification-url": "https://packagist.org/downloads/",
1600
+ "license": [
1601
+ "MIT"
1602
+ ],
1603
+ "authors": [
1604
+ {
1605
+ "name": "Nicolas Grekas",
1606
+ "email": "p@tchwork.com"
1607
+ },
1608
+ {
1609
+ "name": "Symfony Community",
1610
+ "homepage": "https://symfony.com/contributors"
1611
+ }
1612
+ ],
1613
+ "description": "Symfony polyfill for intl's Normalizer class and related functions",
1614
+ "homepage": "https://symfony.com",
1615
+ "keywords": [
1616
+ "compatibility",
1617
+ "intl",
1618
+ "normalizer",
1619
+ "polyfill",
1620
+ "portable",
1621
+ "shim"
1622
+ ],
1623
+ "support": {
1624
+ "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.24.0"
1625
+ },
1626
+ "funding": [
1627
+ {
1628
+ "url": "https://symfony.com/sponsor",
1629
+ "type": "custom"
1630
+ },
1631
+ {
1632
+ "url": "https://github.com/fabpot",
1633
+ "type": "github"
1634
+ },
1635
+ {
1636
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
1637
+ "type": "tidelift"
1638
+ }
1639
+ ],
1640
+ "install-path": "../symfony/polyfill-intl-normalizer"
1641
  },
1642
+ {
1643
+ "name": "symfony/polyfill-php72",
1644
+ "version": "v1.24.0",
1645
+ "version_normalized": "1.24.0.0",
1646
+ "source": {
1647
+ "type": "git",
1648
+ "url": "https://github.com/symfony/polyfill-php72.git",
1649
+ "reference": "9a142215a36a3888e30d0a9eeea9766764e96976"
1650
+ },
1651
+ "dist": {
1652
+ "type": "zip",
1653
+ "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976",
1654
+ "reference": "9a142215a36a3888e30d0a9eeea9766764e96976",
1655
+ "shasum": ""
1656
+ },
1657
+ "require": {
1658
+ "php": ">=7.1"
1659
+ },
1660
+ "time": "2021-05-27T09:17:38+00:00",
1661
+ "type": "library",
1662
+ "extra": {
1663
+ "branch-alias": {
1664
+ "dev-main": "1.23-dev"
1665
+ },
1666
+ "thanks": {
1667
+ "name": "symfony/polyfill",
1668
+ "url": "https://github.com/symfony/polyfill"
1669
+ }
1670
+ },
1671
+ "installation-source": "dist",
1672
+ "autoload": {
1673
+ "psr-4": {
1674
+ "Symfony\\Polyfill\\Php72\\": ""
1675
+ },
1676
+ "files": [
1677
+ "bootstrap.php"
1678
+ ]
1679
+ },
1680
+ "notification-url": "https://packagist.org/downloads/",
1681
+ "license": [
1682
+ "MIT"
1683
+ ],
1684
+ "authors": [
1685
+ {
1686
+ "name": "Nicolas Grekas",
1687
+ "email": "p@tchwork.com"
1688
+ },
1689
+ {
1690
+ "name": "Symfony Community",
1691
+ "homepage": "https://symfony.com/contributors"
1692
+ }
1693
+ ],
1694
+ "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
1695
+ "homepage": "https://symfony.com",
1696
+ "keywords": [
1697
+ "compatibility",
1698
+ "polyfill",
1699
+ "portable",
1700
+ "shim"
1701
+ ],
1702
+ "support": {
1703
+ "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0"
1704
+ },
1705
+ "funding": [
1706
+ {
1707
+ "url": "https://symfony.com/sponsor",
1708
+ "type": "custom"
1709
+ },
1710
+ {
1711
+ "url": "https://github.com/fabpot",
1712
+ "type": "github"
1713
+ },
1714
+ {
1715
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
1716
+ "type": "tidelift"
1717
+ }
1718
+ ],
1719
+ "install-path": "../symfony/polyfill-php72"
1720
  },
1721
+ {
1722
+ "name": "symfony/polyfill-php73",
1723
+ "version": "v1.24.0",
1724
+ "version_normalized": "1.24.0.0",
1725
+ "source": {
1726
+ "type": "git",
1727
+ "url": "https://github.com/symfony/polyfill-php73.git",
1728
+ "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5"
1729
+ },
1730
+ "dist": {
1731
+ "type": "zip",
1732
+ "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5",
1733
+ "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5",
1734
+ "shasum": ""
1735
+ },
1736
+ "require": {
1737
+ "php": ">=7.1"
1738
+ },
1739
+ "time": "2021-06-05T21:20:04+00:00",
1740
+ "type": "library",
1741
+ "extra": {
1742
+ "branch-alias": {
1743
+ "dev-main": "1.23-dev"
1744
+ },
1745
+ "thanks": {
1746
+ "name": "symfony/polyfill",
1747
+ "url": "https://github.com/symfony/polyfill"
1748
+ }
1749
+ },
1750
+ "installation-source": "dist",
1751
+ "autoload": {
1752
+ "psr-4": {
1753
+ "Symfony\\Polyfill\\Php73\\": ""
1754
+ },
1755
+ "files": [
1756
+ "bootstrap.php"
1757
+ ],
1758
+ "classmap": [
1759
+ "Resources/stubs"
1760
+ ]
1761
+ },
1762
+ "notification-url": "https://packagist.org/downloads/",
1763
+ "license": [
1764
+ "MIT"
1765
+ ],
1766
+ "authors": [
1767
+ {
1768
+ "name": "Nicolas Grekas",
1769
+ "email": "p@tchwork.com"
1770
+ },
1771
+ {
1772
+ "name": "Symfony Community",
1773
+ "homepage": "https://symfony.com/contributors"
1774
+ }
1775
+ ],
1776
+ "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
1777
+ "homepage": "https://symfony.com",
1778
+ "keywords": [
1779
+ "compatibility",
1780
+ "polyfill",
1781
+ "portable",
1782
+ "shim"
1783
+ ],
1784
+ "support": {
1785
+ "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.0"
1786
+ },
1787
+ "funding": [
1788
+ {
1789
+ "url": "https://symfony.com/sponsor",
1790
+ "type": "custom"
1791
+ },
1792
+ {
1793
+ "url": "https://github.com/fabpot",
1794
+ "type": "github"
1795
+ },
1796
+ {
1797
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
1798
+ "type": "tidelift"
1799
+ }
1800
+ ],
1801
+ "install-path": "../symfony/polyfill-php73"
1802
  },
1803
+ {
1804
+ "name": "symfony/polyfill-php80",
1805
+ "version": "v1.24.0",
1806
+ "version_normalized": "1.24.0.0",
1807
+ "source": {
1808
+ "type": "git",
1809
+ "url": "https://github.com/symfony/polyfill-php80.git",
1810
+ "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9"
1811
+ },
1812
+ "dist": {
1813
+ "type": "zip",
1814
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9",
1815
+ "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9",
1816
+ "shasum": ""
1817
+ },
1818
+ "require": {
1819
+ "php": ">=7.1"
1820
+ },
1821
+ "time": "2021-09-13T13:58:33+00:00",
1822
+ "type": "library",
1823
+ "extra": {
1824
+ "branch-alias": {
1825
+ "dev-main": "1.23-dev"
1826
+ },
1827
+ "thanks": {
1828
+ "name": "symfony/polyfill",
1829
+ "url": "https://github.com/symfony/polyfill"
1830
+ }
1831
+ },
1832
+ "installation-source": "dist",
1833
+ "autoload": {
1834
+ "psr-4": {
1835
+ "Symfony\\Polyfill\\Php80\\": ""
1836
+ },
1837
+ "files": [
1838
+ "bootstrap.php"
1839
+ ],
1840
+ "classmap": [
1841
+ "Resources/stubs"
1842
+ ]
1843
+ },
1844
+ "notification-url": "https://packagist.org/downloads/",
1845
+ "license": [
1846
+ "MIT"
1847
+ ],
1848
+ "authors": [
1849
+ {
1850
+ "name": "Ion Bazan",
1851
+ "email": "ion.bazan@gmail.com"
1852
+ },
1853
+ {
1854
+ "name": "Nicolas Grekas",
1855
+ "email": "p@tchwork.com"
1856
+ },
1857
+ {
1858
+ "name": "Symfony Community",
1859
+ "homepage": "https://symfony.com/contributors"
1860
+ }
1861
+ ],
1862
+ "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
1863
+ "homepage": "https://symfony.com",
1864
+ "keywords": [
1865
+ "compatibility",
1866
+ "polyfill",
1867
+ "portable",
1868
+ "shim"
1869
+ ],
1870
+ "support": {
1871
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0"
1872
+ },
1873
+ "funding": [
1874
+ {
1875
+ "url": "https://symfony.com/sponsor",
1876
+ "type": "custom"
1877
+ },
1878
+ {
1879
+ "url": "https://github.com/fabpot",
1880
+ "type": "github"
1881
+ },
1882
+ {
1883
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
1884
+ "type": "tidelift"
1885
+ }
1886
+ ],
1887
+ "install-path": "../symfony/polyfill-php80"
1888
  }
1889
+ ],
1890
+ "dev": true,
1891
+ "dev-package-names": []
1892
+ }
vendor/composer/installed.php ADDED
@@ -0,0 +1,309 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php return array (
2
+ 'root' =>
3
+ array (
4
+ 'pretty_version' => 'dev-master',
5
+ 'version' => 'dev-master',
6
+ 'aliases' =>
7
+ array (
8
+ ),
9
+ 'reference' => '4f5f67af3cd2f2e144cd7d76325094c837319921',
10
+ 'name' => '__root__',
11
+ ),
12
+ 'versions' =>
13
+ array (
14
+ '__root__' =>
15
+ array (
16
+ 'pretty_version' => 'dev-master',
17
+ 'version' => 'dev-master',
18
+ 'aliases' =>
19
+ array (
20
+ ),
21
+ 'reference' => '4f5f67af3cd2f2e144cd7d76325094c837319921',
22
+ ),
23
+ 'clue/stream-filter' =>
24
+ array (
25
+ 'pretty_version' => 'v1.5.0',
26
+ 'version' => '1.5.0.0',
27
+ 'aliases' =>
28
+ array (
29
+ ),
30
+ 'reference' => 'aeb7d8ea49c7963d3b581378955dbf5bc49aa320',
31
+ ),
32
+ 'getresponse/sdk-php' =>
33
+ array (
34
+ 'pretty_version' => '2.0.0',
35
+ 'version' => '2.0.0.0',
36
+ 'aliases' =>
37
+ array (
38
+ ),
39
+ 'reference' => '752529f6e310513c711d1c9a92d3c5c4c059dcad',
40
+ ),
41
+ 'getresponse/sdk-php-client' =>
42
+ array (
43
+ 'pretty_version' => '1.1.1',
44
+ 'version' => '1.1.1.0',
45
+ 'aliases' =>
46
+ array (
47
+ ),
48
+ 'reference' => 'a9ec8b20a72b8b6366adec04068f20541aa9d648',
49
+ ),
50
+ 'guzzlehttp/guzzle' =>
51
+ array (
52
+ 'pretty_version' => '6.5.5',
53
+ 'version' => '6.5.5.0',
54
+ 'aliases' =>
55
+ array (
56
+ ),
57
+ 'reference' => '9d4290de1cfd701f38099ef7e183b64b4b7b0c5e',
58
+ ),
59
+ 'guzzlehttp/promises' =>
60
+ array (
61
+ 'pretty_version' => '1.5.1',
62
+ 'version' => '1.5.1.0',
63
+ 'aliases' =>
64
+ array (
65
+ ),
66
+ 'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da',
67
+ ),
68
+ 'guzzlehttp/psr7' =>
69
+ array (
70
+ 'pretty_version' => '1.8.3',
71
+ 'version' => '1.8.3.0',
72
+ 'aliases' =>
73
+ array (
74
+ ),
75
+ 'reference' => '1afdd860a2566ed3c2b0b4a3de6e23434a79ec85',
76
+ ),
77
+ 'mailerlite/mailerlite-api-v2-php-sdk' =>
78
+ array (
79
+ 'pretty_version' => '0.3.2',
80
+ 'version' => '0.3.2.0',
81
+ 'aliases' =>
82
+ array (
83
+ ),
84
+ 'reference' => '9fb6b8adb3b0dd9eb964ba5169b229516c73fd78',
85
+ ),
86
+ 'nyholm/psr7' =>
87
+ array (
88
+ 'pretty_version' => '1.4.1',
89
+ 'version' => '1.4.1.0',
90
+ 'aliases' =>
91
+ array (
92
+ ),
93
+ 'reference' => '2212385b47153ea71b1c1b1374f8cb5e4f7892ec',
94
+ ),
95
+ 'php-http/async-client-implementation' =>
96
+ array (
97
+ 'provided' =>
98
+ array (
99
+ 0 => '1.0',
100
+ ),
101
+ ),
102
+ 'php-http/client-common' =>
103
+ array (
104
+ 'pretty_version' => '2.5.0',
105
+ 'version' => '2.5.0.0',
106
+ 'aliases' =>
107
+ array (
108
+ ),
109
+ 'reference' => 'd135751167d57e27c74de674d6a30cef2dc8e054',
110
+ ),
111
+ 'php-http/client-implementation' =>
112
+ array (
113
+ 'provided' =>
114
+ array (
115
+ 0 => '1.0',
116
+ ),
117
+ ),
118
+ 'php-http/discovery' =>
119
+ array (
120
+ 'pretty_version' => '1.14.1',
121
+ 'version' => '1.14.1.0',
122
+ 'aliases' =>
123
+ array (
124
+ ),
125
+ 'reference' => 'de90ab2b41d7d61609f504e031339776bc8c7223',
126
+ ),
127
+ 'php-http/guzzle6-adapter' =>
128
+ array (
129
+ 'pretty_version' => 'v2.0.2',
130
+ 'version' => '2.0.2.0',
131
+ 'aliases' =>
132
+ array (
133
+ ),
134
+ 'reference' => '9d1a45eb1c59f12574552e81fb295e9e53430a56',
135
+ ),
136
+ 'php-http/httplug' =>
137
+ array (
138
+ 'pretty_version' => '2.2.0',
139
+ 'version' => '2.2.0.0',
140
+ 'aliases' =>
141
+ array (
142
+ ),
143
+ 'reference' => '191a0a1b41ed026b717421931f8d3bd2514ffbf9',
144
+ ),
145
+ 'php-http/message' =>
146
+ array (
147
+ 'pretty_version' => '1.12.0',
148
+ 'version' => '1.12.0.0',
149
+ 'aliases' =>
150
+ array (
151
+ ),
152
+ 'reference' => '39eb7548be982a81085fe5a6e2a44268cd586291',
153
+ ),
154
+ 'php-http/message-factory' =>
155
+ array (
156
+ 'pretty_version' => 'v1.0.2',
157
+ 'version' => '1.0.2.0',
158
+ 'aliases' =>
159
+ array (
160
+ ),
161
+ 'reference' => 'a478cb11f66a6ac48d8954216cfed9aa06a501a1',
162
+ ),
163
+ 'php-http/message-factory-implementation' =>
164
+ array (
165
+ 'provided' =>
166
+ array (
167
+ 0 => '1.0',
168
+ ),
169
+ ),
170
+ 'php-http/promise' =>
171
+ array (
172
+ 'pretty_version' => '1.1.0',
173
+ 'version' => '1.1.0.0',
174
+ 'aliases' =>
175
+ array (
176
+ ),
177
+ 'reference' => '4c4c1f9b7289a2ec57cde7f1e9762a5789506f88',
178
+ ),
179
+ 'psr/http-client' =>
180
+ array (
181
+ 'pretty_version' => '1.0.1',
182
+ 'version' => '1.0.1.0',
183
+ 'aliases' =>
184
+ array (
185
+ ),
186
+ 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621',
187
+ ),
188
+ 'psr/http-client-implementation' =>
189
+ array (
190
+ 'provided' =>
191
+ array (
192
+ 0 => '1.0',
193
+ ),
194
+ ),
195
+ 'psr/http-factory' =>
196
+ array (
197
+ 'pretty_version' => '1.0.1',
198
+ 'version' => '1.0.1.0',
199
+ 'aliases' =>
200
+ array (
201
+ ),
202
+ 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be',
203
+ ),
204
+ 'psr/http-factory-implementation' =>
205
+ array (
206
+ 'provided' =>
207
+ array (
208
+ 0 => '1.0',
209
+ ),
210
+ ),
211
+ 'psr/http-message' =>
212
+ array (
213
+ 'pretty_version' => '1.0.1',
214
+ 'version' => '1.0.1.0',
215
+ 'aliases' =>
216
+ array (
217
+ ),
218
+ 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363',
219
+ ),
220
+ 'psr/http-message-implementation' =>
221
+ array (
222
+ 'provided' =>
223
+ array (
224
+ 0 => '1.0',
225
+ ),
226
+ ),
227
+ 'psr/log' =>
228
+ array (
229
+ 'pretty_version' => '1.1.4',
230
+ 'version' => '1.1.4.0',
231
+ 'aliases' =>
232
+ array (
233
+ ),
234
+ 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
235
+ ),
236
+ 'ralouphie/getallheaders' =>
237
+ array (
238
+ 'pretty_version' => '3.0.3',
239
+ 'version' => '3.0.3.0',
240
+ 'aliases' =>
241
+ array (
242
+ ),
243
+ 'reference' => '120b605dfeb996808c31b6477290a714d356e822',
244
+ ),
245
+ 'symfony/deprecation-contracts' =>
246
+ array (
247
+ 'pretty_version' => 'v2.5.0',
248
+ 'version' => '2.5.0.0',
249
+ 'aliases' =>
250
+ array (
251
+ ),
252
+ 'reference' => '6f981ee24cf69ee7ce9736146d1c57c2780598a8',
253
+ ),
254
+ 'symfony/options-resolver' =>
255
+ array (
256
+ 'pretty_version' => 'v5.4.0',
257
+ 'version' => '5.4.0.0',
258
+ 'aliases' =>
259
+ array (
260
+ ),
261
+ 'reference' => 'b0fb78576487af19c500aaddb269fd36701d4847',
262
+ ),
263
+ 'symfony/polyfill-intl-idn' =>
264
+ array (
265
+ 'pretty_version' => 'v1.24.0',
266
+ 'version' => '1.24.0.0',
267
+ 'aliases' =>
268
+ array (
269
+ ),
270
+ 'reference' => '749045c69efb97c70d25d7463abba812e91f3a44',
271
+ ),
272
+ 'symfony/polyfill-intl-normalizer' =>
273
+ array (
274
+ 'pretty_version' => 'v1.24.0',
275
+ 'version' => '1.24.0.0',
276
+ 'aliases' =>
277
+ array (
278
+ ),
279
+ 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8',
280
+ ),
281
+ 'symfony/polyfill-php72' =>
282
+ array (
283
+ 'pretty_version' => 'v1.24.0',
284
+ 'version' => '1.24.0.0',
285
+ 'aliases' =>
286
+ array (
287
+ ),
288
+ 'reference' => '9a142215a36a3888e30d0a9eeea9766764e96976',
289
+ ),
290
+ 'symfony/polyfill-php73' =>
291
+ array (
292
+ 'pretty_version' => 'v1.24.0',
293
+ 'version' => '1.24.0.0',
294
+ 'aliases' =>
295
+ array (
296
+ ),
297
+ 'reference' => 'cc5db0e22b3cb4111010e48785a97f670b350ca5',
298
+ ),
299
+ 'symfony/polyfill-php80' =>
300
+ array (
301
+ 'pretty_version' => 'v1.24.0',
302
+ 'version' => '1.24.0.0',
303
+ 'aliases' =>
304
+ array (
305
+ ),
306
+ 'reference' => '57b712b08eddb97c762a8caa32c84e037892d2e9',
307
+ ),
308
+ ),
309
+ );
vendor/composer/platform_check.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // platform_check.php @generated by Composer
4
+
5
+ $issues = array();
6
+
7
+ if (!(PHP_VERSION_ID >= 70205)) {
8
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.';
9
+ }
10
+
11
+ if ($issues) {
12
+ if (!headers_sent()) {
13
+ header('HTTP/1.1 500 Internal Server Error');
14
+ }
15
+ if (!ini_get('display_errors')) {
16
+ if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
17
+ fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
18
+ } elseif (!headers_sent()) {
19
+ echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
20
+ }
21
+ }
22
+ trigger_error(
23
+ 'Composer detected issues in your platform: ' . implode(' ', $issues),
24
+ E_USER_ERROR
25
+ );
26
+ }
vendor/getresponse/sdk-php/src/Operation/Autoresponders/Statistics/GetAutoresponderStatistics/GetAutoresponderStatistics.php DELETED
@@ -1,94 +0,0 @@
1
- <?php
2
- namespace Getresponse\Sdk\Operation\Autoresponders\Statistics\GetAutoresponderStatistics;
3
-
4
- use Getresponse\Sdk\Client\Operation\Pagination;
5
- use Getresponse\Sdk\Client\Operation\QueryOperation;
6
- use Getresponse\Sdk\OperationVersionTrait;
7
-
8
- class GetAutoresponderStatistics extends QueryOperation
9
- {
10
- use OperationVersionTrait;
11
-
12
- const METHOD_URL = '/v3/autoresponders/{autoresponderId}/statistics';
13
-
14
- /** @var string */
15
- private $autoresponderId;
16
-
17
- /** @var GetAutoresponderStatisticsSearchQuery */
18
- private $query;
19
-
20
- /** @var Pagination */
21
- private $pagination;
22
-
23
- /** @var GetAutoresponderStatisticsFields */
24
- private $fields;
25
-
26
-
27
- /**
28
- * @param string $autoresponderId
29
- */
30
- public function __construct($autoresponderId)
31
- {
32
- $this->autoresponderId = $autoresponderId;
33
- }
34
-
35
-
36
- /**
37
- * @return string
38
- */
39
- public function buildUrlFromTemplate()
40
- {
41
- return str_ireplace(
42
- ['{autoresponderId}'],
43
- [$this->autoresponderId],
44
- self::METHOD_URL
45
- );
46
- }
47
-
48
-
49
- /**
50
- * @param GetAutoresponderStatisticsSearchQuery $query
51
- * @return $this
52
- */
53
- public function setQuery(GetAutoresponderStatisticsSearchQuery $query)
54
- {
55
- $this->query = $query;
56
- return $this;
57
- }
58
-
59
-
60
- /**
61
- * @param Pagination $pagination
62
- * @return $this
63
- */
64
- public function setPagination(Pagination $pagination)
65
- {
66
- $this->pagination = $pagination;
67
- return $this;
68
- }
69
-
70
-
71
- /**
72
- * @param GetAutoresponderStatisticsFields $fields
73
- * @return $this
74
- */
75
- public function setFields(GetAutoresponderStatisticsFields $fields)
76
- {
77
- $this->fields = $fields;
78
- return $this;
79
- }
80
-
81
-
82
- /**
83
- * @return string
84
- */
85
- public function getUrl()
86
- {
87
- $extra = array_merge(
88
- $this->getPaginationParametersArray($this->pagination),
89
- $this->getFieldsParameterArray($this->fields)
90
- );
91
-
92
- return $this->buildUrlFromTemplate() . $this->buildQueryString($this->query, null, $extra);
93
- }
94
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/getresponse/sdk-php/src/Operation/{Campaigns/Statistics/Balance/GetCampaignStatisticsBalance/svn-B825C2A7 → Autoresponders/Statistics/GetAutoresponderStatistics/svn-3E57D9B6} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/Autoresponders/Statistics/GetAutorespondersStatistics/GetAutorespondersStatisticsFields.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
- namespace Getresponse\Sdk\Operation\Autoresponders\Statistics\GetAutorespondersStatistics;
3
-
4
- use Getresponse\Sdk\Client\Operation\ValueList;
5
-
6
- class GetAutorespondersStatisticsFields extends ValueList
7
- {
8
- /**
9
- * @return array
10
- */
11
- public function getAllowedValues()
12
- {
13
- return [
14
- 'timeInterval',
15
- 'sent',
16
- 'totalOpened',
17
- 'uniqueOpened',
18
- 'totalClicked',
19
- 'uniqueClicked',
20
- 'goals',
21
- 'uniqueGoals',
22
- 'forwarded',
23
- 'unsubscribed',
24
- 'bounced',
25
- 'complaints',
26
- ];
27
- }
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/getresponse/sdk-php/src/Operation/Autoresponders/Statistics/GetAutorespondersStatistics/GetAutorespondersStatisticsSearchQuery.php DELETED
@@ -1,94 +0,0 @@
1
- <?php
2
- namespace Getresponse\Sdk\Operation\Autoresponders\Statistics\GetAutorespondersStatistics;
3
-
4
- use Getresponse\Sdk\Client\Operation\DateRangeSearch;
5
- use Getresponse\Sdk\Client\Operation\SearchQuery;
6
-
7
- class GetAutorespondersStatisticsSearchQuery extends SearchQuery
8
- {
9
- /**
10
- * @return array
11
- */
12
- public function getAllowedKeys()
13
- {
14
- return [
15
- 'groupBy',
16
- 'autoreponderId',
17
- 'campaignId',
18
- 'createdOn',
19
- ];
20
- }
21
-
22
-
23
- /**
24
- * @return $this
25
- * @throws \InvalidArgumentException
26
- */
27
- public function whereGroupByIsTotal()
28
- {
29
- return $this->set('groupBy', 'total');
30
- }
31
-
32
-
33
- /**
34
- * @return $this
35
- * @throws \InvalidArgumentException
36
- */
37
- public function whereGroupByIsHour()
38
- {
39
- return $this->set('groupBy', 'hour');
40
- }
41
-
42
-
43
- /**
44
- * @return $this
45
- * @throws \InvalidArgumentException
46
- */
47
- public function whereGroupByIsDay()
48
- {
49
- return $this->set('groupBy', 'day');
50
- }
51
-
52
-
53
- /**
54
- * @return $this
55
- * @throws \InvalidArgumentException
56
- */
57
- public function whereGroupByIsMonth()
58
- {
59
- return $this->set('groupBy', 'month');
60
- }
61
-
62
-
63
- /**
64
- * @param string $autoreponderId
65
- * @return $this
66
- * @throws \InvalidArgumentException
67
- */
68
- public function whereAutoreponderId($autoreponderId)
69
- {
70
- return $this->set('autoreponderId', $autoreponderId);
71
- }
72
-
73
-
74
- /**
75
- * @param string $campaignId
76
- * @return $this
77
- * @throws \InvalidArgumentException
78
- */
79
- public function whereCampaignId($campaignId)
80
- {
81
- return $this->set('campaignId', $campaignId);
82
- }
83
-
84
-
85
- /**
86
- * @param DateRangeSearch $createdOn
87
- * @return $this
88
- * @throws \InvalidArgumentException
89
- */
90
- public function whereCreatedOn(DateRangeSearch $createdOn)
91
- {
92
- return $this->set('createdOn', $createdOn->toArray());
93
- }
94
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/getresponse/sdk-php/src/Operation/{Campaigns/Statistics/Balance/GetCampaignStatisticsBalance/svn-B825C2AE → Autoresponders/Statistics/GetAutorespondersStatistics/svn-3E58D1D2} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/{Campaigns/Statistics/ListSize/GetCampaignStatisticsListSize/svn-B8273AB5 → Autoresponders/Statistics/GetAutorespondersStatistics/svn-3E58D1D9} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/Autoresponders/Thumbnail/GetAutoresponderThumbnail/GetAutoresponderThumbnail.php DELETED
@@ -1,61 +0,0 @@
1
- <?php
2
- namespace Getresponse\Sdk\Operation\Autoresponders\Thumbnail\GetAutoresponderThumbnail;
3
-
4
- use Getresponse\Sdk\Client\Operation\QueryOperation;
5
- use Getresponse\Sdk\OperationVersionTrait;
6
-
7
- class GetAutoresponderThumbnail extends QueryOperation
8
- {
9
- use OperationVersionTrait;
10
-
11
- const METHOD_URL = '/v3/autoresponders/{autoresponderId}/thumbnail';
12
-
13
- /** @var string */
14
- private $autoresponderId;
15
-
16
- /** @var GetAutoresponderThumbnailUrlQueryParameters */
17
- private $urlParameterQuery;
18
-
19
-
20
- /**
21
- * @param string $autoresponderId
22
- */
23
- public function __construct($autoresponderId)
24
- {
25
- $this->autoresponderId = $autoresponderId;
26
- }
27
-
28
-
29
- /**
30
- * @return string
31
- */
32
- public function buildUrlFromTemplate()
33
- {
34
- return str_ireplace(
35
- ['{autoresponderId}'],
36
- [$this->autoresponderId],
37
- self::METHOD_URL
38
- );
39
- }
40
-
41
-
42
- /**
43
- * @param GetAutoresponderThumbnailUrlQueryParameters $urlParameterQuery
44
- * @return $this
45
- */
46
- public function setUrlParameterQuery(GetAutoresponderThumbnailUrlQueryParameters $urlParameterQuery)
47
- {
48
- $this->urlParameterQuery = $urlParameterQuery;
49
- return $this;
50
- }
51
-
52
-
53
- /**
54
- * @return string
55
- */
56
- public function getUrl()
57
- {
58
- $extra = null !== $this->urlParameterQuery ? $this->urlParameterQuery->toArray() : [];
59
- return $this->buildUrlFromTemplate() . $this->buildQueryString(null, null, $extra);
60
- }
61
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/getresponse/sdk-php/src/Operation/{Campaigns/Statistics/ListSize/GetCampaignStatisticsListSize/svn-B8273ABC → Autoresponders/Thumbnail/GetAutoresponderThumbnail/svn-3E58D1E0} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/Autoresponders/Thumbnail/GetAutoresponderThumbnail/{svn-B821DA30 → svn-3E58D1E7} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/Autoresponders/UpdateAutoresponder/UpdateAutoresponder.php DELETED
@@ -1,82 +0,0 @@
1
- <?php
2
- namespace Getresponse\Sdk\Operation\Autoresponders\UpdateAutoresponder;
3
-
4
- use Getresponse\Sdk\Client\Exception\InvalidCommandDataException;
5
- use Getresponse\Sdk\Client\Operation\CommandOperation;
6
- use Getresponse\Sdk\Client\Operation\Operation;
7
- use Getresponse\Sdk\OperationVersionTrait;
8
- use Getresponse\Sdk\Operation\Model\UpdateAutoresponder as ModelUpdateAutoresponder;
9
-
10
- class UpdateAutoresponder extends CommandOperation
11
- {
12
- use OperationVersionTrait;
13
-
14
- const METHOD_URL = '/v3/autoresponders/{autoresponderId}';
15
-
16
- /** @var ModelUpdateAutoresponder */
17
- protected $data;
18
-
19
- /** @var string */
20
- private $autoresponderId;
21
-
22
-
23
- /**
24
- * @param ModelUpdateAutoresponder $data
25
- * @param string $autoresponderId
26
- */
27
- public function __construct(ModelUpdateAutoresponder $data, $autoresponderId)
28
- {
29
- $this->data = $data;
30
- $this->autoresponderId = $autoresponderId;
31
- }
32
-
33
-
34
- /**
35
- * @return string
36
- */
37
- public function buildUrlFromTemplate()
38
- {
39
- return str_ireplace(
40
- ['{autoresponderId}'],
41
- [$this->autoresponderId],
42
- self::METHOD_URL
43
- );
44
- }
45
-
46
-
47
- /**
48
- * @return string
49
- */
50
- public function getUrl()
51
- {
52
- return $this->buildUrlFromTemplate();
53
- }
54
-
55
-
56
- /**
57
- * @return string
58
- */
59
- public function getMethod()
60
- {
61
- return Operation::POST;
62
- }
63
-
64
-
65
- /**
66
- * @return string
67
- * @throws InvalidCommandDataException
68
- */
69
- public function getBody()
70
- {
71
- return $this->encode($this->data->jsonSerialize());
72
- }
73
-
74
-
75
- /**
76
- * @return int
77
- */
78
- public function getSuccessCode()
79
- {
80
- return 200;
81
- }
82
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/getresponse/sdk-php/src/Operation/{Campaigns/Statistics/Locations/GetCampaignStatisticsLocations/svn-B8273AC3 → Autoresponders/UpdateAutoresponder/svn-3E58D1EE} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/Blacklists/GetBlacklists/GetBlacklists.php DELETED
@@ -1,60 +0,0 @@
1
- <?php
2
- namespace Getresponse\Sdk\Operation\Campaigns\Blacklists\GetBlacklists;
3
-
4
- use Getresponse\Sdk\Client\Operation\QueryOperation;
5
- use Getresponse\Sdk\OperationVersionTrait;
6
-
7
- class GetBlacklists extends QueryOperation
8
- {
9
- use OperationVersionTrait;
10
-
11
- const METHOD_URL = '/v3/campaigns/{campaignId}/blacklists';
12
-
13
- /** @var string */
14
- private $campaignId;
15
-
16
- /** @var GetBlacklistsSearchQuery */
17
- private $query;
18
-
19
-
20
- /**
21
- * @param string $campaignId
22
- */
23
- public function __construct($campaignId)
24
- {
25
- $this->campaignId = $campaignId;
26
- }
27
-
28
-
29
- /**
30
- * @return string
31
- */
32
- public function buildUrlFromTemplate()
33
- {
34
- return str_ireplace(
35
- ['{campaignId}'],
36
- [$this->campaignId],
37
- self::METHOD_URL
38
- );
39
- }
40
-
41
-
42
- /**
43
- * @param GetBlacklistsSearchQuery $query
44
- * @return $this
45
- */
46
- public function setQuery(GetBlacklistsSearchQuery $query)
47
- {
48
- $this->query = $query;
49
- return $this;
50
- }
51
-
52
-
53
- /**
54
- * @return string
55
- */
56
- public function getUrl()
57
- {
58
- return $this->buildUrlFromTemplate() . $this->buildQueryString($this->query, null, null);
59
- }
60
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/getresponse/sdk-php/src/Operation/Campaigns/Blacklists/GetBlacklists/GetBlacklistsFields.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- namespace Getresponse\Sdk\Operation\Campaigns\Blacklists\GetBlacklists;
3
-
4
- use Getresponse\Sdk\Client\Operation\ValueList;
5
-
6
- class GetBlacklistsFields extends ValueList
7
- {
8
- /**
9
- * @return array
10
- */
11
- public function getAllowedValues()
12
- {
13
- return [
14
- 'masks',
15
- ];
16
- }
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Locations/GetCampaignStatisticsLocations/svn-B8273ACA → Blacklists/GetBlacklists/svn-3E58D1F5} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Origins/GetCampaignStatisticsOrigins/svn-B8273AD1 → Blacklists/GetBlacklists/svn-3E58D1FC} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/Blacklists/UpdateBlacklists/UpdateBlacklists.php DELETED
@@ -1,82 +0,0 @@
1
- <?php
2
- namespace Getresponse\Sdk\Operation\Campaigns\Blacklists\UpdateBlacklists;
3
-
4
- use Getresponse\Sdk\Client\Exception\InvalidCommandDataException;
5
- use Getresponse\Sdk\Client\Operation\CommandOperation;
6
- use Getresponse\Sdk\Client\Operation\Operation;
7
- use Getresponse\Sdk\OperationVersionTrait;
8
- use Getresponse\Sdk\Operation\Model\UpdateBlacklist;
9
-
10
- class UpdateBlacklists extends CommandOperation
11
- {
12
- use OperationVersionTrait;
13
-
14
- const METHOD_URL = '/v3/campaigns/{campaignId}/blacklists';
15
-
16
- /** @var UpdateBlacklist */
17
- protected $data;
18
-
19
- /** @var string */
20
- private $campaignId;
21
-
22
-
23
- /**
24
- * @param UpdateBlacklist $data
25
- * @param string $campaignId
26
- */
27
- public function __construct(UpdateBlacklist $data, $campaignId)
28
- {
29
- $this->data = $data;
30
- $this->campaignId = $campaignId;
31
- }
32
-
33
-
34
- /**
35
- * @return string
36
- */
37
- public function buildUrlFromTemplate()
38
- {
39
- return str_ireplace(
40
- ['{campaignId}'],
41
- [$this->campaignId],
42
- self::METHOD_URL
43
- );
44
- }
45
-
46
-
47
- /**
48
- * @return string
49
- */
50
- public function getUrl()
51
- {
52
- return $this->buildUrlFromTemplate();
53
- }
54
-
55
-
56
- /**
57
- * @return string
58
- */
59
- public function getMethod()
60
- {
61
- return Operation::POST;
62
- }
63
-
64
-
65
- /**
66
- * @return string
67
- * @throws InvalidCommandDataException
68
- */
69
- public function getBody()
70
- {
71
- return $this->encode($this->data->jsonSerialize());
72
- }
73
-
74
-
75
- /**
76
- * @return int
77
- */
78
- public function getSuccessCode()
79
- {
80
- return 200;
81
- }
82
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Origins/GetCampaignStatisticsOrigins/svn-B8273AD8 → Blacklists/UpdateBlacklists/svn-3E58D20A} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/Contacts/GetContacts/GetContacts.php DELETED
@@ -1,108 +0,0 @@
1
- <?php
2
- namespace Getresponse\Sdk\Operation\Campaigns\Contacts\GetContacts;
3
-
4
- use Getresponse\Sdk\Client\Operation\Pagination;
5
- use Getresponse\Sdk\Client\Operation\QueryOperation;
6
- use Getresponse\Sdk\OperationVersionTrait;
7
-
8
- class GetContacts extends QueryOperation
9
- {
10
- use OperationVersionTrait;
11
-
12
- const METHOD_URL = '/v3/campaigns/{campaignId}/contacts';
13
-
14
- /** @var string */
15
- private $campaignId;
16
-
17
- /** @var GetContactsSearchQuery */
18
- private $query;
19
-
20
- /** @var GetContactsSortParams */
21
- private $sort;
22
-
23
- /** @var Pagination */
24
- private $pagination;
25
-
26
- /** @var GetContactsFields */
27
- private $fields;
28
-
29
-
30
- /**
31
- * @param string $campaignId
32
- */
33
- public function __construct($campaignId)
34
- {
35
- $this->campaignId = $campaignId;
36
- }
37
-
38
-
39
- /**
40
- * @return string
41
- */
42
- public function buildUrlFromTemplate()
43
- {
44
- return str_ireplace(
45
- ['{campaignId}'],
46
- [$this->campaignId],
47
- self::METHOD_URL
48
- );
49
- }
50
-
51
-
52
- /**
53
- * @param GetContactsSearchQuery $query
54
- * @return $this
55
- */
56
- public function setQuery(GetContactsSearchQuery $query)
57
- {
58
- $this->query = $query;
59
- return $this;
60
- }
61
-
62
-
63
- /**
64
- * @param GetContactsSortParams $sort
65
- * @return $this
66
- */
67
- public function setSort(GetContactsSortParams $sort)
68
- {
69
- $this->sort = $sort;
70
- return $this;
71
- }
72
-
73
-
74
- /**
75
- * @param Pagination $pagination
76
- * @return $this
77
- */
78
- public function setPagination(Pagination $pagination)
79
- {
80
- $this->pagination = $pagination;
81
- return $this;
82
- }
83
-
84
-
85
- /**
86
- * @param GetContactsFields $fields
87
- * @return $this
88
- */
89
- public function setFields(GetContactsFields $fields)
90
- {
91
- $this->fields = $fields;
92
- return $this;
93
- }
94
-
95
-
96
- /**
97
- * @return string
98
- */
99
- public function getUrl()
100
- {
101
- $extra = array_merge(
102
- $this->getPaginationParametersArray($this->pagination),
103
- $this->getFieldsParameterArray($this->fields)
104
- );
105
-
106
- return $this->buildUrlFromTemplate() . $this->buildQueryString($this->query, $this->sort, $extra);
107
- }
108
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/getresponse/sdk-php/src/Operation/Campaigns/Contacts/GetContacts/GetContactsFields.php DELETED
@@ -1,31 +0,0 @@
1
- <?php
2
- namespace Getresponse\Sdk\Operation\Campaigns\Contacts\GetContacts;
3
-
4
- use Getresponse\Sdk\Client\Operation\ValueList;
5
-
6
- class GetContactsFields extends ValueList
7
- {
8
- /**
9
- * @return array
10
- */
11
- public function getAllowedValues()
12
- {
13
- return [
14
- 'contactId',
15
- 'name',
16
- 'origin',
17
- 'timeZone',
18
- 'activities',
19
- 'changedOn',
20
- 'createdOn',
21
- 'campaign',
22
- 'email',
23
- 'dayOfCycle',
24
- 'scoring',
25
- 'engagementScore',
26
- 'href',
27
- 'note',
28
- 'ipAddress',
29
- ];
30
- }
31
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/getresponse/sdk-php/src/Operation/Campaigns/Contacts/GetContacts/GetContactsSearchQuery.php DELETED
@@ -1,53 +0,0 @@
1
- <?php
2
- namespace Getresponse\Sdk\Operation\Campaigns\Contacts\GetContacts;
3
-
4
- use Getresponse\Sdk\Client\Operation\DateRangeSearch;
5
- use Getresponse\Sdk\Client\Operation\SearchQuery;
6
-
7
- class GetContactsSearchQuery extends SearchQuery
8
- {
9
- /**
10
- * @return array
11
- */
12
- public function getAllowedKeys()
13
- {
14
- return [
15
- 'email',
16
- 'name',
17
- 'createdOn',
18
- ];
19
- }
20
-
21
-
22
- /**
23
- * @param string $email
24
- * @return $this
25
- * @throws \InvalidArgumentException
26
- */
27
- public function whereEmail($email)
28
- {
29
- return $this->set('email', $email);
30
- }
31
-
32
-
33
- /**
34
- * @param string $name
35
- * @return $this
36
- * @throws \InvalidArgumentException
37
- */
38
- public function whereName($name)
39
- {
40
- return $this->set('name', $name);
41
- }
42
-
43
-
44
- /**
45
- * @param DateRangeSearch $createdOn
46
- * @return $this
47
- * @throws \InvalidArgumentException
48
- */
49
- public function whereCreatedOn(DateRangeSearch $createdOn)
50
- {
51
- return $this->set('createdOn', $createdOn->toArray());
52
- }
53
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/getresponse/sdk-php/src/Operation/Campaigns/Contacts/GetContacts/GetContactsSortParams.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
- namespace Getresponse\Sdk\Operation\Campaigns\Contacts\GetContacts;
3
-
4
- use Getresponse\Sdk\Client\Operation\SortParams;
5
-
6
- class GetContactsSortParams extends SortParams
7
- {
8
- /**
9
- * @return array
10
- */
11
- public function getAllowedKeys()
12
- {
13
- return [
14
- 'email',
15
- 'name',
16
- 'createdOn',
17
- ];
18
- }
19
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Removals/GetCampaignStatisticsRemovals/svn-B8273ADF → Contacts/GetContacts/svn-3E59CA11} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Removals/GetCampaignStatisticsRemovals/svn-B8273AE6 → Contacts/GetContacts/svn-3E59CA18} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Subscriptions/GetCampaignStatisticsSubscriptions/svn-B827B2ED → Contacts/GetContacts/svn-3E59CA1F} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Subscriptions/GetCampaignStatisticsSubscriptions/svn-B827B2F4 → Contacts/GetContacts/svn-3E59CA26} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/CreateCampaign/CreateCampaign.php DELETED
@@ -1,73 +0,0 @@
1
- <?php
2
- namespace Getresponse\Sdk\Operation\Campaigns\CreateCampaign;
3
-
4
- use Getresponse\Sdk\Client\Exception\InvalidCommandDataException;
5
- use Getresponse\Sdk\Client\Operation\CommandOperation;
6
- use Getresponse\Sdk\Client\Operation\Operation;
7
- use Getresponse\Sdk\OperationVersionTrait;
8
- use Getresponse\Sdk\Operation\Model\NewCampaign;
9
-
10
- class CreateCampaign extends CommandOperation
11
- {
12
- use OperationVersionTrait;
13
-
14
- const METHOD_URL = '/v3/campaigns';
15
-
16
- /** @var NewCampaign */
17
- protected $data;
18
-
19
-
20
- /**
21
- * @param NewCampaign $data
22
- */
23
- public function __construct(NewCampaign $data)
24
- {
25
- $this->data = $data;
26
- }
27
-
28
-
29
- /**
30
- * @return string
31
- */
32
- public function buildUrlFromTemplate()
33
- {
34
- return self::METHOD_URL;
35
- }
36
-
37
-
38
- /**
39
- * @return string
40
- */
41
- public function getUrl()
42
- {
43
- return $this->buildUrlFromTemplate();
44
- }
45
-
46
-
47
- /**
48
- * @return string
49
- */
50
- public function getMethod()
51
- {
52
- return Operation::POST;
53
- }
54
-
55
-
56
- /**
57
- * @return string
58
- * @throws InvalidCommandDataException
59
- */
60
- public function getBody()
61
- {
62
- return $this->encode($this->data->jsonSerialize());
63
- }
64
-
65
-
66
- /**
67
- * @return int
68
- */
69
- public function getSuccessCode()
70
- {
71
- return 201;
72
- }
73
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Summary/GetCampaignStatisticsSummary/svn-B827B2FB → CreateCampaign/svn-3E59CA2D} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/GetCampaign/GetCampaign.php DELETED
@@ -1,61 +0,0 @@
1
- <?php
2
- namespace Getresponse\Sdk\Operation\Campaigns\GetCampaign;
3
-
4
- use Getresponse\Sdk\Client\Operation\QueryOperation;
5
- use Getresponse\Sdk\OperationVersionTrait;
6
-
7
- class GetCampaign extends QueryOperation
8
- {
9
- use OperationVersionTrait;
10
-
11
- const METHOD_URL = '/v3/campaigns/{campaignId}';
12
-
13
- /** @var string */
14
- private $campaignId;
15
-
16
- /** @var GetCampaignFields */
17
- private $fields;
18
-
19
-
20
- /**
21
- * @param string $campaignId
22
- */
23
- public function __construct($campaignId)
24
- {
25
- $this->campaignId = $campaignId;
26
- }
27
-
28
-
29
- /**
30
- * @return string
31
- */
32
- public function buildUrlFromTemplate()
33
- {
34
- return str_ireplace(
35
- ['{campaignId}'],
36
- [$this->campaignId],
37
- self::METHOD_URL
38
- );
39
- }
40
-
41
-
42
- /**
43
- * @param GetCampaignFields $fields
44
- * @return $this
45
- */
46
- public function setFields(GetCampaignFields $fields)
47
- {
48
- $this->fields = $fields;
49
- return $this;
50
- }
51
-
52
-
53
- /**
54
- * @return string
55
- */
56
- public function getUrl()
57
- {
58
- $extra = $this->getFieldsParameterArray($this->fields);
59
- return $this->buildUrlFromTemplate() . $this->buildQueryString(null, null, $extra);
60
- }
61
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/getresponse/sdk-php/src/Operation/Campaigns/GetCampaign/GetCampaignFields.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
- namespace Getresponse\Sdk\Operation\Campaigns\GetCampaign;
3
-
4
- use Getresponse\Sdk\Client\Operation\ValueList;
5
-
6
- class GetCampaignFields extends ValueList
7
- {
8
- /**
9
- * @return array
10
- */
11
- public function getAllowedValues()
12
- {
13
- return [
14
- 'campaignId',
15
- 'name',
16
- 'languageCode',
17
- 'isDefault',
18
- 'createdOn',
19
- 'href',
20
- 'postal',
21
- 'confirmation',
22
- 'optinTypes',
23
- 'subscriptionNotifications',
24
- 'profile',
25
- ];
26
- }
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/getresponse/sdk-php/src/Operation/Campaigns/{Statistics/Summary/GetCampaignStatisticsSummary/svn-B828AB02 → GetCampaign/svn-3E59CA34} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/{UpdateCampaign/svn-B828AB09 → GetCampaign/svn-3E59CA3B} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/GetCampaigns/GetCampaignsFields.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
- namespace Getresponse\Sdk\Operation\Campaigns\GetCampaigns;
3
-
4
- use Getresponse\Sdk\Client\Operation\ValueList;
5
-
6
- class GetCampaignsFields extends ValueList
7
- {
8
- /**
9
- * @return array
10
- */
11
- public function getAllowedValues()
12
- {
13
- return [
14
- 'description',
15
- 'campaignId',
16
- 'name',
17
- 'languageCode',
18
- 'isDefault',
19
- 'createdOn',
20
- 'href',
21
- ];
22
- }
23
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/getresponse/sdk-php/src/Operation/Campaigns/GetCampaigns/GetCampaignsSearchQuery.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
- namespace Getresponse\Sdk\Operation\Campaigns\GetCampaigns;
3
-
4
- use Getresponse\Sdk\Client\Operation\SearchQuery;
5
-
6
- class GetCampaignsSearchQuery extends SearchQuery
7
- {
8
- /**
9
- * @return array
10
- */
11
- public function getAllowedKeys()
12
- {
13
- return [
14
- 'name',
15
- 'isDefault',
16
- ];
17
- }
18
-
19
-
20
- /**
21
- * @param string $name
22
- * @return $this
23
- * @throws \InvalidArgumentException
24
- */
25
- public function whereName($name)
26
- {
27
- return $this->set('name', $name);
28
- }
29
-
30
-
31
- /**
32
- * @param string $isDefault
33
- * @return $this
34
- * @throws \InvalidArgumentException
35
- */
36
- public function whereIsDefault($isDefault)
37
- {
38
- return $this->set('isDefault', $isDefault);
39
- }
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/getresponse/sdk-php/src/Operation/{ClickTracks/GetClickTrack/svn-B828AB10 → Campaigns/GetCampaigns/svn-3E59CA42} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/{ClickTracks/GetClickTrack/svn-B828AB17 → Campaigns/GetCampaigns/svn-3E59CA49} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/{ClickTracks/GetClickTracks/svn-B828AB1E → Campaigns/GetCampaigns/svn-3E59CA50} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/{ClickTracks/GetClickTracks/svn-B828AB25 → Campaigns/GetCampaigns/svn-3E59CA57} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/{ClickTracks/GetClickTracks/svn-B828AB2C → Campaigns/Statistics/Balance/GetCampaignStatisticsBalance/svn-3E5F2A5E} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/{ClickTracks/GetClickTracks/svn-B828AB33 → Campaigns/Statistics/Balance/GetCampaignStatisticsBalance/svn-3E5F2A65} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/{Contacts/Activities/GetActivities/svn-B8292B3A → Campaigns/Statistics/ListSize/GetCampaignStatisticsListSize/svn-3E5FAA6C} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/{Contacts/Activities/GetActivities/svn-B8292B41 → Campaigns/Statistics/ListSize/GetCampaignStatisticsListSize/svn-3E5FAA73} RENAMED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Locations/GetCampaignStatisticsLocations/svn-3E5FAA7A ADDED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Locations/GetCampaignStatisticsLocations/svn-3E5FAA81 ADDED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Origins/GetCampaignStatisticsOrigins/svn-3E5FAA88 ADDED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Origins/GetCampaignStatisticsOrigins/svn-3E5FAA8F ADDED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Removals/GetCampaignStatisticsRemovals/svn-3E60A296 ADDED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Removals/GetCampaignStatisticsRemovals/svn-3E60A29D ADDED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Subscriptions/GetCampaignStatisticsSubscriptions/svn-3E60A2A4 ADDED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Subscriptions/GetCampaignStatisticsSubscriptions/svn-3E60A2AB ADDED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Summary/GetCampaignStatisticsSummary/svn-3E60A2B2 ADDED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/Statistics/Summary/GetCampaignStatisticsSummary/svn-3E60A2B9 ADDED
File without changes
vendor/getresponse/sdk-php/src/Operation/Campaigns/UpdateCampaign/svn-3E60A2C0 ADDED
File without changes
vendor/getresponse/sdk-php/src/Operation/ClickTracks/GetClickTrack/svn-3E6122C7 ADDED
File without changes
vendor/getresponse/sdk-php/src/Operation/ClickTracks/GetClickTrack/svn-3E6122CE ADDED
File without changes
vendor/getresponse/sdk-php/src/Operation/ClickTracks/GetClickTracks/svn-3E6122D5 ADDED
File without changes
vendor/getresponse/sdk-php/src/Operation/ClickTracks/GetClickTracks/svn-3E6122DC ADDED
File without changes
vendor/getresponse/sdk-php/src/Operation/ClickTracks/GetClickTracks/svn-3E6122E3 ADDED
File without changes
vendor/getresponse/sdk-php/src/Operation/ClickTracks/GetClickTracks/svn-3E6122EA ADDED
File without changes