Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Featured Image not transfered #380

Closed
d13mas opened this issue May 13, 2019 · 18 comments
Closed

Featured Image not transfered #380

d13mas opened this issue May 13, 2019 · 18 comments
Assignees
Labels
type:bug Something isn't working.
Milestone

Comments

@d13mas
Copy link

d13mas commented May 13, 2019

I've started using this plugin, run several tests on it and it's working fine except for the fact that's not transferring any Featured Image. Not from posts, pages or CPTs.

@jeffpaul jeffpaul added the needs:feedback This requires reporter feedback to better understand the request. label May 14, 2019
@jeffpaul
Copy link
Member

@dmaslogh welcome to Distributor and thanks for the feedback, it's greatly appreciated! Can you confirm the following to help us triage your issue?

  1. Are you using internal connections (via multisite) or external connections (e.g. separate WP installs)?
  2. What filetype is/are the featured image(s) that aren't transferring? Note that Some Pods custom fields not distributed (feedback) #180 already calls out an issue with SVGs, but I'm curious if you're seeing it with other filetypes.
  3. What version of WordPress, Distributor, and other active plugins/theme are on your site?

@d13mas
Copy link
Author

d13mas commented May 14, 2019

@jeffpaul thanks!

  1. Using internal multisite connection.
  2. Most of them are JPG, but there could be some PNG as well. No SVG though.
  3. Versions of the main packages are:
  • WP 5.1.1
  • Divi (latest 3.22.x)
  • Distributor 1.4.1
  • ACF 5.7.13
  • Events Manager 5.9.5
  • Gravity Form 2.4.8.9
  • and some other with less impact like wp-pagenavi, akismet, etc.

Hope this helps.

@jeffpaul
Copy link
Member

@dmaslogh there are some reports of weirdness with ACF, any chance the images are in a field there that aren't getting distributed or is it literally the default WP featured image field?

@d13mas
Copy link
Author

d13mas commented May 15, 2019

@jeffpaul it's the standard Featured Image from WP enabled in a CPT. We are not dealing with ACF image fields.

@jeffpaul
Copy link
Member

@dmaslogh is the CPT setup on both the origin and distributed sites? If so, are these custom CPTs or are they created using a plugin (e.g. CPT UI)?

@d13mas
Copy link
Author

d13mas commented May 15, 2019

@jeffpaul I've created a plugin that registers the same CPT on both sites. The CPTs are created by code, the internal fields are created using ACF.

@jeffpaul
Copy link
Member

@dmaslogh ok, that's helpful detail. I'm labeling this as a bug, but if there's any further details on errors or code samples you can provide to help with further triage that would be greatly appreciated, thanks!

@jeffpaul jeffpaul added type:bug Something isn't working. and removed needs:feedback This requires reporter feedback to better understand the request. labels May 15, 2019
@d13mas
Copy link
Author

d13mas commented May 15, 2019

@jeffpaul I'll need to check with my client, but I think I can share with you some code if you need it. Just let me know if there's something specific you find useful for this research and I'll try to provide it asap.
Thanks!

@d13mas
Copy link
Author

d13mas commented May 21, 2019

@jeffpaul Did you have any luck reviewing this? Did you at least reproduce the error on your side?
I appreciate if you keep me posted on this.

@jeffpaul jeffpaul added this to the Future Release milestone May 21, 2019
@jeffpaul
Copy link
Member

@dmaslogh we're currently focused on finishing up our 1.5.0 release, which is mainly focused on major performance improvements on the Push and Pull screens within Distributor as well as an enhanced connection setup process. From there we'll be reviewing open issues and PRs to determine what to target in our next release, so for now I'm milestoning this for Future Release and will keep you posted as we get further into triaging and resolving this issue.

@d13mas
Copy link
Author

d13mas commented May 21, 2019

@jeffpaul thanks!

@Kpudlo
Copy link

Kpudlo commented Jun 4, 2019

We've been having this same issue with an external connection. For some reason, some posts aren't transferring the standard featured image.

After activating the debug log, we're getting the following error:
PHP Notice: Object of class WP_Error could not be converted to int in /<server_path>/wp-content/plugins/distributor-stable/includes/push-ui.php on line 155

@jeffpaul
Copy link
Member

jeffpaul commented Jun 4, 2019

@Kpudlo thanks for the debug info, that's massively helpful!

@jeffpaul jeffpaul modified the milestones: Future Release, 2.0.0 Jun 6, 2019
@jeffpaul jeffpaul modified the milestones: 3.0.0, 2.1.0 Sep 12, 2019
@petenelson
Copy link
Contributor

@dmaslogh what sort of hosting environment is your multisite running on? The internals of Distributor use download_url to download the featured image and then sideload it into the media library. If the server is unable to connect to other sites within the multisite, then it would be unable to download the image. This could be due to DNS, firewalls, HTTP authentication, or some other issue.

I had to implement some additional filters for a client to pass basic HTTP authentication since all of the sites in their multisite have that enabled and it was not able to download the image.

@jeffpaul do you think a pull request to use the filesystem to copy and sideload the image instead of doing a download would be a good idea for a multisite connection?

@dkotter
Copy link
Collaborator

dkotter commented Dec 13, 2019

@jeffpaul @petenelson I really like this idea, though I'm not exactly sure how we'd go about it. The current approach uses download_url to download the image and then media_handle_sideload to actually build the attachment information itself. This then returns the attachment ID, which we need to set the featured image.

Is your thought here to use the filesystem to copy the image and then build our own $file_array we can pass into media_handle_sideload?

But yes, definitely something I'm interested in seeing an approach for, as I think this could potentially help with performance, as we'd be copying an image instead of making a remote request to download the image.

@petenelson
Copy link
Contributor

Is your thought here to use the filesystem to copy the image and then build our own $file_array we can pass into media_handle_sideload?

Yep, that's what I was thinking, shouldn't be a a big lift to make this change.

@dkotter
Copy link
Collaborator

dkotter commented Dec 13, 2019

👍 Cool, sounds good to me. I'm happy to review and test it out once you have something in place. Thanks!

@jeffpaul
Copy link
Member

jeffpaul commented Jun 8, 2020

Closed via #567.

@jeffpaul jeffpaul closed this as completed Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

5 participants