• Resolved finnsk3

    (@finnsk3)


    Hi all,

    Just installed WP-Optimize and enabled minification but this is how css/js is being added:

    <link rel="stylesheet" id="wpo_min-header-0-css" href="https://wp-content/cache/wpo-minify/1673572879/assets/wpo-minify-header-cb0d6789.min.css" type="text/css" media="all">

    Obviously this isn’t going to work. I had a look through the settings but couldn’t find anyway to fix this. I assume it’s trying to put the site URL in there but failing.

    Any ideas?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support vupdraft

    (@vupdraft)

    Under Minify >> CSS , have you got the option to ?Enable merging of CSS files?

    Under Minify>> Java Script, have you got the option to ?Enable merging of JavaScript files checked?

    Thread Starter finnsk3

    (@finnsk3)

    It doesn’t work wether it is enabled or disabeld.

    With out merging enabled:

    <link rel='stylesheet' id='wpo_min-header-0-css' href='https://wp-content/cache/wpo-minify/1673751005/assets/wpo-minify-header-c830677b.min.css' type='text/css' media='all' />
    
    

    I had a look through the PHP in the plugin and worked it out though. WP-Optimize is using WP_CONTENT_URL (line 39 – class-wp-optimize-minify.php).
    WP_CONTENT_URL =

    define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );

    I am using an azure hosted wordpress instance and it has some weird settings in wp_config by default including siteurl:

    define('WP_SITEURL', 'https://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));

    INPUT_SERVER isn’t defined at all by default and I am not sure if this is something that can be done in the azure portal as I don’t work in infastructure I don’t have visilibity of it. That being said hardcoded ‘https://&#8217; in the definition of WP_SITEURL sounds very wrong and after doing a google search it looks like people have ran in to this issue https://arlanblogs.alvarnet.com/change-http-to-https-in-azure-hosted-wordpress-website-when-option-grayed-out/

    I just removed the definition for WP_HOME and WP_SITEURL so that I could edit these settings within the WP dashboard which fixed the issue. Luckily I have write access to wp_admin.php.

    It’s an issue that only happens to people using azure app services but it could be fixed by not including WP_CONTENT_URL when defining WPO_CACHE_MIN_FILES_URL if WP_CONTENT_URL is incorrect.

    Thanks.

    • This reply was modified 2 years, 1 month ago by finnsk3.
    Plugin Support vupdraft

    (@vupdraft)

    Hi,

    Thank you for sharing your resolution, it really is very helpful. I have passed your comments onto our development team

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘minify causing incorrect source urls’ is closed to new replies.