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/clone/wp-conte.../plugins/accelera.../includes
File: thirdparty-compatibility.php
}
[1000] Fix | Delete
if (function_exists('attachment_url_to_postid')) {
[1001] Fix | Delete
$image_id = attachment_url_to_postid( $url );
[1002] Fix | Delete
if ( !$image_id ){
[1003] Fix | Delete
return;
[1004] Fix | Delete
}
[1005] Fix | Delete
[1006] Fix | Delete
$image_src = wp_get_attachment_image_src( $image_id, 'full' );
[1007] Fix | Delete
[1008] Fix | Delete
//OG:IMAGE
[1009] Fix | Delete
$seopress_twitter_img = '';
[1010] Fix | Delete
$seopress_twitter_img .= '<meta property="twitter:image" content="'.esc_url($url).'" />';
[1011] Fix | Delete
$seopress_twitter_img .= "\n";
[1012] Fix | Delete
[1013] Fix | Delete
//OG:IMAGE:SECURE_URL IF SSL
[1014] Fix | Delete
if (is_ssl()) {
[1015] Fix | Delete
$seopress_twitter_img .= '<meta property="twitter:image:secure_url" content="'.esc_url($url).'" />';
[1016] Fix | Delete
$seopress_twitter_img .= "\n";
[1017] Fix | Delete
}
[1018] Fix | Delete
[1019] Fix | Delete
//OG:IMAGE:WIDTH + OG:IMAGE:HEIGHT
[1020] Fix | Delete
if (!empty($image_src)) {
[1021] Fix | Delete
$seopress_twitter_img .= '<meta property="twitter:image:width" content="'.esc_attr($image_src[1]).'" />';
[1022] Fix | Delete
$seopress_twitter_img .= "\n";
[1023] Fix | Delete
$seopress_twitter_img .= '<meta property="twitter:image:height" content="'.esc_attr($image_src[2]).'" />';
[1024] Fix | Delete
$seopress_twitter_img .= "\n";
[1025] Fix | Delete
}
[1026] Fix | Delete
[1027] Fix | Delete
//OG:IMAGE:ALT
[1028] Fix | Delete
if (get_post_meta($image_id, '_wp_attachment_image_alt', true) !='') {
[1029] Fix | Delete
$seopress_twitter_img .= '<meta property="twitter:image:alt" content="'.esc_attr(get_post_meta($image_id, '_wp_attachment_image_alt', true)).'" />';
[1030] Fix | Delete
$seopress_twitter_img .= "\n";
[1031] Fix | Delete
}
[1032] Fix | Delete
[1033] Fix | Delete
//Hook on post OG thumbnail - 'seopress_social_og_thumb'
[1034] Fix | Delete
if (has_filter('seopress_social_og_thumb')) {
[1035] Fix | Delete
$seopress_twitter_img = apply_filters('seopress_social_og_thumb', $seopress_twitter_img);
[1036] Fix | Delete
}
[1037] Fix | Delete
if (isset($seopress_twitter_img) && $seopress_twitter_img !='') {
[1038] Fix | Delete
echo $seopress_twitter_img; // escaped above
[1039] Fix | Delete
}
[1040] Fix | Delete
}
[1041] Fix | Delete
}
[1042] Fix | Delete
}
[1043] Fix | Delete
}
[1044] Fix | Delete
}
[1045] Fix | Delete
[1046] Fix | Delete
// yoast author twitter handle #2133
[1047] Fix | Delete
if ( ! function_exists('ampforwp_yoast_twitter_handle') ) {
[1048] Fix | Delete
function ampforwp_yoast_twitter_handle() {
[1049] Fix | Delete
$twitter = '';
[1050] Fix | Delete
if ( class_exists('WPSEO_Frontend') ) {
[1051] Fix | Delete
global $post;
[1052] Fix | Delete
$twitter = get_the_author_meta( 'twitter', $post->post_author );
[1053] Fix | Delete
}
[1054] Fix | Delete
if($twitter){
[1055] Fix | Delete
if ( function_exists('mvp_setup') ) {
[1056] Fix | Delete
return ' <span><a class="zox_tw" href="https://twitter.com/'.esc_attr($twitter).'" target="_blank"></a></span>';
[1057] Fix | Delete
}else{
[1058] Fix | Delete
$parse = parse_url($twitter);
[1059] Fix | Delete
if(isset($parse['host']) && $parse['host'] == 'twitter.com'){
[1060] Fix | Delete
$twitter_url = $twitter;
[1061] Fix | Delete
}else{
[1062] Fix | Delete
$twitter_url = 'https://twitter.com/'.esc_attr($twitter);
[1063] Fix | Delete
}
[1064] Fix | Delete
if(ampforwp_design_selector()==4){
[1065] Fix | Delete
return ' <span><a class="author-tw" href="'.esc_url($twitter_url).'" target="_blank"></a></span>';
[1066] Fix | Delete
}else{
[1067] Fix | Delete
return '<a title="twitter share" href="'.esc_url($twitter_url).'" class="amp-social-icon-rounded-author amp-social-twitter">
[1068] Fix | Delete
<amp-img src="'.AMPFORWP_IMAGE_DIR . '/twitter-icon.webp'.'" width="16" height="16" ></amp-img></a>';
[1069] Fix | Delete
}
[1070] Fix | Delete
}
[1071] Fix | Delete
[1072] Fix | Delete
}
[1073] Fix | Delete
return '';
[1074] Fix | Delete
}
[1075] Fix | Delete
}
[1076] Fix | Delete
// #3124 enfold theme shortcodes removed
[1077] Fix | Delete
add_action('init','ampforwp_enfold_theme_compatibility',2);
[1078] Fix | Delete
if(!function_exists('ampforwp_enfold_theme_compatibility')){
[1079] Fix | Delete
function ampforwp_enfold_theme_compatibility(){
[1080] Fix | Delete
$url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH),'/' );
[1081] Fix | Delete
$explode_path = explode('/', $url_path);
[1082] Fix | Delete
if ( AMPFORWP_AMP_QUERY_VAR === end( $explode_path) ) {
[1083] Fix | Delete
remove_filter('avia_load_shortcodes','add_shortcode_folder',11);
[1084] Fix | Delete
}
[1085] Fix | Delete
}
[1086] Fix | Delete
}
[1087] Fix | Delete
if(!function_exists('ampforwp_remove_enfold_theme_shortcodes_tags')){
[1088] Fix | Delete
function ampforwp_remove_enfold_theme_shortcodes_tags($content){
[1089] Fix | Delete
$content = preg_replace('/\[av_(.*?)]/', ' ', $content);
[1090] Fix | Delete
$content = preg_replace('/\[\/av_(.*?)]/', ' ', $content);
[1091] Fix | Delete
return $content;
[1092] Fix | Delete
}
[1093] Fix | Delete
}
[1094] Fix | Delete
[1095] Fix | Delete
//Need to AMP compatible with this plugin HTTP / HTTPS Remover #3123
[1096] Fix | Delete
add_action('wp_loaded','ampforwp_http_remover_support');
[1097] Fix | Delete
function ampforwp_http_remover_support(){
[1098] Fix | Delete
if ( class_exists('HTTP_HTTPS_REMOVER')){
[1099] Fix | Delete
$url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH),'/' );
[1100] Fix | Delete
if (true == ampforwp_get_setting('amp-core-end-point')) {
[1101] Fix | Delete
$url_path = trim(parse_url(add_query_arg(array()), PHP_URL_QUERY),'/' );
[1102] Fix | Delete
}
[1103] Fix | Delete
$explode_path = explode('/', $url_path);
[1104] Fix | Delete
if ( AMPFORWP_AMP_QUERY_VAR === end( $explode_path)) {
[1105] Fix | Delete
global $http_https_remover;
[1106] Fix | Delete
remove_action('wp_loaded', array(
[1107] Fix | Delete
$http_https_remover,
[1108] Fix | Delete
'letsGo'
[1109] Fix | Delete
), 99, 1);
[1110] Fix | Delete
}
[1111] Fix | Delete
}
[1112] Fix | Delete
}
[1113] Fix | Delete
//AMP Woocommerce function
[1114] Fix | Delete
function ampforwp_woocommerce_conditional_check(){
[1115] Fix | Delete
$showSingleCss = false;
[1116] Fix | Delete
if(!defined('AMP_WOOCOMMERCE_PLUGIN_URI')){
[1117] Fix | Delete
$showSingleCss = false;
[1118] Fix | Delete
}else{
[1119] Fix | Delete
if(function_exists('is_product') && is_product()){
[1120] Fix | Delete
$showSingleCss = true;
[1121] Fix | Delete
}elseif(function_exists('is_cart') && is_cart()){
[1122] Fix | Delete
$showSingleCss = true;
[1123] Fix | Delete
}elseif(function_exists('is_shop') && is_shop()){
[1124] Fix | Delete
$showSingleCss = true;
[1125] Fix | Delete
}elseif(function_exists('is_checkout') && is_checkout()){
[1126] Fix | Delete
$showSingleCss = true;
[1127] Fix | Delete
}elseif(function_exists('is_account_page') && is_account_page()){
[1128] Fix | Delete
$showSingleCss = true;
[1129] Fix | Delete
}
[1130] Fix | Delete
}
[1131] Fix | Delete
return apply_filters('ampforwp_woocommerce_conditional_check', $showSingleCss);
[1132] Fix | Delete
}
[1133] Fix | Delete
[1134] Fix | Delete
// Gallery Images
[1135] Fix | Delete
function ampforwp_non_amp_gallery($matches){
[1136] Fix | Delete
$images = $matches[2];
[1137] Fix | Delete
$images = preg_replace_callback("/<img(.*?)>/", function($m){
[1138] Fix | Delete
return '<li class="mySlides fade">'.$m[0]. /* $m[0] is already sanitized, XSS OK */'</li>';
[1139] Fix | Delete
}, $images);
[1140] Fix | Delete
$imagesHTML = '<ul class="slideshow-container">'.$images. /* $images is already sanitized, XSS OK */'<a class="nonamp-prev" onclick="plusSlides(-1)">&#10094;</a>
[1141] Fix | Delete
<a class="nonamp-next" onclick="plusSlides(1)">&#10095;</a></ul>';
[1142] Fix | Delete
return $imagesHTML;
[1143] Fix | Delete
}
[1144] Fix | Delete
// MISTAPE PLUGIN COMPATIBILITY #3974
[1145] Fix | Delete
if(function_exists('deco_mistape_init')){
[1146] Fix | Delete
add_action('amp_post_template_css', 'ampforwp_mistape_plugin_style');
[1147] Fix | Delete
}
[1148] Fix | Delete
if(!function_exists('ampforwp_mistape_plugin_style')){
[1149] Fix | Delete
function ampforwp_mistape_plugin_style(){
[1150] Fix | Delete
$css = '.mistape_caption{font-size:80%;opacity:.8}.mistape-logo svg{display:block;height:22px;width:22px;fill:#e42029}.mistape_caption .mistape-link{text-decoration:none;border:none;box-shadow:none}.mistape-link:hover{text-decoration:none;border:none}';
[1151] Fix | Delete
echo ampforwp_css_sanitizer($css);
[1152] Fix | Delete
}
[1153] Fix | Delete
}
[1154] Fix | Delete
if(!function_exists('ampforwp_mistape_plugin_compatibility')){
[1155] Fix | Delete
function ampforwp_mistape_plugin_compatibility($content){
[1156] Fix | Delete
if(function_exists('deco_mistape_init')){
[1157] Fix | Delete
$rep = '<a href="https://mistape.com" target="_blank" rel="nofollow" class="mistape-link mistape-logo"><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="40px" height="40px" viewBox="-12 -10 39.9 40" enable-background="new -12 -10 39.9 40" xml:space="preserve">';
[1158] Fix | Delete
$content = preg_replace('/<span\sclass=\"mistape-link-wrap">(.*?)<\/span>/', $rep.'$1</svg></a>', $content);
[1159] Fix | Delete
}
[1160] Fix | Delete
return $content;
[1161] Fix | Delete
}
[1162] Fix | Delete
}
[1163] Fix | Delete
function ampforwp_valid_amp_componet_script(){
[1164] Fix | Delete
$ce_valid_scripts = array('amp-3d-gltf','amp-3q-player','amp-access','amp-analytics','amp-access-laterpay','amp-access-poool','amp-accordion','amp-action-macro','amp-ad-exit','amp-ad','amp-embed','amp-addthis','amp-anim','amp-animation','amp-apester-media','amp-app-banner','amp-audio','amp-auto-ads','amp-autocomplete','amp-base-carousel','amp-beopinion','amp-bind','amp-bodymovin-animation','amp-brid-player','amp-brightcove','amp-byside-content','amp-call-tracking','amp-carousel','amp-connatix-player','amp-consent','amp-dailymotion','amp-date-countdown','amp-date-picker','amp-delight-player','amp-dynamic-css-classes','amp-embedly-card','amp-experiment','amp-facebook-comments','amp-facebook-like','amp-facebook-page','amp-facebook','amp-fit-text','amp-font','amp-form','amp-fx-collection','amp-fx-flying-carpet','amp-geo','amp-gfycat','amp-gist','amp-google-document-embed','amp-google-vrview-image','amp-hulu','amp-iframe','amp-ima-video','amp-image-lightbox','amp-image-slider','amp-imgur','amp-inputmask','amp-instagram','amp-install-serviceworker','amp-izlesene','amp-jwplayer','amp-kaltura-player','amp-lightbox-gallery','amp-lightbox','amp-link-rewriter','amp-list','amp-live-list','amp-mathml','amp-mega-menu','amp-megaphone','amp-minute-media-player','amp-form','amp-mustache','amp-next-page','amp-nexxtv-player','amp-o2-player','amp-ooyala-player','amp-orientation-observer','amp-pan-zoom','amp-pinterest','amp-playbuzz','amp-position-observer','amp-powr-player','amp-reach-player','amp-recaptcha-input','amp-redbull-player','amp-reddit','amp-riddle-quiz','amp-script','amp-selector','amp-sidebar','amp-skimlinks','amp-smartlinks','amp-social-share','amp-soundcloud','amp-springboard-player','amp-sticky-ad','amp-story-auto-ads','amp-story','amp-subscriptions-google','amp-subscriptions','amp-timeago','amp-truncate-text','amp-twitter','amp-user-notification','amp-video-docking','amp-video-iframe','amp-video','amp-vimeo','amp-vine','amp-viqeo-player','amp-viz-vega','amp-vk','amp-web-push','amp-wistia-player','amp-yotpo','amp-youtube','amp-story-player','amp-wordpress-embed');
[1165] Fix | Delete
$ce_valid_scripts = apply_filters('ampforwp_valid_amp_component_script',$ce_valid_scripts);
[1166] Fix | Delete
return $ce_valid_scripts;
[1167] Fix | Delete
}
[1168] Fix | Delete
//iframes are not working with WP optimize premium #4290
[1169] Fix | Delete
add_filter('wp_optimize_lazy_load_hook_these','ampforwp_wp_optimize_iframe');
[1170] Fix | Delete
function ampforwp_wp_optimize_iframe($content){
[1171] Fix | Delete
$url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH),'/' );
[1172] Fix | Delete
$explode_path = explode('/', $url_path);
[1173] Fix | Delete
if ( AMPFORWP_AMP_QUERY_VAR === end( $explode_path)) {
[1174] Fix | Delete
$content = array_flip($content);
[1175] Fix | Delete
unset($content['the_content']);
[1176] Fix | Delete
}
[1177] Fix | Delete
return $content;
[1178] Fix | Delete
}
[1179] Fix | Delete
add_action('init','ampforwp_include_required_yoast_files');
[1180] Fix | Delete
function ampforwp_include_required_yoast_files(){
[1181] Fix | Delete
if(class_exists('WPSEO_Premium') && defined('WPSEO_VERSION') && version_compare(WPSEO_VERSION,'15.8', '>=') && !method_exists('WPSEO_Meta_Columns', 'get_context_for_post_id')){
[1182] Fix | Delete
return;
[1183] Fix | Delete
}
[1184] Fix | Delete
// Yoast SEO 14+ support helper class #4574
[1185] Fix | Delete
$include_file = $include_yoast_files = $include_yoast_premium_files= '';
[1186] Fix | Delete
$include_yoast_files = WP_PLUGIN_DIR . '/wordpress-seo/admin/class-meta-columns.php';
[1187] Fix | Delete
$include_yoast_premium_files = WP_PLUGIN_DIR . '/wordpress-seo-premium/admin/class-meta-columns.php';
[1188] Fix | Delete
if ( file_exists($include_yoast_files) && function_exists('wpseo_init') ) {
[1189] Fix | Delete
$include_file = $include_yoast_files;
[1190] Fix | Delete
}
[1191] Fix | Delete
if ( file_exists($include_yoast_premium_files) && class_exists('WPSEO_Premium')) {
[1192] Fix | Delete
$include_file = $include_yoast_premium_files;
[1193] Fix | Delete
}
[1194] Fix | Delete
if ( file_exists($include_file) ){
[1195] Fix | Delete
require_once($include_file);
[1196] Fix | Delete
class Ampforwp_Yoast_Data extends WPSEO_Meta_Columns {
[1197] Fix | Delete
[1198] Fix | Delete
public function get_context_for_post_id($id) {
[1199] Fix | Delete
if ( method_exists('WPSEO_Meta_Columns', 'get_context_for_post_id')) {
[1200] Fix | Delete
return parent::get_context_for_post_id($id);
[1201] Fix | Delete
}
[1202] Fix | Delete
return false;
[1203] Fix | Delete
}
[1204] Fix | Delete
}
[1205] Fix | Delete
}
[1206] Fix | Delete
}
[1207] Fix | Delete
// Load ampforwp markup prior to marfeel amp #4560
[1208] Fix | Delete
add_action('plugin_loaded','ampforwp_execute_amp_prior_marfeel', 10);
[1209] Fix | Delete
function ampforwp_execute_amp_prior_marfeel(){
[1210] Fix | Delete
global $wp_filter;
[1211] Fix | Delete
if(function_exists('mrfp_activate_marfeel_press') && isset($wp_filter['plugins_loaded']->callbacks[9])){
[1212] Fix | Delete
$current_url = filter_input(INPUT_SERVER, 'REQUEST_URI');
[1213] Fix | Delete
$amp_endpoint = explode('/', $current_url);
[1214] Fix | Delete
foreach ($wp_filter['plugins_loaded']->callbacks[9] as $key => $value) {
[1215] Fix | Delete
if((in_array('amp', $amp_endpoint ) || in_array('?amp', $amp_endpoint) || in_array('?amp=1', $amp_endpoint) ) && isset($value['function']['1']) && $value['function']['1'] == 'marfeel_press_init'){
[1216] Fix | Delete
unset($wp_filter['plugins_loaded']->callbacks[9][$key]);
[1217] Fix | Delete
}
[1218] Fix | Delete
}
[1219] Fix | Delete
}
[1220] Fix | Delete
//Removed OMGF Host Google Fonts Locally in AMP #4775
[1221] Fix | Delete
if(function_exists( 'omgf_pro_init' ) ){
[1222] Fix | Delete
$url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH),'/' );
[1223] Fix | Delete
if( function_exists('ampforwp_is_amp_inURL') && ampforwp_is_amp_inURL($url_path)) {
[1224] Fix | Delete
remove_action( 'plugins_loaded', 'omgf_pro_init', 49 );
[1225] Fix | Delete
}
[1226] Fix | Delete
}
[1227] Fix | Delete
}
[1228] Fix | Delete
function ampforwp_is_amp_inURL($url){
[1229] Fix | Delete
if (ampforwp_get_setting('amp-core-end-point')) {
[1230] Fix | Delete
global $wp;
[1231] Fix | Delete
$url = home_url(add_query_arg(array($_GET), $wp->request));
[1232] Fix | Delete
$urlArray = explode("/", $url);
[1233] Fix | Delete
if( in_array( '?' . AMPFORWP_AMP_QUERY_VAR , $urlArray ) ) {
[1234] Fix | Delete
return true;
[1235] Fix | Delete
}
[1236] Fix | Delete
else {
[1237] Fix | Delete
foreach($urlArray as $index => $string) {
[1238] Fix | Delete
if (strpos($string, '?' . AMPFORWP_AMP_QUERY_VAR) !== FALSE)
[1239] Fix | Delete
return true;
[1240] Fix | Delete
}
[1241] Fix | Delete
}
[1242] Fix | Delete
}
[1243] Fix | Delete
if (ampforwp_get_setting('ampforwp-amp-takeover')) {
[1244] Fix | Delete
return true;
[1245] Fix | Delete
}
[1246] Fix | Delete
if(get_option('permalink_structure') == '' && isset($_GET['amp'])){
[1247] Fix | Delete
return true;
[1248] Fix | Delete
}
[1249] Fix | Delete
if (class_exists('AMPforWP_Subdomain_Endpoint') && ampforwp_get_setting('amp-subdomain-url-format')) {
[1250] Fix | Delete
return true;
[1251] Fix | Delete
}
[1252] Fix | Delete
$mob_pres_link = false;
[1253] Fix | Delete
if(function_exists('ampforwp_mobile_redirect_preseve_link')){
[1254] Fix | Delete
$mob_pres_link = ampforwp_mobile_redirect_preseve_link();
[1255] Fix | Delete
}
[1256] Fix | Delete
if ($mob_pres_link == true) {
[1257] Fix | Delete
return true;
[1258] Fix | Delete
}
[1259] Fix | Delete
$urlArray = explode("/", $url);
[1260] Fix | Delete
if( !in_array( AMPFORWP_AMP_QUERY_VAR , $urlArray ) ) {
[1261] Fix | Delete
return false;
[1262] Fix | Delete
}
[1263] Fix | Delete
return true;
[1264] Fix | Delete
}
[1265] Fix | Delete
function ampforwp_show_yoast_seo_local_map($content){
[1266] Fix | Delete
if(function_exists('wpseo_local_seo_init') && preg_match('/wpseo-map-canvas/', $content)){
[1267] Fix | Delete
$options = get_option( 'wpseo_local' );
[1268] Fix | Delete
$local_address = $options['location_address'];
[1269] Fix | Delete
$location_city = $options['location_city'];
[1270] Fix | Delete
$location_state = $options['location_state'];
[1271] Fix | Delete
$location_zipcode = $options['location_zipcode'];
[1272] Fix | Delete
$location_country = $options['location_country'];
[1273] Fix | Delete
$address = $local_address.", ".$location_city.", ".$location_state.", ".$location_zipcode.", ".$location_country;
[1274] Fix | Delete
$location_coords_lat = $options['location_coords_lat'];
[1275] Fix | Delete
$location_coords_long = $options['location_coords_long'];
[1276] Fix | Delete
$googlemaps_api_key = $options['googlemaps_api_key'];
[1277] Fix | Delete
$map_str = '<iframe width="350" height="250" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?key='.esc_attr($googlemaps_api_key).'&q='.urlencode($address).'&center='.esc_attr($location_coords_lat).','.esc_attr($location_coords_long).'" allowfullscreen>
[1278] Fix | Delete
</iframe>';
[1279] Fix | Delete
$sanitizer = new AMPFORWP_Content( $map_str, array(),
[1280] Fix | Delete
apply_filters( 'ampforwp_content_sanitizers',
[1281] Fix | Delete
array(
[1282] Fix | Delete
'AMP_Style_Sanitizer' => array(),
[1283] Fix | Delete
'AMP_Blacklist_Sanitizer' => array(),
[1284] Fix | Delete
'AMP_Img_Sanitizer' => array(),
[1285] Fix | Delete
'AMP_Video_Sanitizer' => array(),
[1286] Fix | Delete
'AMP_Audio_Sanitizer' => array(),
[1287] Fix | Delete
'AMP_Iframe_Sanitizer' => array(
[1288] Fix | Delete
'add_placeholder' => true,
[1289] Fix | Delete
)
[1290] Fix | Delete
) ) );
[1291] Fix | Delete
$map_str = $sanitizer->get_amp_content();
[1292] Fix | Delete
$content = preg_replace('/(<div\sid="(.*?)"(.*?)class="wpseo-map-canvas(.*?)">)(.*?)(<\/div>)/s', '$1'.$map_str.'$6', $content);
[1293] Fix | Delete
preg_match('/(<div\sid="(.*?)"(.*?)class="wpseo-map-canvas(.*?)">)(.*?)(<\/div>)/s', $content,$match);
[1294] Fix | Delete
if(isset($match[4])){
[1295] Fix | Delete
$content = str_replace($match[4], '', $content);
[1296] Fix | Delete
}
[1297] Fix | Delete
$content = preg_replace('/<div id="wpseo-directions-wrapper">(.*?)<\/div>/s','', $content);
[1298] Fix | Delete
}
[1299] Fix | Delete
return $content;
[1300] Fix | Delete
}
[1301] Fix | Delete
function ampforwp_final_tiles_grid_gallery($mobile){
[1302] Fix | Delete
$mobile = false;
[1303] Fix | Delete
return $mobile;
[1304] Fix | Delete
}
[1305] Fix | Delete
if(!function_exists('ampforwp_category_image_compatibility')){
[1306] Fix | Delete
function ampforwp_category_image_compatibility($type='',$class=''){
[1307] Fix | Delete
$cat_image = '';
[1308] Fix | Delete
if(function_exists('z_taxonomy_image_url')){
[1309] Fix | Delete
$cat_url = z_taxonomy_image_url();
[1310] Fix | Delete
$r_width = 220;
[1311] Fix | Delete
$r_height = 134;
[1312] Fix | Delete
if(function_exists('ampforwp_get_retina_image_settings')){
[1313] Fix | Delete
$ret_config = ampforwp_get_retina_image_settings(intval($r_width),intval($r_height));
[1314] Fix | Delete
$r_width = intval($ret_config['width']);
[1315] Fix | Delete
$r_height = intval($ret_config['height']);
[1316] Fix | Delete
}
[1317] Fix | Delete
if (!empty($cat_url)) {
[1318] Fix | Delete
$cat_image = '<div class="'.esc_attr($class).'"><amp-img src="'.esc_url($cat_url).'" width="'.intval($r_width).'" height="'.intval($r_height).'" layout="fixed"></amp-img></div>';
[1319] Fix | Delete
}
[1320] Fix | Delete
}
[1321] Fix | Delete
if($type==''){
[1322] Fix | Delete
$type='echo';
[1323] Fix | Delete
}
[1324] Fix | Delete
if($type=='return'){
[1325] Fix | Delete
return $cat_image;
[1326] Fix | Delete
}else if($type=='echo'){
[1327] Fix | Delete
echo $cat_image;
[1328] Fix | Delete
}
[1329] Fix | Delete
}
[1330] Fix | Delete
}
[1331] Fix | Delete
[1332] Fix | Delete
function ampforwp_zeen_lazyload($lazyload){
[1333] Fix | Delete
$lazyload = false;
[1334] Fix | Delete
return $lazyload;
[1335] Fix | Delete
}
[1336] Fix | Delete
[1337] Fix | Delete
add_action('plugins_loaded', 'ampforwp_jetpack_boost_compatibility' , 1);
[1338] Fix | Delete
function ampforwp_jetpack_boost_compatibility(){
[1339] Fix | Delete
$url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH),'/' );
[1340] Fix | Delete
if (function_exists('\Automattic\Jetpack_Boost\run_jetpack_boost') && function_exists('ampforwp_is_amp_inURL') && ampforwp_is_amp_inURL($url_path) && !is_admin()) {
[1341] Fix | Delete
remove_action( 'plugins_loaded', '\Automattic\Jetpack_Boost\run_jetpack_boost', 1 );
[1342] Fix | Delete
}
[1343] Fix | Delete
}
[1344] Fix | Delete
if(!function_exists('ampforwp_get_coauthor_id')){
[1345] Fix | Delete
function ampforwp_get_coauthor_id()
[1346] Fix | Delete
{
[1347] Fix | Delete
$author_name = esc_attr(get_query_var('author_name'));
[1348] Fix | Delete
$coauthor_id = get_the_author_meta( 'ID' );
[1349] Fix | Delete
if(!$coauthor_id)
[1350] Fix | Delete
{
[1351] Fix | Delete
$coauthors = get_the_coauthor_meta('login');
[1352] Fix | Delete
foreach($coauthors as $key=>$value)
[1353] Fix | Delete
{
[1354] Fix | Delete
if($value==$author_name)
[1355] Fix | Delete
{
[1356] Fix | Delete
$coauthor_id = $key;
[1357] Fix | Delete
}
[1358] Fix | Delete
}
[1359] Fix | Delete
}
[1360] Fix | Delete
return $coauthor_id;
[1361] Fix | Delete
}
[1362] Fix | Delete
}
[1363] Fix | Delete
[1364] Fix | Delete
if(!function_exists('ampforwp_get_coauthor_meta')){
[1365] Fix | Delete
function ampforwp_get_coauthor_meta($meta_name=null)
[1366] Fix | Delete
{
[1367] Fix | Delete
if(!function_exists('get_the_coauthor_meta') || !$meta_name)
[1368] Fix | Delete
{
[1369] Fix | Delete
return '';
[1370] Fix | Delete
}
[1371] Fix | Delete
$coauthor_id = get_the_author_meta( 'ID' );
[1372] Fix | Delete
if(!$coauthor_id)
[1373] Fix | Delete
{
[1374] Fix | Delete
$author_name = esc_attr(get_query_var('author_name'));
[1375] Fix | Delete
$coauthors = get_the_coauthor_meta('login');
[1376] Fix | Delete
foreach($coauthors as $key=>$value)
[1377] Fix | Delete
{
[1378] Fix | Delete
if($value==$author_name)
[1379] Fix | Delete
{
[1380] Fix | Delete
$coauthor_id = $key;
[1381] Fix | Delete
}
[1382] Fix | Delete
}
[1383] Fix | Delete
}
[1384] Fix | Delete
if(!$coauthor_id)
[1385] Fix | Delete
{
[1386] Fix | Delete
return '';
[1387] Fix | Delete
}
[1388] Fix | Delete
if($meta_name=='avatar_url')
[1389] Fix | Delete
{
[1390] Fix | Delete
$meta_value = get_avatar_url($coauthor_id,array('size'=>180));
[1391] Fix | Delete
}
[1392] Fix | Delete
else
[1393] Fix | Delete
{
[1394] Fix | Delete
$meta_value = get_the_coauthor_meta($meta_name,$coauthor_id);
[1395] Fix | Delete
}
[1396] Fix | Delete
if(is_array($meta_value))
[1397] Fix | Delete
{
[1398] Fix | Delete
$meta_value=$meta_value[$coauthor_id];
[1399] Fix | Delete
}
[1400] Fix | Delete
return esc_html($meta_value);
[1401] Fix | Delete
}
[1402] Fix | Delete
}
[1403] Fix | Delete
[1404] Fix | Delete
add_action('template_redirect', 'ampforwp_callrail_buffer_start', 0);
[1405] Fix | Delete
function ampforwp_callrail_buffer_start() {
[1406] Fix | Delete
if(ampforwp_is_callrail_switch_active()){
[1407] Fix | Delete
$url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH),'/' );
[1408] Fix | Delete
if(function_exists('ampforwp_is_amp_inURL') && ampforwp_is_amp_inURL($url_path) && !is_admin()) {
[1409] Fix | Delete
add_action('shutdown', 'ampforwp_callrail_buffer_stop', PHP_INT_MAX);
[1410] Fix | Delete
ob_start('ampforwp_callrail_modify_content');
[1411] Fix | Delete
}
[1412] Fix | Delete
}
[1413] Fix | Delete
}
[1414] Fix | Delete
function ampforwp_callrail_buffer_stop() {
[1415] Fix | Delete
if(ob_get_length() > 0) {
[1416] Fix | Delete
ob_end_flush();
[1417] Fix | Delete
}
[1418] Fix | Delete
}
[1419] Fix | Delete
function ampforwp_callrail_modify_content($content) {
[1420] Fix | Delete
//modify $content
[1421] Fix | Delete
$config_url = $number = $analytics_url = '';
[1422] Fix | Delete
$config_url = ampforwp_get_setting('ampforwp-callrail-config-url');
[1423] Fix | Delete
$number = ampforwp_get_setting('ampforwp-callrail-number');
[1424] Fix | Delete
$number_2 = ampforwp_callrail_get_formated_phone($number); // getting number in format 123-456-7890
[1425] Fix | Delete
$number_2_replace= '(<a(.*?)href="tel:((.*?-)?'.esc_attr($number_2).')"(.*?)>(.*?)<\/a>)'; // regex for matching number format with anchor tag
[1426] Fix | Delete
$analytics_url = ampforwp_get_setting('ampforwp-callrail-analytics-url');
[1427] Fix | Delete
$call_rail_analytics = '<amp-call-tracking config="'.esc_url($config_url).'"><a href="tel:'.esc_attr($number).'">'.esc_html($number).'</a></amp-call-tracking><amp-analytics config="'.esc_url($analytics_url).'"></amp-analytics>';
[1428] Fix | Delete
$content = str_replace($number, $call_rail_analytics, $content);
[1429] Fix | Delete
$content = preg_replace($number_2_replace, $call_rail_analytics, $content); // replacing number with call tracing code
[1430] Fix | Delete
$ct_test = '<amp-call-tracking config="'.esc_url($config_url).'"><a href="tel:'.esc_attr($number).'">'.esc_attr($number).'</a></amp-call-tracking>';
[1431] Fix | Delete
$content = preg_replace('/<a(.*?)><amp-call-tracking(.*?)><a(.*?)<\/a>/', $ct_test, $content);
[1432] Fix | Delete
[1433] Fix | Delete
return $content;
[1434] Fix | Delete
}
[1435] Fix | Delete
function ampforwp_callrail_get_formated_phone($number){
[1436] Fix | Delete
$number = preg_replace("/[^\d]/","",$number);
[1437] Fix | Delete
$number = preg_replace("/^1?(\d{3})(\d{3})(\d{4})$/", "$1-$2-$3", $number);
[1438] Fix | Delete
return $number;
[1439] Fix | Delete
}
[1440] Fix | Delete
[1441] Fix | Delete
function ampforwp_is_callrail_switch_active()
[1442] Fix | Delete
{
[1443] Fix | Delete
if(ampforwp_get_setting('ampforwp-callrail-switch')){
[1444] Fix | Delete
$config_url = $number = $analytics_url = '';
[1445] Fix | Delete
$config_url = ampforwp_get_setting('ampforwp-callrail-config-url');
[1446] Fix | Delete
$number = ampforwp_get_setting('ampforwp-callrail-number');
[1447] Fix | Delete
$analytics_url = ampforwp_get_setting('ampforwp-callrail-analytics-url');
[1448] Fix | Delete
if(!empty($config_url) && !empty($number) && !empty($analytics_url)){
[1449] Fix | Delete
return true;
[1450] Fix | Delete
}else{
[1451] Fix | Delete
return false;
[1452] Fix | Delete
}
[1453] Fix | Delete
}else{
[1454] Fix | Delete
return false;
[1455] Fix | Delete
}
[1456] Fix | Delete
}
[1457] Fix | Delete
[1458] Fix | Delete
add_action('pre_amp_render_post', 'amp_saswp_faq_comp');
[1459] Fix | Delete
function amp_saswp_faq_comp(){
[1460] Fix | Delete
if ( function_exists('ampforwp_is_amp_endpoint') && ampforwp_is_amp_endpoint() ) {
[1461] Fix | Delete
remove_shortcode('saswp_tiny_multiple_faq');
[1462] Fix | Delete
add_shortcode( 'saswp_tiny_multiple_faq', 'amp_saswp_tiny_multi_faq_render' );
[1463] Fix | Delete
}
[1464] Fix | Delete
}
[1465] Fix | Delete
[1466] Fix | Delete
function amp_saswp_tiny_multi_faq_render( $atts, $content = null ){
[1467] Fix | Delete
global $saswp_tiny_multi_faq;
[1468] Fix | Delete
$output = '';
[1469] Fix | Delete
$saswp_tiny_multi_faq = shortcode_atts(
[1470] Fix | Delete
[
[1471] Fix | Delete
'css_class' => '',
[1472] Fix | Delete
'count' => '1',
[1473] Fix | Delete
'html' => true,
[1474] Fix | Delete
'elements' => [],
[1475] Fix | Delete
], $atts );
[1476] Fix | Delete
foreach ( $atts as $key => $merged_att ) {
[1477] Fix | Delete
if ( strpos( $key, 'headline' ) !== false || strpos( $key, 'question' ) !== false || strpos( $key,
[1478] Fix | Delete
'answer' ) !== false || strpos( $key, 'image' ) !== false ) {
[1479] Fix | Delete
$saswp_tiny_multi_faq['elements'][ explode( '-', $key )[1] ][ substr( $key, 0, strpos( $key, '-' ) ) ] = $merged_att;
[1480] Fix | Delete
}
[1481] Fix | Delete
}
[1482] Fix | Delete
if($saswp_tiny_multi_faq['html'] == 'true'){
[1483] Fix | Delete
if( !empty($saswp_tiny_multi_faq['elements']) ){
[1484] Fix | Delete
foreach ($saswp_tiny_multi_faq['elements'] as $value) {
[1485] Fix | Delete
$output .= '<details>';
[1486] Fix | Delete
$output .= '<summary>';
[1487] Fix | Delete
$output .= '<'.esc_attr($value['headline']).'>';
[1488] Fix | Delete
$output .= esc_html($value['question']);
[1489] Fix | Delete
$output .= '</'.esc_attr($value['headline']).'>';
[1490] Fix | Delete
$output .= '</summary>';
[1491] Fix | Delete
$output .= '<div>';
[1492] Fix | Delete
if ( ! empty( $value['image'] ) ) {
[1493] Fix | Delete
$image_id = intval( $value['image'] );
[1494] Fix | Delete
$image_thumburl = wp_get_attachment_image_url( $image_id, [ 150, 150 ] );
[1495] Fix | Delete
$output .= '<figure>';
[1496] Fix | Delete
$output .= '<a href="'.esc_url(esc_url($image_thumburl)).'"><img class="saswp_tiny_faq_image" src="'.esc_url($image_thumburl).'"></a>';
[1497] Fix | Delete
$output .= '</figure>';
[1498] Fix | Delete
}
[1499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function