Comments (9)
@tomjn I'll wait until we hear from your systems team before we do anything here.
from distributor.
@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.
@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.
@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.
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.
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.
@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.
And some systems wrangling means this is no longer an issue :) Sideloading should be possible now
from distributor.
Woohoo, yea systems wrangling!
from distributor.
Related Issues (20)
- E2E Tests: migrate TestLodge tests to Cypress
- Parent of a distributed page is not saved
- The plugin hasn't been tested with the latest version of WordPress HOT 1
- Update admin menu icon to have the same width & height HOT 2
- List formerly-linked posts in pull UI with option to reassociate HOT 6
- Distributor UI disappears HOT 5
- Feature request: Add filter to allow for arbitrary media to be included in push/pull
- Upgrade Cypress to version 13
- [Block themes] Pulled posts author details are not replaced as author is unset HOT 1
- Cannot pull posts after update HOT 5
- Featured image not distributed/pushed after update HOT 6
- Is there a way to stop the auto sync of linked posts?
- Unpublish ditributed post HOT 1
- Connection Issues HOT 7
- Variable products pull as simple products HOT 1
- webp images dont pull for woocommerce
- lost connections when update the WordPress in version 6.3.2
- The plugin hasn't been tested with the latest version of WordPress HOT 2
- Filter to allow push/pull of draft/scheduled posts in network/external connected sites HOT 3
- Limited connection established. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from distributor.