Changeset 1890469
- Timestamp:
- 06/10/2018 02:29:55 PM (8 years ago)
- Location:
- overtok/trunk
- Files:
-
- 2 edited
-
overtok-init.php (modified) (7 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
overtok/trunk/overtok-init.php
r1861993 r1890469 4 4 Plugin URI: https://overtok.com 5 5 Description: This plugin will allow you to put your Overtok button on your website 6 Author: Dagan Yaakov7 Version: 0. 38 Author URI: http ://wp.dugi.co.il/6 Author: overtok 7 Version: 0.4 8 Author URI: https://overtok.com/ 9 9 */ 10 10 … … 12 12 const OPTION_PREFIX = 'overtok_'; 13 13 const A_SLUG_PREFIX = 'o5k_'; 14 const WEB_SDK_SRC = 'https://assets.overtok-qa.com/web-sdk/overtok.js';14 const WEB_SDK_SRC = ['https://assets.overtok.com/web-sdk/overtok.js','https://assets.overtok-qa.com/web-sdk/overtok.js']; 15 15 16 16 private static $instance = null; 17 17 18 private $web_sdk_src = ''; 18 19 19 20 static function init() { … … 27 28 28 29 private function __construct() { 30 $this->web_sdk_src = (!empty(SELF::WEB_SDK_SRC[0])) ? SELF::WEB_SDK_SRC[0] : ''; 31 29 32 add_action( 'admin_menu', [$this,'add_options_page'] ); 30 33 add_action( 'admin_init', [$this,'save_options_page'] ); … … 37 40 return get_option(self::OPTION_PREFIX .'global_code'); 38 41 } 42 43 public function get_overtok_code_sdk(){ 44 45 $sdk_i = (int)get_option(self::OPTION_PREFIX .'global_code_sdk_i'); 46 47 if (array_key_exists($sdk_i,SELF::WEB_SDK_SRC)) 48 $this->web_sdk_src = SELF::WEB_SDK_SRC[$sdk_i]; 49 50 51 return $this->web_sdk_src; 52 } 53 39 54 40 55 public function build_overtok_script(){ … … 43 58 44 59 if ($code){ 45 $js_src = (defined('OVERTOK_WEB_SDK_SRC')) ? OVERTOK_WEB_SDK_SRC : self::WEB_SDK_SRC;60 $js_src = (defined('OVERTOK_WEB_SDK_SRC')) ? OVERTOK_WEB_SDK_SRC : $this->get_overtok_code_sdk(); 46 61 return "<script>!function(){var e=function(){{$code}},t=document.createElement('script');t.type='text/javascript',t.src='{$js_src}',t.onreadystatechange=e,t.onload=e,document.getElementsByTagName('head')[0].appendChild(t)}();</script>"; 47 62 } … … 61 76 public function embed_code_block(){ 62 77 $overtok_method = get_option(self::OPTION_PREFIX .'global_method'); 78 63 79 64 80 if ($overtok_method == 'footer'){ … … 125 141 }else{ 126 142 update_option( self::OPTION_PREFIX .'global_code', $overtok_code ); 143 144 foreach ((array)SELF::WEB_SDK_SRC as $k=>$v){ 145 146 if( strpos( $_POST['overtok_code'], $v ) !== false ) 147 update_option( self::OPTION_PREFIX .'global_code_sdk_i', $k ); 148 149 150 } 127 151 } 128 152 -
overtok/trunk/readme.txt
r1884403 r1890469 82 82 83 83 = Are call recorded? = 84 Yes! You can easily listen to all conversations with your customers and even see a copy of your text messages in the business app.84 Yes! we'll launch this option soon. stay tuned.
Note: See TracChangeset
for help on using the changeset viewer.