Refactor plugin structure:

- Rename pro-plugins-config.php to data/pro-plugins.php
- Rename recommended-plugins.php to free-plugins.php
- Rename class-recommended-plugins-manager.php to class-free-plugins-manager.php
- Update all references throughout the codebase
- Add enhanced hover effects to Go Pro buttons
This commit is contained in:
Marcus Quinn
2025-03-24 18:42:24 +00:00
parent 4bbcbe3d12
commit 9e1c077080
15 changed files with 1256 additions and 1237 deletions

2
.gitignore vendored
View File

@ -38,7 +38,7 @@ $RECYCLE.BIN/
.git_status_temp.txt .git_status_temp.txt
project-documents/ project-documents/
reference-plugins/ reference-plugins/
*.bak *.bak*
node_modules/ node_modules/
composer.lock composer.lock
package-lock.json package-lock.json

View File

@ -342,6 +342,40 @@ body.wp-admin .wp-list-table.plugin-install #the-list .plugin-card .action-links
line-height: 28px !important; line-height: 28px !important;
padding-top: 0 !important; padding-top: 0 !important;
padding-bottom: 0 !important; padding-bottom: 0 !important;
background-color: #d35400 !important;
color: #fff !important;
border-color: #c24e00 !important;
transition: all 0.3s ease !important;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
position: relative !important;
overflow: hidden !important;
}
body.wp-admin .wp-list-table.plugin-install #the-list .plugin-card .action-links .button.go-pro::before {
content: '' !important;
position: absolute !important;
top: 0 !important;
left: -100% !important;
width: 100% !important;
height: 100% !important;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent) !important;
transition: all 0.5s ease !important;
}
body.wp-admin .wp-list-table.plugin-install #the-list .plugin-card .action-links .button.go-pro:hover {
background-color: #aa4300 !important;
border-color: #953b00 !important;
transform: translateY(-2px) !important;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}
body.wp-admin .wp-list-table.plugin-install #the-list .plugin-card .action-links .button.go-pro:hover::before {
left: 100% !important;
}
body.wp-admin .wp-list-table.plugin-install #the-list .plugin-card .action-links .button.go-pro:active {
transform: translateY(0) !important;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
} }
/* Ensure consistent layout for action buttons */ /* Ensure consistent layout for action buttons */

161
admin/data/free-plugins.php Normal file
View File

@ -0,0 +1,161 @@
<?php
/**
* Recommended plugins data for WP ALLSTARS plugin
*/
// Define recommended plugins
function wp_allstars_get_free_plugins() {
return array(
'minimal' => array(
'antispam-bee',
'compressx',
'fluent-smtp',
'kadence-blocks',
'simple-cloudflare-turnstile'
),
'admin' => array(
'admin-bar-dashboard-control',
'codepress-admin-columns',
'admin-menu-editor',
'hide-admin-notices',
'mainwp-child',
'mainwp-child-reports',
'magic-login',
'manage-notification-emails',
'plugin-groups',
'plugin-toggle'
),
'affiliates' => array(
'pretty-links',
'simple-urls',
'slicewp'
),
'ai' => array(
'ai-engine',
),
'cms' => array(
'auto-post-scheduler',
'block-options',
'bookmark-card',
'browser-shots',
'bulk-actions-select-all',
'bulk-edit-categories-tags',
'bulk-edit-user-profiles-in-spreadsheet',
'carbon-copy',
'code-block-pro',
'iframe-block',
'ics-calendar',
'mammoth-docx-converter',
'nav-menu-roles',
'ninja-tables',
'post-draft-preview',
'post-type-switcher',
'simple-custom-post-order',
'simple-icons',
'sticky-posts-switch',
'term-management-tools',
'the-paste',
'ultimate-addons-for-gutenberg',
'wikipedia-preview',
'wp-sheet-editor-bulk-spreadsheet-editor-for-posts-and-pages'
),
'compliance' => array(
'avatar-privacy',
'complianz-gdpr',
'complianz-terms-conditions',
'really-simple-ssl'
),
'crm' => array(
'fluent-boards',
'fluent-booking',
'fluent-community',
'fluent-crm',
'fluentform',
'fluentforms-pdf',
'fluentform-block',
'fluent-support'
),
'ecommerce' => array(
'woocommerce',
'woo-bulk-edit-products',
'woo-coupons-bulk-editor',
'woocommerce-gateway-gocardless',
'kadence-woocommerce-email-designer',
'pymntpl-paypal-woocommerce',
'woo-stripe-payment'
),
'lms' => array(
'fluent-community',
'masterstudy-lms-learning-management-system',
'tutor'
),
'media' => array(
'easy-watermark',
'enable-media-replace',
'image-copytrack',
'imsanity',
'media-file-renamer',
'safe-svg'
),
'seo' => array(
'burst-statistics',
'pretty-link',
'revive-so',
'seo-by-rank-math',
'syndication-links',
'ultimate-410',
'webmention'
),
'setup' => array(
'kadence-starter-templates',
'wordpress-importer'
),
'social' => array(
'bit-social',
'easy-video-reviews',
'social-engine',
'wp-social-ninja',
'wp-social-reviews'
),
'speed' => array(
'disable-wordpress-updates',
'flying-analytics',
'flying-pages',
'flying-scripts',
'freesoul-deactivate-plugins',
'index-wp-mysql-for-speed',
'litespeed-cache',
'performant-translations',
'wp-optimize',
'wp-widget-disable'
),
'translation' => array(
'hreflang-manager-lite',
'performant-translations',
'translatepress-multilingual'
),
'advanced' => array(
'acf-better-search',
'advanced-custom-fields',
'automatorwp',
'bit-pi',
'bit-integrations',
'code-snippets',
'easy-code-manager',
'favorites',
'remove-cpt-base',
'remove-old-slugspermalinks',
'secure-custom-fields',
'yellow-pencil-visual-theme-customizer'
),
'debug' => array(
'advanced-database-cleaner',
'debug-log-manager',
'gotmls',
'query-monitor',
'string-locator',
'user-switching',
'wp-crontrol'
)
);
}

530
admin/data/pro-plugins.php Normal file
View File

@ -0,0 +1,530 @@
<?php
/**
* Pro Plugins Data
*
* This file contains the configuration data for premium plugins
* displayed in the Pro Plugins tab.
*
* @package WP_ALLSTARS
* @since 0.2.0
*/
if (!defined('ABSPATH')) {
exit;
}
/**
* Get pro plugins configuration data
*
* @return array Array of pro plugins with their details
*/
function wp_allstars_get_pro_plugins() {
return array(
'magic-login-pro' => array(
'name' => 'Magic Login Pro',
'description' => 'Enable passwordless authentication with magic login links and enhance WordPress site security.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://handyplugins.co/magic-login-pro/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://handyplugins.co/magic-login-pro/#pricing'
)
),
'free_slug' => 'magic-login'
),
'admin-columns' => array(
'name' => 'Admin Columns Pro',
'description' => 'Advanced admin columns management with sorting, filtering, and editing capabilities.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://www.admincolumns.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://www.admincolumns.com/pricing/'
)
),
'free_slug' => 'codepress-admin-columns'
),
'admin-menu-editor' => array(
'name' => 'Admin Menu Editor Pro',
'description' => 'Customize the WordPress admin menu with advanced features and role management.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://adminmenueditor.com/upgrade-to-pro/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://adminmenueditor.com/upgrade-to-pro/'
)
),
'free_slug' => 'admin-menu-editor'
),
'advanced-custom-fields' => array(
'name' => 'Advanced Custom Fields PRO',
'description' => 'Create custom fields and content types with advanced features and options.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://www.advancedcustomfields.com/pro/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://www.advancedcustomfields.com/pro/#pricing'
)
),
'free_slug' => 'advanced-custom-fields'
),
'advanced-database-cleaner' => array(
'name' => 'Advanced Database Cleaner PRO',
'description' => 'Clean and optimize your WordPress database with advanced tools and automation.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://sigmaplugin.com/downloads/wordpress-advanced-database-cleaner',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://sigmaplugin.com/downloads/wordpress-advanced-database-cleaner/#price_table'
)
),
'free_slug' => 'advanced-database-cleaner'
),
'ai-engine' => array(
'name' => 'AI Engine (Pro)',
'description' => 'Enhanced AI capabilities for content generation, analysis, and automation.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://meowapps.com/plugin/ai-engine/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://meowapps.com/ai-engine-pricing/'
)
),
'free_slug' => 'ai-engine'
),
'code-profiler' => array(
'name' => 'Code Profiler Pro',
'description' => 'Advanced performance monitoring and debugging tools for WordPress.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://codeprofiler.io/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://codeprofiler.io/#pricing'
)
)
),
'code-snippets' => array(
'name' => 'Code Snippets Pro',
'description' => 'Add and manage custom code snippets with advanced features and management tools.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://codesnippets.pro/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://codesnippets.pro/pricing/'
)
),
'free_slug' => 'code-snippets'
),
'comment-goblin' => array(
'name' => 'Comment Goblin',
'description' => 'Advanced comment management and spam protection system.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://commentgoblin.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://commentgoblin.com/#pricing'
)
)
),
'complianz-gdpr' => array(
'name' => 'Complianz Privacy Suite',
'description' => 'Complete GDPR/CCPA compliance solution with advanced features.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://complianz.io/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://complianz.io/pricing/'
)
),
'free_slug' => 'complianz-gdpr'
),
'disable-bloat' => array(
'name' => 'Disable Bloat PRO',
'description' => 'Advanced optimization for WordPress & WooCommerce with premium features.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://disablebloat.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://disablebloat.com/#pricing'
)
)
),
'fluent-crm' => array(
'name' => 'FluentCRM Pro',
'description' => 'Advanced CRM and email marketing automation.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://fluentcrm.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://fluentcrm.com/pricing/'
),
array(
'text' => 'Automation Pack',
'url' => 'https://fluentcrm.com/modules/automation-pack/'
)
),
'free_slug' => 'fluent-crm'
),
'fluent-forms' => array(
'name' => 'Fluent Forms Pro',
'description' => 'Advanced form builder with conversational forms and powerful integrations.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://fluentforms.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://fluentforms.com/pricing/'
)
),
'free_slug' => 'fluentform'
),
'fluent-smtp' => array(
'name' => 'FluentSMTP Pro',
'description' => 'Advanced SMTP and email delivery solution with analytics and logs.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://fluentsmtp.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://fluentsmtp.com/pricing/'
)
),
'free_slug' => 'fluent-smtp'
),
'flyingpress' => array(
'name' => 'FlyingPress',
'description' => 'Advanced WordPress performance optimization with automatic critical CSS and more.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://flyingpress.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://flyingpress.com/pricing/'
)
)
),
'freesoul-deactivate-plugins' => array(
'name' => 'Freesoul Deactivate Plugins PRO',
'description' => 'Advanced plugin management with selective deactivation and performance optimization.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://freesoul-deactivate-plugins.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://freesoul-deactivate-plugins.com/pricing/'
)
),
'free_slug' => 'freesoul-deactivate-plugins'
),
'generateblocks-pro' => array(
'name' => 'GenerateBlocks Pro',
'description' => 'Advanced block library extension with powerful features for GenerateBlocks.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://generateblocks.com/pro/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://generateblocks.com/pro/#pricing'
)
),
'free_slug' => 'generateblocks'
),
'oxygen-builder' => array(
'name' => 'Oxygen Builder',
'description' => 'Advanced visual website builder with unlimited design flexibility.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://oxygenbuilder.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://oxygenbuilder.com/pricing/'
)
)
),
'perfmatters' => array(
'name' => 'Perfmatters',
'description' => 'Lightweight performance plugin for WordPress to disable unused features.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://perfmatters.io/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://perfmatters.io/pricing/'
)
)
),
'pixelbuddha' => array(
'name' => 'PixelBuddha PRO',
'description' => 'Premium design assets and templates for WordPress.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://pixelbuddha.net/membership',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://pixelbuddha.net/membership'
)
)
),
'rank-math-pro' => array(
'name' => 'Rank Math PRO',
'description' => 'Advanced SEO features including schema markup, rank tracking, and content analysis.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://rankmath.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://rankmath.com/pricing/'
)
),
'free_slug' => 'seo-by-rank-math'
),
'self-hosted-google-fonts' => array(
'name' => 'OMGF Pro',
'description' => 'Advanced control over Google Fonts with local hosting and optimization.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://daan.dev/wordpress/omgf-pro/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://daan.dev/wordpress/omgf-pro/#pricing'
)
),
'free_slug' => 'host-webfonts-local'
),
'shortpixel-image-optimizer' => array(
'name' => 'ShortPixel Image Optimizer',
'description' => 'Premium image optimization with advanced compression algorithms.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://shortpixel.com/otp/af/WMBPNHN1231799',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://shortpixel.com/otp/af/WMBPNHN1231799#pricing'
)
),
'free_slug' => 'shortpixel-image-optimiser'
),
'simpletoc-pro' => array(
'name' => 'Simple TOC Pro',
'description' => 'Advanced table of contents with custom designs and display options.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://marc.tv/simpletoc-pro/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://marc.tv/en/checkout/purchase-history/?level=6'
)
),
'free_slug' => 'simpletoc'
),
'swift-control-pro' => array(
'name' => 'Swift Control Pro',
'description' => 'Advanced admin bar replacement with customizable controls and shortcuts.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://swiftcontrolpro.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://swiftcontrolpro.com/#pricing'
)
),
'free_slug' => 'swift-control'
),
'swiftperformance' => array(
'name' => 'Swift Performance',
'description' => 'Advanced performance optimization with caching, minification, and CDN integration.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://swiftperformance.io/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://swiftperformance.io/pricing/'
)
),
'free_slug' => 'swift-performance-lite'
),
'wp-rocket' => array(
'name' => 'WP Rocket',
'description' => 'Premium caching and performance plugin with advanced optimization features.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://wp-rocket.me/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://wp-rocket.me/pricing/'
)
)
),
'wp-seopress-pro' => array(
'name' => 'SEOPress Pro',
'description' => 'Advanced SEO plugin with premium features for optimization and analytics.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://www.seopress.org/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://www.seopress.org/pricing/'
)
),
'free_slug' => 'wp-seopress'
),
'woocommerce-color-swatches' => array(
'name' => 'Variation Swatches for WooCommerce Pro',
'description' => 'Advanced color and image swatches for WooCommerce product variations.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://getwooplugins.com/plugins/woocommerce-variation-swatches/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://getwooplugins.com/plugins/woocommerce-variation-swatches/'
)
),
'free_slug' => 'woo-variation-swatches'
),
'woocommerce-subscriptions' => array(
'name' => 'WooCommerce Subscriptions',
'description' => 'Add subscription-based products and recurring payments to WooCommerce.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://woocommerce.com/products/woocommerce-subscriptions/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://woocommerce.com/products/woocommerce-subscriptions/'
)
)
),
'woocommerce-wholesale-suite' => array(
'name' => 'WooCommerce Wholesale Suite',
'description' => 'Add wholesale functionality to your WooCommerce store.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://wholesalesuiteplugin.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://wholesalesuiteplugin.com/pricing/'
)
)
),
'yoast-seo-premium' => array(
'name' => 'Yoast SEO Premium',
'description' => 'Advanced SEO tools with premium features for optimization and content analysis.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://yoast.com/wordpress/plugins/seo/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://yoast.com/wordpress/plugins/seo/#licenses'
)
),
'free_slug' => 'wordpress-seo'
)
);
}

View File

@ -2,52 +2,41 @@
/** /**
* WP ALLSTARS Admin Manager * WP ALLSTARS Admin Manager
* *
* Main controller for the plugin's admin interface. Responsible for:
* - Registering the admin menu item
* - Enqueueing admin scripts and styles
* - Handling AJAX requests for settings updates
* - Rendering the admin page with tabs
* - Managing plugin settings registration
*
* @package WP_ALLSTARS * @package WP_ALLSTARS
* @since 0.2.0 * @since 0.2.0
*/ */
if (!defined('ABSPATH')) { if (!defined('ABSPATH')) {
exit; // Exit if accessed directly exit;
} }
/**
* WP_Allstars_Admin_Manager class
*
* Centralizes all admin-related functionality for the WP ALLSTARS plugin.
*/
class WP_Allstars_Admin_Manager { class WP_Allstars_Admin_Manager {
/** /**
* Initialize the class and register all hooks * Initialize the class and register hooks
*
* @return void
*/ */
public static function init() { public static function init() {
// Register admin hooks
add_action('admin_menu', array(__CLASS__, 'register_admin_menu')); add_action('admin_menu', array(__CLASS__, 'register_admin_menu'));
add_action('wp_ajax_wp_allstars_update_option', array(__CLASS__, 'update_option')); add_action('wp_ajax_wp_allstars_update_option', array(__CLASS__, 'update_option'));
add_action('admin_init', array(__CLASS__, 'register_settings')); add_action('admin_init', array(__CLASS__, 'register_settings'));
add_action('admin_enqueue_scripts', array(__CLASS__, 'enqueue_admin_scripts')); add_action('admin_enqueue_scripts', array(__CLASS__, 'enqueue_admin_scripts'));
// Initialize all manager classes
WP_Allstars_Settings_Manager::init();
WP_Allstars_Theme_Manager::init();
WP_Allstars_Workflow_Manager::init();
WP_Allstars_Pro_Plugins_Manager::init();
WP_Allstars_Tools_Manager::init();
WP_Allstars_Hosting_Manager::init();
WP_Allstars_Free_Plugins_Manager::init();
} }
/** /**
* Enqueue admin scripts and styles * Enqueue admin scripts and styles
* *
* Loads CSS and JavaScript only on the plugin admin page
* to avoid conflicts with other plugins.
*
* @param string $hook The current admin page hook * @param string $hook The current admin page hook
* @return void
*/ */
public static function enqueue_admin_scripts($hook) { public static function enqueue_admin_scripts($hook) {
// Only load on our plugin's admin page
if ('settings_page_wp-allstars' !== $hook) { if ('settings_page_wp-allstars' !== $hook) {
return; return;
} }
@ -77,39 +66,79 @@ class WP_Allstars_Admin_Manager {
} }
/** /**
* Register plugin settings * Register core plugin settings
*
* Registers all settings fields with the WordPress Settings API
* for proper data sanitization and storage.
*
* @return void
*/ */
public static function register_settings() { public static function register_settings() {
// Register settings for each tab as needed // Core settings groups - tab-specific settings are registered in their respective manager classes
register_setting('wp_allstars_general', 'wp_allstars_general_settings'); register_setting('wp_allstars_general', 'wp_allstars_general_settings');
register_setting('wp_allstars_advanced', 'wp_allstars_advanced_settings'); register_setting('wp_allstars_advanced', 'wp_allstars_advanced_settings');
// Add additional settings as needed for future functionality
} }
/** /**
* AJAX handler for updating options * AJAX handler for updating options
*/ */
public static function update_option() { public static function update_option() {
// Verify nonce for security
check_ajax_referer('wp-allstars-nonce', 'nonce'); check_ajax_referer('wp-allstars-nonce', 'nonce');
// Check if user has proper permissions
if (!current_user_can('manage_options')) {
wp_send_json_error('Insufficient permissions');
return;
}
// Validate and sanitize input
if (!isset($_POST['option']) || !isset($_POST['value'])) {
wp_send_json_error('Missing required parameters');
return;
}
$option = sanitize_text_field($_POST['option']); $option = sanitize_text_field($_POST['option']);
$value = intval($_POST['value']);
update_option($option, $value); // Different sanitization based on expected value type
wp_send_json_success('Option updated'); $value = $_POST['value'];
if (is_numeric($value)) {
$value = intval($value);
} elseif (is_string($value)) {
$value = sanitize_text_field($value);
} elseif (is_array($value)) {
$value = array_map('sanitize_text_field', $value);
}
// Whitelist of allowed options to update for security
$allowed_options = array(
'wp_allstars_auto_upload_images',
'wp_allstars_max_width',
'wp_allstars_max_height',
'wp_allstars_exclude_urls',
'wp_allstars_image_name_pattern',
'wp_allstars_image_alt_pattern'
);
if (!in_array($option, $allowed_options)) {
wp_send_json_error('Invalid option');
return;
}
// Update the option
$result = update_option($option, $value);
if ($result) {
wp_send_json_success(array(
'message' => 'Option updated successfully',
'option' => $option,
'value' => $value
));
} else {
wp_send_json_success(array(
'message' => 'No changes made to option',
'option' => $option
));
}
} }
/** /**
* Register the admin menu item * Register the admin menu item
*
* Adds the WP ALLSTARS menu item under the Settings menu
* in the WordPress admin dashboard.
*
* @return void
*/ */
public static function register_admin_menu() { public static function register_admin_menu() {
add_options_page( add_options_page(
@ -130,14 +159,12 @@ class WP_Allstars_Admin_Manager {
$active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'general'; $active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'general';
$active_category = isset($_GET['category']) ? $_GET['category'] : 'minimal'; $active_category = isset($_GET['category']) ? $_GET['category'] : 'minimal';
// Clear cache and load required files // Tab-specific resources
if ($active_tab === 'recommended') { if ($active_tab === 'recommended') {
WP_Allstars_Plugin_Manager::clear_plugin_cache(); WP_Allstars_Plugin_Manager::clear_plugin_cache();
require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
wp_enqueue_script('plugin-install'); wp_enqueue_script('plugin-install');
wp_enqueue_script('updates'); wp_enqueue_script('updates');
add_thickbox(); add_thickbox();
wp_enqueue_style('wp-allstars-admin', plugins_url('css/wp-allstars-admin.css', dirname(__FILE__)));
wp_enqueue_style('wp-allstars-plugins', plugins_url('css/wp-allstars-plugins.css', dirname(__FILE__))); wp_enqueue_style('wp-allstars-plugins', plugins_url('css/wp-allstars-plugins.css', dirname(__FILE__)));
// Add inline script to load plugins on page load // Add inline script to load plugins on page load
@ -237,7 +264,7 @@ class WP_Allstars_Admin_Manager {
break; break;
case 'workflow': case 'workflow':
self::display_workflow_tab(); WP_Allstars_Workflow_Manager::display_tab_content();
break; break;
case 'theme': case 'theme':
@ -245,7 +272,7 @@ class WP_Allstars_Admin_Manager {
break; break;
case 'recommended': case 'recommended':
WP_Allstars_Recommended_Plugins_Manager::display_tab_content(); WP_Allstars_Free_Plugins_Manager::display_tab_content();
break; break;
case 'pro': case 'pro':
@ -275,91 +302,4 @@ class WP_Allstars_Admin_Manager {
public static function enqueue_scripts($hook) { public static function enqueue_scripts($hook) {
self::enqueue_admin_scripts($hook); self::enqueue_admin_scripts($hook);
} }
/**
* Display the Workflow tab content
*/
public static function display_workflow_tab() {
?>
<div class="wp-allstars-settings-content tab-content" id="workflow">
<div class="wp-allstars-toggle">
<div class="wp-allstars-toggle-header" aria-expanded="false">
<div class="wp-allstars-toggle-main">
<div class="wp-allstars-toggle-left">
<div class="wp-toggle-switch">
<input type="checkbox"
id="wp_allstars_auto_upload_images"
name="wp_allstars_auto_upload_images"
value="1"
<?php checked(get_option('wp_allstars_auto_upload_images', false)); ?>
/>
<span class="wp-toggle-slider"></span>
</div>
<label for="wp_allstars_auto_upload_images">
<?php esc_html_e('Enable Auto Upload Images', 'wp-allstars'); ?>
</label>
</div>
</div>
<p class="wp-setting-description">
<?php esc_html_e('Import images that have external URLs into your Media Library when saving. Consider disabling during large data imports with many external image URLs.', 'wp-allstars'); ?>
</p>
</div>
<div class="wp-allstars-toggle-settings">
<div class="wp-allstars-setting-row">
<label for="wp_allstars_max_width"><?php esc_html_e('Max Width', 'wp-allstars'); ?></label>
<input type="number"
id="wp_allstars_max_width"
name="wp_allstars_max_width"
value="<?php echo esc_attr(get_option('wp_allstars_max_width', 2560)); ?>"
/>
<p class="description"><?php esc_html_e('Maximum width for uploaded images in pixels.', 'wp-allstars'); ?></p>
</div>
<div class="wp-allstars-setting-row">
<label for="wp_allstars_max_height"><?php esc_html_e('Max Height', 'wp-allstars'); ?></label>
<input type="number"
id="wp_allstars_max_height"
name="wp_allstars_max_height"
value="<?php echo esc_attr(get_option('wp_allstars_max_height', 2560)); ?>"
/>
<p class="description"><?php esc_html_e('Maximum height for uploaded images in pixels.', 'wp-allstars'); ?></p>
</div>
<div class="wp-allstars-setting-row">
<label for="wp_exclude_urls"><?php esc_html_e('Exclude URLs', 'wp-allstars'); ?></label>
<textarea id="wp_exclude_urls"
name="wp_exclude_urls"
rows="3"
placeholder="example.com&#10;another-domain.com"
><?php echo esc_textarea(get_option('wp_allstars_exclude_urls', '')); ?></textarea>
<p class="description"><?php esc_html_e('Enter domains to exclude (one per line). Images from these domains will not be imported.', 'wp-allstars'); ?></p>
</div>
<div class="wp-allstars-setting-row">
<label for="wp_image_name"><?php esc_html_e('Image Name Pattern', 'wp-allstars'); ?></label>
<input type="text"
id="wp_image_name"
name="wp_image_name"
value="<?php echo esc_attr(get_option('wp_allstars_image_name_pattern', '%filename%')); ?>"
/>
<p class="description">
<?php esc_html_e('Available patterns:', 'wp-allstars'); ?> %filename%, %post_id%, %postname%, %timestamp%, %date%, %year%, %month%, %day%
</p>
</div>
<div class="wp-allstars-setting-row">
<label for="wp_image_alt"><?php esc_html_e('Image Alt Pattern', 'wp-allstars'); ?></label>
<input type="text"
id="wp_image_alt"
name="wp_image_alt"
value="<?php echo esc_attr(get_option('wp_allstars_image_alt_pattern', '%filename%')); ?>"
/>
<p class="description">
<?php esc_html_e('Available patterns:', 'wp-allstars'); ?> %filename%, %post_title%, %post_id%, %postname%, %timestamp%
</p>
</div>
</div>
</div>
</div>
<?php
}
} }

View File

@ -0,0 +1,159 @@
<?php
/**
* WP ALLSTARS Free Plugins Manager
*
* Manages the Free Plugins tab including:
* - Category filtering system
* - Plugin recommendations by use case
* - Plugin installation functionality
*
* @package WP_ALLSTARS
* @since 0.2.0
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
}
/**
* WP_Allstars_Free_Plugins_Manager class
*
* Provides categorized plugin recommendations based on website needs
*/
class WP_Allstars_Free_Plugins_Manager {
/**
* Initialize the class and register hooks if needed
*
* @return void
*/
public static function init() {
// We'll implement AJAX handlers in a future update if needed
// add_action('wp_ajax_wp_allstars_load_free_plugins', array(self::class, 'ajax_load_free_plugins'));
}
/**
* Display the free plugins tab content
*
* Renders the category filter bar and plugin list container.
* Initial view shows 'minimal' category plugins by default.
*
* @return void
*/
public static function display_tab_content() {
// Get the active category from query params or use default
$active_category = isset($_GET['category']) ? sanitize_text_field($_GET['category']) : 'minimal';
?>
<div class="wp-allstars-settings-content tab-content" id="recommended">
<div id="wpa-plugin-filters" class="wp-filter">
<ul class="filter-links">
<li><a href="#" data-category="minimal" class="<?php echo $active_category == 'minimal' ? 'current' : ''; ?>">
<?php esc_html_e('Minimal', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="admin" class="<?php echo $active_category == 'admin' ? 'current' : ''; ?>">
<?php esc_html_e('Admin', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="cms" class="<?php echo $active_category == 'cms' ? 'current' : ''; ?>">
<?php esc_html_e('CMS', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="ecommerce" class="<?php echo $active_category == 'ecommerce' ? 'current' : ''; ?>">
<?php esc_html_e('eCommerce', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="marketing" class="<?php echo $active_category == 'marketing' ? 'current' : ''; ?>">
<?php esc_html_e('Marketing', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="media" class="<?php echo $active_category == 'media' ? 'current' : ''; ?>">
<?php esc_html_e('Media', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="security" class="<?php echo $active_category == 'security' ? 'current' : ''; ?>">
<?php esc_html_e('Security', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="developers" class="<?php echo $active_category == 'developers' ? 'current' : ''; ?>">
<?php esc_html_e('Developers', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="affiliates" class="<?php echo $active_category == 'affiliates' ? 'current' : ''; ?>">
<?php esc_html_e('Affiliates', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="ai" class="<?php echo $active_category == 'ai' ? 'current' : ''; ?>">
<?php esc_html_e('AI', 'wp-allstars'); ?>
</a></li>
</ul>
</div>
<div class="wp-allstars-plugin-browser">
<div class="wp-list-table plugin-install">
<div id="wpa-plugin-list">
<div id="the-list"></div>
</div>
</div>
<div class="wp-allstars-loading-overlay">
<span class="spinner is-active"></span>
</div>
</div>
<script>
jQuery(document).ready(function($) {
// Filter tab click handler
$('#wpa-plugin-filters .filter-links a').on('click', function(e) {
e.preventDefault();
var category = $(this).data('category');
// Update filter UI
$('#wpa-plugin-filters .filter-links a').removeClass('current');
$(this).addClass('current');
// Show loading spinner
$('.wp-allstars-loading-overlay').show();
// Clear existing plugins
$('#the-list').empty();
// Load plugins in selected category
$.ajax({
url: ajaxurl,
type: 'POST',
data: {
action: 'wp_allstars_load_plugins',
category: category,
nonce: '<?php echo wp_create_nonce('wp_allstars_load_plugins'); ?>'
},
success: function(response) {
if (response.success) {
// Hide loading spinner
$('.wp-allstars-loading-overlay').hide();
// Add plugins to the container
$('#the-list').html(response.data);
} else {
console.error('Error loading plugins:', response.data);
}
},
error: function(xhr, status, error) {
console.error('AJAX error:', error);
}
});
});
// Load initial category (minimal or from URL)
$('#wpa-plugin-filters .filter-links a.current').trigger('click');
});
</script>
</div>
<?php
}
/**
* Get the recommended plugins data
*
* @return array Array of recommended plugins by category
*/
public static function get_recommended_plugins() {
// Define the plugins data if it hasn't been included yet
if (!function_exists('wp_allstars_get_free_plugins')) {
require_once dirname(dirname(__FILE__)) . '/data/free-plugins.php';
}
return wp_allstars_get_free_plugins();
}
}

View File

@ -91,7 +91,7 @@ class WP_Allstars_Plugin_Manager {
require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
// Get our recommended plugins for this category // Get our recommended plugins for this category
$recommended_plugins = wp_allstars_get_recommended_plugins(); $recommended_plugins = wp_allstars_get_free_plugins();
if (!isset($recommended_plugins[$category])) { if (!isset($recommended_plugins[$category])) {
wp_send_json_error('Invalid category: ' . $category); wp_send_json_error('Invalid category: ' . $category);
return; return;
@ -309,7 +309,7 @@ class WP_Allstars_Plugin_Manager {
* @param object $plugin The plugin object * @param object $plugin The plugin object
*/ */
public static function add_pro_button($plugin) { public static function add_pro_button($plugin) {
$pro_plugins = wp_allstars_get_pro_plugins_config(); $pro_plugins = wp_allstars_get_pro_plugins();
if (isset($pro_plugins[$plugin->slug])) { if (isset($pro_plugins[$plugin->slug])) {
$pro_plugin = $pro_plugins[$plugin->slug]; $pro_plugin = $pro_plugins[$plugin->slug];
@ -355,7 +355,7 @@ class WP_Allstars_Plugin_Manager {
* Clear plugin cache when plugins are updated, activated, or deactivated * Clear plugin cache when plugins are updated, activated, or deactivated
*/ */
public static function clear_plugin_cache() { public static function clear_plugin_cache() {
$recommended_plugins = wp_allstars_get_recommended_plugins(); $recommended_plugins = wp_allstars_get_free_plugins();
foreach (array_keys($recommended_plugins) as $category) { foreach (array_keys($recommended_plugins) as $category) {
delete_transient('wp_allstars_plugins_' . $category); delete_transient('wp_allstars_plugins_' . $category);
} }

View File

@ -43,8 +43,8 @@ class WP_Allstars_Pro_Plugins_Manager {
* @return array Array of premium plugin data * @return array Array of premium plugin data
*/ */
public static function get_pro_plugins() { public static function get_pro_plugins() {
// Load pro plugin configuration from the function defined in pro-plugins-config.php // Load pro plugin configuration from the data file
return wp_allstars_get_pro_plugins_config(); return wp_allstars_get_pro_plugins();
} }
/** /**

View File

@ -1,121 +0,0 @@
<?php
/**
* WP ALLSTARS Recommended Plugins Manager
*
* Manages the Recommended Plugins tab including:
* - Category filtering system
* - Plugin recommendations by use case
* - Plugin installation functionality
*
* @package WP_ALLSTARS
* @since 0.2.0
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
}
/**
* WP_Allstars_Recommended_Plugins_Manager class
*
* Provides categorized plugin recommendations based on website needs
*/
class WP_Allstars_Recommended_Plugins_Manager {
/**
* Initialize the class and register hooks if needed
*
* @return void
*/
public static function init() {
// We'll implement AJAX handlers in a future update if needed
// add_action('wp_ajax_wp_allstars_load_recommended_plugins', array(self::class, 'ajax_load_recommended_plugins'));
}
/**
* Display the recommended plugins tab content
*
* Renders the category filter bar and plugin list container.
* Initial view shows 'minimal' category plugins by default.
*
* @return void
*/
public static function display_tab_content() {
// Get the active category from query params or use default
$active_category = isset($_GET['category']) ? sanitize_text_field($_GET['category']) : 'minimal';
?>
<div class="wp-allstars-settings-content tab-content" id="recommended">
<div id="wpa-plugin-filters" class="wp-filter">
<ul class="filter-links">
<li><a href="#" data-category="minimal" class="<?php echo $active_category == 'minimal' ? 'current' : ''; ?>">
<?php esc_html_e('Minimal', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="admin" class="<?php echo $active_category == 'admin' ? 'current' : ''; ?>">
<?php esc_html_e('Admin', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="ai" class="<?php echo $active_category == 'ai' ? 'current' : ''; ?>">
<?php esc_html_e('AI', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="cms" class="<?php echo $active_category == 'cms' ? 'current' : ''; ?>">
<?php esc_html_e('CMS', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="compliance" class="<?php echo $active_category == 'compliance' ? 'current' : ''; ?>">
<?php esc_html_e('Compliance', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="crm" class="<?php echo $active_category == 'crm' ? 'current' : ''; ?>">
<?php esc_html_e('CRM', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="ecommerce" class="<?php echo $active_category == 'ecommerce' ? 'current' : ''; ?>">
<?php esc_html_e('Ecommerce', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="lms" class="<?php echo $active_category == 'lms' ? 'current' : ''; ?>">
<?php esc_html_e('LMS', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="media" class="<?php echo $active_category == 'media' ? 'current' : ''; ?>">
<?php esc_html_e('Media', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="seo" class="<?php echo $active_category == 'seo' ? 'current' : ''; ?>">
<?php esc_html_e('SEO', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="setup" class="<?php echo $active_category == 'setup' ? 'current' : ''; ?>">
<?php esc_html_e('Setup', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="social" class="<?php echo $active_category == 'social' ? 'current' : ''; ?>">
<?php esc_html_e('Social', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="speed" class="<?php echo $active_category == 'speed' ? 'current' : ''; ?>">
<?php esc_html_e('Speed', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="translation" class="<?php echo $active_category == 'translation' ? 'current' : ''; ?>">
<?php esc_html_e('Translation', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="advanced" class="<?php echo $active_category == 'advanced' ? 'current' : ''; ?>">
<?php esc_html_e('Advanced', 'wp-allstars'); ?>
</a></li>
<li><a href="#" data-category="debug" class="<?php echo $active_category == 'debug' ? 'current' : ''; ?>">
<?php esc_html_e('Debug', 'wp-allstars'); ?>
</a></li>
</ul>
</div>
<div class="wp-allstars-plugin-browser">
<div id="wpa-plugin-list"></div>
</div>
</div>
<?php
}
/**
* Get the list of recommended plugins
*
* @return array Array of recommended plugins
*/
public static function get_recommended_plugins() {
// Define the plugins data if it hasn't been included yet
if (!function_exists('wp_allstars_get_recommended_plugins')) {
require_once dirname(dirname(__FILE__)) . '/data/recommended-plugins.php';
}
return wp_allstars_get_recommended_plugins();
}
}

View File

@ -2,12 +2,12 @@
/** /**
* Tools Manager Class * Tools Manager Class
* *
* Handles the display and management of recommended tools. * @package WP_ALLSTARS
* @since 0.2.0
*/ */
// If this file is called directly, abort. if (!defined('ABSPATH')) {
if ( ! defined( 'WPINC' ) ) { exit;
die;
} }
class WP_Allstars_Tools_Manager { class WP_Allstars_Tools_Manager {
@ -16,16 +16,33 @@ class WP_Allstars_Tools_Manager {
* Initialize the class * Initialize the class
*/ */
public static function init() { public static function init() {
// No hooks needed currently as styles are included directly in the HTML output add_action('admin_enqueue_scripts', array(__CLASS__, 'enqueue_styles'));
}
/**
* Enqueue styles for the tools tab
*
* @param string $hook Current admin page hook
*/
public static function enqueue_styles($hook) {
if ('settings_page_wp-allstars' !== $hook) {
return;
}
wp_enqueue_style(
'wp-allstars-admin',
plugins_url('css/wp-allstars-admin.css', dirname(__FILE__)),
array(),
WP_ALLSTARS_VERSION
);
} }
/** /**
* Get all tools * Get all tools
* *
* @return array Tools configuration * @return array
*/ */
public static function get_tools() { public static function get_tools() {
// Using the existing function to maintain compatibility
return wp_allstars_get_tools(); return wp_allstars_get_tools();
} }
@ -40,116 +57,15 @@ class WP_Allstars_Tools_Manager {
return strcasecmp($a['name'], $b['name']); return strcasecmp($a['name'], $b['name']);
}); });
// Output the CSS and HTML for the tools tab
?> ?>
<div class="wp-allstars-settings-content tab-content" id="tools"> <div class="wp-allstars-settings-content tab-content" id="tools">
<style> <div class="wpa-pro-plugins">
.wpa-pro-plugins { <?php
padding: 0; foreach ($tools as $tool) {
display: grid; self::display_tool_card(self::sanitize_tool_data($tool));
grid-template-columns: repeat(auto-fill, minmax(450px, 1fr)); }
gap: 24px; ?>
max-width: 1920px; </div>
margin: 0 auto;
}
.wpa-pro-plugin {
background: #fff;
border: 1px solid #ddd;
padding: 24px;
border-radius: 8px;
display: flex;
flex-direction: column;
transition: all 0.2s ease;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.wpa-pro-plugin:hover {
border-color: #2271b1;
box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.wpa-pro-plugin h3 {
margin: 0 0 12px;
font-size: 16px;
font-weight: 600;
color: #1d2327;
line-height: 1.4;
}
.wpa-pro-plugin p {
margin: 0 0 16px;
color: #50575e;
font-size: 14px;
line-height: 1.6;
}
.wpa-pro-plugin .button-group {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: auto;
}
.wpa-pro-plugin .button {
text-decoration: none;
min-width: 120px;
text-align: center;
height: 30px;
line-height: 28px;
padding: 0 12px;
font-size: 13px;
font-weight: normal;
margin: 0;
border: 1px solid #0071a1 !important;
border-radius: 3px !important;
background: #f6f7f7;
color: #0071a1;
display: inline-block;
vertical-align: top;
box-shadow: none;
cursor: pointer;
}
.wpa-pro-plugin .button:hover {
background: #f0f0f1;
border-color: #0071a1;
color: #0071a1;
}
.wpa-pro-plugin .button.button-primary {
background: #2271b1;
border-color: #2271b1 !important;
color: #fff;
}
.wpa-tool-card .button.button-primary:hover {
background: #135e96;
border-color: #135e96 !important;
}
@media screen and (max-width: 960px) {
.wpa-tools-grid {
grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
gap: 20px;
padding: 16px;
}
.wpa-pro-plugin {
padding: 20px;
}
}
@media screen and (max-width: 782px) {
.wpa-tools-grid {
grid-template-columns: 1fr;
gap: 16px;
padding: 12px;
}
.wpa-pro-plugin {
padding: 16px;
}
.wpa-pro-plugin .button {
width: 100%;
}
}
</style>
<div class="wpa-pro-plugins">
<?php
foreach ($tools as $tool) {
self::display_tool_card($tool);
}
?>
</div>
</div> </div>
<?php <?php
} }
@ -157,19 +73,33 @@ class WP_Allstars_Tools_Manager {
/** /**
* Display a single tool card * Display a single tool card
* *
* @param array $tool Tool configuration * @param array $tool Sanitized tool configuration
*/ */
public static function display_tool_card($tool) { private static function display_tool_card($tool) {
// Ensure we have the required fields
if (empty($tool['name'])) {
return;
}
?> ?>
<div class="wpa-pro-plugin"> <div class="wpa-pro-plugin">
<h3><?php echo esc_html($tool['name']); ?></h3> <h3><?php echo esc_html($tool['name']); ?></h3>
<p><?php echo esc_html($tool['description']); ?></p>
<?php if (isset($tool['button_group'])): ?> <?php if (!empty($tool['description'])): ?>
<p><?php echo esc_html($tool['description']); ?></p>
<?php endif; ?>
<?php if (!empty($tool['button_group']) && is_array($tool['button_group'])): ?>
<div class="button-group"> <div class="button-group">
<?php foreach ($tool['button_group'] as $button): ?> <?php foreach ($tool['button_group'] as $button): ?>
<a href="<?php echo esc_url($button['url']); ?>" target="_blank" class="button <?php echo isset($button['primary']) && $button['primary'] ? 'button-primary' : ''; ?>"> <?php if (!empty($button['url']) && !empty($button['text'])): ?>
<?php echo esc_html($button['text']); ?> <a
</a> href="<?php echo esc_url($button['url']); ?>"
target="_blank"
class="button <?php echo !empty($button['primary']) ? 'button-primary' : ''; ?>"
>
<?php echo esc_html($button['text']); ?>
</a>
<?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
@ -178,13 +108,16 @@ class WP_Allstars_Tools_Manager {
} }
/** /**
* Enqueue styles specific to tools * Sanitize tool data
* *
* Note: This method is no longer used as styles are now directly included in the display_tab_content method * @param array $tool Raw tool data
* for immediate application. Kept for reference or future use if needed. * @return array Sanitized tool data
*/ */
public static function enqueue_styles($hook) { private static function sanitize_tool_data($tool) {
// This method is currently not in use as styles are directly included in the HTML output return array(
// to ensure immediate application without relying on the WordPress hook system timing 'name' => isset($tool['name']) ? sanitize_text_field($tool['name']) : '',
'description' => isset($tool['description']) ? sanitize_text_field($tool['description']) : '',
'button_group' => isset($tool['button_group']) ? $tool['button_group'] : array(),
);
} }
} }

View File

@ -0,0 +1,178 @@
<?php
/**
* Workflow Manager Class
*
* @package WP_ALLSTARS
* @since 0.2.0
*/
if (!defined('ABSPATH')) {
exit;
}
class WP_Allstars_Workflow_Manager {
/**
* Initialize the class
*/
public static function init() {
add_action('admin_init', array(__CLASS__, 'register_settings'));
}
/**
* Register workflow settings
*/
public static function register_settings() {
register_setting('wp_allstars_workflow', 'wp_allstars_workflow_options');
register_setting('wp_allstars_workflow', 'wp_allstars_auto_upload_images');
register_setting('wp_allstars_workflow', 'wp_allstars_max_width');
register_setting('wp_allstars_workflow', 'wp_allstars_max_height');
register_setting('wp_allstars_workflow', 'wp_allstars_exclude_urls');
register_setting('wp_allstars_workflow', 'wp_allstars_image_name_pattern');
register_setting('wp_allstars_workflow', 'wp_allstars_image_alt_pattern');
}
/**
* Display the workflow tab content
*/
public static function display_tab_content() {
?>
<div class="wp-allstars-settings-content tab-content" id="workflow">
<div class="wp-allstars-toggle">
<div class="wp-allstars-toggle-header" aria-expanded="false">
<div class="wp-allstars-toggle-main">
<div class="wp-allstars-toggle-left">
<div class="wp-toggle-switch">
<input type="checkbox"
id="wp_allstars_auto_upload_images"
name="wp_allstars_auto_upload_images"
value="1"
<?php checked(get_option('wp_allstars_auto_upload_images', false)); ?>
/>
<span class="wp-toggle-slider"></span>
</div>
<label for="wp_allstars_auto_upload_images">
<?php esc_html_e('Enable Auto Upload Images', 'wp-allstars'); ?>
</label>
</div>
</div>
<p class="wp-setting-description">
<?php esc_html_e('Import images that have external URLs into your Media Library when saving. Consider disabling during large data imports with many external image URLs.', 'wp-allstars'); ?>
</p>
</div>
<div class="wp-allstars-toggle-settings">
<div class="wp-allstars-setting-row">
<label for="wp_allstars_max_width"><?php esc_html_e('Max Width', 'wp-allstars'); ?></label>
<input type="number"
id="wp_allstars_max_width"
name="wp_allstars_max_width"
value="<?php echo esc_attr(get_option('wp_allstars_max_width', 2560)); ?>"
/>
<p class="description"><?php esc_html_e('Maximum width for uploaded images in pixels.', 'wp-allstars'); ?></p>
</div>
<div class="wp-allstars-setting-row">
<label for="wp_allstars_max_height"><?php esc_html_e('Max Height', 'wp-allstars'); ?></label>
<input type="number"
id="wp_allstars_max_height"
name="wp_allstars_max_height"
value="<?php echo esc_attr(get_option('wp_allstars_max_height', 2560)); ?>"
/>
<p class="description"><?php esc_html_e('Maximum height for uploaded images in pixels.', 'wp-allstars'); ?></p>
</div>
<div class="wp-allstars-setting-row">
<label for="wp_allstars_exclude_urls"><?php esc_html_e('Exclude URLs', 'wp-allstars'); ?></label>
<textarea id="wp_allstars_exclude_urls"
name="wp_allstars_exclude_urls"
rows="3"
placeholder="example.com&#10;another-domain.com"
><?php echo esc_textarea(get_option('wp_allstars_exclude_urls', '')); ?></textarea>
<p class="description"><?php esc_html_e('Enter domains to exclude (one per line). Images from these domains will not be imported.', 'wp-allstars'); ?></p>
</div>
<div class="wp-allstars-setting-row">
<label for="wp_allstars_image_name"><?php esc_html_e('Image Name Pattern', 'wp-allstars'); ?></label>
<input type="text"
id="wp_allstars_image_name"
name="wp_allstars_image_name"
value="<?php echo esc_attr(get_option('wp_allstars_image_name_pattern', '%filename%')); ?>"
/>
<p class="description">
<?php esc_html_e('Available patterns:', 'wp-allstars'); ?> %filename%, %post_id%, %postname%, %timestamp%, %date%, %year%, %month%, %day%
</p>
</div>
<div class="wp-allstars-setting-row">
<label for="wp_allstars_image_alt"><?php esc_html_e('Image Alt Pattern', 'wp-allstars'); ?></label>
<input type="text"
id="wp_allstars_image_alt"
name="wp_allstars_image_alt"
value="<?php echo esc_attr(get_option('wp_allstars_image_alt_pattern', '%filename%')); ?>"
/>
<p class="description">
<?php esc_html_e('Available patterns:', 'wp-allstars'); ?> %filename%, %post_title%, %post_id%, %postname%, %timestamp%
</p>
</div>
</div>
</div>
</div>
<?php
}
/**
* Save workflow settings via AJAX
*/
public static function save_settings() {
// Verify nonce for security
check_ajax_referer('wp-allstars-nonce', 'nonce');
// Check if user has proper permissions
if (!current_user_can('manage_options')) {
wp_send_json_error('Insufficient permissions');
return;
}
$options = array();
// Auto upload images setting
$options['auto_upload_images'] = isset($_POST['auto_upload_images']) ?
(bool) $_POST['auto_upload_images'] :
false;
// Max dimensions
$options['max_width'] = isset($_POST['max_width']) ?
absint($_POST['max_width']) :
2560;
$options['max_height'] = isset($_POST['max_height']) ?
absint($_POST['max_height']) :
2560;
// Exclude URLs
$options['exclude_urls'] = isset($_POST['exclude_urls']) ?
sanitize_textarea_field($_POST['exclude_urls']) :
'';
// Name and alt patterns
$options['image_name_pattern'] = isset($_POST['image_name_pattern']) ?
sanitize_text_field($_POST['image_name_pattern']) :
'%filename%';
$options['image_alt_pattern'] = isset($_POST['image_alt_pattern']) ?
sanitize_text_field($_POST['image_alt_pattern']) :
'%filename%';
// Update the options
update_option('wp_allstars_workflow_options', $options);
// Also update individual options for backward compatibility
update_option('wp_allstars_auto_upload_images', $options['auto_upload_images']);
update_option('wp_allstars_max_width', $options['max_width']);
update_option('wp_allstars_max_height', $options['max_height']);
update_option('wp_allstars_exclude_urls', $options['exclude_urls']);
update_option('wp_allstars_image_name_pattern', $options['image_name_pattern']);
update_option('wp_allstars_image_alt_pattern', $options['image_alt_pattern']);
wp_send_json_success('Workflow settings saved');
}
}

View File

@ -1,778 +0,0 @@
<?php
/**
* Pro Plugins Configuration
*/
function wp_allstars_get_pro_plugins_config() {
return array(
'magic-login-pro' => array(
'name' => 'Magic Login Pro',
'description' => 'Enable passwordless authentication with magic login links and enhance WordPress site security.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://handyplugins.co/magic-login-pro/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://handyplugins.co/magic-login-pro/#pricing'
)
),
'free_slug' => 'magic-login'
),
'admin-columns' => array(
'name' => 'Admin Columns Pro',
'description' => 'Advanced admin columns management with sorting, filtering, and editing capabilities.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://www.admincolumns.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://www.admincolumns.com/pricing/'
)
),
'free_slug' => 'codepress-admin-columns'
),
'admin-menu-editor' => array(
'name' => 'Admin Menu Editor Pro',
'description' => 'Customize the WordPress admin menu with advanced features and role management.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://adminmenueditor.com/upgrade-to-pro/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://adminmenueditor.com/upgrade-to-pro/'
)
),
'free_slug' => 'admin-menu-editor'
),
'advanced-custom-fields' => array(
'name' => 'Advanced Custom Fields PRO',
'description' => 'Create custom fields and content types with advanced features and options.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://www.advancedcustomfields.com/pro/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://www.advancedcustomfields.com/pro/#pricing'
)
),
'free_slug' => 'advanced-custom-fields'
),
'advanced-database-cleaner' => array(
'name' => 'Advanced Database Cleaner PRO',
'description' => 'Clean and optimize your WordPress database with advanced tools and automation.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://sigmaplugin.com/downloads/wordpress-advanced-database-cleaner',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://sigmaplugin.com/downloads/wordpress-advanced-database-cleaner/#price_table'
)
),
'free_slug' => 'advanced-database-cleaner'
),
'ai-engine' => array(
'name' => 'AI Engine (Pro)',
'description' => 'Enhanced AI capabilities for content generation, analysis, and automation.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://meowapps.com/plugin/ai-engine/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://meowapps.com/ai-engine-pricing/'
)
),
'free_slug' => 'ai-engine'
),
'code-profiler' => array(
'name' => 'Code Profiler Pro',
'description' => 'Advanced performance monitoring and debugging tools for WordPress.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://codeprofiler.io/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://codeprofiler.io/#pricing'
)
)
),
'code-snippets' => array(
'name' => 'Code Snippets Pro',
'description' => 'Add and manage custom code snippets with advanced features and management tools.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://codesnippets.pro/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://codesnippets.pro/pricing/'
)
),
'free_slug' => 'code-snippets'
),
'comment-goblin' => array(
'name' => 'Comment Goblin',
'description' => 'Advanced comment management and spam protection system.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://commentgoblin.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://commentgoblin.com/#pricing'
)
)
),
'complianz-gdpr' => array(
'name' => 'Complianz Privacy Suite',
'description' => 'Complete GDPR/CCPA compliance solution with advanced features.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://complianz.io/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://complianz.io/pricing/'
)
),
'free_slug' => 'complianz-gdpr'
),
'disable-bloat' => array(
'name' => 'Disable Bloat PRO',
'description' => 'Advanced optimization for WordPress & WooCommerce with premium features.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://disablebloat.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://disablebloat.com/#pricing'
)
)
),
'fluent-crm' => array(
'name' => 'FluentCRM Pro',
'description' => 'Advanced CRM and email marketing automation.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://fluentcrm.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://fluentcrm.com/pricing/'
),
array(
'text' => 'Automation Pack',
'url' => 'https://fluentcrm.com/modules/automation-pack/'
)
),
'free_slug' => 'fluent-crm'
),
'fluent-forms' => array(
'name' => 'Fluent Forms Pro',
'description' => 'Advanced form builder with premium features.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://fluentforms.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://fluentforms.com/pricing/'
),
array(
'text' => 'PDF Add-on',
'url' => 'https://fluentforms.com/modules/pdf-add-on/'
)
),
'free_slug' => 'fluentform'
),
'mainwp' => array(
'name' => 'MainWP Pro',
'description' => 'Manage multiple WordPress sites from a single dashboard with advanced features.',
'button_group' => array(
array(
'text' => 'Go Pro',
'url' => 'https://mainwp.com/upgrade/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://mainwp.com/purchase/'
)
),
'free_slug' => 'mainwp-child'
),
'revive-so' => array(
'name' => 'Revive.so Pro',
'description' => 'Advanced content optimization and SEO tool for WordPress.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://revive.so/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://revive.so/pricing/'
)
),
'free_slug' => 'revive-so'
),
'fluent-support' => array(
'name' => 'Fluent Support Pro',
'description' => 'Premium help desk and support ticket system.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://fluentsupport.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://fluentsupport.com/pricing/'
)
),
'free_slug' => 'fluent-support'
),
'fluentbooking' => array(
'name' => 'FluentBooking Pro',
'description' => 'Advanced booking and scheduling system.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://fluentbooking.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://fluentbooking.com/pricing/'
)
),
'free_slug' => 'fluent-booking'
),
'freesoul-deactivate-plugins' => array(
'name' => 'Freesoul Deactivate Plugins PRO',
'description' => 'Advanced plugin management with conditional loading and optimization.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://freesoul-deactivate-plugins.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://freesoul-deactivate-plugins.com/pro/'
)
),
'free_slug' => 'freesoul-deactivate-plugins'
),
'kadence-blocks' => array(
'name' => 'Kadence Blocks Pro',
'description' => 'Premium blocks and templates for the WordPress editor.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://www.kadencewp.com/kadence-blocks/pro/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://www.kadencewp.com/pricing/'
),
array(
'text' => 'Theme Pro',
'url' => 'https://www.kadencewp.com/kadence-theme/pro/'
)
),
'free_slug' => 'kadence-blocks'
),
'link-whisper' => array(
'name' => 'Link Whisper',
'description' => 'AI-powered internal linking suggestions and management.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://linkwhisper.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://linkwhisper.com/pricing/'
)
)
),
'media-file-renamer' => array(
'name' => 'Media File Renamer Pro',
'description' => 'AI-Powered media file renaming for better SEO.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://meowapps.com/plugin/media-file-renamer/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://meowapps.com/media-file-renamer-pricing/'
)
),
'free_slug' => 'media-file-renamer'
),
'ninja-tables' => array(
'name' => 'Ninja Tables Pro',
'description' => 'Advanced table creation and management with premium features.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://wpmanageninja.com/ninja-tables/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://wpmanageninja.com/downloads/ninja-tables-pro-add-on/'
)
),
'free_slug' => 'ninja-tables'
),
'seo-by-rank-math' => array(
'name' => 'Rank Math SEO PRO',
'description' => 'Advanced SEO tools and features for better search engine optimization.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://rankmath.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://rankmath.com/pricing/'
)
),
'free_slug' => 'seo-by-rank-math'
),
'really-simple-ssl' => array(
'name' => 'Really Simple SSL Pro',
'description' => 'Advanced SSL management and security features.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://really-simple-ssl.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://really-simple-ssl.com/pro/'
)
),
'free_slug' => 'really-simple-ssl'
),
'scalability-pro' => array(
'name' => 'Scalability Pro',
'description' => 'Advanced performance optimization and scaling tools.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://scalability.pro/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://scalability.pro/#pricing'
)
)
),
'social-engine' => array(
'name' => 'Social Engine Pro',
'description' => 'Advanced social media scheduling and management.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://meowapps.com/plugin/social-engine/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://meowapps.com/social-engine-pricing/'
)
),
'free_slug' => 'social-engine'
),
'taxopress' => array(
'name' => 'TaxoPress Pro',
'description' => 'Advanced taxonomy and tag management tools.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://taxopress.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://taxopress.com/pro/'
)
)
),
'tutor' => array(
'name' => 'Tutor LMS Pro',
'description' => 'Premium LMS features including certificate builder.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://www.themeum.com/product/tutor-lms/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://www.themeum.com/product/tutor-lms/#pricing'
),
array(
'text' => 'Certificate Builder',
'url' => 'https://www.themeum.com/product/tutor-lms-certificate-builder/'
),
array(
'text' => 'Course Preview',
'url' => 'https://www.themeum.com/product/tutor-lms-course-preview/'
)
),
'free_slug' => 'tutor'
),
'wp-migrate' => array(
'name' => 'WP Migrate',
'description' => 'Professional WordPress migration and backup solution.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://deliciousbrains.com/wp-migrate-db-pro/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://deliciousbrains.com/wp-migrate-db-pro/pricing/'
)
)
),
'wp-social-ninja' => array(
'name' => 'WP Social Ninja Pro',
'description' => 'Advanced social media integration and management tools.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://wpsocialninja.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://wpsocialninja.com/price/'
)
),
'free_slug' => 'wp-social-ninja'
),
'yellow-pencil' => array(
'name' => 'YellowPencil Pro',
'description' => 'Advanced visual CSS style editor and customization tool.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://yellowpencil.waspthemes.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://yellowpencil.waspthemes.com/pricing/'
)
),
'free_slug' => 'yellow-pencil-visual-theme-customizer'
),
'fluent-boards' => array(
'name' => 'FluentBoards Pro',
'description' => 'Advanced dashboard and reporting solution for WordPress.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://fluentboards.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://fluentboards.com/pricing/'
)
),
'free_slug' => 'fluent-boards'
),
'fluent-community' => array(
'name' => 'FluentCommunity Pro',
'description' => 'Advanced community and membership platform for WordPress.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://fluentcommunity.co/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://fluentcommunity.co/pricing/'
)
),
'free_slug' => 'fluent-community'
),
'wp-sheet-editor' => array(
'name' => 'WP Sheet Editor',
'description' => 'Edit WordPress content in spreadsheet-like interface with bulk editing capabilities.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://wpsheeteditor.com/',
'primary' => true
)
),
'free_slug' => 'wp-sheet-editor-bulk-spreadsheet-editor-for-posts-and-pages'
),
'masterstudy-lms' => array(
'name' => 'MasterStudy LMS Pro',
'description' => 'Complete learning management system for WordPress with courses, lessons, quizzes, and more.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://stylemixthemes.com/wordpress-lms-plugin/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://stylemixthemes.com/wordpress-lms-plugin/pricing/'
)
),
'free_slug' => 'masterstudy-lms-learning-management-system'
),
'pretty-link' => array(
'name' => 'Pretty Links Pro',
'description' => 'Advanced link management, tracking, and marketing tools for WordPress.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://prettylinks.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://prettylinks.com/pricing/plans/'
)
),
'free_slug' => 'pretty-link'
),
'kadence-starter-templates' => array(
'name' => 'AI Powered Starter Templates by Kadence WP',
'description' => 'Premium AI-powered starter templates for WordPress with advanced customization options.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://www.kadencewp.com/',
'primary' => true
)
),
'free_slug' => 'kadence-starter-templates'
),
'bit-social' => array(
'name' => 'Bit Social Pro',
'description' => 'Premium social networking features for WordPress with advanced community building tools.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://bit-social.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://bit-social.com/#pricing'
)
),
'free_slug' => 'bit-social'
),
'easy-video-reviews' => array(
'name' => 'Easy Video Reviews Pro',
'description' => 'Premium video review collection and display features for WordPress.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://wppool.dev/easy-video-reviews/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://wppool.dev/easy-video-reviews-pricing/'
)
),
'free_slug' => 'easy-video-reviews'
),
'flying-press' => array(
'name' => 'Flying Press',
'description' => 'Advanced WordPress performance optimization and speed enhancement suite.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://flyingpress.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://flyingpress.com/pricing/'
)
),
'free_slug' => ['flying-analytics', 'flying-pages', 'flying-scripts']
),
'translatepress' => array(
'name' => 'TranslatePress Pro',
'description' => 'Advanced WordPress translation plugin with premium features for multilingual websites.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://translatepress.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://translatepress.com/pricing/'
)
),
'free_slug' => 'translatepress-multilingual'
),
'hreflang-manager' => array(
'name' => 'Hreflang Manager Pro',
'description' => 'Advanced hreflang tag management for multilingual and multi-regional WordPress websites.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://daext.com/hreflang-manager/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://daext.com/hreflang-manager/#pricing'
)
),
'free_slug' => 'hreflang-manager-lite'
),
'automatorwp' => array(
'name' => 'AutomatorWP Pro',
'description' => 'Advanced WordPress automation toolkit with premium integrations and features.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://automatorwp.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://automatorwp.com/'
),
array(
'text' => 'Integrations',
'url' => 'https://automatorwp.com/all-triggers-and-actions/'
)
),
'free_slug' => 'automatorwp'
),
'bit-integrations' => array(
'name' => 'Bit Integrations Pro',
'description' => 'Advanced WordPress integration platform with premium connectors and automation features.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://bit-integrations.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://bit-integrations.com/#pricing'
),
array(
'text' => 'Integrations',
'url' => 'https://bit-integrations.com/all-integrations/'
)
),
'free_slug' => 'bit-integrations'
),
'bit-flows' => array(
'name' => 'Bit Flows Pro',
'description' => 'Advanced workflow automation platform for WordPress with premium features and integrations.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://bit-flows.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://bit-flows.com/pricing/'
),
array(
'text' => 'Integrations',
'url' => 'https://bit-flows.com/integrations-list/'
)
),
'free_slug' => 'bit-pi'
),
'yellow-pencil' => array(
'name' => 'Yellow Pencil Pro',
'description' => 'Advanced visual CSS style editor for WordPress with premium features.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://yellowpencil.waspthemes.com/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://codecanyon.net/item/yellow-pencil-visual-css-style-editor/11322180'
)
),
'free_slug' => 'yellow-pencil-visual-theme-customizer'
),
'gotmls' => array(
'name' => 'Anti-Malware Pro',
'description' => 'Advanced WordPress malware scanner and security toolkit with premium features.',
'button_group' => array(
array(
'text' => 'Home Page',
'url' => 'https://gotmls.net/',
'primary' => true
),
array(
'text' => 'Pricing',
'url' => 'https://gotmls.net/donate/'
)
),
'free_slug' => 'gotmls'
)
);
}

View File

@ -11,7 +11,7 @@
// Include data configuration files // Include data configuration files
require_once dirname(__FILE__) . '/data/tools.php'; require_once dirname(__FILE__) . '/data/tools.php';
require_once dirname(__FILE__) . '/data/hosting-providers.php'; require_once dirname(__FILE__) . '/data/hosting-providers.php';
require_once dirname(__FILE__) . '/data/recommended-plugins.php'; require_once dirname(__FILE__) . '/data/free-plugins.php';
// Include manager classes - each handles a specific plugin functionality area // Include manager classes - each handles a specific plugin functionality area
require_once dirname(__FILE__) . '/includes/class-plugin-manager.php'; require_once dirname(__FILE__) . '/includes/class-plugin-manager.php';
@ -20,7 +20,7 @@ require_once dirname(__FILE__) . '/includes/class-settings-manager.php';
require_once dirname(__FILE__) . '/includes/class-tools-manager.php'; require_once dirname(__FILE__) . '/includes/class-tools-manager.php';
require_once dirname(__FILE__) . '/includes/class-theme-manager.php'; require_once dirname(__FILE__) . '/includes/class-theme-manager.php';
require_once dirname(__FILE__) . '/includes/class-hosting-manager.php'; require_once dirname(__FILE__) . '/includes/class-hosting-manager.php';
require_once dirname(__FILE__) . '/includes/class-recommended-plugins-manager.php'; require_once dirname(__FILE__) . '/includes/class-free-plugins-manager.php';
require_once dirname(__FILE__) . '/includes/class-admin-manager.php'; require_once dirname(__FILE__) . '/includes/class-admin-manager.php';
/** /**
@ -35,5 +35,5 @@ WP_Allstars_Settings_Manager::init();
WP_Allstars_Tools_Manager::init(); WP_Allstars_Tools_Manager::init();
WP_Allstars_Theme_Manager::init(); WP_Allstars_Theme_Manager::init();
WP_Allstars_Hosting_Manager::init(); WP_Allstars_Hosting_Manager::init();
WP_Allstars_Recommended_Plugins_Manager::init(); WP_Allstars_Free_Plugins_Manager::init();
WP_Allstars_Admin_Manager::init(); WP_Allstars_Admin_Manager::init();

View File

@ -2,15 +2,20 @@
/** /**
* Auto Upload Images functionality * Auto Upload Images functionality
* *
* @package WP_Allstars * @package WP_ALLSTARS
* @since 0.2.0
*/ */
if (!defined('ABSPATH')) {
exit;
}
class WP_Allstars_Auto_Upload { class WP_Allstars_Auto_Upload {
/** /**
* Initialize the class * Initialize the class
*/ */
public function __construct() { public function __construct() {
add_filter('content_save_pre', array($this, 'process_content'), 10, 1); add_filter('content_save_pre', array($this, 'process_content'));
add_action('wp_allstars_image_upload_error', array($this, 'log_error'), 10, 2); add_action('wp_allstars_image_upload_error', array($this, 'log_error'), 10, 2);
} }
@ -57,7 +62,8 @@ class WP_Allstars_Auto_Upload {
return str_replace($url, $local_url, $matches[0]); return str_replace($url, $local_url, $matches[0]);
} }
} catch (Exception $e) { } catch (Exception $e) {
do_action('wp_allstars_image_upload_error', $url, $e->getMessage()); // Trigger error action for logging
do_action('wp_allstars_image_upload_error', esc_url($url), $e->getMessage());
} }
return $matches[0]; return $matches[0];
@ -80,11 +86,12 @@ class WP_Allstars_Auto_Upload {
* *
* @param string $url External image URL * @param string $url External image URL
* @return string|false Local URL on success, false on failure * @return string|false Local URL on success, false on failure
* @throws Exception If download or upload fails
*/ */
private function upload_image($url) { private function upload_image($url) {
// Get file info $file_array = array(
$file_array = array(); 'name' => sanitize_file_name(basename($url))
$file_array['name'] = basename($url); );
// Download file to temp location // Download file to temp location
$file_array['tmp_name'] = download_url($url); $file_array['tmp_name'] = download_url($url);
@ -93,17 +100,18 @@ class WP_Allstars_Auto_Upload {
throw new Exception('Failed to download image: ' . $file_array['tmp_name']->get_error_message()); throw new Exception('Failed to download image: ' . $file_array['tmp_name']->get_error_message());
} }
// Check file type // Check file type for security
$wp_filetype = wp_check_filetype_and_ext($file_array['tmp_name'], $file_array['name']); $wp_filetype = wp_check_filetype_and_ext($file_array['tmp_name'], $file_array['name']);
if (!$wp_filetype['type']) { if (!$wp_filetype['type']) {
unlink($file_array['tmp_name']); unlink($file_array['tmp_name']);
throw new Exception('Invalid file type'); throw new Exception('Invalid file type');
} }
// Upload the file // Upload the file to media library
$attachment_id = media_handle_sideload($file_array, 0); $attachment_id = media_handle_sideload($file_array, 0);
if (is_wp_error($attachment_id)) { if (is_wp_error($attachment_id)) {
unlink($file_array['tmp_name']);
throw new Exception('Failed to upload image: ' . $attachment_id->get_error_message()); throw new Exception('Failed to upload image: ' . $attachment_id->get_error_message());
} }
@ -117,10 +125,12 @@ class WP_Allstars_Auto_Upload {
* @param string $error Error message * @param string $error Error message
*/ */
public function log_error($url, $error) { public function log_error($url, $error) {
error_log(sprintf( if (WP_DEBUG) {
'[WP ALLSTARS] Auto Upload Images Error - URL: %s, Error: %s', error_log(sprintf(
$url, '[WP ALLSTARS] Auto Upload Images Error - URL: %s, Error: %s',
$error esc_url_raw($url),
)); sanitize_text_field($error)
));
}
} }
} }

View File

@ -22,14 +22,11 @@
* Requires PHP: 7.2 * Requires PHP: 7.2
*/ */
// If this file is called directly, abort.
if (!defined('WPINC')) { if (!defined('WPINC')) {
die; exit;
} }
/** // Define plugin version from the file header
* Define plugin version from the file header
*/
if (!function_exists('get_plugin_data')) { if (!function_exists('get_plugin_data')) {
require_once(ABSPATH . 'wp-admin/includes/plugin.php'); require_once(ABSPATH . 'wp-admin/includes/plugin.php');
} }
@ -39,14 +36,9 @@ define('WP_ALLSTARS_VERSION', $plugin_data['Version']);
/** /**
* Plugin activation hook * Plugin activation hook
*
* Called when the plugin is activated.
* Initialize plugin settings and defaults here.
*/ */
function wp_allstars_activate() { function wp_allstars_activate() {
// Create initial plugin settings // Setup initial configuration when needed
// Register cron jobs if needed
// Initialize defaults
} }
register_activation_hook(__FILE__, 'wp_allstars_activate'); register_activation_hook(__FILE__, 'wp_allstars_activate');
@ -55,60 +47,41 @@ register_activation_hook(__FILE__, 'wp_allstars_activate');
*/ */
require_once plugin_dir_path(__FILE__) . 'includes/class-wp-allstars-auto-upload.php'; require_once plugin_dir_path(__FILE__) . 'includes/class-wp-allstars-auto-upload.php';
/** // Load admin-specific components
* Load admin-specific components
*/
if (is_admin()) { if (is_admin()) {
require_once plugin_dir_path(__FILE__) . 'admin/pro-plugins-config.php'; // Include manager classes
require_once plugin_dir_path(__FILE__) . 'admin/includes/class-admin-manager.php';
require_once plugin_dir_path(__FILE__) . 'admin/includes/class-settings-manager.php';
require_once plugin_dir_path(__FILE__) . 'admin/includes/class-theme-manager.php';
require_once plugin_dir_path(__FILE__) . 'admin/includes/class-workflow-manager.php';
require_once plugin_dir_path(__FILE__) . 'admin/includes/class-tools-manager.php';
require_once plugin_dir_path(__FILE__) . 'admin/includes/class-hosting-manager.php';
require_once plugin_dir_path(__FILE__) . 'admin/includes/class-pro-plugins-manager.php';
require_once plugin_dir_path(__FILE__) . 'admin/includes/class-plugin-manager.php';
require_once plugin_dir_path(__FILE__) . 'admin/includes/class-free-plugins-manager.php';
// Initialize the admin manager
add_action('plugins_loaded', array('WP_Allstars_Admin_Manager', 'init'));
// Legacy files (for backward compatibility)
require_once plugin_dir_path(__FILE__) . 'admin/data/pro-plugins.php';
require_once plugin_dir_path(__FILE__) . 'admin/settings.php'; require_once plugin_dir_path(__FILE__) . 'admin/settings.php';
} }
/** /**
* Enqueue admin assets * Auto Upload feature initialization
* *
* Loads the CSS and JavaScript files for the admin interface. * Initialize the Auto Upload feature when a user is logged in
* Localizes the JavaScript with necessary data for AJAX operations.
*/ */
function wp_allstars_admin_assets() { function wp_allstars_init_auto_upload() {
// Only load assets on plugin pages to avoid conflicts // Only initialize for logged-in users
$screen = get_current_screen(); if (is_user_logged_in()) {
if (!isset($screen->id) || strpos($screen->id, 'wp-allstars') === false) { new WP_Allstars_Auto_Upload();
return;
} }
// Enqueue CSS
wp_enqueue_style(
'wp-allstars-admin',
plugins_url('admin/css/wp-allstars-admin.css', __FILE__),
[],
WP_ALLSTARS_VERSION
);
// Enqueue WordPress updates script for theme/plugin installation
wp_enqueue_script('updates');
// Enqueue main admin script
wp_enqueue_script(
'wp-allstars-admin',
plugins_url('admin/js/wp-allstars-admin.js', __FILE__),
['jquery', 'updates'],
WP_ALLSTARS_VERSION,
true
);
// Localize script with AJAX and security data
$ajax_data = [
'ajaxurl' => admin_url('admin-ajax.php'),
'adminUrl' => admin_url(),
'nonce' => wp_create_nonce('wp-allstars-nonce'),
'updateNonce' => wp_create_nonce('updates')
];
wp_localize_script('wp-allstars-admin', 'wpAllstars', $ajax_data);
} }
add_action('admin_enqueue_scripts', 'wp_allstars_admin_assets'); add_action('init', 'wp_allstars_init_auto_upload');
/** /**
* Initialize core plugin classes * Initialize core plugin classes