Add a file size field to the REST API and use its value when fetching media
This is a follow-up to #6.
The file size is not exposed by default in the WordPress REST API media endpoint. This plugin should add a new field to the REST API which exposes it, and then reads that value in Factory::create() and sets the file size via $item->set_file_size() if the field exists.
This would solve the problem of not having file size information when this plugin is used for sharing media within a Multisite network.
Longer term, we should open a ticket for WordPress core to get the file size added to the REST API too.
Just noting that, for audio files, this information is already present in $data->media_details->filesize. For any other media type, it is not.
Also, I just created https://core.trac.wordpress.org/ticket/52840.
Older issue I know but any change to enable this would have to be in code running on the source site, this plugin won't necessarily be enabled there.