blogtutor / blog-tutor-support

Custom Support Plugin for NerdPress Clients
6 stars 3 forks source link

Use cPanel API to get free disk space? #221

Open blogtutor opened 1 year ago

blogtutor commented 1 year ago

On sites with cPanel (such as with WPopt hosting), our current free disk space query gets the free disk space info for the entire server, not the site's cPanel account/quota.

From Charles:

Unfortunately there is no PHP function which allows for the display of quota information - since the information is visible in cPanel though, which has an API, perhaps it's possible to retrieve this through this method: https://forums.cpanel.net/threads/api-function-to-get-account-usage.189122/ cPanel support is excellent in the event you have specific questions relating to their API.

So perhaps we can use the API on these sites? I suppose we could add another setting for an API key (or whatever it needs), and if that's in place, our plugin could query the API instead of doing the usual PHP free disk space function?

CNoemi94 commented 1 month ago

Are we already getting this data in the Relay Server?

blogtutor commented 1 month ago

@CNoemi94 The relay server gets the Free Disk Space data from what the NerdPress Support plugin sends back to it in the "Snapshots." So this issue is about trying to have NP Support read that data on the server.