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.../EmbedPre...
File: Core.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace EmbedPress;
[2] Fix | Delete
[3] Fix | Delete
use EmbedPress\Ends\Back\Handler as EndHandlerAdmin;
[4] Fix | Delete
use EmbedPress\Ends\Back\Settings\EmbedpressSettings;
[5] Fix | Delete
use EmbedPress\Ends\Front\Handler as EndHandlerPublic;
[6] Fix | Delete
use EmbedPress\Includes\Traits\Shared;
[7] Fix | Delete
[8] Fix | Delete
[9] Fix | Delete
(defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Entity that glues together all pieces that the plugin is made of, for WordPress 5+.
[13] Fix | Delete
*
[14] Fix | Delete
* @package EmbedPress
[15] Fix | Delete
* @author EmbedPress <help@embedpress.com>
[16] Fix | Delete
* @copyright Copyright (C) 2021 WPDeveloper. All rights reserved.
[17] Fix | Delete
* @license GPLv3 or later
[18] Fix | Delete
* @since 1.0.0
[19] Fix | Delete
*/
[20] Fix | Delete
class Core {
[21] Fix | Delete
use Shared;
[22] Fix | Delete
[23] Fix | Delete
/**
[24] Fix | Delete
* The name of the plugin.
[25] Fix | Delete
*
[26] Fix | Delete
* @since 1.0.0
[27] Fix | Delete
* @access protected
[28] Fix | Delete
*
[29] Fix | Delete
* @var string $pluginName The name of the plugin.
[30] Fix | Delete
*/
[31] Fix | Delete
protected $pluginName;
[32] Fix | Delete
[33] Fix | Delete
/**
[34] Fix | Delete
* The version of the plugin.
[35] Fix | Delete
*
[36] Fix | Delete
* @since 1.0.0
[37] Fix | Delete
* @access protected
[38] Fix | Delete
*
[39] Fix | Delete
* @var string $pluginVersion The version of the plugin.
[40] Fix | Delete
*/
[41] Fix | Delete
protected $pluginVersion;
[42] Fix | Delete
[43] Fix | Delete
/**
[44] Fix | Delete
* An instance of the plugin loader.
[45] Fix | Delete
*
[46] Fix | Delete
* @since 1.0.0
[47] Fix | Delete
* @access protected
[48] Fix | Delete
*
[49] Fix | Delete
* @var Loader $pluginVersion The version of the plugin.
[50] Fix | Delete
*/
[51] Fix | Delete
protected $loaderInstance;
[52] Fix | Delete
[53] Fix | Delete
/**
[54] Fix | Delete
* An associative array storing all registered/active EmbedPress plugins and their namespaces.
[55] Fix | Delete
*
[56] Fix | Delete
* @since 1.4.0
[57] Fix | Delete
* @access private
[58] Fix | Delete
* @static
[59] Fix | Delete
*
[60] Fix | Delete
* @var array
[61] Fix | Delete
*/
[62] Fix | Delete
private static $plugins = [];
[63] Fix | Delete
[64] Fix | Delete
/**
[65] Fix | Delete
* Initialize the plugin and set its properties.
[66] Fix | Delete
*
[67] Fix | Delete
* @return void
[68] Fix | Delete
* @since 1.0.0
[69] Fix | Delete
*
[70] Fix | Delete
*/
[71] Fix | Delete
public function __construct () {
[72] Fix | Delete
$this->pluginName = EMBEDPRESS_PLG_NAME;
[73] Fix | Delete
$this->pluginVersion = EMBEDPRESS_VERSION;
[74] Fix | Delete
[75] Fix | Delete
$this->loaderInstance = new Loader();
[76] Fix | Delete
[77] Fix | Delete
add_action('admin_notices',[$this,'embedpress_admin_notice']);
[78] Fix | Delete
[79] Fix | Delete
add_filter('upload_mimes', [$this, 'extended_mime_types']);
[80] Fix | Delete
[81] Fix | Delete
}
[82] Fix | Delete
[83] Fix | Delete
/**
[84] Fix | Delete
* Method that retrieves the plugin name.
[85] Fix | Delete
*
[86] Fix | Delete
* @return string
[87] Fix | Delete
* @since 1.0.0
[88] Fix | Delete
*
[89] Fix | Delete
*/
[90] Fix | Delete
public function getPluginName () {
[91] Fix | Delete
return $this->pluginName;
[92] Fix | Delete
}
[93] Fix | Delete
[94] Fix | Delete
/**
[95] Fix | Delete
* Method that retrieves the plugin version.
[96] Fix | Delete
*
[97] Fix | Delete
* @return string
[98] Fix | Delete
* @since 1.0.0
[99] Fix | Delete
*
[100] Fix | Delete
*/
[101] Fix | Delete
public function getPluginVersion () {
[102] Fix | Delete
return $this->pluginVersion;
[103] Fix | Delete
}
[104] Fix | Delete
[105] Fix | Delete
/**
[106] Fix | Delete
* Method that retrieves the loader instance.
[107] Fix | Delete
*
[108] Fix | Delete
* @return Loader
[109] Fix | Delete
* @since 1.0.0
[110] Fix | Delete
*
[111] Fix | Delete
*/
[112] Fix | Delete
public function getLoader () {
[113] Fix | Delete
return $this->loaderInstance;
[114] Fix | Delete
}
[115] Fix | Delete
[116] Fix | Delete
/**
[117] Fix | Delete
* Method responsible to connect all required hooks in order to make the plugin work.
[118] Fix | Delete
*
[119] Fix | Delete
* @return void
[120] Fix | Delete
* @since 1.0.0
[121] Fix | Delete
*
[122] Fix | Delete
*/
[123] Fix | Delete
public function initialize () {
[124] Fix | Delete
global $wp_actions;
[125] Fix | Delete
add_filter('oembed_providers', [$this, 'addOEmbedProviders']);
[126] Fix | Delete
add_action('rest_api_init', [$this, 'registerOEmbedRestRoutes']);
[127] Fix | Delete
[128] Fix | Delete
$this->start_plugin_tracking();
[129] Fix | Delete
[130] Fix | Delete
if (is_admin()) {
[131] Fix | Delete
new EmbedpressSettings();
[132] Fix | Delete
$plgSettings = self::getSettings();
[133] Fix | Delete
$this->admin_notice();
[134] Fix | Delete
add_filter('plugin_action_links_embedpress/embedpress.php', ['\\EmbedPress\\Core', 'handleActionLinks'], 10,
[135] Fix | Delete
2);
[136] Fix | Delete
[137] Fix | Delete
add_action('admin_enqueue_scripts', ['\\EmbedPress\\Ends\\Back\\Handler', 'enqueueStyles']);
[138] Fix | Delete
add_action('wp_ajax_embedpress_notice_dismiss', ['\\EmbedPress\\Ends\\Back\\Handler', 'embedpress_notice_dismiss']);
[139] Fix | Delete
[140] Fix | Delete
$plgHandlerAdminInstance = new EndHandlerAdmin($this->getPluginName(), $this->getPluginVersion());
[141] Fix | Delete
[142] Fix | Delete
if ( $plgSettings->enablePluginInAdmin ) {
[143] Fix | Delete
$this->loaderInstance->add_action('admin_enqueue_scripts', $plgHandlerAdminInstance, 'enqueueScripts');
[144] Fix | Delete
}
[145] Fix | Delete
[146] Fix | Delete
} else {
[147] Fix | Delete
$plgHandlerPublicInstance = new EndHandlerPublic($this->getPluginName(), $this->getPluginVersion());
[148] Fix | Delete
[149] Fix | Delete
$this->loaderInstance->add_action('wp_enqueue_scripts', $plgHandlerPublicInstance, 'enqueueScripts');
[150] Fix | Delete
$this->loaderInstance->add_action('wp_enqueue_scripts', $plgHandlerPublicInstance, 'enqueueStyles');
[151] Fix | Delete
[152] Fix | Delete
unset($plgHandlerPublicInstance);
[153] Fix | Delete
}
[154] Fix | Delete
[155] Fix | Delete
// Add support for embeds on AMP pages
[156] Fix | Delete
add_filter('pp_embed_parsed_content', ['\\EmbedPress\\AMP\\EmbedHandler', 'processParsedContent'], 10, 3);
[157] Fix | Delete
[158] Fix | Delete
// Add support for our embeds on Beaver Builder. Without this it only run the native embeds.
[159] Fix | Delete
add_filter('fl_builder_before_render_shortcodes',
[160] Fix | Delete
['\\EmbedPress\\ThirdParty\\BeaverBuilder', 'before_render_shortcodes']);
[161] Fix | Delete
$this->loaderInstance->run();
[162] Fix | Delete
[163] Fix | Delete
}
[164] Fix | Delete
[165] Fix | Delete
/**
[166] Fix | Delete
* @param $providers
[167] Fix | Delete
*
[168] Fix | Delete
* @return mixed
[169] Fix | Delete
*/
[170] Fix | Delete
public function addOEmbedProviders ($providers) {
[171] Fix | Delete
$newProviders = [
[172] Fix | Delete
// Viddler
[173] Fix | Delete
'#https?://(.+\.)?viddler\.com/v/.+#i' => 'viddler',
[174] Fix | Delete
[175] Fix | Delete
// Deviantart.com (http://www.deviantart.com)
[176] Fix | Delete
// '#https?://(.+\.)?deviantart\.com/art/.+#i' => 'devianart',
[177] Fix | Delete
// '#https?://(.+\.)?deviantart\.com/.+#i' => 'devianart',
[178] Fix | Delete
// '#https?://(.+\.)?deviantart\.com/.*/d.+#i' => 'devianart',
[179] Fix | Delete
// '#https?://(.+\.)?fav\.me/.+#i' => 'devianart',
[180] Fix | Delete
// '#https?://(.+\.)?sta\.sh/.+#i' => 'devianart',
[181] Fix | Delete
[182] Fix | Delete
// chirbit.com (http://www.chirbit.com/)
[183] Fix | Delete
//'#https?://(.+\.)?chirb\.it/.+#i' => 'chirbit',
[184] Fix | Delete
[185] Fix | Delete
[186] Fix | Delete
// nfb.ca (http://www.nfb.ca/)
[187] Fix | Delete
//'#https?://(.+\.)?nfb\.ca/film/.+#i' => 'nfb',
[188] Fix | Delete
[189] Fix | Delete
// Dotsub (http://dotsub.com/)
[190] Fix | Delete
//'#https?://(.+\.)?dotsub\.com/view/.+#i' => 'dotsub',
[191] Fix | Delete
[192] Fix | Delete
// Rdio (http://rdio.com/)
[193] Fix | Delete
'#https?://(.+\.)?rdio\.com/(artist|people)/.+#i' => 'rdio',
[194] Fix | Delete
[195] Fix | Delete
// Sapo Videos (http://videos.sapo.pt)
[196] Fix | Delete
//'#https?://(.+\.)?videos\.sapo\.pt/.+#i' => 'sapo',
[197] Fix | Delete
[198] Fix | Delete
// Official FM (http://official.fm)
[199] Fix | Delete
'#https?://(.+\.)?official\.fm/(tracks|playlists)/.+#i' => 'officialfm',
[200] Fix | Delete
[201] Fix | Delete
// HuffDuffer (http://huffduffer.com)
[202] Fix | Delete
//'#https?://(.+\.)?huffduffer\.com/.+#i' => 'huffduffer',
[203] Fix | Delete
[204] Fix | Delete
// Shoudio (http://shoudio.com)
[205] Fix | Delete
//'#https?://(.+\.)?shoudio\.(com|io)/.+#i' => 'shoudio',
[206] Fix | Delete
[207] Fix | Delete
// Moby Picture (http://www.mobypicture.com)
[208] Fix | Delete
'#https?://(.+\.)?mobypicture\.com/user/.+/view/.+#i' => 'mobypicture',
[209] Fix | Delete
'#https?://(.+\.)?moby\.to/.+#i' => 'mobypicture',
[210] Fix | Delete
[211] Fix | Delete
// 23HQ (http://www.23hq.com)
[212] Fix | Delete
//'#https?://(.+\.)?23hq\.com/.+/photo/.+#i' => '23hq',
[213] Fix | Delete
[214] Fix | Delete
// Cacoo (https://cacoo.com)
[215] Fix | Delete
'#https?://(.+\.)?cacoo\.com/diagrams/.+#i' => 'cacoo',
[216] Fix | Delete
[217] Fix | Delete
// Dipity (http://www.dipity.com)
[218] Fix | Delete
'#https?://(.+\.)?dipity\.com/.+#i' => 'dipity',
[219] Fix | Delete
[220] Fix | Delete
// Roomshare (http://roomshare.jp)
[221] Fix | Delete
//'#https?://(.+\.)?roomshare\.jp/(en/)?post/.+#i' => 'roomshare',
[222] Fix | Delete
[223] Fix | Delete
// Crowd Ranking (http://crowdranking.com)
[224] Fix | Delete
'#https?://(.+\.)?c9ng\.com/.+#i' => 'crowd',
[225] Fix | Delete
[226] Fix | Delete
// CircuitLab (https://www.circuitlab.com/)
[227] Fix | Delete
//'#https?://(.+\.)?circuitlab\.com/circuit/.+#i' => 'circuitlab',
[228] Fix | Delete
[229] Fix | Delete
// Coub (http://coub.com/)
[230] Fix | Delete
//'#https?://(.+\.)?coub\.com/(view|embed)/.+#i' => 'coub',
[231] Fix | Delete
[232] Fix | Delete
// Ustream (http://www.ustream.tv)
[233] Fix | Delete
//'#https?://(.+\.)?ustream\.(tv|com)/.+#i' => 'ustream',
[234] Fix | Delete
[235] Fix | Delete
// Daily Mile (http://www.dailymile.com)
[236] Fix | Delete
'#https?://(.+\.)?dailymile\.com/people/.+/entries/.+#i' => 'daily',
[237] Fix | Delete
[238] Fix | Delete
// Sketchfab (http://sketchfab.com)
[239] Fix | Delete
'#https?://(.+\.)?sketchfab\.com/models/.+#i' => 'sketchfab',
[240] Fix | Delete
'#https?://(.+\.)?sketchfab\.com/.+/folders/.+#i' => 'sketchfab',
[241] Fix | Delete
[242] Fix | Delete
// AudioSnaps (http://audiosnaps.com)
[243] Fix | Delete
'#https?://(.+\.)?audiosnaps\.com/k/.+#i' => 'audiosnaps',
[244] Fix | Delete
[245] Fix | Delete
// RapidEngage (https://rapidengage.com)
[246] Fix | Delete
'#https?://(.+\.)?rapidengage\.com/s/.+#i' => 'rapidengage',
[247] Fix | Delete
[248] Fix | Delete
// Getty Images (http://www.gettyimages.com/)
[249] Fix | Delete
//'#https?://(.+\.)?gty\.im/.+#i' => 'gettyimages',
[250] Fix | Delete
//'#https?://(.+\.)?gettyimages\.com/detail/photo/.+#i' => 'gettyimages',
[251] Fix | Delete
[252] Fix | Delete
// amCharts Live Editor (http://live.amcharts.com/)
[253] Fix | Delete
//'#https?://(.+\.)?live\.amcharts\.com/.+#i' => 'amcharts',
[254] Fix | Delete
[255] Fix | Delete
// Infogram (https://infogr.am/)
[256] Fix | Delete
//'#https?://(.+\.)?infogr\.am/.+#i' => 'infogram',
[257] Fix | Delete
//(https://infogram.com/)
[258] Fix | Delete
//'#https?://(.+\.)?infogram\.com/.+#i' => 'infogram',
[259] Fix | Delete
[260] Fix | Delete
// ChartBlocks (http://www.chartblocks.com/)
[261] Fix | Delete
//'#https?://(.+\.)?public\.chartblocks\.com/c/.+#i' => 'chartblocks',
[262] Fix | Delete
[263] Fix | Delete
// ReleaseWire (http://www.releasewire.com/)
[264] Fix | Delete
//'#https?://(.+\.)?rwire\.com/.+#i' => 'releasewire',
[265] Fix | Delete
[266] Fix | Delete
// ShortNote (https://www.shortnote.jp/)
[267] Fix | Delete
//'#https?://(.+\.)?shortnote\.jp/view/notes/.+#i' => 'shortnote',
[268] Fix | Delete
[269] Fix | Delete
// EgliseInfo (http://egliseinfo.catholique.fr/)
[270] Fix | Delete
'#https?://(.+\.)?egliseinfo\.catholique\.fr/.+#i' => 'egliseinfo',
[271] Fix | Delete
[272] Fix | Delete
// Silk (http://www.silk.co/)
[273] Fix | Delete
'#https?://(.+\.)?silk\.co/explore/.+#i' => 'silk',
[274] Fix | Delete
'#https?://(.+\.)?silk\.co/s/embed/.+#i' => 'silk',
[275] Fix | Delete
[276] Fix | Delete
// http://bambuser.com
[277] Fix | Delete
'#https?://(.+\.)?bambuser\.com/v/.+#i' => 'bambuser',
[278] Fix | Delete
[279] Fix | Delete
// https://clyp.it
[280] Fix | Delete
//'#https?://(.+\.)?clyp\.it/.+#i' => 'clyp',
[281] Fix | Delete
[282] Fix | Delete
// https://gist.github.com
[283] Fix | Delete
// '#https?://(.+\.)?gist\.github\.com/.+#i' => 'github',
[284] Fix | Delete
[285] Fix | Delete
// https://portfolium.com
[286] Fix | Delete
//'#https?://(.+\.)?portfolium\.com/.+#i' => 'portfolium',
[287] Fix | Delete
[288] Fix | Delete
// http://rutube.ru
[289] Fix | Delete
'#https?://(.+\.)?rutube\.ru/video/.+#i' => 'rutube',
[290] Fix | Delete
[291] Fix | Delete
// http://www.videojug.com
[292] Fix | Delete
'#https?://(.+\.)?videojug\.com/.+#i' => 'videojug',
[293] Fix | Delete
[294] Fix | Delete
// https://vine.com
[295] Fix | Delete
//'#https?://(.+\.)?vine\.co/v/.+#i' => 'vine',
[296] Fix | Delete
[297] Fix | Delete
// Google Shortened Url
[298] Fix | Delete
'#https?://(.+\.)?goo\.gl/.+#i' => 'google',
[299] Fix | Delete
[300] Fix | Delete
// Google Maps
[301] Fix | Delete
//'#https?://(.+\.)?google\.com/maps/.+#i' => 'googlemaps',
[302] Fix | Delete
//'#https?://(.+\.)?maps\.google\.com/.+#i' => 'googlemaps',
[303] Fix | Delete
[304] Fix | Delete
// Google Docs
[305] Fix | Delete
//'#https?://(.+\.)?docs\.google\.com/(.+/)?(document|presentation|spreadsheets|forms|drawings)/.+#i' => 'googledocs',
[306] Fix | Delete
[307] Fix | Delete
// Twitch.tv
[308] Fix | Delete
//'#https?://(.+\.)?twitch\.tv/.+#i' => 'twitch',
[309] Fix | Delete
[310] Fix | Delete
// Giphy
[311] Fix | Delete
//'#https?://(.+\.)?giphy\.com/gifs/.+#i' => 'giphy',
[312] Fix | Delete
//'#https?://(.+\.)?i\.giphy\.com/.+#i' => 'giphy',
[313] Fix | Delete
//'#https?://(.+\.)?gph\.is/.+#i' => 'giphy',
[314] Fix | Delete
[315] Fix | Delete
// Wistia
[316] Fix | Delete
//'#https?://(.+\.)?wistia\.com/medias/.+#i' => 'wistia',
[317] Fix | Delete
//'#https?://(.+\.)?fast\.wistia\.com/embed/medias/.+#i\.jsonp' => 'wistia',
[318] Fix | Delete
];
[319] Fix | Delete
[320] Fix | Delete
/**
[321] Fix | Delete
* ========================================
[322] Fix | Delete
* Make sure the $wp_write global is set.
[323] Fix | Delete
* This fix compatibility with JetPack, Classical Editor and Disable Gutenberg. JetPack makes
[324] Fix | Delete
* the oembed_providers filter be called and this activates our class too, but one dependency
[325] Fix | Delete
* of the rest_url method is not loaded yet.
[326] Fix | Delete
*/
[327] Fix | Delete
global $wp_rewrite;
[328] Fix | Delete
[329] Fix | Delete
if (!class_exists('\\WP_Rewrite')) {
[330] Fix | Delete
$path = ABSPATH.WPINC.'/class-wp-rewrite.php';
[331] Fix | Delete
if (file_exists($path)) {
[332] Fix | Delete
require_once $path;
[333] Fix | Delete
}
[334] Fix | Delete
}
[335] Fix | Delete
[336] Fix | Delete
if (!is_object($wp_rewrite)) {
[337] Fix | Delete
$wp_rewrite = new \WP_Rewrite();
[338] Fix | Delete
$_GLOBALS['wp_write'] = $wp_rewrite;
[339] Fix | Delete
}
[340] Fix | Delete
/*========================================*/
[341] Fix | Delete
[342] Fix | Delete
foreach ($newProviders as $url => &$data) {
[343] Fix | Delete
$data = [
[344] Fix | Delete
rest_url('embedpress/v1/oembed/'.$data),
[345] Fix | Delete
true,
[346] Fix | Delete
];
[347] Fix | Delete
}
[348] Fix | Delete
[349] Fix | Delete
$providers = array_merge($providers, $newProviders);
[350] Fix | Delete
[351] Fix | Delete
return $providers;
[352] Fix | Delete
}
[353] Fix | Delete
[354] Fix | Delete
/**
[355] Fix | Delete
* Register OEmbed Rest Routes
[356] Fix | Delete
*/
[357] Fix | Delete
public function registerOEmbedRestRoutes () {
[358] Fix | Delete
register_rest_route(
[359] Fix | Delete
'embedpress/v1', '/oembed/(?P<provider>[a-zA-Z0-9\-]+)',
[360] Fix | Delete
[
[361] Fix | Delete
'methods' => \WP_REST_Server::READABLE,
[362] Fix | Delete
'callback' => ['\\EmbedPress\\RestAPI', 'oembed'],
[363] Fix | Delete
'permission_callback' => '__return_true',
[364] Fix | Delete
]
[365] Fix | Delete
);
[366] Fix | Delete
register_rest_route(
[367] Fix | Delete
'embedpress/v1', '/oembed/(?P<provider>[a-zA-Z0-9\-]+)',
[368] Fix | Delete
[
[369] Fix | Delete
'methods' => \WP_REST_Server::CREATABLE,
[370] Fix | Delete
'callback' => ['\\EmbedPress\\RestAPI', 'oembed'],
[371] Fix | Delete
'permission_callback' => '__return_true',
[372] Fix | Delete
]
[373] Fix | Delete
);
[374] Fix | Delete
}
[375] Fix | Delete
[376] Fix | Delete
/**
[377] Fix | Delete
* Callback called right after the plugin has been activated.
[378] Fix | Delete
*
[379] Fix | Delete
* @return void
[380] Fix | Delete
* @since 1.0.0
[381] Fix | Delete
* @static
[382] Fix | Delete
*
[383] Fix | Delete
*/
[384] Fix | Delete
public static function onPluginActivationCallback () {
[385] Fix | Delete
$dirname = wp_get_upload_dir()['basedir'].'/embedpress';
[386] Fix | Delete
if (!file_exists($dirname)) {
[387] Fix | Delete
mkdir($dirname, 0777);
[388] Fix | Delete
}
[389] Fix | Delete
flush_rewrite_rules();
[390] Fix | Delete
embedpress_schedule_cache_cleanup();
[391] Fix | Delete
}
[392] Fix | Delete
[393] Fix | Delete
/**
[394] Fix | Delete
* Callback called right after the plugin has been deactivated.
[395] Fix | Delete
*
[396] Fix | Delete
* @return void
[397] Fix | Delete
* @since 1.0.0
[398] Fix | Delete
* @static
[399] Fix | Delete
*
[400] Fix | Delete
*/
[401] Fix | Delete
public static function onPluginDeactivationCallback () {
[402] Fix | Delete
flush_rewrite_rules();
[403] Fix | Delete
embedpress_cache_cleanup();
[404] Fix | Delete
$timestamp = wp_next_scheduled( 'embedpress_backup_cleanup_action' );
[405] Fix | Delete
if ( $timestamp ) {
[406] Fix | Delete
wp_unschedule_event( $timestamp, 'embedpress_backup_cleanup_action' );
[407] Fix | Delete
}
[408] Fix | Delete
}
[409] Fix | Delete
[410] Fix | Delete
/**
[411] Fix | Delete
* Method that retrieves all additional service providers defined in the ~<plugin_root_path>/providers.php file.
[412] Fix | Delete
*
[413] Fix | Delete
* @return array
[414] Fix | Delete
* @since 1.0.0
[415] Fix | Delete
* @static
[416] Fix | Delete
*
[417] Fix | Delete
*/
[418] Fix | Delete
public static function getAdditionalServiceProviders () {
[419] Fix | Delete
$additionalProvidersFilePath = EMBEDPRESS_PATH_BASE.'providers.php';
[420] Fix | Delete
if (file_exists($additionalProvidersFilePath)) {
[421] Fix | Delete
include $additionalProvidersFilePath;
[422] Fix | Delete
[423] Fix | Delete
if (isset($additionalServiceProviders)) {
[424] Fix | Delete
return apply_filters( 'embedpress_additional_service_providers', $additionalServiceProviders);
[425] Fix | Delete
}
[426] Fix | Delete
}
[427] Fix | Delete
[428] Fix | Delete
return apply_filters( 'embedpress_additional_service_providers', []);
[429] Fix | Delete
[430] Fix | Delete
}
[431] Fix | Delete
[432] Fix | Delete
/**
[433] Fix | Delete
* Method that checks if an embed of a given service provider can be responsive.
[434] Fix | Delete
*
[435] Fix | Delete
* @param string $serviceProviderAlias The service's slug.
[436] Fix | Delete
*
[437] Fix | Delete
* @return boolean
[438] Fix | Delete
* @since 1.0.0
[439] Fix | Delete
* @static
[440] Fix | Delete
*
[441] Fix | Delete
*/
[442] Fix | Delete
public static function canServiceProviderBeResponsive ($serviceProviderAlias) {
[443] Fix | Delete
return in_array($serviceProviderAlias, [
[444] Fix | Delete
"dailymotion",
[445] Fix | Delete
"kickstarter",
[446] Fix | Delete
"rutube",
[447] Fix | Delete
"ted",
[448] Fix | Delete
"vimeo",
[449] Fix | Delete
"youtube",
[450] Fix | Delete
"ustream",
[451] Fix | Delete
"google-docs",
[452] Fix | Delete
"animatron",
[453] Fix | Delete
"amcharts",
[454] Fix | Delete
"on-aol-com",
[455] Fix | Delete
"animoto",
[456] Fix | Delete
"videojug",
[457] Fix | Delete
'issuu',
[458] Fix | Delete
]);
[459] Fix | Delete
}
[460] Fix | Delete
[461] Fix | Delete
/**
[462] Fix | Delete
* Method that retrieves the plugin settings defined by the user.
[463] Fix | Delete
*
[464] Fix | Delete
* @return object
[465] Fix | Delete
* @since 1.0.0
[466] Fix | Delete
* @static
[467] Fix | Delete
*
[468] Fix | Delete
*/
[469] Fix | Delete
public static function getSettings () {
[470] Fix | Delete
$settings = get_option(EMBEDPRESS_PLG_NAME);
[471] Fix | Delete
[472] Fix | Delete
if (!isset($settings['enablePluginInAdmin'])) {
[473] Fix | Delete
$settings['enablePluginInAdmin'] = true;
[474] Fix | Delete
}
[475] Fix | Delete
[476] Fix | Delete
if (!isset($settings['enablePluginInFront'])) {
[477] Fix | Delete
$settings['enablePluginInFront'] = true;
[478] Fix | Delete
}
[479] Fix | Delete
[480] Fix | Delete
if (!isset($settings['enableGlobalEmbedResize'])) {
[481] Fix | Delete
$settings['enableGlobalEmbedResize'] = false;
[482] Fix | Delete
}
[483] Fix | Delete
[484] Fix | Delete
if (!isset($settings['enableEmbedResizeHeight'])) {
[485] Fix | Delete
$settings['enableEmbedResizeHeight'] = 550; // old 552
[486] Fix | Delete
}
[487] Fix | Delete
[488] Fix | Delete
if (!isset($settings['enableEmbedResizeWidth'])) {
[489] Fix | Delete
$settings['enableEmbedResizeWidth'] = 600; // old 652
[490] Fix | Delete
}
[491] Fix | Delete
[492] Fix | Delete
return (object) $settings;
[493] Fix | Delete
}
[494] Fix | Delete
[495] Fix | Delete
[496] Fix | Delete
/**
[497] Fix | Delete
* Retrieve all registered plugins.
[498] Fix | Delete
*
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function