PluginProbe
Tagembed: Social Media Feeds and Customer Reviews Widget / 7.8
Tagembed: Social Media Feeds and Customer Reviews Widget v7.8
7.8 7.5 7.6 7.7 7.4 trunk 3.10 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 All 43 releases
← All changes | views/includes/footerView.php +267 -149 5.17.8 View file →
@@ -1,78 +1,187 @@
1 -<?php if ($__tagembed__chat_script): ?>
2 - <!--Start-- Tagembed Chat Script -->
3 - <script type="text/javascript">
4 - /*--Start-- Manage Intercom Chat And Setting Data */
5 - window.addEventListener ? window.addEventListener("load", __tagembed__getAndManageIntercomSetting, false) : window.attachEvent && window.attachEvent("onload", __tagembed__getAndManageIntercomSetting);
6 - function __tagembed__getAndManageIntercomSetting() {
7 - let formData = new FormData();
8 - formData.append('action', 'data');
9 - formData.append('__tagembed__ajax_call_nones', __tagembed__ajax_call_nones);
10 - formData.append('__tagembed__ajax_action', '__tagembed__get_and_manage_intercom_chat_setting');
11 - fetch(__tagembed__ajax_url, {method: 'POST', headers: {'x-requested-with': 'XMLHttpRequest'}, body: formData,
12 - }).then(response => {
13 - return response.json();
14 - }).then(response => {
15 - if (response.status == true) {
16 - /*--Start--Manage Intercom Setting Data*/
17 - window.intercomSettings = {
18 - api_base: "https://api-iam.intercom.io",
19 - app_id: "t8e1b7uq",
20 - email: response.data.email,
21 - user_id: response.data.userId,
22 - user_hash: response.data.userHash,
23 - billing_email: response.data.billingEmail,
24 - name: response.data.name,
25 - created_at: response.data.created,
26 - user_type: response.data.type,
27 - plan: response.data.plan,
28 - active_plan: response.data.activePlan,
29 - product: response.data.product,
30 - active_product: response.data.activeProduct
31 - };
32 - /*--End--Manage Intercom Setting Data*/
33 - /*--Start--Manage Intercom Calling Script*/
34 - var w = window;
35 - var ic = w.Intercom;
36 - if (typeof ic === "function") {
37 - ic('reattach_activator');
38 - ic('update', w.intercomSettings);
39 - } else {
40 - var d = document;
41 - var i = function () {
42 - i.c(arguments);
43 - };
44 - i.q = [];
45 - i.c = function (args) {
46 - i.q.push(args);
47 - };
48 - w.Intercom = i;
49 - var l = function () {
50 - var s = d.createElement('script');
51 - s.type = 'text/javascript';
52 - s.async = true;
53 - s.src = 'https://widget.intercom.io/widget/t8e1b7uq';
54 - var x = d.getElementsByTagName('script')[0];
55 - x.parentNode.insertBefore(s, x);
56 - };
57 - if (document.readyState === 'complete') {
58 - l();
59 - } else if (w.attachEvent) {
60 - w.attachEvent('onload', l);
61 - } else {
62 - w.addEventListener('load', l, false);
63 - }
64 - }
65 - /*--End--Manage Intercom Calling Script*/
66 - }
67 - }).catch((error) => {
68 - console.log(error);
69 - });
70 - }
71 - /*--End-- Manage Intercom Chat And Setting Data */
72 - </script>
1 +<?php
2 +if (!defined('ABSPATH')) :
3 + exit;
4 +endif;
5 +?>
6 +<!--Start-- Upgrade Plan Overlay And Message-->
7 +<div id="__tagembed__upgrade_plan_overlay" style="position:fixed;width:100%;height:100%;background:rgba(0,0,0,0.1);z-index:999;display:none;"></div>
8 +<div id="__tagembed__plan_upgrade_message" class="__tagembed__plan_upgrade_message"></div>
9 +<!--End-- Upgrade Plan Overlay And Message-->
10 +
11 +<!--Start-- Call Tagembed Chat And Plugin Version Script After Login And Register-->
12 +<?php if (!empty($__tagembed__user_details)) : ?>
13 + <script type="text/javascript">
14 + /*--Start-- Manage Intercom Chat And Setting Data */
15 + window.addEventListener ? window.addEventListener("load", __tagembed__getAndManageIntercomSetting, false) : window.attachEvent && window.attachEvent("onload", __tagembed__getAndManageIntercomSetting);
16 +
17 + function __tagembed__getAndManageIntercomSetting() {
18 + let formData = new FormData();
19 + formData.append('action', 'tagembed_data');
20 + formData.append('__tagembed__ajax_call_nones', __tagembed__ajax_call_nones);
21 + formData.append('__tagembed__ajax_action', '__tagembed__get_and_manage_intercom_chat_setting');
22 + fetch(__tagembed__ajax_url, {
23 + method: 'POST',
24 + headers: {
25 + 'x-requested-with': 'XMLHttpRequest'
26 + },
27 + body: formData,
28 + }).then(response => {
29 + return response.json();
30 + }).then(response => {
31 + if (response.status == true) {
32 + /*--Start--Manage Intercom Setting Data*/
33 + window.intercomSettings = {
34 + api_base: "https://api-iam.intercom.io",
35 + app_id: "veiaqij8",
36 + email: response.data.email,
37 + user_id: response.data.userId,
38 + user_hash: response.data.userHash,
39 + name: response.data.name,
40 + };
41 + /*--End--Manage Intercom Setting Data*/
42 + /*--Start--Manage Intercom Calling Script*/
43 + var w = window;
44 + var ic = w.Intercom;
45 + if (typeof ic === "function") {
46 + ic('reattach_activator');
47 + ic('update', w.intercomSettings);
48 + } else {
49 + var d = document;
50 + var i = function() {
51 + i.c(arguments);
52 + };
53 + i.q = [];
54 + i.c = function(args) {
55 + i.q.push(args);
56 + };
57 + w.Intercom = i;
58 + var l = function() {
59 + var s = d.createElement('script');
60 + s.type = 'text/javascript';
61 + s.async = true;
62 + s.src = 'https://widget.intercom.io/widget/veiaqij8';
63 + var x = d.getElementsByTagName('script')[0];
64 + x.parentNode.insertBefore(s, x);
65 + };
66 + if (document.readyState === 'complete') {
67 + l();
68 + } else if (w.attachEvent) {
69 + w.attachEvent('onload', l);
70 + } else {
71 + w.addEventListener('load', l, false);
72 + }
73 + }
74 + /*--End--Manage Intercom Calling Script*/
75 + }
76 + }).catch((error) => {
77 + console.log(error);
78 + });
79 + }
80 + /*--Start-- Open Intercom Chat*/
81 + document.addEventListener('click', function(e) {
82 + if (e.target.closest('.__tagembed__intercom_chat_btn')) {
83 + e.preventDefault();
84 + if (typeof window.Intercom === "function") {
85 + window.Intercom('show');
86 + } else {
87 + console.log('Intercom not loaded yet');
88 + }
89 + }
90 + });
91 + /*--End-- Open Intercom Chat*/
92 + /*--End-- Manage Intercom Chat And Setting Data */
93 + /*--Start-- Manage Hide And Show plugin Upgrade Message*/
94 + window.addEventListener ? window.addEventListener("load", __tagembed__plugin_version, false) : window.attachEvent && window.attachEvent("onload", __tagembed__plugin_version);
95 +
96 + function __tagembed__plugin_version() {
97 + let __tagembed__toast = new TagembedToast;
98 + let formData = new FormData();
99 + formData.append('action', 'tagembed_data');
100 + formData.append('__tagembed__ajax_call_nones', __tagembed__ajax_call_nones);
101 + formData.append('__tagembed__ajax_action', '__tagembed__plugin_version');
102 + fetch(__tagembed__ajax_url, {
103 + method: 'POST',
104 + headers: {
105 + 'x-requested-with': 'XMLHttpRequest',
106 + },
107 + body: formData,
108 + }).then(response => {
109 + return response.json()
110 + }).then(response => {
111 + if (response.status == true) {
112 + if (response.data.installedPluginVersion != response.data.livePluginVersion) {
113 + /* Built with DOM methods : the version string and the upgrade URL are
114 + assigned as a text node and an attribute, never as markup. */
115 + let popupWrap = document.createElement("div");
116 + popupWrap.className = "__tagembed__popupwrap __tagembed__popup_md";
117 + let closeBtn = document.createElement("button");
118 + closeBtn.setAttribute("type", "button");
119 + closeBtn.className = "__tagembed__closebtn";
120 + closeBtn.addEventListener("click", __tagembed__hide_plugin_upgrade_message);
121 + let popupInn = document.createElement("div");
122 + popupInn.className = "__tagembed__popupinn";
123 + let header = document.createElement("div");
124 + header.className = "__tagembed__header";
125 + let heading = document.createElement("h2");
126 + heading.textContent = "Update Plugin For Free";
127 + header.appendChild(heading);
128 + let horizontalBorder = document.createElement("hr");
129 + horizontalBorder.className = "__tagembed__horizontaborder";
130 + let formBody = document.createElement("div");
131 + formBody.className = "__tagembed__formwbody";
132 + let formRow = document.createElement("div");
133 + formRow.className = "__tagembed__formwrow";
134 + let note = document.createElement("p");
135 + let noteLabel = document.createElement("strong");
136 + noteLabel.textContent = " Note : ";
137 + let versionLabel = document.createElement("strong");
138 + versionLabel.textContent = " " + response.data.livePluginVersion + " ";
139 + note.appendChild(noteLabel);
140 + note.appendChild(document.createTextNode(" There is a new version of Tagembed Widget available. "));
141 + note.appendChild(versionLabel);
142 + note.appendChild(document.createTextNode(" is a recommended Update For Performance Improvements. "));
143 + formRow.appendChild(note);
144 + formBody.appendChild(formRow);
145 + let btnWrap = document.createElement("div");
146 + btnWrap.className = "__tagembed__btnwrap text-center";
147 + let updateLink = document.createElement("a");
148 + updateLink.setAttribute("style", "background: #d63638;");
149 + updateLink.setAttribute("href", response.data.pluginUpgradeURL);
150 + updateLink.className = "__tagembed__okaybtn";
151 + updateLink.textContent = "Update Plugin";
152 + btnWrap.appendChild(updateLink);
153 + popupInn.appendChild(header);
154 + popupInn.appendChild(horizontalBorder);
155 + popupInn.appendChild(formBody);
156 + popupInn.appendChild(btnWrap);
157 + popupWrap.appendChild(closeBtn);
158 + popupWrap.appendChild(popupInn);
159 + document.getElementById("__tagembed__plugin_upgrade_message").replaceChildren(popupWrap);
160 + }
161 + } else {
162 + __tagembed__toast.danger({
163 + message: "Something went wrong. Please try after sometime",
164 + position: '__tagembed__is-top-right'
165 + });
166 + }
167 + }).catch((error) => {
168 + console.log(error);
169 + __tagembed__toast.danger({
170 + message: "Something went wrong. Please try after sometime",
171 + position: '__tagembed__is-top-right'
172 + });
173 + });
174 + }
175 +
176 + function __tagembed__hide_plugin_upgrade_message() {
177 + let __tagembed__plugin_upgrade_message = document.querySelector("#__tagembed__plugin_upgrade_message")
178 + __tagembed__plugin_upgrade_message.style.display = "none";
179 + }
180 + /*--End-- Manage Hide And Show plugin Upgrade Message*/
181 + </script>
73 182 <?php endif; ?>
74 -<!--End-- Tagembed Chat Script -->
183 +<!--End-- Call Tagembed Chat And Plugin Version Script After Login And Register-->
75 184 </div>
76 185 </div>
77 186 <!--Start-- Manage Next And Back Button On All Pages -->
78 187 <div id="__tagembed__next_and_back_link_main_section"></div>
@@ -79,83 +188,92 @@
79 188 <!--End-- Manage Next And Back Button On All Pages -->
80 189 </div>
81 190 </div>
82 191 <!-- Other Default WordPress Css -->
83 -<style> #footer-thankyou {font-style: normal !important;}</style>
84 -<?php if ($__tagembed__active_menue_id != 4): ?>
85 - <style> body{min-height: auto!important;} </style>
192 +<style>
193 + #footer-thankyou {
194 + font-style: normal !important;
195 + }
196 +</style>
197 +<?php if (4 != $__tagembed__active_menue_id) : ?>
198 + <style>
199 + body {
200 + min-height: auto !important;
201 + }
202 + </style>
86 203 <?php endif; ?>
87 -<?php if ($__tagembed__active_menue_id == 6): ?>
88 - <script>
89 - /*--Start-- Manage Embed Accordion Section*/
90 - let __tagembed__accordionItem = document.getElementsByClassName('__tagembed__accordionItem');
91 - let __tagembed__accordionItemHeading = document.getElementsByClassName('__tagembed__accordionItemHeading');
92 - for (i = 0; i < __tagembed__accordionItemHeading.length; i++)
93 - __tagembed__accordionItemHeading[i].addEventListener('click', __tagembed__toggleAccodionSection, false);
94 - function __tagembed__toggleAccodionSection() {
95 - let __tagembed__accordionSectionClass = this.parentNode.className;
96 - for (i = 0; i < __tagembed__accordionItem.length; i++)
97 - __tagembed__accordionItem[i].className = '__tagembed__accordionItem __tagembed__close';
98 - if (__tagembed__accordionSectionClass == '__tagembed__accordionItem __tagembed__close')
99 - this.parentNode.className = '__tagembed__accordionItem __tagembed__open';
100 - }
101 - /*--End-- Manage Embed Accordion Section*/
102 - </script>
204 +<?php if (6 == $__tagembed__active_menue_id) : ?>
205 + <script>
206 + /*--Start-- Manage Embed Accordion Section*/
207 + let __tagembed__accordionItem = document.getElementsByClassName('__tagembed__accordionItem');
208 + let __tagembed__accordionItemHeading = document.getElementsByClassName('__tagembed__accordionItemHeading');
209 + for (i = 0; i < __tagembed__accordionItemHeading.length; i++)
210 + __tagembed__accordionItemHeading[i].addEventListener('click', __tagembed__toggleAccodionSection, false);
211 +
212 + function __tagembed__toggleAccodionSection() {
213 + let __tagembed__accordionSectionClass = this.parentNode.className;
214 + for (i = 0; i < __tagembed__accordionItem.length; i++)
215 + __tagembed__accordionItem[i].className = '__tagembed__accordionItem __tagembed__close';
216 + if (__tagembed__accordionSectionClass == '__tagembed__accordionItem __tagembed__close')
217 + this.parentNode.className = '__tagembed__accordionItem __tagembed__open';
218 + }
219 + /*--End-- Manage Embed Accordion Section*/
220 + </script>
103 221 <?php endif; ?>
104 222 <script>
105 - /*--Start-- Manage And Generate Next And Back Link In Footer*/
106 - function __tagembed__manageNextAndBackButon() {
107 - let __tagembed__nextLink = null;
108 - let __tagembed__backLink = null;
109 - let __tagembed__nextAndBackLinkHtml = "";
110 - let __tagembed__next_and_back_link_main_section = document.querySelector("#__tagembed__next_and_back_link_main_section");
111 - __tagembed__next_and_back_link_main_section.innerHTML = "";
112 - let __tagembed__nextAndBackLinkSectionStyle = "block";
113 - let __tagembed__widgets_count = "<?php echo esc_html($__tagembed__widgets_count); ?>";
114 - let __tagembed__active_menue_id = "<?php echo esc_html($__tagembed__active_menue_id); ?>";
115 - if (__tagembed__widgets_count == 0) {
116 - __tagembed__nextAndBackLinkSectionStyle = "none";
117 - }
118 - switch (__tagembed__active_menue_id) {
119 - case "1" :
120 - __tagembed__nextLink = "2";
121 - __tagembed__backLink = null;
122 - break;
123 - case "2" :
124 - __tagembed__nextLink = "3";
125 - __tagembed__backLink = "1";
126 - __tagembed__nextAndBackLinkSectionStyle = "none"; /* Show In tagembed.feed.script.js */
127 - break;
128 - case "3" :
129 - __tagembed__nextLink = "4";
130 - __tagembed__backLink = "2";
131 - break;
132 - case "4" :
133 - __tagembed__nextLink = "5";
134 - __tagembed__backLink = "3";
135 - break;
136 - case "5" :
137 - __tagembed__nextLink = "6";
138 - __tagembed__backLink = "4";
139 - break;
140 - case "6" :
141 - __tagembed__nextLink = null;
142 - __tagembed__backLink = "5";
143 - break;
144 - }
145 - /* Manage Next And Back */
146 - if (__tagembed__nextLink != null || __tagembed__backLink != null) {
147 - __tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}<div class="__tagembed__foot_nextprevious" id="__tagembed__next_and_back_link_section" style="display:${__tagembed__nextAndBackLinkSectionStyle}">`;
148 - __tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}<div class="__tagembed__footnp_inn">`;
149 - if (__tagembed__backLink != null) {
150 - __tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}<button class="__tagembed__btn __tagembed__backbtn" onclick="__tagembed__menus(${__tagembed__backLink});"> <i class="fas fa-angle-left"></i> Back </button>`;
151 - }
152 - if (__tagembed__nextLink != null) {
153 - __tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}<button class="__tagembed__btn" onclick="__tagembed__menus(${__tagembed__nextLink});">Next <i class="fas fa-angle-right"></i> </button>`;
154 - }
155 - __tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}</div></div>`;
156 - __tagembed__next_and_back_link_main_section.innerHTML = __tagembed__nextAndBackLinkHtml;
157 - }
158 - }
159 - window.onload = __tagembed__manageNextAndBackButon();
160 - /*--End-- Manage And Generate Next And Back Link In Footer*/
161 -</script>
223 + /*--Start-- Manage And Generate Next And Back Link In Footer*/
224 + function __tagembed__manageNextAndBackButon() {
225 + let __tagembed__nextLink = null;
226 + let __tagembed__backLink = null;
227 + let __tagembed__nextAndBackLinkHtml = "";
228 + let __tagembed__next_and_back_link_main_section = document.querySelector("#__tagembed__next_and_back_link_main_section");
229 + __tagembed__next_and_back_link_main_section.innerHTML = "";
230 + let __tagembed__nextAndBackLinkSectionStyle = "block";
231 + let __tagembed__widgets_count = <?php echo wp_json_encode((string) $__tagembed__widgets_count); ?>;
232 + let __tagembed__active_menue_id = <?php echo wp_json_encode((string) $__tagembed__active_menue_id); ?>;
233 + if (__tagembed__widgets_count == 0) {
234 + __tagembed__nextAndBackLinkSectionStyle = "none";
235 + }
236 + switch (__tagembed__active_menue_id) {
237 + case "1":
238 + __tagembed__nextLink = "2";
239 + __tagembed__backLink = null;
240 + break;
241 + case "2":
242 + __tagembed__nextLink = "3";
243 + __tagembed__backLink = "1";
244 + __tagembed__nextAndBackLinkSectionStyle = "none"; /* Show In tagembed.feed.script.js */
245 + break;
246 + case "3":
247 + __tagembed__nextLink = "4";
248 + __tagembed__backLink = "2";
249 + break;
250 + case "4":
251 + __tagembed__nextLink = "5";
252 + __tagembed__backLink = "3";
253 + break;
254 + case "5":
255 + __tagembed__nextLink = "6";
256 + __tagembed__backLink = "4";
257 + break;
258 + case "6":
259 + __tagembed__nextLink = null;
260 + __tagembed__backLink = "5";
261 + break;
262 + }
263 + /* Manage Next And Back */
264 + if (__tagembed__nextLink != null || __tagembed__backLink != null) {
265 + __tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}<div class="__tagembed__foot_nextprevious" id="__tagembed__next_and_back_link_section" style="display:${__tagembed__nextAndBackLinkSectionStyle}">`;
266 + __tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}<div class="__tagembed__footnp_inn">`;
267 + if (__tagembed__backLink != null) {
268 + __tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}<button class="__tagembed__btn __tagembed__backbtn" onclick="__tagembed__menus(${__tagembed__backLink});"> <i class="fas fa-angle-left"></i> Back </button>`;
269 + }
270 + if (__tagembed__nextLink != null) {
271 + __tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}<button class="__tagembed__btn" onclick="__tagembed__menus(${__tagembed__nextLink});">Next <i class="fas fa-angle-right"></i> </button>`;
272 + }
273 + __tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}</div></div>`;
274 + __tagembed__next_and_back_link_main_section.innerHTML = __tagembed__nextAndBackLinkHtml;
275 + }
276 + }
277 + window.onload = __tagembed__manageNextAndBackButon();
278 + /*--End-- Manage And Generate Next And Back Link In Footer*/
279 +</script>