Compare commits
3 Commits
v0.2.3-sta
...
v0.2.3.1-s
Author | SHA1 | Date | |
---|---|---|---|
d490604513 | |||
e57f22f277 | |||
bae13ca936 |
111
DEVELOPMENT.md
Normal file
111
DEVELOPMENT.md
Normal file
@ -0,0 +1,111 @@
|
||||
# WP Allstars Plugin Development Workflow
|
||||
|
||||
This document outlines the development workflow for the WP Allstars Plugin to ensure stable and reliable feature implementation.
|
||||
|
||||
## Development Principles
|
||||
|
||||
1. **Stability First**: The primary goal is maintaining a stable plugin that works reliably
|
||||
2. **Incremental Changes**: Implement changes in small, manageable increments
|
||||
3. **Complete Testing**: Every change must be thoroughly tested before integration
|
||||
4. **Documentation**: All features and changes must be well-documented
|
||||
|
||||
## Branch Structure
|
||||
|
||||
- `main` - Production-ready code, always stable
|
||||
- `v0.2.3-stable` - Our current stable development branch
|
||||
- `feature/v0.2.3-stable/{feature-name}` - Feature branches for new development
|
||||
|
||||
## Development Workflow
|
||||
|
||||
### 1. Feature Planning
|
||||
|
||||
1. Identify a feature from the ROADMAP.md file to implement
|
||||
2. Review any existing implementation in unstable versions
|
||||
3. Document the implementation plan in ROADMAP.md
|
||||
4. Create a new feature branch from the stable base
|
||||
|
||||
```bash
|
||||
git checkout v0.2.3-stable
|
||||
git checkout -b feature/v0.2.3-stable/sync-guard
|
||||
```
|
||||
|
||||
### 2. Feature Implementation
|
||||
|
||||
1. Start with the smallest possible functional change
|
||||
2. Commit frequently with descriptive commit messages including stability classification
|
||||
3. Example commit message format:
|
||||
```
|
||||
[EXPERIMENTAL] Add basic sync guard detection functionality
|
||||
|
||||
- Adds file existence check for .syncing flag
|
||||
- Implements conditional loading based on flag
|
||||
- Does not yet handle admin notices
|
||||
```
|
||||
|
||||
4. Reference the ROADMAP.md and TESTING.md documents while implementing
|
||||
|
||||
### 3. Testing
|
||||
|
||||
1. Complete all relevant tests from TESTING.md
|
||||
2. Add feature-specific tests if needed
|
||||
3. Test in a clean WordPress environment
|
||||
4. Test with WP_DEBUG enabled
|
||||
5. Document any issues found and fix them
|
||||
|
||||
### 4. Code Review
|
||||
|
||||
1. Self-review code for:
|
||||
- PHP best practices
|
||||
- WordPress coding standards
|
||||
- Security considerations
|
||||
- Performance implications
|
||||
- Error handling
|
||||
|
||||
2. Consider peer review if possible
|
||||
|
||||
### 5. Integration
|
||||
|
||||
1. Create a pull request to merge into the stable branch
|
||||
2. Summarize changes, testing performed, and any caveats
|
||||
3. Once approved, merge using `--no-ff` to preserve feature history
|
||||
|
||||
```bash
|
||||
git checkout v0.2.3-stable
|
||||
git merge --no-ff feature/v0.2.3-stable/sync-guard
|
||||
```
|
||||
|
||||
4. Tag new version if appropriate:
|
||||
|
||||
```bash
|
||||
git tag v0.2.3.1-stable
|
||||
git push origin v0.2.3.1-stable
|
||||
```
|
||||
|
||||
5. Update STABILITY.md with the new version information
|
||||
|
||||
### 6. Post-Integration
|
||||
|
||||
1. Deploy to test environment and confirm functionality
|
||||
2. Update ROADMAP.md to reflect the implemented feature
|
||||
3. Clean up feature branch if no longer needed
|
||||
|
||||
## Handling Unstable Code References
|
||||
|
||||
When examining code from unstable versions:
|
||||
|
||||
1. **Never copy-paste directly** - Understand the approach and reimplement
|
||||
2. **Isolate problematic code** - Identify why it might have failed
|
||||
3. **Take the best ideas** - Implement the concept, not the exact implementation
|
||||
4. **Document the reference** - Note which version inspired each implementation
|
||||
|
||||
## Versioning Scheme
|
||||
|
||||
- `vX.Y.Z` - Major.Minor.Patch
|
||||
- `vX.Y.Z-stable` - Stable development branches
|
||||
- `vX.Y.Z.N-stable` - Minor updates to stable branches
|
||||
|
||||
## Continuous Improvement
|
||||
|
||||
- Regularly review and update these development procedures
|
||||
- Document lessons learned
|
||||
- Improve testing procedures based on discoveries
|
51
ROADMAP.md
Normal file
51
ROADMAP.md
Normal file
@ -0,0 +1,51 @@
|
||||
# WP Allstars Plugin Development Roadmap
|
||||
|
||||
This document outlines features from later versions that we plan to integrate into our stable development branch. The goal is to incrementally implement these features in a stable manner, without introducing critical errors.
|
||||
|
||||
## Feature Backlog
|
||||
|
||||
| Feature | Source Version | Priority | Complexity | Risk | Status |
|
||||
|---------|----------------|----------|------------|------|--------|
|
||||
| Multisite Category | v0.2.6 | High | Low | Low | ✅ Implemented in v0.2.3-stable |
|
||||
| Sync Guard | v0.2.6-fix | High | Low | Low | 🔄 To be implemented |
|
||||
| More Robust File Loading | v0.2.6-fix | High | Low | Low | ✅ Implemented in v0.2.3-stable |
|
||||
| Enhanced Admin UI | v0.2.4+ | Medium | Medium | Medium | 🔄 To be implemented |
|
||||
| Plugin Dashboard | v0.2.6-fix | Medium | Medium | Medium | 🔄 To be implemented |
|
||||
| New Category Pages | v0.2.4+ | Medium | Low | Low | 🔄 To be implemented |
|
||||
|
||||
## Implementation Strategy
|
||||
|
||||
### Multisite Category with Network Plugin Auditor
|
||||
- **Description**: Add a "Multisite" filter after Advanced and include network-plugin-auditor
|
||||
- **Why it failed before**: Didn't properly update all required files for the feature
|
||||
- **Implementation plan**: Add to free-plugins.php and update class-free-plugins-manager.php to display the category correctly
|
||||
- **Testing criteria**: Verify category appears in UI and plugin can be installed
|
||||
|
||||
### Sync Guard
|
||||
- **Description**: Prevent plugin loading during rsync operations to avoid partial file loading
|
||||
- **Why it failed before**: Added to wrong location, dependent on missing files
|
||||
- **Implementation plan**:
|
||||
1. Create a simpler version of the sync guard
|
||||
2. Update post-commit hook to handle sync operations better
|
||||
3. Use file flag to signal when sync is in progress
|
||||
- **Testing criteria**: Verify plugin doesn't attempt to load during sync operations
|
||||
|
||||
### Enhanced Admin UI
|
||||
- **Description**: Improve the admin interface with better styling and more intuitive navigation
|
||||
- **Why it failed before**: Too many changes at once without proper testing
|
||||
- **Implementation plan**:
|
||||
1. Small, incremental UI improvements
|
||||
2. Focus on one component at a time
|
||||
3. Thorough testing after each change
|
||||
- **Testing criteria**: UI changes shouldn't affect functionality, should be responsive
|
||||
|
||||
## Development Order
|
||||
|
||||
The suggested implementation order is:
|
||||
|
||||
1. Sync Guard
|
||||
2. Enhanced Admin UI (component by component)
|
||||
3. Plugin Dashboard improvements
|
||||
4. New Category Pages
|
||||
|
||||
Each feature should be developed in its own branch and only merged after thorough testing.
|
32
STABILITY.md
Normal file
32
STABILITY.md
Normal file
@ -0,0 +1,32 @@
|
||||
# WP Allstars Plugin Stability Status
|
||||
|
||||
This document tracks the stability status of different versions of the WP Allstars Plugin.
|
||||
|
||||
## Stability Classification
|
||||
|
||||
- **[STABLE]**: Thoroughly tested, works as expected in production environments
|
||||
- **[FUNCTIONAL]**: Works but may have minor issues or incomplete features
|
||||
- **[EXPERIMENTAL]**: Contains new features that are not fully tested
|
||||
- **[UNSTABLE]**: Known to have critical issues that affect functionality
|
||||
|
||||
## Version Status
|
||||
|
||||
| Version | Status | Notes |
|
||||
|---------|--------|-------|
|
||||
| v0.2.3-stable-base | **[STABLE]** | Base stable version with robust file loading. All core functionality works properly. |
|
||||
| v0.2.4 | **[UNSTABLE]** | Contains critical errors - reference only for feature ideas. |
|
||||
| v0.2.6 | **[UNSTABLE]** | Contains file structure issues and critical errors - reference only for feature ideas. |
|
||||
| v0.2.6-fix | **[UNSTABLE]** | Attempted fixes but still has issues - reference only. |
|
||||
| v0.2.6-revert | **[UNSTABLE]** | Failed attempt to revert to stable version - do not use. |
|
||||
|
||||
## Current Development
|
||||
|
||||
Current development is based on the v0.2.3-stable-base version. Features from later versions are being analyzed and reimplemented in a stable manner.
|
||||
|
||||
## Stability Guidelines
|
||||
|
||||
1. All new features must be developed in isolated feature branches
|
||||
2. Comprehensive testing is required before merging
|
||||
3. Each feature should be implemented as a series of small, atomic commits
|
||||
4. All commits should include a stability classification in commit messages: [STABLE], [FUNCTIONAL], etc.
|
||||
5. Full testing checklist must be completed before marking a version as [STABLE]
|
70
TESTING.md
Normal file
70
TESTING.md
Normal file
@ -0,0 +1,70 @@
|
||||
# WP Allstars Plugin Testing Procedures
|
||||
|
||||
This document outlines the testing procedures for the WP Allstars Plugin to ensure stability and reliability.
|
||||
|
||||
## Pre-Merge Testing Checklist
|
||||
|
||||
### Basic Functionality Tests
|
||||
|
||||
- [ ] Plugin activates without errors
|
||||
- [ ] Plugin deactivates without errors
|
||||
- [ ] Admin menu appears correctly
|
||||
- [ ] All submenu items load without errors
|
||||
- [ ] Settings can be saved without errors
|
||||
- [ ] Plugin works with WordPress debug mode enabled
|
||||
|
||||
### Feature-Specific Tests
|
||||
|
||||
Each new feature should have its own testing checklist added here.
|
||||
|
||||
#### Multisite Category Feature
|
||||
|
||||
- [ ] "Multisite" category appears in the correct location in the UI
|
||||
- [ ] Network Plugin Auditor appears in the Multisite category
|
||||
- [ ] Category filter works when clicked
|
||||
- [ ] Plugin can be installed from the category
|
||||
|
||||
#### Sync Guard Feature
|
||||
|
||||
- [ ] Plugin doesn't load when .syncing file is present
|
||||
- [ ] .syncing file is created during sync operations
|
||||
- [ ] .syncing file is removed after sync completes
|
||||
- [ ] User is notified when plugin is in sync mode
|
||||
|
||||
### Compatibility Tests
|
||||
|
||||
- [ ] Plugin works with latest WordPress version
|
||||
- [ ] Plugin works with PHP 7.4+
|
||||
- [ ] Plugin works with common themes (Twenty Twenty-Three, Kadence)
|
||||
- [ ] Plugin co-exists with other popular plugins without conflicts
|
||||
|
||||
### Browser Compatibility
|
||||
|
||||
- [ ] UI works correctly in Chrome
|
||||
- [ ] UI works correctly in Firefox
|
||||
- [ ] UI works correctly in Safari
|
||||
- [ ] UI works correctly in Edge
|
||||
|
||||
### Mobile Responsiveness
|
||||
|
||||
- [ ] Admin interface is usable on mobile devices
|
||||
- [ ] No layout issues on small screens
|
||||
|
||||
## Testing Process
|
||||
|
||||
1. Create a clean WordPress installation for testing
|
||||
2. Install and activate the plugin
|
||||
3. Enable WordPress debug mode (WP_DEBUG = true)
|
||||
4. Complete all tests in the checklist
|
||||
5. Document any issues found
|
||||
6. Fix issues and retest
|
||||
7. Only mark as [STABLE] when all tests pass
|
||||
|
||||
## Continuous Integration
|
||||
|
||||
For future implementation:
|
||||
|
||||
- [ ] Automated unit tests
|
||||
- [ ] Integration tests
|
||||
- [ ] End-to-end tests
|
||||
- [ ] Code quality checks
|
60
includes/class-wp-allstars-sync-guard.php
Normal file
60
includes/class-wp-allstars-sync-guard.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* WP ALLSTARS Sync Guard
|
||||
*
|
||||
* Prevents plugin loading during sync operations to avoid fatal errors.
|
||||
*
|
||||
* @package WP_ALLSTARS
|
||||
* @since 0.2.3.1
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class responsible for detecting sync operations and preventing plugin loading
|
||||
*/
|
||||
class WP_Allstars_Sync_Guard {
|
||||
|
||||
/**
|
||||
* Flag file name for sync operations
|
||||
*/
|
||||
const SYNC_FLAG_FILE = '.syncing';
|
||||
|
||||
/**
|
||||
* Check if sync is in progress
|
||||
*
|
||||
* @return bool Whether sync is in progress
|
||||
*/
|
||||
public static function is_sync_in_progress() {
|
||||
$flag_file = plugin_dir_path(dirname(__FILE__)) . self::SYNC_FLAG_FILE;
|
||||
return file_exists($flag_file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle sync mode by showing admin notice and preventing plugin loading
|
||||
*
|
||||
* @return bool True if sync is in progress, false otherwise
|
||||
*/
|
||||
public static function handle_sync_mode() {
|
||||
if (self::is_sync_in_progress()) {
|
||||
// Add admin notice
|
||||
add_action('admin_notices', array(__CLASS__, 'display_sync_notice'));
|
||||
|
||||
// Return true to indicate plugin should not continue loading
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display sync in progress notice
|
||||
*/
|
||||
public static function display_sync_notice() {
|
||||
echo '<div class="notice notice-warning is-dismissible">';
|
||||
echo '<p><strong>WP Allstars:</strong> Plugin files are currently syncing. The plugin functionality is temporarily disabled to prevent errors. Please try again in a moment.</p>';
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
@ -6,33 +6,37 @@
|
||||
* site performance, improve workflow, and provide recommendations for plugins and hosting.
|
||||
*
|
||||
* @package WP_ALLSTARS
|
||||
* @version v0.2.3
|
||||
* @version v0.2.3.1
|
||||
*
|
||||
* Plugin Name: WP ALLSTARS Plugin
|
||||
* Plugin URI: https://www.wpallstars.com
|
||||
* Description: WP ALLSTARS Plugin for WordPress. Speed Matters.
|
||||
* Version: v0.2.3 (Beta)
|
||||
* Author: WP ALLSTARS
|
||||
* Author URI: https://www.wpallstars.com
|
||||
* License: GPL-2.0+
|
||||
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
||||
* Plugin Name: WP Allstars
|
||||
* Plugin URI: https://wpallstars.com
|
||||
* Description: A superstar stack of premium WordPress functionality, designed for SEO pros.
|
||||
* Author: Marcus Quinn
|
||||
* Author URI: https://wpallstars.com
|
||||
* Text Domain: wp-allstars
|
||||
* Domain Path: /languages
|
||||
* Requires at least: 5.0
|
||||
* Requires PHP: 7.2
|
||||
* @version v0.2.3.1
|
||||
*
|
||||
* WP Allstars is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* any later version.
|
||||
* Version: v0.2.3.1 (Beta)
|
||||
*
|
||||
* WP Allstars is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with WP Allstars. If not, see https://www.gnu.org/licenses/gpl-2.0.html.
|
||||
*/
|
||||
|
||||
if (!defined('WPINC')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Define plugin version from the file header
|
||||
if (!function_exists('get_plugin_data')) {
|
||||
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
||||
}
|
||||
|
||||
$plugin_data = get_plugin_data(__FILE__, false, false);
|
||||
define('WP_ALLSTARS_VERSION', $plugin_data['Version']);
|
||||
define('WP_ALLSTARS_VERSION', 'v0.2.3.1');
|
||||
|
||||
/**
|
||||
* Load files safely by checking if they exist first
|
||||
@ -45,20 +49,39 @@ function wp_allstars_require_if_exists($file) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for sync operations before loading the plugin
|
||||
*/
|
||||
// Simple sync detection - check for .syncing file
|
||||
if (file_exists(__DIR__ . '/.syncing')) {
|
||||
// Only load the minimal code needed for admin notice
|
||||
if (is_admin()) {
|
||||
add_action('admin_notices', function() {
|
||||
echo '<div class="notice notice-warning is-dismissible">';
|
||||
echo '<p><strong>WP Allstars:</strong> Plugin files are currently syncing. The plugin functionality is temporarily disabled to prevent errors. Please try again in a moment.</p>';
|
||||
echo '</div>';
|
||||
});
|
||||
}
|
||||
// Exit early to prevent loading other files
|
||||
return;
|
||||
}
|
||||
|
||||
// Load the sync guard for future use and more advanced sync detection
|
||||
wp_allstars_require_if_exists(plugin_dir_path(__FILE__) . 'includes/class-wp-allstars-sync-guard.php');
|
||||
|
||||
/**
|
||||
* Plugin activation hook
|
||||
*/
|
||||
function wp_allstars_activate() {
|
||||
// Setup initial configuration when needed
|
||||
// Setup initial config
|
||||
}
|
||||
register_activation_hook(__FILE__, 'wp_allstars_activate');
|
||||
|
||||
// Core includes
|
||||
wp_allstars_require_if_exists(plugin_dir_path(__FILE__) . 'includes/class-wp-allstars-auto-upload.php');
|
||||
|
||||
// Load admin-specific components
|
||||
// Admin includes
|
||||
if (is_admin()) {
|
||||
// Include manager classes
|
||||
$admin_includes = array(
|
||||
'admin/includes/class-admin-manager.php',
|
||||
'admin/includes/class-settings-manager.php',
|
||||
@ -76,14 +99,11 @@ if (is_admin()) {
|
||||
wp_allstars_require_if_exists(plugin_dir_path(__FILE__) . $file);
|
||||
}
|
||||
|
||||
// Initialize the admin manager
|
||||
add_action('plugins_loaded', array('WP_Allstars_Admin_Manager', 'init'));
|
||||
|
||||
// Data files
|
||||
// Settings and data
|
||||
wp_allstars_require_if_exists(plugin_dir_path(__FILE__) . 'admin/data/pro-plugins.php');
|
||||
wp_allstars_require_if_exists(plugin_dir_path(__FILE__) . 'admin/data/readme.php');
|
||||
|
||||
// Legacy files (for backward compatibility)
|
||||
// Admin settings
|
||||
wp_allstars_require_if_exists(plugin_dir_path(__FILE__) . 'admin/settings.php');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user