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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/themify-.../themify
File: class-themify-enqueue.php
if(!isset($html_atts['height'])&& $size['h']!==''){
[2000] Fix | Delete
$html_atts['height'] = $size['h'];
[2001] Fix | Delete
}
[2002] Fix | Delete
}
[2003] Fix | Delete
}
[2004] Fix | Delete
if(isset($html_atts['width'],$html_atts['height']) && $html_atts['width']>0 && $html_atts['height']>0){
[2005] Fix | Delete
$html_atts['style']='aspect-ratio:'.($html_atts['width']/$html_atts['height']);
[2006] Fix | Delete
}
[2007] Fix | Delete
$html = '<video ' . themify_get_element_attributes($html_atts) . '>'.$source. '</video>' . trim($content);
[2008] Fix | Delete
}
[2009] Fix | Delete
}
[2010] Fix | Delete
return $html;
[2011] Fix | Delete
}
[2012] Fix | Delete
[2013] Fix | Delete
public static function media_shortcode_library($library):string {
[2014] Fix | Delete
return 'tf_lazy';
[2015] Fix | Delete
}
[2016] Fix | Delete
[2017] Fix | Delete
public static function load_loop_css($class, $post_type, $layout, $type, $moduleArgs = array(), $slug = false) {
[2018] Fix | Delete
global $themify;
[2019] Fix | Delete
if (self::$themeVersion !== null) {//only in themify theme
[2020] Fix | Delete
if (!empty($themify->post_layout_type) && $themify->post_layout_type !== 'default') {
[2021] Fix | Delete
$class[] = $themify->post_layout_type;
[2022] Fix | Delete
}
[2023] Fix | Delete
if ($post_type === 'product' && themify_is_woocommerce_active()) {
[2024] Fix | Delete
global $woocommerce_loop;
[2025] Fix | Delete
if ((isset($woocommerce_loop['name']) && ($woocommerce_loop['name'] === 'related' || $woocommerce_loop['name'] === 'up-sells') ) || wc_get_loop_prop('is_shortcode')) {
[2026] Fix | Delete
$layout = (int) wc_get_loop_prop('columns');
[2027] Fix | Delete
$index = array_search('columns-' . $layout, $class, true);
[2028] Fix | Delete
if ($index !== false) {
[2029] Fix | Delete
unset($class[$index]);
[2030] Fix | Delete
}
[2031] Fix | Delete
$index = array_search('masonry', $class, true);
[2032] Fix | Delete
if ($index !== false) {
[2033] Fix | Delete
unset($class[$index]);
[2034] Fix | Delete
}
[2035] Fix | Delete
$index = array_search('infinite', $class, true);
[2036] Fix | Delete
if ($index !== false) {
[2037] Fix | Delete
unset($class[$index]);
[2038] Fix | Delete
}
[2039] Fix | Delete
$index = array_search('no-gutter', $class, true);
[2040] Fix | Delete
if ($index !== false) {
[2041] Fix | Delete
unset($class[$index]);
[2042] Fix | Delete
}
[2043] Fix | Delete
$layout = $layout === 1 ? 'list-post' : 'grid' . $layout;
[2044] Fix | Delete
}
[2045] Fix | Delete
}
[2046] Fix | Delete
}
[2047] Fix | Delete
self::loadGridCss($layout);
[2048] Fix | Delete
if (in_array('masonry', $class, true)) {
[2049] Fix | Delete
if (!in_array($layout, array('slider', 'auto_tiles'), true) || (!empty($themify->post_filter) && $themify->post_filter !== 'no')) {
[2050] Fix | Delete
$class[] = 'tf_rel';
[2051] Fix | Delete
if (in_array('tf_fluid', $class, true)) {
[2052] Fix | Delete
self::loadFluidMasonryCss();
[2053] Fix | Delete
} else {
[2054] Fix | Delete
self::preFetchMasonry();
[2055] Fix | Delete
}
[2056] Fix | Delete
} else {
[2057] Fix | Delete
$index = array_search('masonry', $class, true);
[2058] Fix | Delete
if ($index !== false) {
[2059] Fix | Delete
unset($class[$index]);
[2060] Fix | Delete
}
[2061] Fix | Delete
}
[2062] Fix | Delete
}
[2063] Fix | Delete
$class[] = $layout;
[2064] Fix | Delete
return array_keys( array_flip($class));
[2065] Fix | Delete
}
[2066] Fix | Delete
[2067] Fix | Delete
public static function get_css():array {
[2068] Fix | Delete
return self::$css;
[2069] Fix | Delete
}
[2070] Fix | Delete
[2071] Fix | Delete
/**
[2072] Fix | Delete
* Check if the file belongs to themify(plugin, FW, theme and etc.)
[2073] Fix | Delete
*
[2074] Fix | Delete
* return boolean
[2075] Fix | Delete
*/
[2076] Fix | Delete
public static function is_themify_file(string $file, string $handler):bool {
[2077] Fix | Delete
return strpos($file, 'maps.google.com') === false && (strpos($handler, 'themify') !== false || strpos($handler, 'builder-') === 0 || strpos($handler, 'tf-') === 0 || strpos($handler, 'tb_builder') === 0|| strpos($handler, 'tbp') === 0 || (defined('THEME_URI') && strpos($file, THEME_URI) !== false) || preg_match('/themify[\.\-][^\/]*\.js/', $file));// match "themify.*.js" or "themify-*.js"
[2078] Fix | Delete
}
[2079] Fix | Delete
[2080] Fix | Delete
public static function loadGuttenbergCss($parsed_block, $source_block) {
[2081] Fix | Delete
remove_filter('render_block_data', array(__CLASS__, 'loadGuttenbergCss'), PHP_INT_MAX);
[2082] Fix | Delete
if (!empty(self::$guttenbergCss)) {
[2083] Fix | Delete
global $wp_styles, $wp_version;
[2084] Fix | Delete
foreach (self::$guttenbergCss as $k => $src) {
[2085] Fix | Delete
if (isset($wp_styles->registered[$k])) {
[2086] Fix | Delete
$ver = $wp_styles->registered[$k]->ver;
[2087] Fix | Delete
if (empty($ver)) {
[2088] Fix | Delete
$ver = $wp_version;
[2089] Fix | Delete
}
[2090] Fix | Delete
if (strpos($src, 'http') === false) {
[2091] Fix | Delete
$src = get_site_url(null, $src);
[2092] Fix | Delete
}
[2093] Fix | Delete
self::add_css($k, $src, $wp_styles->registered[$k]->deps, $ver, $wp_styles->registered[$k]->args);
[2094] Fix | Delete
}
[2095] Fix | Delete
}
[2096] Fix | Delete
self::$guttenbergCss = null;
[2097] Fix | Delete
}
[2098] Fix | Delete
return $parsed_block;
[2099] Fix | Delete
}
[2100] Fix | Delete
[2101] Fix | Delete
public static function getCurrentVersionFolder($blog_id = false):string {
[2102] Fix | Delete
global $wp_version;
[2103] Fix | Delete
$object = wp_get_theme();
[2104] Fix | Delete
$globalKey = THEMIFY_VERSION . $wp_version . $object->get('Name');
[2105] Fix | Delete
$globalKey .= self::$themeVersion !== null ? self::$themeVersion : $object->get('Version');
[2106] Fix | Delete
if (themify_is_woocommerce_active()) {
[2107] Fix | Delete
$globalKey .= WC()->version;
[2108] Fix | Delete
}
[2109] Fix | Delete
$globalKey = (string) crc32($globalKey);
[2110] Fix | Delete
return themify_upload_dir('basedir') . '/themify-concate/' . $globalKey . '/';
[2111] Fix | Delete
}
[2112] Fix | Delete
[2113] Fix | Delete
/** Add schedule four_week
[2114] Fix | Delete
* array $schedules
[2115] Fix | Delete
*
[2116] Fix | Delete
* return array
[2117] Fix | Delete
*/
[2118] Fix | Delete
public static function cron_schedules(array $schedules):array {
[2119] Fix | Delete
$schedules['four_week'] = array(
[2120] Fix | Delete
'interval' => WEEK_IN_SECONDS * 4,
[2121] Fix | Delete
'display' => '4 weeks'
[2122] Fix | Delete
);
[2123] Fix | Delete
return $schedules;
[2124] Fix | Delete
}
[2125] Fix | Delete
[2126] Fix | Delete
/** Cron job to remove old concate css files and customizer css files
[2127] Fix | Delete
* return void
[2128] Fix | Delete
*/
[2129] Fix | Delete
public static function cron() {
[2130] Fix | Delete
[2131] Fix | Delete
$path = pathinfo(self::getCurrentVersionFolder());
[2132] Fix | Delete
$dir = $path['dirname'] . '/';
[2133] Fix | Delete
if(!class_exists('Themify_Filesystem',false)){
[2134] Fix | Delete
require_once THEMIFY_DIR . '/class-themify-filesystem.php';
[2135] Fix | Delete
}
[2136] Fix | Delete
clearstatcache();
[2137] Fix | Delete
if (Themify_Filesystem::is_dir($dir) && ($handle = opendir($dir))) {
[2138] Fix | Delete
$found=false;
[2139] Fix | Delete
$currentFolder = $path['filename'];
[2140] Fix | Delete
$globalKey = '-' . $currentFolder . '-'; //Need for Backward Compatibility, can be removed 11.05.2021
[2141] Fix | Delete
while (false !== ($f = readdir($handle))) {
[2142] Fix | Delete
if ($f !== '.' && $f !== '..' && $currentFolder !== $f && strpos($f, $globalKey, 5) === false) {
[2143] Fix | Delete
Themify_Filesystem::delete($dir . $f);
[2144] Fix | Delete
$found=true;
[2145] Fix | Delete
}
[2146] Fix | Delete
}
[2147] Fix | Delete
closedir($handle);
[2148] Fix | Delete
unset($currentFolder, $dir, $globalKey);
[2149] Fix | Delete
if($found===true){
[2150] Fix | Delete
TFCache::clear_3rd_plugins_cache();
[2151] Fix | Delete
TFCache::remove_cache();
[2152] Fix | Delete
}
[2153] Fix | Delete
}
[2154] Fix | Delete
unset($path);
[2155] Fix | Delete
$upload_dir = themify_upload_dir('basedir').'/';
[2156] Fix | Delete
$deperecated=$upload_dir.'tf_images_sizes/';
[2157] Fix | Delete
if(Themify_Filesystem::is_dir($deperecated)){
[2158] Fix | Delete
Themify_Filesystem::delete($deperecated);
[2159] Fix | Delete
}
[2160] Fix | Delete
$deperecated=$upload_dir.'tf_image_ids/';
[2161] Fix | Delete
if(Themify_Filesystem::is_dir($deperecated)){
[2162] Fix | Delete
Themify_Filesystem::delete($deperecated);
[2163] Fix | Delete
}
[2164] Fix | Delete
if (self::$themeVersion !== null && Themify_Filesystem::is_dir($upload_dir) && ($handle = opendir($upload_dir))) {//remove old customizer css
[2165] Fix | Delete
$cssFile = THEMIFY_VERSION . '-' . self::$themeVersion;
[2166] Fix | Delete
while (false !== ($f = readdir($handle))) {
[2167] Fix | Delete
if ($f !== '.' && $f !== '..' && strpos($f, 'themify-customizer-') === 0 && strpos($f, $cssFile, 10) === false) {
[2168] Fix | Delete
Themify_Filesystem::delete($upload_dir . $f,'f');
[2169] Fix | Delete
}
[2170] Fix | Delete
}
[2171] Fix | Delete
closedir($handle);
[2172] Fix | Delete
}
[2173] Fix | Delete
Themify_Storage::cleanDb();
[2174] Fix | Delete
}
[2175] Fix | Delete
[2176] Fix | Delete
private static function getPreLoad():string {
[2177] Fix | Delete
$return = '';
[2178] Fix | Delete
if(!empty(self::$preLoadMedia)){
[2179] Fix | Delete
foreach (self::$preLoadMedia as $src => $arr) {
[2180] Fix | Delete
$type=$arr['t'];
[2181] Fix | Delete
if ($type === 'style' && isset(self::$css[$src])) {
[2182] Fix | Delete
continue;
[2183] Fix | Delete
}
[2184] Fix | Delete
if (isset($arr['v'])) {
[2185] Fix | Delete
$src = $src . '?ver=' . $arr['v'];
[2186] Fix | Delete
}
[2187] Fix | Delete
$extra='';
[2188] Fix | Delete
if($type === 'font'){
[2189] Fix | Delete
$extra=' type="font/' . strtok(pathinfo($src, PATHINFO_EXTENSION), '?') . '" crossorigin';
[2190] Fix | Delete
}
[2191] Fix | Delete
elseif($type === 'image' && isset($arr['srcset'])){
[2192] Fix | Delete
$extra=' imagesrcset="'.$arr['srcset'].'" imagesizes="'.$arr['sizes'].'"';
[2193] Fix | Delete
}
[2194] Fix | Delete
elseif($type=== 'json'){
[2195] Fix | Delete
$extra=' type="application/json" crossorigin="anonymous"';
[2196] Fix | Delete
$type='fetch';
[2197] Fix | Delete
}
[2198] Fix | Delete
$return .= sprintf('<link rel="%s" href="%s" as="%s"%s%s>',
[2199] Fix | Delete
$arr['r'],
[2200] Fix | Delete
$src,
[2201] Fix | Delete
$type,
[2202] Fix | Delete
$extra,
[2203] Fix | Delete
(isset($arr['i']) ? ' fetchpriority="' . $arr['i'] . '"' : '')
[2204] Fix | Delete
);
[2205] Fix | Delete
}
[2206] Fix | Delete
}
[2207] Fix | Delete
return $return;
[2208] Fix | Delete
}
[2209] Fix | Delete
[2210] Fix | Delete
public static function get_version($url, $ver) {
[2211] Fix | Delete
return $ver;
[2212] Fix | Delete
}
[2213] Fix | Delete
[2214] Fix | Delete
public static function load_search_form_css() {
[2215] Fix | Delete
remove_action('pre_get_search_form', array(__CLASS__, 'load_search_form_css'), 9);
[2216] Fix | Delete
self::add_css('tf_search_form', self::THEMIFY_CSS_MODULES_URI . 'search-form.css', null, THEMIFY_VERSION);
[2217] Fix | Delete
self::addLocalization('done', 'tf_search_form', true);
[2218] Fix | Delete
}
[2219] Fix | Delete
[2220] Fix | Delete
public static function body_open(){
[2221] Fix | Delete
echo '<!--tf_svg_holder-->','<script> </script>';
[2222] Fix | Delete
$ga=themify_get('setting-ga_m_id', '', true);
[2223] Fix | Delete
if($ga!==''){
[2224] Fix | Delete
echo '<noscript><iframe data-no-script src="https://www.googletagmanager.com/ns.html?id=GTM-'.$ga.'" height="0" width="0" style="display:none"></iframe></noscript>',
[2225] Fix | Delete
'<script async data-no-optimize="1" data-noptimize="1" data-cfasync="false" data-ga="'.$ga.'" src="data:text/javascript;base64,KGE9PntmdW5jdGlvbiBlKCl7YS5kYXRhTGF5ZXIucHVzaChhcmd1bWVudHMpfWEuZGF0YUxheWVyPWEuZGF0YUxheWVyfHxbXSxlKCJqcyIsbmV3IERhdGUpLGUoImNvbmZpZyIsZG9jdW1lbnQuY3VycmVudFNjcmlwdC5kYXRhc2V0LmdhKSxlKCJldmVudCIsInBhZ2VfdmlldyIpfSkod2luZG93KTs="></script>',
[2226] Fix | Delete
'<script async data-no-optimize="1" data-noptimize="1" data-cfasync="false" src="https://www.googletagmanager.com/gtag/js?id='.$ga.'"></script>';
[2227] Fix | Delete
}
[2228] Fix | Delete
}
[2229] Fix | Delete
[2230] Fix | Delete
public static function add_theme_support_css($css) {
[2231] Fix | Delete
self::$theme_css_support[$css]=true;
[2232] Fix | Delete
}
[2233] Fix | Delete
[2234] Fix | Delete
public static function remove_theme_support_css($css) {
[2235] Fix | Delete
unset(self::$theme_css_support[$css]);
[2236] Fix | Delete
}
[2237] Fix | Delete
[2238] Fix | Delete
public static function has_theme_support_css($css) {
[2239] Fix | Delete
return isset(self::$theme_css_support[$css]);
[2240] Fix | Delete
}
[2241] Fix | Delete
[2242] Fix | Delete
public static function exclude_main_js( $exclude) {
[2243] Fix | Delete
if(current_filter()==='autoptimize_filter_js_consider_minified'){
[2244] Fix | Delete
if($exclude===false){
[2245] Fix | Delete
$exclude='';
[2246] Fix | Delete
}
[2247] Fix | Delete
if($exclude!=='' && is_array($exclude)){
[2248] Fix | Delete
$exclude[]='themify/';
[2249] Fix | Delete
}
[2250] Fix | Delete
else{
[2251] Fix | Delete
$exclude.='themify/';
[2252] Fix | Delete
}
[2253] Fix | Delete
}
[2254] Fix | Delete
elseif(is_array($exclude)){
[2255] Fix | Delete
$exclude[] = 'themify-main-script';
[2256] Fix | Delete
$exclude[] = 'themify/';
[2257] Fix | Delete
$exclude[] = 'tf_vars';
[2258] Fix | Delete
}
[2259] Fix | Delete
else{
[2260] Fix | Delete
$exclude.= ',themify/';
[2261] Fix | Delete
}
[2262] Fix | Delete
return $exclude;
[2263] Fix | Delete
}
[2264] Fix | Delete
[2265] Fix | Delete
/**
[2266] Fix | Delete
* Exclude Themify scripts from being concatenated in Page Optimize plugin
[2267] Fix | Delete
* @link https://wordpress.org/plugins/page-optimize/
[2268] Fix | Delete
*
[2269] Fix | Delete
* @return bool
[2270] Fix | Delete
*/
[2271] Fix | Delete
public static function Automattic_page_optimize_js_exclude(bool $do_concat,string $handle ):bool {
[2272] Fix | Delete
if (strpos( $handle, 'themify' ) !== false|| strpos( $handle, 'tb_' ) !== false) {
[2273] Fix | Delete
return false;
[2274] Fix | Delete
}
[2275] Fix | Delete
return $do_concat;
[2276] Fix | Delete
}
[2277] Fix | Delete
}
[2278] Fix | Delete
Themify_Enqueue_Assets::init();
[2279] Fix | Delete
[2280] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function