Plugin Directory

Changeset 3407972


Ignore:
Timestamp:
12/02/2025 12:22:11 PM (3 months ago)
Author:
galdub
Message:

trunk 1.3.8

Location:
poptin/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • poptin/trunk/poptin.php

    r3354690 r3407972  
    44Contributors: poptin, galdub, tomeraharon
    55Description: Use Poptin to get more leads, sales, and email subscribers. Create targeted beautiful pop ups and forms in less than 2 minutes with ease.
    6 Version: 1.3.7
     6Version: 1.3.8
    77Author: Poptin
    88Author URI: https://www.poptin.com
     
    173173        if(isset($_GET['page']) && $_GET['page'] == 'Poptin-support') {
    174174            wp_redirect(admin_url("admin.php?page=poptin"));
     175            exit;
     176        }
     177       
     178        // Handle logout redirect early, before any output is sent
     179        if(isset($_GET['page']) && $_GET['page'] == 'poptin-logout') {
     180            // Check user permissions
     181            if (!current_user_can('manage_options')) {
     182                wp_die(__('You do not have sufficient permissions to access this page.', 'ppbase'));
     183            }
     184           
     185            // Clear Poptin data
     186            update_option('poptin_id', '');
     187            update_option('poptin_marketplace_token', '');
     188            update_option('poptin_marketplace_email_id', '');
     189            update_option('poptin_user_id', '');
     190            poptin_clear_all_caches();
     191           
     192            // Redirect to Poptin dashboard
     193            wp_redirect(admin_url('admin.php?page=poptin'));
    175194            exit;
    176195        }
     
    832851
    833852    public function poptin_logout_view() {
    834         // Clear Poptin data (similar to your existing delete_poptin_id method)
     853        // This is a fallback - the logout should be handled in admin_init
     854        // But if we reach here, clear data and use JavaScript redirect
    835855        update_option('poptin_id', '');
    836856        update_option('poptin_marketplace_token', '');
     
    839859        poptin_clear_all_caches();
    840860       
    841         // Redirect back to main page
    842         wp_redirect(admin_url('admin.php?page=poptin'));
    843         exit;
     861        // Use JavaScript redirect since headers may already be sent
     862        $redirect_url = admin_url('admin.php?page=poptin');
     863        ?>
     864        <script type="text/javascript">
     865            window.location.href = "<?php echo esc_js($redirect_url); ?>";
     866        </script>
     867        <p><?php esc_html_e('Logging out... If you are not redirected automatically, ', 'ppbase'); ?><a href="<?php echo esc_url($redirect_url); ?>"><?php esc_html_e('click here', 'ppbase'); ?></a>.</p>
     868        <?php
    844869    }
    845870
  • poptin/trunk/readme.txt

    r3406762 r3407972  
    44Requires at least: 3.1
    55Tested up to: 6.9
    6 Stable tag: 1.3.7
     6Stable tag: 1.3.8
    77Plugin URI: https://www.poptin.com
    88License: GPLv3
     
    243243== Changelog ==
    244244
     245= 1.3.8 =
     246Logout bug fixed
     247
    245248= 1.3.7 =
    246249WordPress Playground bug fixed
Note: See TracChangeset for help on using the changeset viewer.