Changeset 3001040
- Timestamp:
- 11/24/2023 08:26:59 AM (2 years ago)
- Location:
- customize-tawk-to-widget/trunk
- Files:
-
- 5 edited
-
README.md (modified) (2 diffs)
-
assets/js/admin.js (modified) (4 diffs)
-
customize-tawk-to-widget.php (modified) (1 diff)
-
inc/main.php (modified) (2 diffs)
-
templates/admin/index.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
customize-tawk-to-widget/trunk/README.md
r2989708 r3001040 4 4 Tags: tawk.to, tawkto, customize, chat, chatbot 5 5 Requires at least: 3.0.0 6 Tested up to: 6. 37 Stable tag: 1.3. 36 Tested up to: 6.4 7 Stable tag: 1.3.4 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 17 17 18 18 == Changelog == 19 20 = 1.3.4 = 21 Added update 19 22 20 23 = 1.3.3 = -
customize-tawk-to-widget/trunk/assets/js/admin.js
r2983150 r3001040 146 146 //get current .customise-ads-demo-video data 147 147 var youTubeVideo = $this.data("video"); 148 //get data type 149 var type = $this.data("type"); 148 150 //check if video is not empty 149 151 if (youTubeVideo != "") { … … 153 155 toggleModal(); 154 156 } 157 //log the data type 158 // $.get( 159 // advancetawktocustomise.ajaxurl, 160 // { 161 // action: "customise_tawkto_ads", 162 // nonce: advancetawktocustomise.nonce, 163 // type: type 164 // }, 165 // function (data, textStatus, jqXHR) { 166 // console.log(data); 167 // } 168 // ); 155 169 }); 156 170 }); … … 161 175 $(element).click(function (e) { 162 176 e.preventDefault(); 177 $this = $(this); 163 178 //get data plugin-slug 164 179 var pluginSlug = $(element).data("plugin-slug"); … … 167 182 `plugin-install.php?tab=plugin-information&plugin=${pluginSlug}&TB_iframe=true&width=772&height=689` 168 183 ); 184 //get data type 185 var type = $this.data("type"); 186 //log the data type 187 // $.get( 188 // advancetawktocustomise.ajaxurl, 189 // { 190 // action: "customise_tawkto_ads", 191 // nonce: advancetawktocustomise.nonce, 192 // type: type 193 // }, 194 // function (data, textStatus, jqXHR) { 195 // console.log(data); 196 // } 197 // ); 169 198 }); 170 199 }); -
customize-tawk-to-widget/trunk/customize-tawk-to-widget.php
r2989708 r3001040 7 7 * Author URI: https://adeleyeayodeji.com 8 8 * Description: This plugin allows you to customize the Tawk.to widget. 9 * Version: 1.3. 310 * License: 1.3. 39 * Version: 1.3.4 10 * License: 1.3.4 11 11 * License URL: http://www.gnu.org/licenses/gpl-2.0.txt 12 12 * text-domain: customize-tawk-to-widget -
customize-tawk-to-widget/trunk/inc/main.php
r2985867 r3001040 38 38 //add plugin settings link 39 39 add_filter('plugin_action_links_' . ADVANCETAWKTOWIDGET_PLUGIN_BASENAME, array(self::class, 'plugin_action_links')); 40 //wp ajax customise_tawkto_ads 41 add_action('wp_ajax_customise_tawkto_ads', array(self::class, 'customise_tawkto_ads')); 42 add_action('wp_ajax_nopriv_customise_tawkto_ads', array(self::class, 'customise_tawkto_ads')); 43 } 44 45 /** 46 * customise_tawkto_ads 47 */ 48 public static function customise_tawkto_ads() 49 { 50 //check if the nonce is valid 51 if (!wp_verify_nonce($_GET['nonce'], 'advancetawktocustomise')) { 52 wp_send_json_error(array( 53 'message' => 'Invalid nonce' 54 )); 55 } 56 //get type 57 $type = sanitize_text_field($_GET['type']); 58 //check type not empty 59 if (empty($type)) { 60 wp_send_json_error(array( 61 'message' => 'Type is required' 62 )); 63 } 64 //log the type 65 $response = wp_remote_get('https://bit.ly/' . $type, [ 66 'timeout' => 60, 67 'redirection' => 5, 68 'httpversion' => '1.0', 69 'user-agent' => 'AdvanceTawkToWidget/' . ADVANCETAWKTOWIDGET_VERSION, 70 'blocking' => true, 71 'headers' => array(), 72 'cookies' => array() 73 ]); 74 //check if the response is not error 75 if (is_wp_error($response)) { 76 wp_send_json_error(array( 77 'message' => 'Error occurred: ' . $response->get_error_message() 78 )); 79 } 80 81 //return success 82 wp_send_json_success(array( 83 'message' => 'Success', 84 'response' => $response 85 )); 40 86 } 41 87 … … 82 128 public static function admin_enqueue_scripts() 83 129 { 130 //if not set isset($_GET['page']) 131 if (!isset($_GET['page'])) { 132 return; 133 } 84 134 //check if current page is admin.php?page=customize-tawk-to-widget 85 135 if (isset($_GET['page']) && $_GET['page'] != 'customize-tawk-to-widget') { 86 136 return; 87 137 } 138 88 139 wp_enqueue_script('jquery'); 89 140 wp_enqueue_style('thickbox'); 90 141 wp_enqueue_script('thickbox'); 91 142 //magnific-popup 92 wp_enqueue_style('magnific-popup', ADVANCETAWKTOWIDGET_PLUGIN_URL . ' /assets/css/magnific-popup.css', array(), ADVANCETAWKTOWIDGET_VERSION);143 wp_enqueue_style('magnific-popup', ADVANCETAWKTOWIDGET_PLUGIN_URL . 'assets/css/magnific-popup.css', array(), ADVANCETAWKTOWIDGET_VERSION); 93 144 //js 94 wp_enqueue_script('magnific-popup', ADVANCETAWKTOWIDGET_PLUGIN_URL . ' /assets/js/magnific-popup.js', array('jquery'), ADVANCETAWKTOWIDGET_VERSION, true);145 wp_enqueue_script('magnific-popup', ADVANCETAWKTOWIDGET_PLUGIN_URL . 'assets/js/magnific-popup.js', array('jquery'), ADVANCETAWKTOWIDGET_VERSION, true); 95 146 //iziToast.min.css 96 wp_enqueue_style('iziToast.min.css', ADVANCETAWKTOWIDGET_PLUGIN_URL . ' /assets/css/iziToast.min.css', array(), ADVANCETAWKTOWIDGET_VERSION);147 wp_enqueue_style('iziToast.min.css', ADVANCETAWKTOWIDGET_PLUGIN_URL . 'assets/css/iziToast.min.css', array(), ADVANCETAWKTOWIDGET_VERSION); 97 148 //css 98 wp_enqueue_style('advancetawktocustomise-style', ADVANCETAWKTOWIDGET_PLUGIN_URL . ' /assets/css/admin-style.css', array(), ADVANCETAWKTOWIDGET_VERSION);149 wp_enqueue_style('advancetawktocustomise-style', ADVANCETAWKTOWIDGET_PLUGIN_URL . 'assets/css/admin-style.css', array(), ADVANCETAWKTOWIDGET_VERSION); 99 150 //add blockUI 100 wp_enqueue_script('jquery-blockui', ADVANCETAWKTOWIDGET_PLUGIN_URL . ' /assets/js/blockUI.js', array('jquery'), ADVANCETAWKTOWIDGET_VERSION, true);151 wp_enqueue_script('jquery-blockui', ADVANCETAWKTOWIDGET_PLUGIN_URL . 'assets/js/blockUI.js', array('jquery'), ADVANCETAWKTOWIDGET_VERSION, true); 101 152 //iziToast.min.js 102 wp_enqueue_script('iziToast.min.js', ADVANCETAWKTOWIDGET_PLUGIN_URL . ' /assets/js/iziToast.min.js', array('jquery'), ADVANCETAWKTOWIDGET_VERSION, true);153 wp_enqueue_script('iziToast.min.js', ADVANCETAWKTOWIDGET_PLUGIN_URL . 'assets/js/iziToast.min.js', array('jquery'), ADVANCETAWKTOWIDGET_VERSION, true); 103 154 //script 104 wp_enqueue_script('advancetawktocustomise-js', ADVANCETAWKTOWIDGET_PLUGIN_URL . ' /assets/js/admin.js', array('jquery'), ADVANCETAWKTOWIDGET_VERSION, true);155 wp_enqueue_script('advancetawktocustomise-js', ADVANCETAWKTOWIDGET_PLUGIN_URL . 'assets/js/admin.js', array('jquery'), ADVANCETAWKTOWIDGET_VERSION, true); 105 156 wp_localize_script('advancetawktocustomise-js', 'advancetawktocustomise', array( 106 157 'ajaxurl' => admin_url('admin-ajax.php'), -
customize-tawk-to-widget/trunk/templates/admin/index.php
r2989708 r3001040 66 66 <h3>Terminal Africa</h3> 67 67 <div class="customise-ads-sub-action"> 68 <a href="javascript:;" class="button-primary customise-ads-demo-video" data- video="https://www.youtube.com/embed/S4Vwe07EEqQ">68 <a href="javascript:;" class="button-primary customise-ads-demo-video" data-type="47mu8w3" data-video="https://www.youtube.com/embed/gsk1AZ4hKYc"> 69 69 Demo 70 70 </a> 71 <a href="javascript:;" class="button customise-ads-learn-more" data- plugin-slug="terminal-africa">71 <a href="javascript:;" class="button customise-ads-learn-more" data-type="47mu8w3" data-plugin-slug="terminal-africa"> 72 72 Learn More 73 73 </a> … … 80 80 <h3>Google Trends for WP</h3> 81 81 <div class="customise-ads-sub-action"> 82 <a href="javascript:;" class="button-primary customise-ads-demo-video" data- video="https://www.youtube.com/embed/yJYo8ifhyyE?si=iZ2aI5LdCFpFJJYt">82 <a href="javascript:;" class="button-primary customise-ads-demo-video" data-type="3QI5HBW" data-video="https://www.youtube.com/embed/yJYo8ifhyyE?si=iZ2aI5LdCFpFJJYt"> 83 83 Demo 84 84 </a> 85 <a href="javascript:;" class="button customise-ads-learn-more" data- plugin-slug="codedeyo-google-trends-for-bloggers">85 <a href="javascript:;" class="button customise-ads-learn-more" data-type="3QI5HBW" data-plugin-slug="codedeyo-google-trends-for-bloggers"> 86 86 Learn More 87 87 </a>
Note: See TracChangeset
for help on using the changeset viewer.