File: /home/bt667/public_html/wp-content/plugins/wp_mvplayer/wp_mvplayer.php
<?php
/*
Plugin Name: MVP Player
Plugin URI:
Description: MVP - Most complete and engaging Video Player Plugin for your WordPress Site.
Version: 1.24
Author: wpqualityplugins | View Details
Author URI: https://wpqualityplugins.com/mvp/
Text Domain: mvp
*/
define('MV_PLAYER_URL', plugin_dir_url(__FILE__));
define('MV_PLAYER_PATH', plugin_dir_path(__FILE__));
define('MV_PLAYER_VERSION', '1.11');
define('MV_PLAYER_SLUG', 'mv-player');
define('MV_PLAYER_FILE', __FILE__);
define('LICENSE_PLUGIN_SECRET_KEY', '631c981aa59459.04946878');
define('LICENSE_PLUGIN_LICENSE_SERVER_URL', 'https://marketersvideoplayer.com/');
define('LICENSE_PLUGIN_ITEM_REFERENCE', 'MVP Player');
// Portfolio Importer Json URL
define( 'MVP_PLUGIN_UPDATE_JSON_URL', 'https://marketersvideoplayer.com/mvp-details.json');
// Plugin Update Checker
require 'mvplayer-update-checker/mvplayer-update-checker.php';
$myUpdateChecker = Puc_v4_Factory::buildUpdateChecker(
MVP_PLUGIN_UPDATE_JSON_URL,
__FILE__, //Full path to the main plugin file or functions.php.
'wp_mvplayer'
);
require_once MV_PLAYER_PATH . 'includes/class-mvp-importer-helper.php';
require_once MV_PLAYER_PATH . 'admin/class-admin-wpmvp.php';
require_once MV_PLAYER_PATH . 'init.php';
//activated plugin
add_action('activated_plugin', 'mvp_activate');
function mvp_activate()
{
$mvp_player_license_option = mvp_importer_helper::mvp_player_license_status_option();
if (empty($mvp_player_license_option)) {
exit(wp_redirect(admin_url('admin.php?page=mv_player_license_required')));
}
}
// deactivated plugin
register_deactivation_hook(__FILE__, 'mvp_deactivate');
function mvp_deactivate()
{
update_option('mvp_player_license_option', '');
}
//admin notices code
add_action('admin_notices', 'mvp_admin_notice');
function mvp_admin_notice()
{
global $pagenow;
$video_url = $pagenow . '?page=mv_player_manage_video';
$mvp_player_license_option = MVP_Importer_Helper::mvp_player_license_status_option();
if (!empty($mvp_player_license_option)) {
$license = $mvp_player_license_option['license_key'];
$status = $mvp_player_license_option['status'];
$mvp_player_license_expiry = MVP_Importer_Helper::mvp_license_status($license);
if ((isset($mvp_player_license_expiry)) && ($mvp_player_license_expiry->status == 'Error')) {
echo '<div class="notice notice-success is-dismissible">
<p>' . $mvp_player_license_expiry->message . ' </p>
</div>';
} elseif ($video_url == 'admin.php?page=mv_player_manage_video' && $status == 'Active') {
if (isset($mvp_player_license_expiry->date_expiry)) {
$date_expiry = date('d-m-Y', strtotime($mvp_player_license_expiry->date_expiry));
} else {
$date_expiry = "";
}
echo '<div class="notice notice-success is-dismissible">
<p>' . __('Your License is activated. License Till ', 'mvp') . $date_expiry . ' </p>
</div>';
} elseif ($video_url == 'admin.php?page=mv_player_manage_video' && $status == 'Expired') {
echo '<div class="notice notice-success is-dismissible">
<p>' . __('Your License is expired.', 'mvp') . '</p>
</div>';
}
}
}
// cron schedules code
add_filter('cron_schedules', 'mvp_add_every_one_minutes');
function mvp_add_every_one_minutes($schedules)
{
$schedules['every_one_minutes'] = array(
'interval' => 60,
'display' => __('Every 1 Minutes', 'mvp'),
);
return $schedules;
}
// Schedule an action if it's not already scheduled
if (!wp_next_scheduled('mvp_add_every_one_minutes')) {
wp_schedule_event(time(), 'every_one_minutes', 'mvp_add_every_one_minutes');
}
// Hook into that action that'll fire every one minutes
add_action('mvp_add_every_one_minutes', 'mvp_every_one_minutes_event_func');
function mvp_every_one_minutes_event_func()
{
$mvp_player_license_option = MVP_Importer_Helper::mvp_player_license_status_option();
$license = (isset($mvp_player_license_option['license_key'])) ? $mvp_player_license_option['license_key'] : '';
if (!isset($license) && empty($license)) {
$mvp_player_license_expiry = MVP_Importer_Helper::mvp_license_status($license);
if ((isset($mvp_player_license_expiry)) && ($mvp_player_license_expiry->status == 'Error')) {
} elseif (isset($mvp_player_license_expiry)) {
$status = (isset($mvp_player_license_option->status)) ? $mvp_player_license_option->status : '';
$date_expiry = strtotime($mvp_player_license_expiry->date_expiry);
$today = strtotime(date("Y-m-d"));
if ($today > $date_expiry) {
$license_data_expiry = array(
'status' => 'Expired',
'license_key' => $license,
);
update_option('mvp_player_license_option', $license_data_expiry);
} else {
$license_data_expiry = array(
'status' => 'Active',
'license_key' => $license,
);
update_option('mvp_player_license_option', $license_data_expiry);
}
}
}
}