GRAYBYTE WORDPRESS FILE MANAGER1674

Server IP : 162.213.255.40 / Your IP : 216.73.216.114
System : Linux server146.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
PHP Version : 8.0.30
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF

HOME

/home/hellrfbn/public_html/wp-content/updraft/plugins-old/nitropack/classes/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/hellrfbn/public_html/wp-content/updraft/plugins-old/nitropack/classes//PluginStateHandler.php
<?php

namespace NitroPack;

use NitroPack\Integration\Plugin\AeliaCurrencySwitcher;
use NitroPack\Integration\Plugin\GeoTargetingWP;

class PluginStateHandler {
    const eventHandlersMap = [
        'woocommerce-aelia-currencyswitcher/woocommerce-aelia-currencyswitcher.php' =>[
            'activateCallback' => 'HandleAeliaCurrencyActivation',
            'deactivateCallback' => 'HandleAeliaCurrencyDeactivation',
        ],
    ];
    private static $instance;

    public static function getInstance() {
        if (!self::$instance) {
            self::$instance = new PluginStateHandler();
        }
        return self::$instance;
    }

    public static function init() {
        add_action('activated_plugin', [self::getInstance(), 'handleActivation'], 10, 1);
        add_action('deactivated_plugin', [self::getInstance(), 'handleDeactivation'], 10, 1);
    }

    public function handleActivation($plugin) {
        if (array_key_exists($plugin, self::eventHandlersMap) && !empty(self::eventHandlersMap[$plugin]['activateCallback'])) {
            self::{self::eventHandlersMap[$plugin]['activateCallback']}();
        }
    }

    public function handleDeactivation($plugin) {
        if (array_key_exists($plugin, self::eventHandlersMap) && !empty(self::eventHandlersMap[$plugin]['deactivateCallback'])) {
            self::{self::eventHandlersMap[$plugin]['deactivateCallback']}();
        }
    }

    // maybe have these handlers be part of each plugin compatibility class (maybe even have a class PluginCompatibility that they extend).
    public static function HandleAeliaCurrencyActivation() {
        initVariationCookies(AeliaCurrencySwitcher::customVariationCookies);
    }

    public static function HandleAeliaCurrencyDeactivation() {
        removeVariationCookies(AeliaCurrencySwitcher::customVariationCookies);
    }

    public static function HandleGeowpActivation() {
        initVariationCookies(GeoTargetingWP::getCustomVariationCookies());
    }

    public static function HandleGeowpDeactivation() {
        removeVariationCookies(GeoTargetingWP::allGeoWpCookies);
    }
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 23 2025 15:04:17
hellrfbn / hellrfbn
0755
Feature
--
July 23 2025 07:38:27
hellrfbn / hellrfbn
0755
Integration
--
July 23 2025 07:38:27
hellrfbn / hellrfbn
0755
Interfaces
--
July 23 2025 07:38:27
hellrfbn / hellrfbn
0755
Util
--
July 23 2025 07:38:27
hellrfbn / hellrfbn
0755
WordPress
--
July 23 2025 07:38:27
hellrfbn / hellrfbn
0755
.htaccess
0.41 KB
July 23 2025 07:38:27
hellrfbn / hellrfbn
0644
ModuleHandler.php
7.197 KB
June 25 2024 18:18:45
hellrfbn / hellrfbn
0644
PluginStateHandler.php
2.064 KB
June 25 2024 18:18:45
hellrfbn / hellrfbn
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF