• Resolved Raul P.

    (@alignak)


    Hi,

    Is it possible to detect if wp hide is active and obtain a list of before and after urls, according to the user settings in php?

    I specifically need to determine what is the wp hide url for the wp-content, wp-content/plugins, wp-content/themes, wp-content/uploads, wp-includes directories, so I can rewrite some paths and other stuff accordingly.

    Any info or php snippet would be appreciated.

    Thanks

    • This topic was modified 4 years, 5 months ago by Raul P..
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author nsp-code

    (@nsp-code)

    Hey Raul,
    Thanks for your message, i wanted to get in touch too, i think related to the same problem. From time to time we receive support request regarding incompatibility between WP Hide & Security Enhancer and Fast Velocity Minify plugins. This occurs, when using minify (CSS/JavaScript) option on your plugin. If the user has customized the default URLs through our plugin, the minified files will still use the old URLs format, since our code does not trigger ( through a filter ) to do the replacements.
    The best approach for this would be to add a filter on your plugin code, right before it create the static files ( during my tests, i created a filter at /inc/functions.php, function fvm_download_and_minify(), right before the encoded JSON. This worked great ). Then we can use the filter on our plugin, to create a compatibility file with your code. We did that with most of cache plugins which use similar minify/optimisation functionality and working fine.

    If your support question is related to something else, i’ll just send the code to retrive a list of before/after urls

    Thanks

    Thread Starter Raul P.

    (@alignak)

    Hi

    I was thinking of detecting wp hide configuration and rewrite the paths on my own (because paths also need to be adjusted inside merged css files).. but if you already tested some code and got it working, please let me know the php snippet you used and I’ll add it to FVM on the next version.

    Thank you

    Plugin Author nsp-code

    (@nsp-code)

    Hi,
    The easiest way would be to add a filter on your code ( on 4 spots, before returns ), at file /inc/functions.php within function fvm_download_and_minify() add the following:
    $code = apply_filters( 'fvm/download_and_minify/code', $code, $type);

    Here’s a compare diff to identify the location where the filter should be placed https://www.mergely.com/Bl0rZzym/

    The filter will be used on our code to apply the replacements, before the code is being saved on server as cache file. Let me know if i can help further with this.

    Thanks

    • This reply was modified 4 years, 5 months ago by nsp-code.
    Thread Starter Raul P.

    (@alignak)

    If you will hook into FVM filter, then perfect.
    Thank you very much, just pushed it live on version 2.8.9

    Please use the fvm_after_download_and_minify_code filter and if anything else let me know.

    Thanks again

    Plugin Author nsp-code

    (@nsp-code)

    This works great, thanks for the filter, both plugins are now compatible.

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘get urls with php?’ is closed to new replies.