Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/embedpre...
File: includes.php
<?php
[0] Fix | Delete
defined('ABSPATH') or die("No direct script access allowed.");
[1] Fix | Delete
[2] Fix | Delete
/**
[3] Fix | Delete
* File responsible for defining basic general constants used by the plugin.
[4] Fix | Delete
*
[5] Fix | Delete
* @package EmbedPress
[6] Fix | Delete
* @author EmbedPress <help@embedpress.com>
[7] Fix | Delete
* @copyright Copyright (C) 2021 WPDeveloper. All rights reserved.
[8] Fix | Delete
* @license GPLv3 or later
[9] Fix | Delete
* @since 1.0.0
[10] Fix | Delete
*/
[11] Fix | Delete
[12] Fix | Delete
[13] Fix | Delete
if ( ! defined('EMBEDPRESS')) {
[14] Fix | Delete
[15] Fix | Delete
define('EMBEDPRESS', "EmbedPress");
[16] Fix | Delete
}
[17] Fix | Delete
[18] Fix | Delete
if ( ! defined('EMBEDPRESS_PLG_NAME')) {
[19] Fix | Delete
define('EMBEDPRESS_PLG_NAME', 'embedpress');
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
if ( ! defined('EMBEDPRESS_VERSION')) {
[23] Fix | Delete
define('EMBEDPRESS_VERSION', "4.0.6");
[24] Fix | Delete
/**
[25] Fix | Delete
* @deprecated 2.2.0
[26] Fix | Delete
*/
[27] Fix | Delete
define('EMBEDPRESS_PLG_VERSION', EMBEDPRESS_VERSION);
[28] Fix | Delete
}
[29] Fix | Delete
[30] Fix | Delete
[31] Fix | Delete
if ( ! defined('EMBEDPRESS_ROOT')) {
[32] Fix | Delete
define('EMBEDPRESS_ROOT', dirname(__FILE__));
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
if ( ! defined('EMBEDPRESS_PATH_BASE')) {
[36] Fix | Delete
define('EMBEDPRESS_PATH_BASE', plugin_dir_path(__FILE__));
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
if ( ! defined('EMBEDPRESS_PATH_CORE')) {
[40] Fix | Delete
define('EMBEDPRESS_PATH_CORE', EMBEDPRESS_PATH_BASE . "EmbedPress/");
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
if ( ! defined('EMBEDPRESS_URL_ASSETS')) {
[44] Fix | Delete
define('EMBEDPRESS_URL_ASSETS', plugins_url(EMBEDPRESS_PLG_NAME) . "/assets/");
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
if ( ! defined('EMBEDPRESS_NAMESPACE')) {
[48] Fix | Delete
define('EMBEDPRESS_NAMESPACE', "\\EmbedPress");
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
if ( ! defined('EMBEDPRESS_AUTOLOADER_NAME')) {
[52] Fix | Delete
define('EMBEDPRESS_AUTOLOADER_NAME', "AutoLoader");
[53] Fix | Delete
}
[54] Fix | Delete
[55] Fix | Delete
if ( ! defined('EMBEDPRESS_SHORTCODE')) {
[56] Fix | Delete
define('EMBEDPRESS_SHORTCODE', "embed");
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
if ( ! defined('EMBEDPRESS_LICENSES_API_HOST')) {
[60] Fix | Delete
define('EMBEDPRESS_LICENSES_API_HOST', "embedpress.com");
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
if ( ! defined('EMBEDPRESS_LICENSES_API_URL')) {
[64] Fix | Delete
define('EMBEDPRESS_LICENSES_API_URL', "https://embedpress.com");
[65] Fix | Delete
}
[66] Fix | Delete
[67] Fix | Delete
if ( ! defined('EMBEDPRESS_LICENSES_MORE_INFO_URL')) {
[68] Fix | Delete
define('EMBEDPRESS_LICENSES_MORE_INFO_URL', "https://embedpress.com/docs/activate-license");
[69] Fix | Delete
}
[70] Fix | Delete
function embedpress_cache_cleanup( ){
[71] Fix | Delete
$dirname = wp_get_upload_dir()['basedir'].'/embedpress';
[72] Fix | Delete
if ( file_exists( $dirname) ) {
[73] Fix | Delete
$files = glob($dirname.'/*');
[74] Fix | Delete
//@TODO; delete files only those start with 'mu_'
[75] Fix | Delete
foreach($files as $file) {
[76] Fix | Delete
if(is_file($file))
[77] Fix | Delete
unlink($file);
[78] Fix | Delete
}
[79] Fix | Delete
}
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
function embedpress_schedule_cache_cleanup( ){
[83] Fix | Delete
if ( ! wp_next_scheduled( 'embedpress_cache_cleanup_action' ) ) {
[84] Fix | Delete
wp_schedule_event( time(), 'daily', 'embedpress_cache_cleanup_action' );
[85] Fix | Delete
}
[86] Fix | Delete
}
[87] Fix | Delete
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
[88] Fix | Delete
require_once __DIR__ . '/vendor/autoload.php';
[89] Fix | Delete
}
[90] Fix | Delete
if (file_exists(__DIR__ . '/EmbedPress/ThirdParty/Googlecalendar/Embedpress_Google_Helper.php')) {
[91] Fix | Delete
require_once __DIR__ . '/EmbedPress/ThirdParty/Googlecalendar/Embedpress_Google_Helper.php';
[92] Fix | Delete
}
[93] Fix | Delete
function is_embedpress_pro_active() {
[94] Fix | Delete
if ( ! function_exists( 'is_plugin_active') ) {
[95] Fix | Delete
include_once ABSPATH . 'wp-admin/includes/plugin.php';
[96] Fix | Delete
}
[97] Fix | Delete
[98] Fix | Delete
return is_plugin_active('embedpress-pro/embedpress-pro.php');
[99] Fix | Delete
}
[100] Fix | Delete
[101] Fix | Delete
/**
[102] Fix | Delete
* Get the version of the currently activated embedpress pro plugin dynamically
[103] Fix | Delete
* @return false|mixed
[104] Fix | Delete
*/
[105] Fix | Delete
function get_embedpress_pro_version() {
[106] Fix | Delete
if ( is_embedpress_pro_active() ) {
[107] Fix | Delete
if(defined('EMBEDPRESS_PRO_PLUGIN_VERSION')){
[108] Fix | Delete
return EMBEDPRESS_PRO_PLUGIN_VERSION;
[109] Fix | Delete
}
[110] Fix | Delete
$p = wp_get_active_and_valid_plugins();
[111] Fix | Delete
$p = array_filter( $p, function ( $plugin){
[112] Fix | Delete
return !empty( strpos( $plugin, 'embedpress-pro'));
[113] Fix | Delete
});
[114] Fix | Delete
$p = array_values( $p);
[115] Fix | Delete
if ( !empty( $p[0]) ) {
[116] Fix | Delete
$d = get_plugin_data($p[0]);
[117] Fix | Delete
if ( isset( $d['Version']) ) {
[118] Fix | Delete
return $d['Version'];
[119] Fix | Delete
}
[120] Fix | Delete
return false;
[121] Fix | Delete
}
[122] Fix | Delete
return false;
[123] Fix | Delete
}
[124] Fix | Delete
return false;
[125] Fix | Delete
[126] Fix | Delete
}
[127] Fix | Delete
// Run the plugin autoload script
[128] Fix | Delete
if ( ! defined('EMBEDPRESS_IS_LOADED')) {
[129] Fix | Delete
require_once EMBEDPRESS_PATH_BASE . "autoloader.php";
[130] Fix | Delete
}
[131] Fix | Delete
[132] Fix | Delete
// Update string attributes values to boleen
[133] Fix | Delete
if (!function_exists('stringToBoolean')){
[134] Fix | Delete
function stringToBoolean($attributes) {
[135] Fix | Delete
if(is_array($attributes)) {
[136] Fix | Delete
foreach ($attributes as $key => $value) {
[137] Fix | Delete
if(!empty($value) && $value === 'true'){
[138] Fix | Delete
$attributes[$key] = true;
[139] Fix | Delete
}
[140] Fix | Delete
else if(!empty($value) && $value === 'false'){
[141] Fix | Delete
$attributes[$key] = false;
[142] Fix | Delete
}
[143] Fix | Delete
}
[144] Fix | Delete
}
[145] Fix | Delete
return $attributes;
[146] Fix | Delete
}
[147] Fix | Delete
}
[148] Fix | Delete
[149] Fix | Delete
[150] Fix | Delete
[151] Fix | Delete
// Includes the Gutenberg blocks for EmbedPress
[152] Fix | Delete
require_once __DIR__ . '/Gutenberg/plugin.php';
[153] Fix | Delete
[154] Fix | Delete
[155] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function