Plugin Directory

Changeset 3430383


Ignore:
Timestamp:
01/01/2026 06:54:29 AM (4 weeks ago)
Author:
konceptwise
Message:

Performance Improvement

Location:
authyo-passwordless-login/trunk
Files:
5 added
2 edited

Legend:

Unmodified
Added
Removed
  • authyo-passwordless-login/trunk/authyo-passwordless-login.php

    r3430361 r3430383  
    4242    define('AUTHYO_PASSWORDLESS_LOGIN_URL', plugin_dir_url(__FILE__));
    4343}
     44if (!defined('AUTHYO_PASSWORDLESS_LOGIN_BASENAME')) {
     45    define('AUTHYO_PASSWORDLESS_LOGIN_BASENAME', plugin_basename(__FILE__));
     46}
    4447
    4548// Include required files with existence checks
     
    4952$authyo_passwordless_login_settings_file = $authyo_passwordless_login_includes_dir . 'class-authyo-settings.php';
    5053$authyo_passwordless_login_login_file = $authyo_passwordless_login_includes_dir . 'class-authyo-login.php';
     54$authyo_passwordless_login_tracker_file = $authyo_passwordless_login_includes_dir . 'class-authyo-passwordless-tracker.php';
    5155
    5256// Check file existence without using translation functions (avoid early translation loading)
     
    7276    }
    7377}
     78if (!file_exists($authyo_passwordless_login_tracker_file)) {
     79    if (function_exists('wp_die')) {
     80        wp_die('Authyo Passwordless Login plugin error: Required file not found: ' . esc_html($authyo_passwordless_login_tracker_file));
     81    } else {
     82        die('Authyo Passwordless Login plugin error: Required file not found: ' . esc_html($authyo_passwordless_login_tracker_file));
     83    }
     84}
    7485
    7586require_once $authyo_passwordless_login_api_file;
    7687require_once $authyo_passwordless_login_settings_file;
    7788require_once $authyo_passwordless_login_login_file;
     89require_once $authyo_passwordless_login_tracker_file;
     90
     91// Initialize tracker globally to ensure all hooks are registered early
     92if (class_exists('Authyo_Passwordless_Tracker')) {
     93    new Authyo_Passwordless_Tracker();
     94}
    7895
    7996/**
     
    200217        return $links;
    201218    }
     219
     220    /**
     221     * Plugin activation hook
     222     */
     223    public static function activate() {
     224        set_transient('authyo_passwordless_show_email_subscription', true, HOUR_IN_SECONDS);
     225    }
    202226}
    203227} // End if !class_exists
     228
     229// Register activation hook
     230register_activation_hook(__FILE__, array('Authyo_Passwordless_Login', 'activate'));
    204231
    205232// Initialize the plugin
  • authyo-passwordless-login/trunk/includes/class-authyo-settings.php

    r3430361 r3430383  
    149149            $sanitized['enable_passwordless_login'] = 0;
    150150        }
     151
     152        // Set transient to trigger tracking in the tracker class
     153        set_transient('authyo_passwordless_trigger_tracking', $sanitized, 60);
    151154       
    152155        return $sanitized;
Note: See TracChangeset for help on using the changeset viewer.