WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
[resolved] [closed] Nextgen is requesting the wrong URL adress (30 posts)

  1. pierremg
    Member
    Posted 11 months ago #

    Hi. I'm working on local server and sometimes I need to use ngrok service in order to put my local server online. So, I receive a custom ngrok URL and then I go to my wordpress and change the site URL. The fact is when I change the URL to http://localhost/wordpress again, Nextgen doesn't reconigze it and keep using the previous URL. I think my Lightbox effect isn't working because of this issue.

    My currently URL is http://localhost/wordpress . I checked the source code of a page and I could see Nextgen is using the previous URL http://335d780b.ngrok.com/wordpress

    Example:

    <script type='text/javascript' src='http://335d780b.ngrok.com/wordpress/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/

    nextgen_lightbox_loading_img_url = "http:\/\/335d780b.ngrok.com\/wordpress\/wp-content\/plugins\/nextgen-gallery\/products\/photocrati_nextgen\/

    Why doesn't Nextgen understand that I have changed the URL? Is there something I can do?

    Thanks.

    http://wordpress.org/plugins/nextgen-gallery/

  2. Space2Place
    Member
    Posted 10 months ago #

    Hello, i have the save issue here.
    The wordpress site was moved to anther domain. Everything works and the old domain was removed from the hole mysql dump.
    The only problem i have is the lightbox

    nextgen_lightbox_loading_img_url = "http:\/\/old-domain.tld\/wp-content\/plugins\/nextgen-gallery\/products\/photocrati_nextgen\/modules\/lightbox\/static\/jquery.lightbox\/lightbox-ico-loading.gif";
    nextgen_lightbox_close_btn_url = "http:\/\/old-domain.tld\/wp-content\/plugins\/nextgen-gallery\/products\/photocrati_nextgen\/modules\/lightbox\/static\/jquery.lightbox\/lightbox-btn-close.gif";
    nextgen_lightbox_btn_prev_url = "http:\/\/old-domain.tld\/wp-content\/plugins\/nextgen-gallery\/products\/photocrati_nextgen\/modules\/lightbox\/static\/jquery.lightbox\/lightbox-btn-prev.gif";
    nextgen_lightbox_btn_next_url = "http:\/\/old-domain.tld\/wp-content\/plugins\/nextgen-gallery\/products\/photocrati_nextgen\/modules\/lightbox\/static\/jquery.lightbox\/lightbox-btn-next.gif";
    nextgen_lightbox_blank_img_url = "http:\/\/old-domain.tld\/wp-content\/plugins\/nextgen-gallery\/products\/photocrati_nextgen\/modules\/lightbox\/static\/jquery.lightbox\/lightbox-blank.gif";

    I don't find nothing in files or in the database to change this url.

    I hope someone can help here...

    Thanks

  3. mpluss
    Member
    Posted 10 months ago #

    Hi,

    Menu Gallery : "Other Options" => "Lightbox Effects" => (Show Advanced Settings)

    then change the domain, that's all !!

  4. Space2Place
    Member
    Posted 10 months ago #

    Hello mpluss,
    i did check this. but the url was correct.
    Now i did save it again, but the url still show the old domain.

  5. deltafactory
    Member
    Posted 10 months ago #

    I'm having this problem as well. So far, I can't find the domain referenced in the options table or any source. I am not using any custom local templates.

    The router uses $_SERVER['SERVER_NAME'] - I wonder if this value is affecting the result erratically in my current hosting environment.

  6. deltafactory
    Member
    Posted 10 months ago #

    My second theory, as of yet unconfirmed, points to the use of records in the posts table (not registered as proper custom post type) with the post_type of display_type.

    I'm not sure why the folks at Photocrati decided to shoehorn this non-standard hack into the settings storage of the redesigned NextGEN plugin.. At this point, my only real concern is how to fix it.

  7. deltafactory
    Member
    Posted 10 months ago #

    I was close.. It was a lightbox_library post_type. I wrote a script which will help fix the problem. It requires some knowledge of PHP - use it at your own risk!

    https://gist.github.com/deltafactory/6789297

  8. Space2Place
    Member
    Posted 10 months ago #

    Hello deltafactory.

    You make my day!!!
    Your script fixed the issue... Thank you very much.

  9. deltafactory
    Member
    Posted 10 months ago #

    You're quite welcome. I'm glad it worked!

  10. tonqac
    Member
    Posted 9 months ago #

    Excellent is little to highlight your work!

    Thanks for your beatiful help!!

  11. photocrati
    Member
    Plugin Author

    Posted 9 months ago #

    @deltafactory - Thank you very much for sharing your script!

    - Cais.

  12. zactoff
    Member
    Posted 9 months ago #

    This works like a charm and is super simple to use.

    Thank you deltafactory!

  13. allmyhoney
    Member
    Posted 9 months ago #

    Thank you Deltafactory - much appreciated here and this resolved my issues also. Basically moving from my test site to this live site meant I got caught with old URLs and the "Search and replace" plugin did not catch these URL's. Mayb nextGEN can release a fix for this soon as its a tricky one to find to be honest.

  14. deltafactory
    Member
    Posted 9 months ago #

    Great! Search and replace won't find it because the important values are stored inside of a non-registered custom post type as a serialized and then base64-encoded string. The result of encoding is garbled-looking text.

    Since a member of photocrati commented on this thread last week I'm hoping that they're fully aware of the cause _and_ resolution of the problem and can roll a proper fix into future releases.

  15. rosenzweig70
    Member
    Posted 8 months ago #

    Wow, thank you mpluss. You saved me from half a day of hair-pulling. (And I don't have any hair!!!)

  16. allmyhoney
    Member
    Posted 8 months ago #

    no fix yet it seems in the last few releases now so this script in this thread is crucial. Thank you

  17. homerecords
    Member
    Posted 8 months ago #

    Fantastic..! You made my evening!!! Cause the rest of the day spent on looking where to correct it manually! Should have searched before. :D

    Thanks a lot Deltafactory!!

  18. Fabien
    Member
    Posted 8 months ago #

    deltafactory I really much appreciate you code sharing !

    Wondferfull !

    it works perfectly !

    Thanks

  19. wishie
    Member
    Posted 7 months ago #

    I also had to modify some other records.. here are my additions to the above PHP script:

    $data->css_stylesheets = $base_url . '/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/jquery.lightbox-0.5.css';

    $data->scripts = $base_url . '/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/jquery.lightbox-0.5.min.js';

    $data->guid = $base_url . '/?p=21';

    I, however, still have an issue with my install that I can't fix..

    http://wordpress.org/support/topic/moved-sitecannot-find-where-to-replace-this

    I can't find where to update that data to point at the correct URL

  20. CPDesign
    Member
    Posted 7 months ago #

    Thanks @mpluss

  21. Joao Calheiros
    Member
    Posted 5 months ago #

    Hi guys,

    As a PHP novice i need some help.
    I saw the script created by deltafactory, but in the instructions "1. Copy code to a file in the root of your website." I don't know what to do, Which file?

    Can you help me

    Thanks in advance.

  22. photocrati
    Member
    Plugin Author

    Posted 5 months ago #

    @Joao Calheiros - I sent a reply back to your Bug Report.

    Thanks for submitting one for your issue.

    - Cais.

  23. Joao Calheiros
    Member
    Posted 5 months ago #

    Cais (Photocrati),

    Problem solved.
    Thank you very much.

    Regards,

  24. photocrati
    Member
    Plugin Author

    Posted 5 months ago #

    @Joao Calheiros - Thank you! That's great to read.

    - Cais.

  25. djadan
    Member
    Posted 5 months ago #

    I missed mpluss's post and started ploughing through the database and base64 decoding.

    Just look at Gallery > Other Options > Lightbox Effects > Advanced Options. A simple replacing of one for domain for another sorted this in about 30 seconds.

    Still don't get why it had to be encoded though.

  26. deltafactory
    Member
    Posted 5 months ago #

    @djdan, I believe certain characters, especially Unicode values are mangled during the process. The encoding protects the integrity of those values.

    In general, I agree: I think there are better mechanisms to store this data within the WordPress API.

    I don't know if newer versions of NextGen have fixed this orphaned setting, which may be why your attempt worked.

  27. djadan
    Member
    Posted 5 months ago #

    Good point @deltafactory - it seems to be a long running thread. Thanks for the explanation.

    Dan

  28. sneader
    Member
    Posted 5 months ago #

    I just went live with a site that was in a development directory. I used a script that runs through the database to change the URLs. The only thing that is screwed up is NextGen Gallery!

    When I go to Gallery > Other Options > Lightbox Effects > Advanced Options, I see the OLD URL listed. When I make the changes there and hit Save, it takes me to a 404 page. I am unable to make changes to these settings from NextGen's menu. Thanks NextGen, really nice.

    I will have to look at the script mentioned in this thread to see if it will do the job. Will report back. Many thanks to everyone here that has chimed in with solutions... I would have been stuck without you guys!

    - Scott

  29. D. G.
    Member
    Posted 5 months ago #

    I face the same issues as mentioned here.
    Although it looks like everything is working, the site takes ages to initial load, and it is mentioning the old URL during this initial site load?

    Clean WordPress install / 1 Plugin = NextGen.

    WP 3.8.1 + NextGen 2.0.40

    Tried to remove the NextGen plugin and reinstall it, the old URL's get back??? The db 'holds' the old values 'somewhere' ....

    Within the NextGen options, changed the settings, hit the SAVE button.

    Picture

    What does the SAVE button save, because the old values are still there?
    (sorry mpluss, your solution does NOT help me, the same as Space2Place.
    The URL is NOT changed although the page says 'Saved succesfully'.)

    Tried the php fix of deltafactory (https://gist.github.com/deltafactory/6789297).
    Also this fix, does NOT change the following URL's:
    - Stylesheet URL
    - Javascript URL
    Tried this with the plugin active or inactive, no changes are made.

    photocrati: it would be nice if you inform everybody here which solution you sent privately to Joao Calheiros (I sent a reply back to your Bug Report..)
    I still can't change the old URL's within the NextGen settings.

    How the .... you can change these?
    Even checked the DB, nowhere these URL's can be found (or changed).
    Any other solution ready yet? Its getting annoying, this.

    Regards, DG.

  30. esmi
    Forum Moderator
    Posted 5 months ago #

    If you require assistance then, as per the Forum Welcome, please post your own topic.

    This 6 month old topic references an old version of WordPress & has been resolved.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic