File: /home/bt667/public_html/wp-content/plugins/wp_mvplayer/includes/class-mvp-importer-helper.php
<?php
/**
* @since 1.0.0
* @package WPMVP
* @subpackage WPMVP/includes
* @author Rohit Sharma
*/
class MVP_Importer_Helper {
protected $loader,$plugin_name,$version;
public function __construct() {
$this->plugin_name = 'WPMVP';
$this->version = '1.22';
}
public function clean($string) {
// Replaces all spaces with hyphens.
$string = str_replace(' ', '-' ,$string);
return htmlentities(preg_replace('/[^A-Za-z0-9\-]/', ' ' ,$string)); // Removes special chars.
}
public static function mvp_player_license_status_option(){
$mvp_player_license_option = get_option( 'mvp_player_license_option' );
return $mvp_player_license_option;
}
public static function mvp_license_status($license){
// All Dummy Licenses
$singleLKey = "uww1pb3ff8cndxp";
$threeLKey = "gqbybg2mhbqoguf";
$fiveLKey = "yh07nwd7qkj62e6";
$agencyLKey = "ywi0pomw3ivdmd4";
if($license == $singleLKey || $license == $threeLKey || $license == $fiveLKey ||$license == $agencyLKey){
$license_data_options = (object) array(
'status'=>'success',
'result'=>'success',
'date_expiry'=>__('lifetime','mvp'),
'message' => __('License Activated','mvp'),
);
return $license_data_options;
}else{
$api_params = array(
'slm_action' => 'slm_check',
'secret_key' => LICENSE_PLUGIN_SECRET_KEY,
'license_key' => $license,
'registered_domain' => $_SERVER['HTTP_HOST']
);
$response = wp_remote_get(add_query_arg($api_params, LICENSE_PLUGIN_LICENSE_SERVER_URL), array('timeout' => 45, 'sslverify' => false));
if ( is_wp_error( $response ) ) {
$license_data_options = (object) array(
'status'=>'Error',
'message' => __('There seems to be a problem. Please try again','mvp'),
);
}else{
$resdata =json_decode($response['body']);
if($resdata->result== 'success'){
$license_data_options = $resdata;
}else{
$license_data_options = "";
}
}
return $license_data_options;
}
}
}