Aptranet CDN Integration

Description

Aptranet CDN Integration accelerates your WordPress site by rewriting static asset URLs to use your Aptranet CDN distribution. It fetches distributions automatically and provides an intuitive interface for managing your CDN settings.

Short Description

Integrate Aptranet CDN for faster site performance.

Full Description

Aptranet CDN Integration is designed to enhance your WordPress site’s speed and performance by delivering static assets (such as images, scripts, and styles) via the Aptranet Content Delivery Network. This plugin simplifies the process of connecting your website to the CDN with an intuitive settings interface.

Key features include:
* Automatic Distribution Fetching:
Connect to the Aptranet API to automatically retrieve your available CDN distributions.
* Easy Distribution Selection:
Choose your desired distribution from a dropdown that displays the distribution name instead of just the ID. The plugin automatically updates your CDN Base URL.
* Manage Distribution Access:
A dynamic “Manage Distribution” button links directly to the Aptranet Management Console where you can view detailed analytics and manage your distribution settings.
* Asset URL Rewriting:
The plugin rewrites URLs for attachments, scripts, styles, images embedded in content, and responsive srcset attributes. Your front-end assets are served by the CDN for improved load times, while your WordPress admin remains unaffected.
* Lightweight and Secure:
With proper sanitization for settings and adherence to WordPress coding standards, the plugin is both secure and optimized.
* Minimal Permissions Required:
Your API Key only requires the CDN.ListDistributions permission to fetch distribution details from Aptranet’s API.

External Services

This plugin connects to external services provided by Aptranet:
* Aptranet API:
The plugin fetches available CDN distributions from the Aptranet API at https://api.aptranet.com/cdn/distributions.
Data Sent: Your Access Key (in the Authorization header) and API Secret (in the Aptranet-Secret header) are sent to retrieve distribution information.
Documentation: Aptranet API Documentation
* Aptranet Management Console:
The plugin provides a “Manage Distribution” button that links to https://console.aptranet.com/cdn/distributions/<DISTRIBUTION_ID>/analytics for detailed analytics and management.
Note: Users must have an account with Aptranet to access these features.

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 or later, as published by the Free Software Foundation. For more details, see: https://www.gnu.org/licenses/gpl-2.0.html

Screenshots

  • Settings Page: Displays the local Aptranet logo, API fields, and a polished interface with inline Fetch and Manage Distribution buttons.

Installation

  1. Configure the Plugin Settings:

    • Navigate to Settings > Aptranet CDN.
    • Enter your Access Key and API Secret.
      Note: Your API Key only requires the CDN.ListDistributions permission.
    • Check the Enable CDN checkbox.
    • Click the Fetch Distributions button to retrieve your available CDN distributions.
    • Select your desired distribution from the dropdown. The plugin will automatically update the CDN Base URL.
    • (Optional) Click the Manage Distribution button to view detailed analytics in the Aptranet Management Console.
    • Finally, click Save Changes. A loading spinner will appear while your settings are being saved.
  2. Verify Functionality:

    • Visit your site’s front end to confirm that static asset URLs are rewritten to use your Aptranet CDN distribution.
    • Your WordPress admin area remains unaffected for a seamless backend experience.

FAQ

How do I configure this plugin?

After installation, go to Settings > Aptranet CDN. Enter your API credentials, fetch and select a distribution, then click Save Changes. The plugin automatically rewrites your front-end asset URLs.

What permissions does the API Key need?

Your API Key only requires the CDN.ListDistributions permission to successfully fetch distribution information from Aptranet’s API.

Will the plugin affect my WordPress admin area?

No. The plugin is designed to exclude the WordPress admin area from URL rewriting to prevent any issues with dashboard scripts and styles.

What if I disable the plugin?

If you disable the plugin, your site will revert to serving assets from your origin server.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Aptranet CDN Integration” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.8

  • Added a loading spinner overlay when the Save Changes button is clicked.
  • Added version parameters to enqueued styles and scripts for cache busting.
  • Included sanitization callbacks for all settings.
  • Updated the settings UI with inline Fetch and Manage Distribution buttons.
  • Switched the Aptranet logo to be loaded locally.
  • Updated the External Services section in this readme.
  • Noted that the API Key only requires the CDN.ListDistributions permission.

1.7

  • Initial release with distribution fetching, URL rewriting for front-end assets, and integration with Aptranet’s API.