betterangels / buoy

:sos: A community-based crisis response system. Because friends don't let friends call the cops. :fire::police_car::fire:
https://betterangels.github.io/buoy/
GNU General Public License v3.0
71 stars 23 forks source link

Expose administrator configuration for max file upload size #186

Open hurtstotouchfire opened 7 years ago

hurtstotouchfire commented 7 years ago

For videos in particular, it is expected that large files should be uploadable. There needs to be some kind of guidance for website admins regarding how to set this particular setting, and/or we should consider the utility of dynamically modifying this value using a combination of upload_size_limit and administrator guidance for larger PHP .ini settings.

hurtstotouchfire commented 7 years ago

@meitar I need a little more context on this to be able to gauge the urgency. I'm assuming we store all of these videos (or other large files) on the WP host, and it looks like they are essentially an attribute of our alert model, meaning that they are in these WP post things that we use for the persistence layer. I'm looking here: https://github.com/betterangels/buoy/blob/1f4a75ef32e5178910300bd0046f6d1619b9c57d/includes/class-buoy-alert.php#L1595 So does this mean that files are deleted from the server when the alert is deleted (which is handled with wp_delete_post I presume)?

fabacab commented 7 years ago

I'm assuming we store all of these videos (or other large files) on the WP host,

Correct.

and it looks like they are essentially an attribute of our alert model,

Yeah, essentially.

meaning that they are in these WP post things

Almost. They are actually each their own WP_Post object and have their own record in the wp_posts table in WordPress's underlying database schema. Their post_type field is set to attachment, and they have a foreign key that relates them to the "primary" WP_Post object (which is then wrapped, in this case, with one of our WP_Buoy_Alerts).

So does this mean that files are deleted from the server when the alert is deleted (which is handled with wp_delete_post I presume)?

Not necessarily. It depends on the value of the "Delete attached incident media when deleting old alerts" setting configured by a site administrator.