A comprehensive PHP class designed to simplify interactions with the Pressable REST API v1 from within a WordPress environment. This class provides a structured and easy-to-use wrapper for handling authentication and making requests to various API endpoints.
- Simple Authentication: Handles OAuth2 client credentials flow to obtain an access token.
- Structured Methods: Provides clear, well-documented methods for all major Pressable API endpoints.
- WordPress Native: Built to be used within a WordPress theme or plugin, utilizing
wp_remote_requestand returning standardWP_Errorobjects on failure. - Full API Coverage: Includes methods for managing:
- Account Details & Settings
- Sites (Create, Read, Update, Delete)
- Collaborators (Account & Site level)
- DNS Zones and Records
- Edge Cache & Defensive Mode
- Must-Use (MU) Plugins
- On-Demand & Regular Backups
- Site Plugins & Themes
- Security Alerts
- SFTP Users
- And much more.
- WordPress 5.0 or higher
- PHP 7.2 or higher
- A Pressable account with API credentials (Client ID and Client Secret).
- Place the
pressable-api-client.phpfile into your WordPress theme or plugin directory. - Include the file where you need to use it, for example, in your theme's
functions.phpor your main plugin file:
require_once( __DIR__ . '/wp-pressable-api.php' );