10up / distributor

Share content between your websites.
https://distributorplugin.com
GNU General Public License v2.0
635 stars 156 forks source link

No Connection #848

Closed jadamsbit closed 2 years ago

jadamsbit commented 2 years ago

Describe your question

I have registered and installed the plugin to my main site and remote site and set up a application password and i am not able to get a connection on the main site to the remote site.

Code of Conduct

jeffpaul commented 2 years ago

@jadamsbit can you confirm the WordPress and Distributor versions in use, as well as any other active plugins and theme? Are you getting any errors on the External Connections page? I assume that by setting up External Connections that these are separate WordPress instances and not a multisite, correct?

jadamsbit commented 2 years ago

@jeffpaul

FYI: I have been able to create a new site and connect it to the same remote site.

Wordpress Version: 5.9

Distributor Plugin version: 1.6.8

Yes, it is on two different Wordpress instances.

This is the error that I get on the external connection page. "Unable to connect to site. The external site is private or not a WordPress site. (rest_api_uri_not_found)"

Theme: CityGov (Theme Forest themes.)

Active Plugins:

-ACF Frontend Add From Server Advanced Custom Fields Awesome Weather Widget Better Notifications for WP Caldera Forms Caldera Forms Anti Spam Child Theme Configurator Classic Editor Collapse-O-Matic Confirm Submission Curator.io Custom Facebook Feed Pro - Extensions Custom Facebook Feed Pro Smash Custom Twitter Feeds Pro Developer Default featured image Distributor Download Monitor Duplicate Page Elementor Elementor Pro Eleslider Email Subscribers & Newsletters Events Manager Feeds for YouTube Pro Developer Google Analytics for WordPress by MonsterInsights Health Check & Troubleshooting Instagram Feed Pro Developer JetElements For Elementor MailPoet 3 (New) ManageWP - Worker Max Mega Menu Members Ninja Tables Ninja Tables Pro One Click Demo Import PDF viewer for Elementor Pinpoint Booking System PRO Pods - Custom Content Types and Fields PublishPress PublishPress Future PublishPress Revisions Rank Math SEO Redis Object Cache Redux Search & Filter Shortcodes Ultimate Site Kit by Google Smash Balloon Social Wall Subscribe Forms Table Addons for Elementor TablePress Extension: Responsive Tables The Events Calendar The Events Calendar PRO Woo Custom Emails Per Product WooCommerce WooCommerce Stripe Gateway WordPress Importer WP All Import WP Armour - Honeypot Anti Spam WP Mail SMTP WP Notify Me WP SMS WPFront Notification Bar

jeffpaul commented 2 years ago

@jadamsbit that error message makes it sound like the site you're trying to connect to either has a security plugin enabled that's blocking access to the REST API. What happens if you attempt to browse to the site you're trying to connect to with "/wp-json"?

jadamsbit commented 2 years ago

@jeffpaul if I go to that url on the site it works fine, it shows a json string. The following os a message to us from our hosting environment.

"We have monitored and reviewed the server NginX, Apache, and PHP error logs as well as the Apache transfer logs for both {main site} and {remote site} while attempting to connect the sites using the distributor plugin. We have determined that the 400 error generated when the plugin attempts to make a connection is not related to any server-level services such as ModSecurity, NginX, Apache, or PHP. In addition, we suspected that another plugin may be interfering with the connection so we temporarily disabled all the plugins on {remote site} except for the distributor plugin. Unfortunately, this made no difference as it still resulted in a 400 error being generated in the Apache transfer log when attempting to connect to {remote site} from {main site} . We re-enabled all the plugins on {remote site} once we determined that this connection issue is likely not related to an incompatibility with another plugin. This issue appears to be related to the distributor plugin itself and will require your developers' attention. Since this is a third-party plugin, we can only provide limited support."

Like i stated before we installed a fresh instance of wordpress with only the plugins that is installed on a clean install and was able to connect to the {remote site}

jeffpaul commented 2 years ago

@jadamsbit is there an .htaccess or other limiting factor on those servers that might be blocking access?

jadamsbit commented 2 years ago

@jeffpaul not that I have been able to find or the host been able to find.

jadamsbit commented 2 years ago

@jeffpaul Where is the data for the plugin being stored. We have figured out that if you make a failed connection it will no longer try to re-authorized to make the connection again. This happens on a fresh install on the current host and other hosts.

jadamsbit commented 2 years ago

@jeffpaul is there a way to completely wipe out the connection attempts?

Pitemedia commented 2 years ago

Same problem here after update to the latest version. My main site is also saying this: Your site is not using HTTPS or is a local environment. But it is a live server with SSL?

jadamsbit commented 2 years ago

@jeffpaul can I get the older version to see if that will fix my issue?

jadamsbit commented 2 years ago

@jeffpaul @Pitemedia I tried using 1.6.4 and still the same issue.

jeffpaul commented 2 years ago

@Pitemedia do your site settings show https as part of the URL in Settings > General for WordPress Address (URL) and Site Address (URL)?

dkotter commented 2 years ago

@jadamsbit Just reading through messages now and trying to make sure I fully understand the workflow you've been using.

You mention:

if you make a failed connection it will no longer try to re-authorized to make the connection again

At what point does this happen?

Are these the steps you're following:

  1. Go to Distributor > External Connections and clicking on Add New
  2. Enter a name for the connection and then within the Remote Connection Wizard, entering in the remote URL
  3. Click on Authorize Connection
  4. Do you get the error at that point? And you're saying you'll always get the same error no matter what after that?

Or are you not using the Remote Connection Wizard and manually setting up the connection? And after that it never connects properly?

In theory, the original error message you were getting (Unable to connect to site. The external site is private or not a WordPress site. (rest_api_uri_not_found)) should only show when you first try to create a connection using the wizard. If that error happens, the connection is never created and we don't store any information, so there's nothing to clear out there. But if you're manually creating the connection, I'd have to test further there to see if we are storing something that may need cleared.

jadamsbit commented 2 years ago

@dkotter Whether I make a manual connection or wizard setup connection I get that message.

Pitemedia commented 2 years ago

Yes @jeffpaul .. it shows https..

jeffpaul commented 2 years ago

@jadamsbit are you still seeing this issue after the 1.6.9 release?

jadamsbit commented 2 years ago

@jeffpaul, I will go back and check now thanks for the update.

jadamsbit commented 2 years ago

@jeffpaul If you don't mind, what was the issue? It is connecting now.

jadamsbit commented 2 years ago

@jeffpaul Do I need to close the issue or will you do that?

jeffpaul commented 2 years ago

Thanks for the confirmation, closing this now.