Giter Club home page Giter Club logo

Comments (9)

tlovett1 avatar tlovett1 commented on May 14, 2024

@tomjn I'll wait until we hear from your systems team before we do anything here.

from distributor.

tomjn avatar tomjn commented on May 14, 2024

@tlovett1 An update that I'm still working with the systems team

If this is possible, URLs will need to be whitelisted, but since Distributor attempts to parse API headers to figure these out, this could lead to custom post types being unsupported or partially supported.

You may need a more hardcoded, or restricted way of doing this, especially if using distributor with a new custom post type will require systems level changes every time. It would be best for VIPs if they were prevented from custom post types that had non-whitelisted endpoints unless they explicitly enabled them in code, making sure they were aware a support request was necessary.

Alternatively, if this can be done entirely through the posts endpoint, that would simplify things significantly, and I'd only have to request a single URL be passed through

from distributor.

tomjn avatar tomjn commented on May 14, 2024

@tlovett1 it isn't looking good, we can make it so that creating new posts runs in the needed context, making posts work, but that would completely break GET requests. Sideloading this way is looking increasingly unlikely to work, and I'll admit, the prospects of getting it working that way via REST endpoints be it the new post creation, or media, are looking grim at best.

There will need to be a different mechanism for transferring media across for .com VIP sites. My first thoughts are that the distributor media items are squirreled away and processed later on in a pull via a cron job.

As a sidenote, none of these are issues for VIP Go

from distributor.

adamsilverstein avatar adamsilverstein commented on May 14, 2024

@tomjn Does this issue refer to the use of download_url in utils.php (if not, what exact code is this referring to)? We should be able to replace this block with the VIP helper wpcom_vip_download_image, right?

from distributor.

tomjn avatar tomjn commented on May 14, 2024

The problem isn't a matter of which function, it's a matter of where the code runs. In this context, there is no filesystem write access of any kind, so there is no way to make this work.

Speaking further with systems, I don't see this changing in the near or mid-term futures. It could be a very long time before the creation of attachments via REST API endpoints on .com VIP is a feasible thing. There's a very real chance we're looking at 6 months to a year+

from distributor.

adamsilverstein avatar adamsilverstein commented on May 14, 2024

Thanks for clarifying. I'm going to dig in to better understand where and how this code runs and likely move in the cron for the sideloading direction you suggested.

from distributor.

adamsilverstein avatar adamsilverstein commented on May 14, 2024

@tomjn -

Would sending media separately over the media endpoint work?

Can you confirm if the core Media endpoint would work correctly in VIP for creating media? https://developer.wordpress.org/rest-api/reference/media/#create-a-media-item

If not, will the .com REST API endpoint will work correctly? https://developer.wordpress.com/docs/api/1.1/post/sites/%24site/media/new/

If we sent the media first, we could send the returned object ids to associate media with the post.

from distributor.

tomjn avatar tomjn commented on May 14, 2024

And some systems wrangling means this is no longer an issue :) Sideloading should be possible now

from distributor.

adamsilverstein avatar adamsilverstein commented on May 14, 2024

Woohoo, yea systems wrangling!

from distributor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.