Plugin Directory

Changeset 2974343


Ignore:
Timestamp:
10/03/2023 01:52:51 PM (3 years ago)
Author:
wp2speed
Message:

update of my plugin

Location:
thanh-toan-chuyen-khoan
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • thanh-toan-chuyen-khoan/tags/1.0.0/ttck.php

    r2965789 r2974343  
    7070
    7171        add_action('init', array($this, 'init'));
    72 
     72        register_activation_hook( __FILE__, array($this,'activate') );
     73        register_deactivation_hook( __FILE__, array($this,'deactivate') );
    7374        $this->settings = self::get_settings();
    7475    }
    75 
     76    function activate() {
     77        if( version_compare(phpversion(), '5.6', '<')  ) {
     78            wp_die('You need to update your PHP version. Require: PHP 5.6+');
     79        }
     80        if(!extension_loaded('gd')) wp_die('Please activate PHP GD library.');
     81        if(!class_exists('WooCommerce')) wp_die('Please activate woocommerce plugin');
     82        wp_redirect(admin_url('admin.php?page=qhtp'));
     83    }
     84    function deactivate() {
     85        ;
     86    }
    7687   
    7788    public function init()
  • thanh-toan-chuyen-khoan/trunk/ttck.php

    r2965789 r2974343  
    7070
    7171        add_action('init', array($this, 'init'));
    72 
     72        register_activation_hook( __FILE__, array($this,'activate') );
     73        register_deactivation_hook( __FILE__, array($this,'deactivate') );
    7374        $this->settings = self::get_settings();
    7475    }
    7576
    76    
     77    function activate() {
     78        if( version_compare(phpversion(), '5.6', '<')  ) {
     79            wp_die('You need to update your PHP version. Require: PHP 5.6+');
     80        }
     81        if(!extension_loaded('gd')) wp_die('Please activate PHP GD library.');
     82        if(!class_exists('WooCommerce')) wp_die('Please activate woocommerce plugin');
     83        wp_redirect(admin_url('admin.php?page=qhtp'));
     84    }
     85    function deactivate() {
     86        ;
     87    }
    7788    public function init()
    7889    {
Note: See TracChangeset for help on using the changeset viewer.