Appearance
WordPress SDK
PackEdge offers modular integration for WordPress plugins. Pick only what you need.
Modules
| Module | Integration | Description |
|---|---|---|
| License Validation | JS / REST | Validate keys, manage activations |
| Auto Updates | PHP + REST | WordPress update system |
| Usage Analytics | JS / REST | Track feature usage |
| Feedback | JS / REST | Collect user feedback |
| Release Notes | JS / REST | Display changelog |
JavaScript Modules
Include only the scripts you need:
php
add_action('admin_enqueue_scripts', function($hook) {
if ($hook !== 'settings_page_my-plugin') return;
// License validation
wp_enqueue_script('packedge-license', 'https://cdn.packedge.dev/license.js');
// Analytics (optional)
wp_enqueue_script('packedge-analytics', 'https://cdn.packedge.dev/analytics.js');
// Feedback (optional)
wp_enqueue_script('packedge-feedback', 'https://cdn.packedge.dev/feedback.js');
// Changelog (optional)
wp_enqueue_script('packedge-changelog', 'https://cdn.packedge.dev/changelog.js');
// Configuration
wp_localize_script('packedge-license', 'PackEdgeConfig', [
'publicKey' => 'pk_your_public_key',
'productSlug' => 'my-plugin',
'version' => MY_PLUGIN_VERSION,
]);
});PHP SDK
Two packages available:
| Package | Description |
|---|---|
packedge-sdk/license | License validation + auto-updates |
packedge-sdk/analytics | Usage tracking + feedback |
Via Composer (Recommended)
bash
composer require packedge-sdk/license
composer require packedge-sdk/analyticsManual Installation
Download the SDK files and include:
php
require_once plugin_dir_path(__FILE__) . 'includes/License.php';
require_once plugin_dir_path(__FILE__) . 'includes/Analytics.php';Setup
php
use PackEdge\License;
use PackEdge\Analytics;
// License validation + auto-updates
$license = License::init('pk_your_public_key', __FILE__);
$license->updater();
// Analytics + feedback
$analytics = Analytics::init('pk_your_public_key', __FILE__);
// Track activation
register_activation_hook(__FILE__, fn() => $analytics->activated());
register_deactivation_hook(__FILE__, fn() => $analytics->deactivated());
// Check license status
if ($license->is_valid()) {
// Enable premium features
}
// Track custom events
$analytics->track('feature_used', ['feature' => 'export']);
// Submit feedback
$analytics->feedback('bug', 'Something broke', 'user@example.com');REST API Alternative
All modules (except auto updates) can use REST API directly instead of JavaScript:
php
// License validation
wp_remote_post('https://api.packedge.dev/public/v1/licenses/validate', [...]);
// Analytics
wp_remote_post('https://api.packedge.dev/v1/event', [...]);
// Feedback
wp_remote_post('https://api.packedge.dev/v1/feedback', [...]);
// Release notes
wp_remote_get('https://api.packedge.dev/v1/products/{slug}/releases');Next Steps
- License Validation — Detailed validation guide
- Auto Updates — WordPress update integration
- Analytics — Usage tracking (coming soon)
- Feedback — User feedback collection (coming soon)
