Smart Promotion Manager
Smart Promotion Manager
Description
Smart Promotion Manager is a simple WordPress plugin that allows you to create and manage dynamic promo blocks on your site. Perfect for displaying promotional content, announcements, or featured items with expiration dates and custom call-to-action buttons.
Key Features
- Custom Post Type: Easy-to-use Promo Blocks post type with WYSIWYG editor
- Custom Fields: CTA text, CTA URL, display priority, and expiry date
- Shortcode Support: Display promos anywhere with
[dynamic_promo]shortcode - REST API: Access promo data via
/wp-json/dcm/v1/promosendpoint - Smart Caching: Built-in transient caching with configurable TTL
- AJAX Loading: Optional AJAX loading for better performance
- Expiry Management: Automatically hide expired promos
- Priority Ordering: Control display order with priority numbers
- WP-CLI Support: Clear cache via
wp sprom clear-cachecommand
Performance Features
- Transient-based caching system
- Conditional asset loading (CSS/JS only when needed)
- Lazy loading images
- Efficient database queries
- Optional AJAX loading mode
Support
For support, feature requests, or bug reports, please contact the plugin author.
Credits
Developed by Dhrashti Patel.
Installation
- Upload the plugin files to the
/wp-content/plugins/smart-promotion-managerdirectory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the ‘Plugins’ screen in WordPress.
- Go to Settings Promo Content to configure the plugin.
Faq
Go to Promo Blocks in your WordPress admin menu, click “Add New”, fill in the title, content, upload a featured image, set your CTA text and URL, choose a display priority, and optionally set an expiry date. Then publish.
Use the shortcode [dynamic_promo] anywhere in your posts, pages, or widgets. The shortcode will display all active (non-expired) promo blocks ordered by priority.
Yes, go to Settings Promo Content and set the “Maximum promo blocks” value. The shortcode will respect this limit.
The plugin uses WordPress transients to cache promo queries. Set the cache duration in Settings Promo Content under “Cache time (minutes)”. Cache automatically clears when you save or update any promo block.
Yes, enable “Enable AJAX loading” in Settings Promo Content. When enabled, promos will load after the page loads via REST API, improving initial page load time.
The plugin provides a REST endpoint at /wp-json/sprom/v1/promos that returns JSON data of all active promo blocks.
Yes, use WP-CLI command: wp sprom clear-cache or simply edit and save any promo block.
Reviews
Changelog
1.0.0
- Initial release
- Custom post type for Promo Blocks
- Shortcode support
- REST API endpoint
- Caching system
- AJAX loading option
- WP-CLI commands