• Resolved Thomas

    (@thomhsb)


    Hello team,

    Too bad, your plugin doesn’t work if the images are not located in the standard WordPress/Woocommerce directories but on a subdomain.

    All the other plugins I use recognise this perfectly.

    For this, I just use the following mu-plugin:

    add_filter( ‘pre_option_upload_path’, function( $upload_path ) {
    return ‘my_server_url_to_images’;
    });
    add_filter( ‘pre_option_upload_url_path’, function( $upload_url_path ) {
    return ‘my_https_url_to_images‘;
    });

    Why doesn’t this work with your plugin?
    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Kush

    (@kushnamdev)

    Hello @thomhsb,

    Thank you for using Optimole and reaching out to us for assistance.

    To better assist you with the issue you are experiencing, can you please provide us with an example page or post where the images are not being served or optimized as expected? This will allow us to investigate the issue and provide you with a solution.

    From your query it appears that you are talking about the WordPress multisite network, I would like to inform you that Optimole does work with WordPress multisite. However, it works a bit differently than what you may be used to. Currently, multisite support is experimental, but we can help you set it up if you are interested.

    To set up multisite support, you will need to add some wp-config.php constants. From that moment, all the settings from all sites on the network will be controlled from a base site.

    Here’s an example of what you need to add to your wp-config.php file:

    if ( ! defined( 'OPTIML_ENABLED_MU' ) ) {
        define( 'OPTIML_ENABLED_MU', true );
    }
    if ( ! defined( 'OPTIML_MU_SITE_ID' ) ) {
        define( 'OPTIML_MU_SITE_ID', 92 );
    }
    

    In this example, 92 is the site ID that will control the settings for all sites on the network. Additionally, the plugin needs to be network activated.

    For instance, if you connect the plugin on the site with ID 92, all the sites on the network will be connected. If you change a setting on site 92, all the other sites will use that setting. However, if you try to change the settings on the dashboard of any other site, the settings will not be saved.

    I hope this information helps. Please let us know if you have any further questions or concerns.

    Thread Starter Thomas

    (@thomhsb)

    Hi @kushnamdev,

    Thank you for your answer!

    No, I am not in multisite, it is a single WordPress standard site.

    The hook I notified allows WordPress and WooCommerce to upload and read the images on a subdomain.

    Example, my site is mydomain.com and the images are on media.mydomain.com/uploads/

    All my plugins manage this very well and fetch the images from the subdomain.

    But maybe it’s me who didn’t understand how Optimole works?
    Because when I installed it, I was expecting the images to automatically change url to a remote CDN server. Is this the case?
    Or is it just an “optimization” of the images?

    If so, I’ll reinstall Optimole on my test site and send you the urls so you can see that my image urls don’t change, it’s still served by my subdomain.

    Regards,
    Thomas

    Plugin Support Kush

    (@kushnamdev)

    Hey @thomhsb,

    I was wondering if you have any staging instance where you can enable Optimole and ourselves to see and debug the behavior. An account there would be a huge help where we can debug the issue effectively.
    Would it be possible to?create a staging site?where the issue can be seen? This way we could take a look at it, and your actual site will still work as expected.?

    And Kindly send the details to us via email at?[email protected]?and please include the link to this thread for reference.

    Thanks and have a great day!

    Thread Starter Thomas

    (@thomhsb)

    Hi @kushnamdev,

    I tried a site staging with WP Statging but I have the same problem, it still doesn’t take into account images that are outside /wp-content/uploads: “We are already working on an update for WP STAGING to support custom folders like this.”
    https://wp-staging.com/docs/no-images-are-visible-on-staging-site/

    But it’s not a problem, I will create a preprod site, identical to mine.
    I will send you the link and the login by email.

    Plugin Support Kush

    (@kushnamdev)

    Hey @thomhsb

    Sure, waiting for your email.

    Have a nice day!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Doesn’t work for me’ is closed to new replies.