se_args( $parsed_url, array( 'host' => '', 'query' => '', ) ); if ( ! str_ends_with( $image_url_parts['host'], '.files.wordpress.com' ) ) { return $args; } if ( empty( $image_url_parts['query'] ) ) { return $args; } $wpcom_args = wp_parse_args( $image_url_parts['query'] ); if ( empty( $wpcom_args['w'] ) || empty( $wpcom_args['h'] ) ) { return $args; } // Keep the crop by using "resize". if ( ! empty( $wpcom_args['crop'] ) ) { if ( is_array( $args ) ) { $args = array_merge( array( 'resize' => array( $wpcom_args['w'], $wpcom_args['h'] ) ), $args ); } else { $args = 'resize=' . rawurlencode( absint( $wpcom_args['w'] ) . ',' . absint( $wpcom_args['h'] ) ) . '&' . $args; } } elseif ( is_array( $args ) ) { $args = array_merge( array( 'fit' => array( $wpcom_args['w'], $wpcom_args['h'] ) ), $args ); } else { $args = 'fit=' . rawurlencode( absint( $wpcom_args['w'] ) . ',' . absint( $wpcom_args['h'] ) ) . '&' . $args; } return $args; } /** * Sets the scheme for a URL * * @param string $url URL to set scheme. * @param string $scheme Scheme to use. Accepts http, https, network_path. * * @return string URL. */ public static function cdn_url_scheme( $url, $scheme ) { if ( ! in_array( $scheme, array( 'http', 'https', 'network_path' ), true ) ) { if ( preg_match( '#^(https?:)?//#', $url ) ) { return $url; } $scheme = 'http'; } if ( 'network_path' === $scheme ) { $scheme_slashes = '//'; } else { $scheme_slashes = "$scheme://"; } return preg_replace( '#^([a-z:]+)?//#i', $scheme_slashes, $url ); } /** * Check to skip Photon for a known domain that shouldn't be Photonized. * * @param bool $skip If the image should be skipped by Photon. * @param string $image_url URL of the image. * * @return bool Should the image be skipped by Photon. */ public static function banned_domains( $skip, $image_url ) { $banned_host_patterns = array( '/^chart\.googleapis\.com$/', '/^chart\.apis\.google\.com$/', '/^graph\.facebook\.com$/', '/\.fbcdn\.net$/', '/\.paypalobjects\.com$/', '/\.dropbox\.com$/', '/\.cdninstagram\.com$/', '/^(commons|upload)\.wikimedia\.org$/', '/\.wikipedia\.org$/', ); $host = wp_parse_url( $image_url, PHP_URL_HOST ); foreach ( $banned_host_patterns as $banned_host_pattern ) { if ( 1 === preg_match( $banned_host_pattern, $host ) ) { return true; } } return $skip; } /** * Check whether a string ends with a specific substring. * * @param string $haystack String we are filtering. * @param string $needle The substring we are looking for. * @return bool */ public static function ends_with( $haystack, $needle ) { if ( ! $haystack || ! $needle || ! is_scalar( $haystack ) || ! is_scalar( $needle ) ) { return false; } $haystack = (string) $haystack; $needle = (string) $needle; return str_ends_with( $haystack, $needle ); } /** * This is a copy of Jetpack::get_content_width() * for backwards compatibility. */ public static function get_jetpack_content_width() { $content_width = ( isset( $GLOBALS['content_width'] ) && is_numeric( $GLOBALS['content_width'] ) ) ? $GLOBALS['content_width'] : false; /** * Filter the Content Width value. * * @since 2.2.3 * * @param string $content_width Content Width value. */ return apply_filters( 'jetpack_content_width', $content_width ); } }
Fatal error: Uncaught Error: Class 'Automattic\Jetpack\Image_CDN\Image_CDN_Core' not found in /home/besengumus/public_html/wp-content/plugins/jetpack/jetpack.php:215 Stack trace: #0 /home/besengumus/public_html/wp-settings.php(517): include_once() #1 /home/besengumus/public_html/wp-config.php(79): require_once('/home/besengumu...') #2 /home/besengumus/public_html/wp-load.php(50): require_once('/home/besengumu...') #3 /home/besengumus/public_html/wp-blog-header.php(13): require_once('/home/besengumu...') #4 /home/besengumus/public_html/index.php(17): require('/home/besengumu...') #5 {main} thrown in /home/besengumus/public_html/wp-content/plugins/jetpack/jetpack.php on line 215