PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 1.7
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v1.7
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / inc / 3rd-party / screets-lc.php

screets-lc.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF 1.7, at inc/3rd-party/screets-lc.php

32 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
3
4 if ( function_exists( 'fn_lc_fix_ssl_upload_url' ) && defined( 'SLC_VERSION' ) && version_compare( SLC_VERSION, '2.2.8' ) < 0 ) :
5
6 /**
7 * Fixes a bug in Screets Live Chat plugin (prior version 2.2.8), preventing wp_get_upload_dir() to work properly.
8 */
9 remove_filter( 'upload_dir', 'fn_lc_fix_ssl_upload_url' );
10 add_filter( 'upload_dir', 'imagify_screets_lc_fix_ssl_upload_url' );
11 /**
12 * Filters the uploads directory data to force https URLs.
13 *
14 * @since 1.6.7
15 * @author Grégory Viguier
16 *
17 * @param array $uploads Array of upload directory data with keys of 'path', 'url', 'subdir, 'basedir', 'baseurl', and 'error'.
18 * @return array
19 */
20 function imagify_screets_lc_fix_ssl_upload_url( $uploads ) {
21 if ( false !== $uploads['error'] || ! is_ssl() ) {
22 return $uploads;
23 }
24
25 $uploads['url'] = str_replace( 'http://', 'https://', $uploads['url'] );
26 $uploads['baseurl'] = str_replace( 'http://', 'https://', $uploads['baseurl'] );
27
28 return $uploads;
29 }
30
31 endif;
32