Distributor: Featured Image not transfered

Created on 14 May 2019  路  18Comments  路  Source: 10up/distributor

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.

bug

All 18 comments

@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 #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?

@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.

@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?

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

@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)?

@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.

@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 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!

@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.

@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.

@jeffpaul thanks!

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

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

@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?

@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.

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.

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

Closed via #567.

Was this page helpful?
0 / 5 - 0 ratings