Skip to content

Commit

Permalink
fixed wp-content hardcoded string
Browse files Browse the repository at this point in the history
  • Loading branch information
Fellan-91 committed Sep 23, 2024
1 parent ebab6d8 commit 4ce7898
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion classes/class-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -754,10 +754,12 @@ public function add_custom_assets( $post_id ) {
* @return string
*/
public static function autoptimize_filter_css_exclude( $result ) {
$upload_dir = defined( 'UPLOADS' ) ? UPLOADS : 'wp-content/uploads/';

// By default in Autoptimize excluded folder `wp-content/uploads/`.
// We need to check, if this folder is not excluded, then we
// don't need to use our hack.
if ( $result && strpos( $result, 'wp-content/uploads/' ) === false ) {
if ( $result && strpos( $result, $upload_dir ) === false ) {
return $result;
}

Expand Down
3 changes: 2 additions & 1 deletion classes/class-breakpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
$pro_version = false;

if ( is_plugin_active( 'ghostkit-pro/class-ghost-kit-pro.php' ) ) {
$ghostkit_wp_content_dir = defined( 'WP_CONTENT_DIR' ) ? WP_CONTENT_DIR : ABSPATH . 'wp-content';
// phpcs:ignore
$pro_data = get_plugin_data( ABSPATH . 'wp-content/plugins/ghostkit-pro/class-ghost-kit-pro.php' );
$pro_data = get_plugin_data( $ghostkit_wp_content_dir . '/plugins/ghostkit-pro/class-ghost-kit-pro.php' );
// phpcs:ignore
$pro_version = isset( $pro_data['Version'] ) ? $pro_data['Version'] : false;
}
Expand Down

0 comments on commit 4ce7898

Please sign in to comment.