Plugin Directory

Changeset 3220122


Ignore:
Timestamp:
01/10/2025 10:56:58 AM (14 months ago)
Author:
anshumanja
Message:

bug fix

Location:
accessibe/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • accessibe/trunk/accessibe.php

    r3219469 r3220122  
    44  * Plugin URI: https://accessibe.com/
    55  * Description: accessiBe is the #1 fully automated web accessibility solution. Protect your website from lawsuits and increase your potential audience.
    6   * Version: 2.1
     6  * Version: 2.2
    77  * Author: accessiBe
    88  * Author URI: https://accessibe.com/
  • accessibe/trunk/accessibe_inc/js/accessibe.js

    r3219439 r3220122  
    132132        break;
    133133      case 'logout':
    134         console.log('reloading: logout');
    135134        await API.logOut();
    136135        // await API.syncMerchantDetails();
  • accessibe/trunk/class.accessibeforwp.php

    r3219439 r3220122  
    149149    public static function accessibe_render_js_in_footer() {
    150150        $accessibe_options = self::accessibe_get_options();
    151         $current_domain = wp_parse_url(site_url())['host'];
     151        $current_domain = self::removeWWW(wp_parse_url(site_url())['host']);
    152152        // $current_domain = '9cc3-2405-201-5c0f-d070-14fd-b303-b02-1999.ngrok-free.app';
    153153       
     
    227227            'email' => $current_user->user_email,
    228228            'fullName' => $current_user->display_name,
    229             'storeId' => wp_parse_url(site_url())['host'],
     229            'storeId' => self::removeWWW(wp_parse_url(site_url())['host']),
    230230            // 'storeId' => '9cc3-2405-201-5c0f-d070-14fd-b303-b02-1999.ngrok-free.app'
    231231        );
     
    247247        $existing_domains = json_decode(stripslashes($_POST['existingDomains']));
    248248
    249         $current_domain = wp_parse_url(site_url())['host'];
     249        $current_domain = self::removeWWW(wp_parse_url(site_url())['host']);
    250250        // $current_domain = '9cc3-2405-201-5c0f-d070-14fd-b303-b02-1999.ngrok-free.app';
    251251
     
    449449    } // accessibe_admin_footer_text
    450450
     451    public static function removeWWW($domain) {
     452        // Use regex to replace "www." only at the beginning
     453        return preg_replace("/^www\./", "", $domain);
     454    } // removeWWW
     455
    451456
    452457  /**
     
    599604            <iframe id='accessibe-universal-iframe' src='https://universal.accessibe.com'></iframe>
    600605        </div>
     606        <?php
     607        if (!isset($accessibe_options['isLoggedOutOnce'])) {
     608           echo "<script>
     609           window.addEventListener('message', (event) => {
     610            if(event.data.eventName == 'iframe-ready') {
     611                const iframeRef = document.getElementById('accessibe-universal-iframe');
     612                iframeRef?.contentWindow.postMessage(
     613                { eventName: 'request-logout', data: {} },
     614                '*',
     615                );
     616                setTimeout(()=> {
     617                  window.location.reload();
     618                }, 1000);
     619            }});
     620           </script>";
     621           $accessibe_options['isLoggedOutOnce'] = true;
     622
     623           update_option(ACCESSIBE_WP_OPTIONS_KEY, json_encode($accessibe_options));
     624        }
     625        ?>
    601626        <!-- /.wrap -->
    602627        <?php
     
    657682            $current_user = wp_get_current_user();
    658683            $mixpanelHandler = new MixpanelHandler();
    659             $mixpanelHandler->trackEvent('pluginInstalled', ['$device_id' => $uuid, 'primaryDomain' => wp_parse_url(site_url())['host'], 'wp_id' => $current_user->ID, 'wp_email' => $current_user->user_email, 'wp_username' => $current_user->user_login, 'wp_display_name' => $current_user->display_name ]);
     684            $mixpanelHandler->trackEvent('pluginInstalled', ['$device_id' => $uuid, 'primaryDomain' => self::removeWWW(wp_parse_url(site_url())['host']), 'wp_id' => $current_user->ID, 'wp_email' => $current_user->user_email, 'wp_username' => $current_user->user_login, 'wp_display_name' => $current_user->display_name ]);
    660685            $current_data['isInstalled'] = true;
    661686            $current_data['mixpanelUUID'] = $uuid;
     
    669694        $mixpanelHandler = new MixpanelHandler();
    670695        if(isset($current_data['acsbuserId'])) {
    671             $mixpanelHandler->trackEvent('pluginInstalled', ['userId' => $current_data['acsbuserId'], 'primaryDomain' => wp_parse_url(site_url())['host'], 'wp_id' => $current_user->ID, 'wp_email' => $current_user->user_email, 'wp_username' => $current_user->user_login, 'wp_display_name' => $current_user->display_name ]);
     696            $mixpanelHandler->trackEvent('pluginInstalled', ['userId' => $current_data['acsbuserId'], 'primaryDomain' => self::removeWWW(wp_parse_url(site_url())['host']), 'wp_id' => $current_user->ID, 'wp_email' => $current_user->user_email, 'wp_username' => $current_user->user_login, 'wp_display_name' => $current_user->display_name ]);
    672697        }
    673698        else {
    674             $mixpanelHandler->trackEvent('pluginInstalled', ['$device_id' => $current_data['mixpanelUUID'], 'primaryDomain' => wp_parse_url(site_url())['host'], 'wp_id' => $current_user->ID, 'wp_email' => $current_user->user_email, 'wp_username' => $current_user->user_login, 'wp_display_name' => $current_user->display_name ]);
    675         }
    676         $mixpanelHandler->trackEvent('pluginUninstalled', ['primaryDomain' => wp_parse_url(site_url())['host']]);
     699            $mixpanelHandler->trackEvent('pluginInstalled', ['$device_id' => $current_data['mixpanelUUID'], 'primaryDomain' => self::removeWWW(wp_parse_url(site_url())['host']), 'wp_id' => $current_user->ID, 'wp_email' => $current_user->user_email, 'wp_username' => $current_user->user_login, 'wp_display_name' => $current_user->display_name ]);
     700        }
     701        $mixpanelHandler->trackEvent('pluginUninstalled', ['primaryDomain' => self::removeWWW(wp_parse_url(site_url())['host'])]);
    677702        delete_option(ACCESSIBE_WP_OPTIONS_KEY);
    678703        delete_option(ACCESSIBE_WP_POINTERS_KEY);
  • accessibe/trunk/readme.txt

    r3219469 r3220122  
    44Requires at least: 4.7
    55Tested up to: 6.7
    6 Stable tag: 2.1
     6Stable tag: 2.2
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    5858
    5959== Changelog ==
     60= v2.2 =
     61* 2025-01-10
     62* Bug fix
     63
    6064= v2.1 =
    6165* 2025-01-09
Note: See TracChangeset for help on using the changeset viewer.