The WPSmartPay Plugin Initialization system provides hooks and constants for detecting when the WPSmartPay plugin is loaded and ready for use. This system is essential for other plugins and themes that need to integrate with WPSmartPay functionality.

Version Constant

WPSmartPay defines a version constant that can be used to check if the plugin is installed and active.

SMARTPAY_VERSION

Type: Constant

Defined: When WPSmartPay plugin is loaded.

Use Case: Check if WPSmartPay is installed and get version information

// Check if WPSmartPay is installed
if (!defined('SMARTPAY_VERSION')) {
// WPSmartPay is not installed or not active
add_action('admin_notices', function() {
//
});
return;
}

// Check version compatibility
if (version_compare(SMARTPAY_VERSION, '1.0.0', '<')) {
add_action('admin_notices', function() {
//
});
}

smartpay_loaded

Type: Action

Fires: On plugins_loaded hook when WPSmartPay boots

Parameters: None

Use Case: Early initialization tasks that need to run as soon as WPSmartPay is loaded.

add_action('smartpay_loaded', function() {
// Early bootstrap hooks
error_log('SmartPay plugin loaded');

// Initialize custom functionality

});

smartpay_init

Type: Action

Fires: On init hook when WPSmartPay initializes

Parameters: None

Use Case: Initialize functionality that depends on WordPress being fully loaded.

add_action('smartpay_init', function() {
// Initialize after WordPress is fully loaded
error_log('SmartPay plugin initialized');

// Do other tasks
});