Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

if ( ! defined( 'ABSPATH' ) ) exit; if( !class_exists('WCAL') ){ class WCAL{ public ..

Decoded Output download

<?  if ( ! defined( 'ABSPATH' ) ) exit; 
if( !class_exists('WCAL') ){ 
	class WCAL{ 
		public function __construct() { 
			add_action( 'init', [$this,'wcal_load_textdomain'] ); 
			$this->wcal_define(); 
			$this->wcal_includes(); 
		} 
		public function wcal_load_textdomain(){ 
			load_plugin_textdomain( 'wcal', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/'); 
		} 
		public function wcal_define(){ 
			define('WCAL_DIR',trailingslashit(plugin_dir_path(__FILE__))); 
			define('WCAL_URL',trailingslashit(plugin_dir_url(__FILE__))); 
			define('WCAL_FILE_DIR',trailingslashit(__FILE__)); 
		} 
		public function wcal_includes(){ 
			include_once WCAL_DIR.'includes/wcal-functions.php'; 
			include_once WCAL_DIR.'includes/wcal-admin-assets-class.php'; 
			include_once WCAL_DIR.'includes/wcal-installer-class.php'; 
			include_once WCAL_DIR.'includes/wcal-database-class.php'; 
			include_once WCAL_DIR.'includes/wcal-admin-menu-class.php'; 
			include_once WCAL_DIR.'includes/wcal-admin-list-table-class.php'; 
		} 
	} 
} 
new WCAL(); 
 
register_activation_hook( WCAL_FILE_DIR , ['WCAL_Installer', 'wcal_db_installer'] ); 
 
/** 
 * NikanWP License - No need change for this plugin 
 */ 
if(!defined('NW_SPECIAL_SECRET_KEY')) define('NW_SPECIAL_SECRET_KEY', 'af888ff255272f95e4a81a4239e23a6e0de247b113351da432c2497079274c53'); 
if(!defined('NW_LICENSE_SERVER_URL')) define('NW_LICENSE_SERVER_URL', 'https://nikanwp.ir/'); 
if ( !function_exists('nikanwp_license_menu') ) { 
    add_action('admin_menu','nikanwp_license_menu'); 
    function nikanwp_license_menu(){ 
        // Before check redirect from NikanWP plugins. 
        if( !isset( $_REQUEST['nikanwp_license_key_name'] ) ) return; 
        if( empty( $_REQUEST['nikanwp_license_key_name'] ) ){ 
            wp_redirect( admin_url() ); 
            exit; 
        } 
 
        // Add menu... 
        add_menu_page( 
            '    ', 
            ' ', 
            'manage_options', 
            'nikanwp-enter-license', 
            'nikanwp_enter_license_callback', 
            'dashicons-lock' 
        ); 
    } 
} 
if ( !function_exists('nikanwp_enter_license_callback') ) { 
    function nikanwp_enter_license_callback(){ 
        echo '<div class="wrap">'; 
        echo '<h2>    </h2>'; 
        if ( isset( $_REQUEST['activate_license'])) { 
            $license_key = $_REQUEST['nikanwp_license_key']; 
            // API query parameters 
            $api_params = array( 
                'slm_action' => 'slm_activate', 
                'secret_key' => NW_SPECIAL_SECRET_KEY, 
                'license_key' => $license_key, 
                'registered_domain' => get_option('siteurl'), 
            ); 
            // Send query to the license manager server 
            $query = esc_url_raw(add_query_arg($api_params, NW_LICENSE_SERVER_URL)); 
            $response = wp_remote_get($query, array('timeout' => 20, 'sslverify' => false)); 
 
            // Check for error in the response 
            if ( is_wp_error( $response ) ){ 
                echo $response->get_error_message(); 
            } 
 
            // License data. 
            $license_data = json_decode( wp_remote_retrieve_body($response) ); 
 
            if(@$license_data->result == 'success'){ 
                //Uncomment the followng line to see the message that returned from the license server 
                echo '<div class="notice is-dismissible"><p>'.@$license_data->message.'</p></div>'; 
                //Save the license key in the options table 
                update_option( $_GET['nikanwp_license_key_name'], md5( $_SERVER['SERVER_NAME'] )); 
            } 
            else{ 
                //Uncomment the followng line to see the message that returned from the license server 
                echo '<div class="notice is-dismissible"><p>'.@$license_data->message.'</p></div>'; 
            } 
        } 
        echo '<p>                      .</p> 
    <form action="" method="post"> 
        <table class="form-table"> 
            <tr> 
                <th style="width:100px;"><label for="nikanwp_license_key"> </label></th> 
                <td ><input class="regular-text" type="text" id="nikanwp_license_key" name="nikanwp_license_key"  value="" ></td> 
            </tr> 
        </table> 
        <p class="submit"> 
            <input type="submit" name="activate_license" value=" " class="button-primary" /> 
        </p> 
    </form>'; 
        echo '</div>'; 
    } 
} 
 
/** 
 * NikanWP License - Need to change for this plugin 
 */ 
function wcal_license_checker(){ 
    if( !is_admin()) return; 
 
    //Check if valid license 
    $license_option = get_option( 'wcal_license_key' ); 
    $license_option_value = md5($_SERVER['SERVER_NAME']); 
    if( $license_option ){ 
        if( $license_option === $license_option_value ) return; 
    } 
 
    //After check license and return invalid license 
    $page = @$_GET['page']; 
    if( $page === 'wcal' ) { 
        $license_url = admin_url('admin.php?page=nikanwp-enter-license&nikanwp_license_key_name=wcal_license_key'); 
        wp_redirect( $license_url ); 
        exit; 
    } 
} 
add_action('admin_init', 'wcal_license_checker'); 
 
// Remove and disable on customer website from nikanwp.ir license manager 
if( isset( $_REQUEST['nw_action'] ) ){ 
    if ( $_REQUEST['nw_action'] == 'license_deactivated' and $_REQUEST['nw_secret_key'] == NW_SPECIAL_SECRET_KEY and (int)$_REQUEST['nw_product_id'] === 8270){ 
        $delete = delete_option('wcal_license_key'); 
        if ( $delete ) echo 8270; 
    } 
} ?>

Did this file decode correctly?

Original Code

if ( ! defined( 'ABSPATH' ) ) exit;
if( !class_exists('WCAL') ){
	class WCAL{
		public function __construct() {
			add_action( 'init', [$this,'wcal_load_textdomain'] );
			$this->wcal_define();
			$this->wcal_includes();
		}
		public function wcal_load_textdomain(){
			load_plugin_textdomain( 'wcal', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/');
		}
		public function wcal_define(){
			define('WCAL_DIR',trailingslashit(plugin_dir_path(__FILE__)));
			define('WCAL_URL',trailingslashit(plugin_dir_url(__FILE__)));
			define('WCAL_FILE_DIR',trailingslashit(__FILE__));
		}
		public function wcal_includes(){
			include_once WCAL_DIR.'includes/wcal-functions.php';
			include_once WCAL_DIR.'includes/wcal-admin-assets-class.php';
			include_once WCAL_DIR.'includes/wcal-installer-class.php';
			include_once WCAL_DIR.'includes/wcal-database-class.php';
			include_once WCAL_DIR.'includes/wcal-admin-menu-class.php';
			include_once WCAL_DIR.'includes/wcal-admin-list-table-class.php';
		}
	}
}
new WCAL();

register_activation_hook( WCAL_FILE_DIR , ['WCAL_Installer', 'wcal_db_installer'] );

/**
 * NikanWP License - No need change for this plugin
 */
if(!defined('NW_SPECIAL_SECRET_KEY')) define('NW_SPECIAL_SECRET_KEY', 'af888ff255272f95e4a81a4239e23a6e0de247b113351da432c2497079274c53');
if(!defined('NW_LICENSE_SERVER_URL')) define('NW_LICENSE_SERVER_URL', 'https://nikanwp.ir/');
if ( !function_exists('nikanwp_license_menu') ) {
    add_action('admin_menu','nikanwp_license_menu');
    function nikanwp_license_menu(){
        // Before check redirect from NikanWP plugins.
        if( !isset( $_REQUEST['nikanwp_license_key_name'] ) ) return;
        if( empty( $_REQUEST['nikanwp_license_key_name'] ) ){
            wp_redirect( admin_url() );
            exit;
        }

        // Add menu...
        add_menu_page(
            '    ',
            ' ',
            'manage_options',
            'nikanwp-enter-license',
            'nikanwp_enter_license_callback',
            'dashicons-lock'
        );
    }
}
if ( !function_exists('nikanwp_enter_license_callback') ) {
    function nikanwp_enter_license_callback(){
        echo '<div class="wrap">';
        echo '<h2>    </h2>';
        if ( isset( $_REQUEST['activate_license'])) {
            $license_key = $_REQUEST['nikanwp_license_key'];
            // API query parameters
            $api_params = array(
                'slm_action' => 'slm_activate',
                'secret_key' => NW_SPECIAL_SECRET_KEY,
                'license_key' => $license_key,
                'registered_domain' => get_option('siteurl'),
            );
            // Send query to the license manager server
            $query = esc_url_raw(add_query_arg($api_params, NW_LICENSE_SERVER_URL));
            $response = wp_remote_get($query, array('timeout' => 20, 'sslverify' => false));

            // Check for error in the response
            if ( is_wp_error( $response ) ){
                echo $response->get_error_message();
            }

            // License data.
            $license_data = json_decode( wp_remote_retrieve_body($response) );

            if(@$license_data->result == 'success'){
                //Uncomment the followng line to see the message that returned from the license server
                echo '<div class="notice is-dismissible"><p>'.@$license_data->message.'</p></div>';
                //Save the license key in the options table
                update_option( $_GET['nikanwp_license_key_name'], md5( $_SERVER['SERVER_NAME'] ));
            }
            else{
                //Uncomment the followng line to see the message that returned from the license server
                echo '<div class="notice is-dismissible"><p>'.@$license_data->message.'</p></div>';
            }
        }
        echo '<p>                      .</p>
    <form action="" method="post">
        <table class="form-table">
            <tr>
                <th style="width:100px;"><label for="nikanwp_license_key"> </label></th>
                <td ><input class="regular-text" type="text" id="nikanwp_license_key" name="nikanwp_license_key"  value="" ></td>
            </tr>
        </table>
        <p class="submit">
            <input type="submit" name="activate_license" value=" " class="button-primary" />
        </p>
    </form>';
        echo '</div>';
    }
}

/**
 * NikanWP License - Need to change for this plugin
 */
function wcal_license_checker(){
    if( !is_admin()) return;

    //Check if valid license
    $license_option = get_option( 'wcal_license_key' );
    $license_option_value = md5($_SERVER['SERVER_NAME']);
    if( $license_option ){
        if( $license_option === $license_option_value ) return;
    }

    //After check license and return invalid license
    $page = @$_GET['page'];
    if( $page === 'wcal' ) {
        $license_url = admin_url('admin.php?page=nikanwp-enter-license&nikanwp_license_key_name=wcal_license_key');
        wp_redirect( $license_url );
        exit;
    }
}
add_action('admin_init', 'wcal_license_checker');

// Remove and disable on customer website from nikanwp.ir license manager
if( isset( $_REQUEST['nw_action'] ) ){
    if ( $_REQUEST['nw_action'] == 'license_deactivated' and $_REQUEST['nw_secret_key'] == NW_SPECIAL_SECRET_KEY and (int)$_REQUEST['nw_product_id'] === 8270){
        $delete = delete_option('wcal_license_key');
        if ( $delete ) echo 8270;
    }
}

Function Calls

None

Variables

None

Stats

MD5 8be77698cbeb7b5ecfd59d372b8a7761
Eval Count 0
Decode Time 62 ms