10up / distributor

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

Push is not working (autoptimize) #699

Closed dziemann closed 3 years ago

dziemann commented 3 years ago

Clicking on "Dirstributor" in the admin bar is not opening any overlay to start the push process. The popup is not opening, but in the console no error is displayed.

PHP Version: 7.4.10 Wordpress Version: 5.5.3 Theme: Astra Pagebuilder: Elementor

xzykho commented 3 years ago

I'm having the same issue. It seems it only happened after the update. I can pull via individual site but the push is disabled for some reason. We have 15 sites + the main. Can't see any issues from the console.

I'm on - WordPress 5.6 Multisite Install Distributor v1.6.2 JQUERY Migrate 3.3.2

dkotter commented 3 years ago

@dziemann @xzykho Thanks both for this report. Hoping you can both provide some more information as I've been trying to reproduce this but haven't be able to yet.

@dziemann Can you let me know what version of Distributor you are running? And have things worked in the past but have stopped recently? If so, any recent Distributor update you may have done? And just so I'm clear, you see the Distributor admin bar item but when hovering over it, nothing happens at all? Not even an empty dropdown is shown?

@xzykho

It seems it only happened after the update

Can you let me know the update you did that may have caused this? Was it a Distributor update? And if so, from what version?

Also, you mention push is disabled. Does this mean you don't see the Distributor admin menu at all? Or you see it, but when hovering over it nothing happens? Or do you hover over it and a dropdown shows but no options are shown?

xzykho commented 3 years ago

Can you let me know the update you did that may have caused this? Was it a Distributor update? And if so, from what version?

Also, you mention push is disabled. Does this mean you don't see the Distributor admin menu at all? Or you see it, but when hovering over it nothing happens? Or do you hover over it and a dropdown shows but no options are shown?

Hi @dkotter Thank you for getting back to me on this. I did not really notice which update it was that triggered the bug. I remember updating the WordPress core a couple of weeks ago. But can't remember when I updated the Distributor plugin. I only took over this project early December.

I can see the Distributor admin menu - refer to screenshots. I can't click on the options on the left though. And not sure if this matters but it takes awhile for the dropdown to load.

Just to add we are also using a page builder built into a Vamtam Theme.

Screen Shot 2021-01-28 at 9 18 18 am

I'm thinking the reason the links to other sites are disabled is because it detects it was already shared but it does not show on the other sites but we do have the option to pull -

Screen Shot 2021-01-28 at 9 37 12 am

And nothing seems unusual on the sidebar menu

Screen Shot 2021-01-28 at 9 26 44 am

I also just found out that it's working on my local install with versions - WordPress 5.6 Distributor 1.6.1

I will try and use this version in production if possible and let you know how it goes. I hope that helps.

xzykho commented 3 years ago

@dkotter

I've downgraded my Distributor to v1.6.1 -

This made me try out v1.6.2 with a new post and it worked too, but the post where the bug started is still stuck (refer to previous comment screenshot).

So I tested v1.6.1 and v1.6.2 on a new post and it works on both versions but still doesn't work on the original post.

Update: I also noticed we have 400+ content inside the *Pull Content page. Does it have any impact on the performance of the plugin?

dkotter commented 3 years ago

@xzykho

I can see the Distributor admin menu - refer to screenshots. I can't click on the options on the left though

Looking at the screenshots provided, it does appear this particular post has already been distributed to all connections, which is why you can't distribute to those connections again.

but it does not show on the other sites

So this seems like the actual issue here. Distributor sees this post as already having been distributed, so it won't let you distribute it again, but you're not actually seeing this post on the other sites. Is it possible someone else distributed this post and then deleted it on the other sites?

There was also a reported issue (#509) where sometimes a post fails to distribute properly but the origin site thinks it did work, so a connection is setup but there isn't actually a distributed post. This may be the same issue you're facing. This scenario is on our roadmap to add a better way to handle these scenarios.

For now, if you have direct database access, you can delete the distributor connection mapping on the original post in order to allow distribution again. So on the original post, there should be some meta stored under the key dt_connection_map. If you delete this entirely (or delete the appropriate sections, if there's only certain connections you want to try again), should allow you to distribute again.

I also noticed we have 400+ content inside the *Pull Content page. Does it have any impact on the performance of the plugin?

This page allows you to choose how many items show on each screen. I think the default is 10 items at a time and then you can paginate through them. So if you were to set that posts per page to something fairly high, you might run into performance issues. But as long as that's around the 10 mark, this shouldn't be an issue.

xzykho commented 3 years ago

Thank you @dkotter, I think you are right that my issue is very similar or exactly like #509, for now we will just wait for any future updates on this. And if it happens again we can just use the pull feature as a work around. Or as you have suggested do a database cleanup.

dziemann commented 3 years ago

@dziemann Can you let me know what version of Distributor you are running? And have things worked in the past but have stopped recently? If so, any recent Distributor update you may have done? And just so I'm clear, you see the Distributor admin bar item but when hovering over it, nothing happens at all? Not even an empty dropdown is shown?

@dkotter I'm on 1.6.2 from beginning. Since installation it did not work. No update was done. In the admin bar I can see the "Distributor" but hovering it or click on it does not change anything or displaying an overlay/dropdown. In the console there is nothing. No warning and or error. If you want I can PM you the URL.

dkotter commented 3 years ago

@dziemann Hmmm.. that's a weird one. There is some javascript that fires when you hover over that Distributor admin bar item that should show the drop down and load in all available connections. So if you're seeing nothing at all when hovering over that, I'd guess that's a JS error. But that should also show in the console, which you say isn't showing any error.

How did you install Distributor? I'm wondering if you may have cloned this repo instead of downloading the zip release bundle. If so, you'll need to manually run the build commands to get assets to build, which would include the JS file that makes this menu work.

dziemann commented 3 years ago

@dkotter Sorry, there was a filter set. I cleared it and now it shows the following direct after loading the page:

Uncaught ReferenceError: jQuery is not defined at (index):5 (index):205 Uncaught ReferenceError: ECS_update_admin_bar_menu is not defined at (index):205 autoptimize_d685cb5c904332e08070aaf5dd31580d.js:564 Uncaught SyntaxError: Unexpected end of input admin-bar.min.js?ver=5.6.1:2 Uncaught TypeError: u.hoverintent is not a function at HTMLDocument. (admin-bar.min.js?ver=5.6.1:2) (index):259 Uncaught ReferenceError: jQuery is not defined at (index):259 (index):263 Uncaught TypeError: Cannot read property 'setLocale' of undefined at (index):263

So I identified autoptimize as corrupting the script. Can you tell me which script is loaded so I can put it on the blacklist for autoptimize.

Thank you!

dkotter commented 3 years ago

@dziemann For pushing content, Distributor loads this script: wp-content/plugins/distributor/dist/js/push.min.js. Note also that this script has a dependency on both jQuery and underscore, which both of those will load from WordPress itself, not from this plugin. Not sure if you'll need to do anything about those within autoptimize.

dziemann commented 3 years ago

Thanks! Helped a to get one step further. Now the overlay is opening but without content. But nevertheless I found an option to deactivate autoptimize in logged in state. Now it's working like a charm. Thank you for the great support and your patience! Really appreciate that.