Submitting to WordPress.org
Here’s a quick rundown of how the submission process works and what to expect. For more details about the SDK integration into themes or plugins, check the WPBay SDK Integration Documentation.
Prerequisites
- Your plugin must follow WordPress coding standards.
- Include a
readme.txt
with proper headers, tags, and changelog. - License must be GPL-compatible (e.g. GPL-2.0+).
Submission Steps
- Visit https://wordpress.org/plugins/add/
- Submit your plugin slug and description.
- Wait for a manual review (typically 1–7 days).
- Once approved, you’ll get access to an SVN repository.
- Upload your files using SVN and tag your release version in
/tags/1.0.0/
.
Tip: Use a minimal but complete version first. You can add complex features in updates after approval.
Sample Plugin Using WPBay SDK
Below is a basic plugin that integrates with the WPBay SDK:
<?php
/*
* Plugin Name: PostTally
* Plugin URI: https://wordpress.org/plugins/posttally/
* Description: Displays the total number of published posts using [post_count]. Includes optional WPBay SDK integration for licensing and feedback.
* Version: 1.0.0
* Author: CaddyTzitzy
* License: GPL-2.0+
* Text Domain: posttally
*/
if (!defined('ABSPATH')) exit;
// Load WPBay SDK
if (!function_exists('posttally_load_wpbay_sdk')) {
function posttally_load_wpbay_sdk() {
require_once dirname(__FILE__) . '/wpbay-sdk/WPBay_Loader.php';
global $wpbay_sdk_latest_loader;
$sdk_loader_class = $wpbay_sdk_latest_loader;
$sdk_params = array(
'api_key' => 'YOUR-WPBAY-API-KEY', //dummy API Key
'product_file' => __FILE__,
'is_free' => true,
'uploaded_to_wp_org' => true,
'no_activation_required' => true,
);
if (class_exists($sdk_loader_class)) {
return $sdk_loader_class::load_sdk($sdk_params);
}
return false;
}
posttally_load_wpbay_sdk();
do_action('posttally_load_wpbay_sdk_loaded');
}
// Shortcode Plugin Logic
class PostTally {
public function __construct() {
add_action('init', array($this, 'register_shortcodes'));
}
public function register_shortcodes() {
add_shortcode('post_count', array($this, 'post_count_shortcode'));
}
public function post_count_shortcode($atts) {
$count = wp_count_posts('post')->publish;
return esc_html(number_format_i18n($count));
}
}
new PostTally();
?>
What the WPBay SDK Can Do
Feature | Description |
---|---|
Licensing | Optional product activation with license key validation. |
Upgrade Paths | Free to Pro upgrades (one-click purchase flow). |
Analytics | Usage stats (can be disabled). |
Feedback Requests | Show rating prompt after X days. |
Contact & Support | Custom contact form and support ticketing. |
Works for WP.org | Designed to work cleanly inside wp.org-approved plugins. |
All features are optional — simply toggle via flags like 'is_upgradable' => false
.
WPBay SDK Setup Guide
- Download the SDK or clone from Git (coming soon).
- Include the
/wpbay-sdk/
folder inside your plugin root. - Use the loader like in the example above, you can dynamically create it in your SDK Integration Documentation page.
- Adjust
sdk_params
for your plugin settings:is_free
,is_upgradable
,uploaded_to_wp_org
, etc.
- Optionally listen to hooks like
do_action('yourplugin_load_wpbay_sdk_loaded');
to extend logic.
FAQ for New Plugin Devs
Q: Does using WPBay SDK get my plugin rejected?
A: No. It’s designed to be wp.org-safe by default. All SDK features are opt-in and fully compliant.
Q: Do I have to add licensing to plugins on wp.org?
A: No. You can mark 'no_activation_required' => true
and 'is_free' => true
.
Q: Can I later offer a Pro version through WPBay?
A: Yes! You can enable upgrade paths with 'is_upgradable' => true
.
Directory Structure Best Practices
When packaging your plugin or theme for WordPress.org or WPBay, structure matters. Here’s the required layout:
Plugin Example
my-plugin/
├── wpbay-sdk/ # WPBay SDK folder
│ └── WPBay_Loader.php
├── languages/ # .pot/.po/.mo files
├── assets/ # Screenshots, banners
├── includes/ # Modular plugin code
├── css/
├── js/
├── readme.txt # Required for WP.org
├── my-plugin.php # Main plugin file
└── uninstall.php # Optional
Theme Example
my-theme/
├── wpbay-sdk/
│ └── WPBay_Loader.php
├── assets/
├── inc/
├── templates/
├── functions.php
└── style.css
Managing Multiple Products With One API Key
You can use the same API key across all your products (plugins and themes). However, you’ll still need to:
- Include the SDK separately in each product.
- Assign a unique product ID to each one, obtained from your WPBay dashboard.
Example
'sdk_params' => array(
'api_key' => 'YOUR-WPBAY-API-KEY
',
'wpbay_product_id' => '1234', // Each product has its own ID
)
Developer Mode Tips & Workflow
Workflow Example:
- Add your slug (e.g.
my-plugin
) under “Allowed Testing Slugs” in your dashboard. - Copy the generated constants into your main plugin file:
define( 'WPBAY_MY-PLUGIN_DEVELOPER_MODE', true );
define( 'WPBAY_MY-PLUGIN_SECRET_KEY', 'YOUR-WPBAY-SECRET-KEY
' );
- Use this Developer Testing Purchase Code in
wp-config.php
:
define('WPBAY_TEST_PURCHASE_CODE', 'YOUR-WPBAY-TEST-PURCHASE-CODE
');
- Activate your plugin on a local or staging site. It’ll behave like a paid product but is fully sandboxed.
⚠️ Developer licenses auto-expire after 24 hours. Only 3 sandbox activations are allowed at any time.
Advanced Developer Hooks & Filters
The SDK provides several WordPress hooks to extend or override behavior:
Action Hooks
Hook | Description |
---|---|
wpbay_sdk_loaded | Fires after the SDK is initialized. |
my_plugin_sdk_loaded | Custom hook you define after loading the SDK. |
Filter Hooks
Filter | Purpose |
---|---|
wpbay_sdk_license_data | Modify license data before saving. |
wpbay_sdk_admin_notices | Add or remove SDK admin notices. |
wpbay_sdk_disable_auto_update | Return true to disable update checks. |
Example:
add_filter('wpbay_sdk_disable_auto_update', '__return_true');
Integrating WPBay Analytics (Optional)
If enabled, usage analytics include:
- WordPress version
- Active theme
- List of active plugins
- Site locale and timezone
These metrics help you understand your customer environment, but no personal data is collected unless the user consents.
Disable by setting:
'disable_analytics' => true,
You can also log custom events:
$sdk->logger->track_event('my_custom_event', array(
'action' => 'did_something_useful',
'user_role' => 'admin',
));
Marketing With SDK Notices (Upgrade & Ratings)
The SDK includes:
- Rating prompts (
rating_notice
after X days) - Upgrade CTA (if
is_upgradable
istrue
)
These appear as dismissible admin notices or inside dedicated SDK pages.
Disable all SDK notices?
Set:
'disable_feedback' => true,
'disable_upgrade_form' => true,
Going Live: Checklist Before Uploading to WPBay or WordPress.org
Final Checks:
- Remove Developer Mode constants.
- Set
debug_mode => false
. - Confirm valid
wpbay_product_id
. - Test activation and deactivation flows.
- Add screenshots for WordPress.org (if applicable).
- Include a readme.txt with stable tag and changelog.
Join the WPBay Developer Community
- Access premium developer discussions on Discord.
- Be featured in weekly product spotlights.
- Submit feature requests or report bugs directly using the below email.
Check the link in your WPBay dashboard or email us: [email protected]
.