| @@ -1,8 +1,21 @@ | ||
| 1 | 1 | <?php |
| 2 | -wp_enqueue_script('__jquery'); | |
| 3 | -wp_enqueue_script('__tagembed__custom-js', TAGEMBED_PLUGIN_URL . '/assets/js/tagembed.common.js', ['jquery'], TAGEMBED_PLUGIN_VERSION, true); | |
| 4 | -wp_enqueue_script('__script-widget-js', TAGEMBED_PLUGIN_URL . '/assets/js/widget/tagembed.widget.script.js', ['jquery'], TAGEMBED_PLUGIN_VERSION, true); | |
| 2 | +if (!defined('ABSPATH')) : | |
| 3 | + exit; | |
| 4 | +endif; | |
| 5 | +wp_enqueue_script('jquery'); | |
| 6 | +/* --Start-- DOMPurify : Third Party HTML Sanitizer. Loaded only on this plugin's own screen. */ | |
| 7 | +wp_enqueue_script('__tagembed__domPurifyJs', TAGEMBED_PLUGIN_URL . '/assets/js/vendor/purify.js', [], '3.4.13', true); | |
| 8 | +/* DOMPurify 3.4.13. Official release, used unmodified and byte for byte | |
| 9 | + identical to https://github.com/cure53/DOMPurify/blob/3.4.13/dist/purify.js | |
| 10 | + The sanitizer is a UMD bundle. If another plugin has left an AMD or CommonJS loader on | |
| 11 | + the page, the bundle would register there instead of on window, so those globals are | |
| 12 | + hidden for the moment it runs and restored immediately afterwards. */ | |
| 13 | +wp_add_inline_script('__tagembed__domPurifyJs', '(function(w){w.__tagembed__umd={d:w.define,m:w.module,e:w.exports};try{delete w.define;delete w.module;delete w.exports;}catch(e){w.define=undefined;w.module=undefined;w.exports=undefined;}})(window);', 'before'); | |
| 14 | +wp_add_inline_script('__tagembed__domPurifyJs', '(function(w){w.__tagembed__DOMPurify=w.DOMPurify;var s=w.__tagembed__umd;if(s){if(s.d!==undefined){w.define=s.d;}if(s.m!==undefined){w.module=s.m;}if(s.e!==undefined){w.exports=s.e;}delete w.__tagembed__umd;}})(window);', 'after'); | |
| 15 | +/* --End-- DOMPurify */ | |
| 16 | +wp_enqueue_script('__tagembed__custom-js', TAGEMBED_PLUGIN_URL . '/assets/js/tagembed.common.js', ['jquery', 'wp-escape-html', '__tagembed__domPurifyJs'], TAGEMBED_PLUGIN_VERSION, true); | |
| 17 | +wp_enqueue_script('__tagembed__script-widget-js', TAGEMBED_PLUGIN_URL . '/assets/js/widget/tagembed.widget.script.js', ['jquery'], TAGEMBED_PLUGIN_VERSION, true); | |
| 5 | 18 | $__tagembed__account_page = true; /* Use : Check User Token Valid Or Not */ |
| 6 | 19 | $__tagembed__user_details = ___tagembed__user(); |
| 7 | 20 | $__tagembed__active_widget_user_id = ___tagembed__activeWidgetUser(); |
| 8 | 21 | $__tagembed__active_widget_user_name = !empty($__tagembed__user_details->name) ? $__tagembed__user_details->name : ''; |
| @@ -15,15 +28,15 @@ | ||
| 15 | 28 | $__tagembed__widgets_count = count($__tagembed__widgets); /* Use In Next And Back Button */ |
| 16 | 29 | /* $__tagembed__collaborators = __tagembed__collaborator($__tagembed__user_details->userId); */ |
| 17 | 30 | ?> |
| 18 | 31 | <script type="text/javascript"> |
| 19 | - var __tagembed__ajax_call_nones = "<?php echo esc_html(wp_create_nonce('__tagembed__ajax_call_security_nones')); ?>"; | |
| 20 | - var __tagembed__ajax_url = "<?php echo esc_html(admin_url('admin-ajax.php')); ?>"; | |
| 21 | - var __tagembed__plugin_server_url = "<?php echo esc_html(TAGEMBED_PLUGIN_SERVER_URL); ?>"; | |
| 32 | + var __tagembed__ajax_call_nones = <?php echo wp_json_encode((string) wp_create_nonce('__tagembed__ajax_call_security_nones')); ?>; | |
| 33 | + var __tagembed__ajax_url = <?php echo wp_json_encode((string) admin_url('admin-ajax.php')); ?>; | |
| 34 | + var __tagembed__plugin_server_url = <?php echo wp_json_encode((string) TAGEMBED_PLUGIN_SERVER_URL); ?>; | |
| 22 | 35 | var __tagembed__network_already_exist_auth = []; |
| 23 | - var __tagembed__plugin_url_for_js = "<?php echo esc_html(TAGEMBED_PLUGIN_URL); ?>"; | |
| 24 | - var __tagembed__plugin_react_url = "<?php echo esc_html(TAGEMBED_PLUGIN_REACT_URL); ?>"; | |
| 25 | - var __tagembed__user_id = "<?php echo esc_html(!empty($__tagembed__user_details->userId) ? $__tagembed__user_details->userId : ''); ?>"; | |
| 36 | + var __tagembed__plugin_url_for_js = <?php echo wp_json_encode((string) TAGEMBED_PLUGIN_URL); ?>; | |
| 37 | + var __tagembed__plugin_react_url = <?php echo wp_json_encode((string) TAGEMBED_PLUGIN_REACT_URL); ?>; | |
| 38 | + var __tagembed__user_id = <?php echo wp_json_encode(!empty($__tagembed__user_details->userId) ? (string) $__tagembed__user_details->userId : ''); ?>; | |
| 26 | 39 | </script> |
| 27 | 40 | <!--Start--Check User Access Token--> |
| 28 | 41 | <?php if (!empty($__tagembed__user_details)) : ?> |
| 29 | 42 | <script> |
| @@ -32,9 +45,9 @@ | ||
| 32 | 45 | function __tagembed__check_user_token() { |
| 33 | 46 | let __tagembed__toast = new TagembedToast; |
| 34 | 47 | __tagembed__open_loader(); |
| 35 | 48 | let formData = new FormData(); |
| 36 | - formData.append('action', 'data'); | |
| 49 | + formData.append('action', 'tagembed_data'); | |
| 37 | 50 | formData.append('__tagembed__ajax_call_nones', __tagembed__ajax_call_nones); |
| 38 | 51 | formData.append('__tagembed__ajax_action', '__tagembed__check_user_token'); |
| 39 | 52 | fetch(__tagembed__ajax_url, { |
| 40 | 53 | method: 'POST', |
| @@ -81,9 +94,9 @@ | ||
| 81 | 94 | async function __tagembed__upgradePlan() { |
| 82 | 95 | let overlay = document.querySelector("#__tagembed__upgrade_plan_overlay"); |
| 83 | 96 | if (overlay) overlay.style.display = 'block'; |
| 84 | 97 | let formData = new FormData(); |
| 85 | - formData.append('action', 'data'); | |
| 98 | + formData.append('action', 'tagembed_data'); | |
| 86 | 99 | formData.append('__tagembed__ajax_call_nones', __tagembed__ajax_call_nones); |
| 87 | 100 | formData.append('__tagembed__ajax_action', '__tagembed__check_plan_premium_feature'); |
| 88 | 101 | __tagembed__open_loader(); |
| 89 | 102 | let toast = new TagembedToast(); |
| @@ -113,9 +126,9 @@ | ||
| 113 | 126 | <hr class="__tagembed__horizontaborder"> |
| 114 | 127 | <div class="__tagembed__formwbody"> |
| 115 | 128 | <div class="__tagembed__formwrow"> |
| 116 | 129 | <p> |
| 117 | - You've created a <strong>LinkedIn feed</strong>, which is not available in your free plan. | |
| 130 | + You've created a <strong>premium feed</strong>, which is not available in your free plan. | |
| 118 | 131 | To continue displaying content from this network, please upgrade your plan. |
| 119 | 132 | </p> |
| 120 | 133 | </div> |
| 121 | 134 | </div> |
| @@ -127,9 +140,9 @@ | ||
| 127 | 140 | <div style="background:#fdecee; border-top:1px solid #c3c4c7; padding:14px 18px; display:flex; justify-content:space-between; align-items:center;"> |
| 128 | 141 | <div style="display:flex; flex-direction:column;"> |
| 129 | 142 | <span style="font-size:16px; font-weight:700;">Prefer Not to Upgrade?</span> |
| 130 | 143 | <span style="font-size:14px;"> |
| 131 | - You can delete the (<span style="color:#6f42c1;">LinkedIn</span>) feed and choose a network included in the free plan. | |
| 144 | + You can delete the (<span style="color:#6f42c1;"> Premium Network </span>) feed and choose a network included in the free plan. | |
| 132 | 145 | </span> |
| 133 | 146 | </div> |
| 134 | 147 | <button onclick="__tagembed__menus('2')" |
| 135 | 148 | style="background:#ffffff; border:1px solid #dcdcdc; padding:8px 16px; cursor:pointer;"> |