/* Decoded by unphp.net */ 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 '
'; echo '

مدیریت لایسنس محصولات نیکان وردپرس

'; 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 '

'.@$license_data->message.'

'; //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 '

'.@$license_data->message.'

'; } } echo '

جهت فعال سازی افزونه کلید لایسنس را در کادر زیر وارد نموده و در انتها بر روی دکمه فعال سازی کلیک نمایید.

'; echo '
'; } } /** * 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; } } ?>