an error occured! You may not be able to access this plugin via direct URL...';
exit();
}
else if (!defined('ABSPATH'))
{
echo '
an error occured! You may not be able to access this plugin via direct URL...
';
exit();
}
/**/
if (!class_exists('wpjsloadbymdz_admin'))
{
class wpjsloadbymdz_admin
{
//Props
private static $instance;
//constructor
public function __Construct()
{
//activate & deactivate hooks
register_activation_hook(WPJSLOADBYMDZ_PLG, array($this, 'onactivate'));
register_deactivation_hook(WPJSLOADBYMDZ_PLG, array($this, 'ondeactivate'));
$this->checkfirstredirect(); //redirect on first time activation
$this->deactivationConfirmation(); //Confirm to empty or not the data
//add menue
add_action('admin_menu', array($this, 'addmenue'));
}
//METHODS
public static function get_instance()
{
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
public function onactivate()
{
add_option('wpjsloadbymdz_empty_onDeactivate', 0);
add_option('wpjsloadbymdz_redirect_onActivate', 1);
}
public function ondeactivate()
{
update_option('wpjsloadbymdz_redirect_onActivate', 1);
}
//checks to do redirect on activation or not
public function checkfirstredirect()
{
global $pagenow;
$do_redirect = get_option('wpjsloadbymdz_redirect_onActivate');
if ($pagenow == 'plugins.php' && $do_redirect == '1'){
add_action('admin_footer', array($this, 'doredirect'));
}
}
//do redirect
public function doredirect()
{
?>
has_plg('ajax-loader-bymdez.php') && defined('WPJSLOADBYMDZ_VER')){
return true;
}else return false;
break;
case '2':
case 2:
return get_option('wpjsloadbymdz_activate');
break;
case '3':
case 3:
if(get_option('wpjsloadbymdz_activate') == 1){
return false;
}else return true;
break;
case '4':
case 4:
if($this->has_plg('ajax-loader-pro-bymdez.php') && defined('WPJSLOADBPROYMDZ_VER')){
return 3;
}else return 4;
break;
case '5':
case 5:
if(is_user_logged_in()){
return false;
}else return true;
break;
case '6':
case 6:
if($this->has_plg('ajax-loader-pro-bymdez.php') && defined('WPJSLOADBPROYMDZ_VER')){
return 15;
}else return true;
break;
default:
break;
}
}
//Set Options Autoload off (no)
private function set_autoload_off($option)
{
$tmp_option_val = get_option($option);
delete_option($option);
add_option($option, $tmp_option_val, '', 'no');
}
}
}
//init
wpjsloadbymdz_admin::get_instance();
//close the PHP tag to reduce the blank spaces ?>