Debug connectivity

Let’s see why the connection between the LR plugin and the WP plugin is not working. If you get another kind of error which sounds more like a bug and not a connection problem, check 6. Otherwise, continue reading.

Make sure your website is available

Maybe your website is under construction, disabled by a plugin, in maintenance mode, or something that avoids user to login naturally? Make sure your website is normally accessible. Also, make sure that potential plugins that might block external connections are off, at least for this debugging, such as: Coming Soon Page & Maintenance Mode by SeedProd, WP SpamShield.

1. Are you using the REST protocol?

Before the WP/LR Sync for LR 2.6.0, the plugin was always using XML/RPC, which was not playing well with many hosting services (because of historical security issues in the protocol, even though it has been fixed for a long time now). I therefore recommend you to switch to the latest version of the LR plugin and change the Protocol setting of your Publish Service to REST. Try again, and go to 2 if it is still not working.

If you are really willing to use XML/RPC, have a look here.

2. Is WP-JSON enabled on your install?

Check if /wp-json is available on your install. For example, on my haikyo.org website, this URL is http://haikyo.org/wp-json. Understanding it is not important, but make sure that the “wplr” string is present somewhere in this. If you can’t find “wplr”, check 3. If this return an empty page (or 404), please have a look at 4.

3. Is the WP/LR Sync plugin really enabled on your WordPress?

Sounds like not a very clever question, but sometimes that might be that the plugin is disabled πŸ™‚ Can you check your Plugins page in WordPress? If not, enable it and try everything again. Also, there are plugins that can disable other plugins or their functions. Please make sure you try to disable all the plugins and test WP/LR Sync alone (such plugin as Plugin Organizer for example can do that). If nothing helps, go to 5.

4. WP API is off on your install, why?

The WordPress API needs the .htaccess to be set-up. Sometimes, WordPress doesn’t do it magically and you need to trigger it. Check your Permalink Settings (/wp-admin/options-permalink.php), check Post Name (as long as it is not Plain), Save Changes. Perform the same check as you did at 2. Does it work better? It is better to use permalinks and that keeps your .htaccess to work with dynamic URLs (if you wish to do this manually, with the permalinks off, check here: StackOverflow).

5. Check your PHP Error Logs and your WP/LR Sync Logs

You have to be aware that if ANY other plugin fails or generate an error during the WP/LR Sync process, WP/LR Sync will unfortunately fail too. So you need to check your PHP Error Logs to make sure nothing happens during the WP/LR Sync process. Check it before using WP/LR Sync, perform an action (login, sync, or anything else) and check it again. Did something happen in between? Disabling all the plugins (but keep WP/LR Sync enabled) and try again.

Your PHP error logs are made accessible by your hosting service, if you don’t know where they are, the best is to ask them. You can also try to use such a plugin as Error Log Monitor. If you are willing to learn more about checking errors by yourself, check this: Monitor PHP Errors.

Alternatively, you can also have a look at your WPLRSync.log located in your Documents folder.

Nothing worked? Then, contact me, and add some debugging information about what you found and what you did.

6. What kind of errors did you get?

  • “AgExportRendition:recordRemotePhotoId: remote ID must be a number or string”: Are you using JetPack? The plugin might cause this. You have to authorize WP/LR through JetPack -> Settings -> Carousel, find WP/LR at the bottom of the page and enable it.

This is not helping? Please go to 5.

  • Hello,
    Can you provide a screenshot of the setting for #6. It is not in my JetPack settings in that location.
    Thanks

  • Rick Berger

    I’m getting the dreaded “Connection to your website works…” error. I’ve looked at all the logs and the plugin is enabled. PHP log is fine, WPLR log shows the same error. notice the wp-json info is embedded in the log. Permalinks are working – I don’t see any ‘api’ entries in my .htaccess file. Not sure if that should be there.

    I guess I’ll try disabling some other plugins, but that doesn’t really seem like the right direction.

    Details about my WP install:

    1) Running on a local VM machine (Debian 8), https protocol, self-signed cert.

    2) This is a multi-site installation.

    3) PHP5-FPM/fast-cgi

    Any issues with the above?

    I click past the errors, and it seems to try to work on a few images, but then throws the error, again.

    I tried changing to XML-RPC, but then I got XML errors.

    Would really like to get this to work. Will buy when I get past the trial. Still noodling, but any other suggestions/thoughts re- my installation would be appreciated.

    • Rick Berger

      Ok, I changed to PHP apache_mod vs fast-cgi. Now, it’s telling me that ‘The Internet connection works but your website seems down.’ Any idea why it would do that? I can get to both the site and the wp-admin page from a chrome incognito window, so I don’t think there are any caching problems.

      Very strange, now.

      • Hi Rick! Using the standard WP API (= REST) is better. By default, that works fine on any install, Apache or else, fast-cgi or mod. The plugin is really using the standard WordPress process. The API is registered and you should be able to see it localhost/wp-json (add wp-json to your URL). If you can’t even see this, that’s really strange. Another thing: did you enable Permalink? Did you try on a hosting service online?

        • Rick Berger

          Hi, again – ok, I’ll try taking it back to fast-cgi.

          it let me log in, earlier, but then i was getting the error. Now I can’t even log in.

          Yes, I can wp-json. This is not local host – it’s a virtual machine over a bridged network. I dunno. Everything comes up fine in a browser.

          I’m a pretty experienced software developer. Is there some way to debug this? Get to the point where it’s giving the error?

          I really want to get this to work. I need it to work in my local network – I develop here and then stage and move to production on the internet site. Don’t want to be developing on the production site.

          Really wonder why I can’t even log in. Dang.

          Thanks,
          rickb

        • Rick Berger

          Ok, I seem to have found the problem – it had to do with my https setup (local, self-signed.) I tweaked it a bit, and then it worked and I was able to do a total sync (whether *that*s* correct or not, I’m not sure, but it did the operation.)

          So, I need to do a better self-signed ssl cert and likely set myself up as a local CA. My issues.

          Sorry to clot up your comments. I’ll go ahead and purchase and if I have any more issues, will go through the support channels.

          Thanks,
          rickb

          • It’s no problem, and thank you πŸ™‚ I will delete the comments, maybe that’s a bit too much for the visitors to read πŸ™‚

  • Craig Mackay

    Hello Jordy,

    I recently moved a site to a new server and I can’t get WP/LR Sync to work on the new server. I can login to my site from the lightroom plugin and it will happily create the folders/collection sets in my wordpress media library that I create in lightroom but it won’t publish photos to them. I have been through this page several times but I can’t find my answer. I can’t see anything in my php error logs related to this. Here is the output from my WP/LR Sync log:

    02/02/2017 20:43:22 TRACE Photo: C:UsersCraig MackayAppDataLocalTemp1BBB826-E5BD-4610-9404-BC4519DC0644L86C4835.jpg
    02/02/2017 20:43:22 TRACE Filesize: 943943
    02/02/2017 20:43:24 TRACE WPLRSyncAPI.config.url: https://www.myurl.com
    02/02/2017 20:43:24 TRACE Loading REST lib
    02/02/2017 20:43:24 TRACE Execute URL https://www.myurl.com
    02/02/2017 20:43:24 TRACE URL: https://www.myurl.com/wp-json/wplr/v1/sync
    02/02/2017 20:43:25 ERROR Response: “wplr.lrplugin/LrREST.lua:50: attempt to index local ‘json’ (a nil value)”
    02/02/2017 20:43:25 TRACE Check connectivity to Google.com
    02/02/2017 20:43:25 TRACE Check connectivity to https://www.myurl.com
    02/02/2017 20:43:25 ERROR Connection to your website works but got an error from WP. Please check your PHP logs (on server), your WP/LR logs (on your computer) and the FAQ (http://apps.meow.fr/wplr-sync/faq/). Also make sure that the plugin on the WordPress side is enabled.

    The new server is running php 7.0 fpm and nginx rather than apache and php 5 which was on the old server. I have recently changed from http:// to https:// and have changed that in the lightroom plugin.

    Have you any advice on what I can try?
    Thanks
    Craig

    • Hi Craig! That log shows that something is crashing on the WordPress side. It can be anything. The best is to look at the PHP Error Logs, and the error will be in there. Alternatively, you can switch off all the others plugins (except WP/LR Sync), and try. If it works, enable more plugins, one by one… until it crashes.

  • Photocitizen

    To log in, add /wp-admin to the end of the URL.

    THE PROBLEM
    I was setting up the WP/LR Lightroom publishing service and I was getting the error message that there was a problem connecting to WordPress. I checked everything you mention on this page and it all checked out.

    HERE’S HOW I SOLVED IT
    In the “WordPress URL” field, I added /wp-admin at the end. So the URL should look something like this at the end: “yourwebsitename.com/wp-admin”. (don’t forget the http://www. at the beginning, though). This is not documented anywhere, but it worked for me and now I am logged in.

    Once I was logged in, I noticed that the URL reverted to the format without the wp-admin at the end, but I was still logged in. I even logged out and then logged back in and I did NOT have to re-enter wp-admin to log back in.

    SUGGESTION
    If this seems to be a valid fix, update your documentation and, especially, your screen shot here: https://meowapps.com/wp-content/uploads/wplr-settings-1024×992.png.

    BTW, I’m using the trial version for now until I make sure everything works. Maybe this is only an issue for the trial version and not the pro version.

    Cheers,
    Alan

    • Hello Alan πŸ™‚ This is a bit odd. Yes, the plugin actually “clean” your URL when you type it in, if you add wp-admin, it removes it. So basically I am not sure why it was not working before, and then it was working after. Can you actually try to login again with the URL without wp-admin? Basically by logout and login again?

      Trial = Pro πŸ™‚

      • Photocitizen

        Hi Jordy. I logged out and logged back in without adding wp-admin to the URL and it works fine. It was just the very first time that I had to add wp-admin to make it work. Not sure why it worked, but at least now I can test your plugin. So far, I’m impressed.

        • Yes, that’s strange, or maybe it was a temporary connectivity issue? Not sure. Anyway, please enjoy the plugin πŸ™‚ If any issue, come back to me πŸ™‚

I recommend you to use WPEngine or SiteGround. They are both excellent hosting services and work perfectly with all my plugins.