| 1 |
<?php |
| 2 |
/* |
| 3 |
* Plugin Name: HTML5 Audio Player - The Ultimate No-Code Podcast, MP3 & Audio Player |
| 4 |
* Plugin URI: https://bplugins.com/products/html5-audio-player/ |
| 5 |
* Description: You can easily integrate html5 audio player in your WordPress website using this plugin. |
| 6 |
* Version: 2.8.0 |
| 7 |
* Requires at least: 6.5 |
| 8 |
* Tested up to: 7.0 |
| 9 |
* Requires PHP: 7.1 |
| 10 |
* Author: bPlugins |
| 11 |
* Author URI: http://bPlugins.com |
| 12 |
* License: GPLv2 or later |
| 13 |
* Text Domain: html5-audio-player |
| 14 |
*/ |
| 15 |
|
| 16 |
if (!defined('ABSPATH')) { |
| 17 |
exit; |
| 18 |
} |
| 19 |
|
| 20 |
if (function_exists('h5ap_fs')) { |
| 21 |
h5ap_fs()->set_basename(true, __FILE__); |
| 22 |
} else { |
| 23 |
define('H5AP_PLUGIN_DIR', plugin_dir_url(__FILE__)); |
| 24 |
define('H5AP_VERSION', isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] === 'dev.local' ? time() : '2.8.0'); |
| 25 |
|
| 26 |
if (file_exists(dirname(__FILE__) . '/vendor/autoload.php')) { |
| 27 |
require_once(dirname(__FILE__) . '/vendor/autoload.php'); |
| 28 |
} |
| 29 |
|
| 30 |
if (file_exists(dirname(__FILE__) . '/inc/functions.php')) { |
| 31 |
require_once(dirname(__FILE__) . '/inc/functions.php'); |
| 32 |
} |
| 33 |
|
| 34 |
if (!class_exists('CSF')) { |
| 35 |
require_once(dirname(__FILE__) . '/vendor/codestar-framework/codestar-framework.php'); |
| 36 |
} |
| 37 |
|
| 38 |
if (! function_exists('h5ap_fs')) { |
| 39 |
// Create a helper function for easy SDK access. |
| 40 |
function h5ap_fs(){ |
| 41 |
global $h5ap_fs; |
| 42 |
|
| 43 |
if (! isset($h5ap_fs)) { |
| 44 |
// Include Freemius SDK. |
| 45 |
// SDK is auto-loaded through composer |
| 46 |
$h5ap_fs = fs_dynamic_init(array( |
| 47 |
'id' => '14260', |
| 48 |
'slug' => 'html5-audio-player', |
| 49 |
'type' => 'plugin', |
| 50 |
'public_key' => 'pk_ea4da01be073820a5edf59346b675', |
| 51 |
'is_premium' => false, |
| 52 |
'premium_slug' => 'html5-audio-player-pro', |
| 53 |
'premium_suffix' => 'Pro', |
| 54 |
'has_premium_version' => true, |
| 55 |
'has_addons' => false, |
| 56 |
'has_paid_plans' => true, |
| 57 |
'has_affiliation' => 'selected', |
| 58 |
'menu' => array( |
| 59 |
'slug' => 'html5-audio-player', |
| 60 |
'support' => false, |
| 61 |
'contact' => false, |
| 62 |
'affiliation' => false, |
| 63 |
), |
| 64 |
)); |
| 65 |
} |
| 66 |
|
| 67 |
return $h5ap_fs; |
| 68 |
} |
| 69 |
|
| 70 |
// Init Freemius. |
| 71 |
h5ap_fs(); |
| 72 |
// Signal that SDK was initiated. |
| 73 |
do_action('h5ap_fs_loaded'); |
| 74 |
} |
| 75 |
|
| 76 |
if (class_exists('H5APPlayer\\Init')) { |
| 77 |
H5APPlayer\Init::register_services(); |
| 78 |
} |
| 79 |
|
| 80 |
add_action('plugins_loaded', function () { |
| 81 |
require_once 'shortcode/player.php'; |
| 82 |
require_once 'inc/admin.php'; |
| 83 |
require_once('tinymce/ewic-tinymce.php'); |
| 84 |
require_once(__DIR__ . '/blocks.php'); |
| 85 |
require_once(__DIR__ . '/blocks/init.php'); |
| 86 |
|
| 87 |
add_filter('template_include', 'h5ap_search_template'); |
| 88 |
function h5ap_search_template($template){ |
| 89 |
// phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 90 |
if (!isset($_GET['bps'])) |
| 91 |
return $template; |
| 92 |
|
| 93 |
return dirname(__FILE__) . '/inc/Template/search.php'; |
| 94 |
} |
| 95 |
}); |
| 96 |
|
| 97 |
|
| 98 |
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'h5ap_add_help_demo_link' ); |
| 99 |
|
| 100 |
function h5ap_add_help_demo_link( $links ) { |
| 101 |
|
| 102 |
$help_link = '<a href="' . admin_url( 'admin.php?page=html5-audio-player-help-demo' ) . '" style="color:#FF7A00;font-weight:bold;">Help & Demos</a>'; |
| 103 |
|
| 104 |
$links[] = $help_link; |
| 105 |
|
| 106 |
return $links; |
| 107 |
} |
| 108 |
|
| 109 |
} |
| 110 |
|
| 111 |
|
| 112 |
|