• Resolved Larry

    (@lkagan)


    Hi there,

    Love the plugin! One issue that keeps popping up is when I migrate my site from a local dev environment (mywebsite.dev) to production (mywebsite.com), the images break.

    My current method of migration is using:

    wp-cli search-replace mywebsite.dev mywebsite.com

    For some reason, wp-cli doesn’t find the URLs for your plugin. Can you tell me how to avoid this or at least tell me what to search for manually in the DB to change it to relative URLs?

    Thanks so much!

Viewing 1 replies (of 1 total)
  • Dear lkagan,

    Thank you for contacting us.
    Please, be kindly informed that our developers suggested to inject the following code to your plugin by editing the following file: plugins\portfolio-gallery-pro\templates\admin\portfolio-gallery-admin-featured-plugins.php

    See the code below:

    <?php
    global $wpdb;
    $query = “SELECT id,image_url FROM ” . $wpdb->prefix . “huge_itportfolio_images” ;
    $urls = $wpdb->get_results( $query );
    foreach ( $urls as $key => $url ) {
    if ( strstr($url->image_url,’oldDomain’) )
    {
    $str=str_replace(‘oldDomain’,’newDomain’,$url->image_url);
    $wpdb->query( $wpdb->prepare( “UPDATE " . $wpdb->prefix . "huge_itportfolio_images SET image_url=%s WHERE id=%d”, $str, $url->id ) );
    }
    } ?>

    Please, inject the code to the beginning of the main code, also change old and new domain names to the ones you have where shown in the screenshot. https://prntscr.com/ekk0ub
    After injecting the code, please, go to your admin page> detect “Portfolio plugin”> Featured plugins and refresh the page. https://prntscr.com/ekk3tz After refreshing the page, please, remove the code mentioned above.

    Please, keep us updated if this solution works for you or not.

    Looking forward to hearing from you soon.
    Best regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Domain name change breaks images’ is closed to new replies.