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/clone/wp-conte.../themes/Divi/includes/builder/plugin-c...
File: amazon-s3-and-cloudfront.php
<?php
[0] Fix | Delete
[1] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[2] Fix | Delete
exit; // Exit if accessed directly
[3] Fix | Delete
}
[4] Fix | Delete
[5] Fix | Delete
/**
[6] Fix | Delete
* Plugin compatibility for Amazon S3 Offload
[7] Fix | Delete
*
[8] Fix | Delete
* @since 3.0.49
[9] Fix | Delete
*
[10] Fix | Delete
* @link https://wordpress.org/plugins/amazon-s3-and-cloudfront/
[11] Fix | Delete
*/
[12] Fix | Delete
class ET_Builder_Plugin_Compat_WP_Offload_S3 extends ET_Builder_Plugin_Compat_Base {
[13] Fix | Delete
/**
[14] Fix | Delete
* Constructor
[15] Fix | Delete
*/
[16] Fix | Delete
function __construct() {
[17] Fix | Delete
$this->plugin_id = 'amazon-s3-and-cloudfront/wordpress-s3.php';
[18] Fix | Delete
[19] Fix | Delete
$this->init_hooks();
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
/**
[23] Fix | Delete
* Hook methods to WordPress
[24] Fix | Delete
*
[25] Fix | Delete
* Latest plugin version: 1.1.6
[26] Fix | Delete
*
[27] Fix | Delete
* @return void
[28] Fix | Delete
*/
[29] Fix | Delete
function init_hooks() {
[30] Fix | Delete
// Bail if there's no version found
[31] Fix | Delete
if ( ! $this->get_plugin_version() ) {
[32] Fix | Delete
return;
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
// Up to: latest theme version
[36] Fix | Delete
add_action( 'et_fb_ajax_save_verification_result', array( $this, 'override_fb_ajax_save_verification' ) );
[37] Fix | Delete
[38] Fix | Delete
// Filter attachment IDs for images with an external/CDN URL.
[39] Fix | Delete
add_filter( 'et_get_attachment_id_by_url_pre', array( $this, 'et_get_attachment_id_by_url_pre' ), 10, 2 );
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
/**
[43] Fix | Delete
* @param bool $verification
[44] Fix | Delete
*
[45] Fix | Delete
* @return bool
[46] Fix | Delete
*/
[47] Fix | Delete
function override_fb_ajax_save_verification( $verification ) {
[48] Fix | Delete
return true;
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
/**
[52] Fix | Delete
* Filter attachment ID in case it has an external/CDN URL.
[53] Fix | Delete
*
[54] Fix | Delete
* @since 4.2.1
[55] Fix | Delete
*
[56] Fix | Delete
* @param bool|int $attachment_id_pre Default value. Default is false.
[57] Fix | Delete
* @param string $url URL of the image need to query.
[58] Fix | Delete
*
[59] Fix | Delete
* @return bool|int
[60] Fix | Delete
*/
[61] Fix | Delete
public function et_get_attachment_id_by_url_pre( $attachment_id_pre, $url ) {
[62] Fix | Delete
global $as3cf;
[63] Fix | Delete
[64] Fix | Delete
$as3cf_s3_to_local = new AS3CF_S3_To_Local( $as3cf );
[65] Fix | Delete
[66] Fix | Delete
$attachment_id = $as3cf_s3_to_local->get_attachment_id_from_url( $url );
[67] Fix | Delete
[68] Fix | Delete
if ( $attachment_id ) {
[69] Fix | Delete
return $attachment_id;
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
return $attachment_id_pre;
[73] Fix | Delete
}
[74] Fix | Delete
}
[75] Fix | Delete
[76] Fix | Delete
new ET_Builder_Plugin_Compat_WP_Offload_S3();
[77] Fix | Delete
[78] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function