A professional WordPress admin tool for searching, previewing, and replacing post meta values across posts with advanced features, backups, and live testing.
- Advanced Search: Search posts by post type, meta key, and value with case-sensitive and regex options
- Live Preview: Preview replacements before executing with diff highlighting
- Multiple Replace Modes: Plain text, regex, URL operations, prefix swap, and full text replacement
- Automatic Backups: Create backups before any replacement with versioning support
- Live Tester: Test replacement patterns in real-time with sample data
- Bulk Operations: Process multiple posts simultaneously with progress tracking
- Modern UI: Beautiful React-based interface with Tailwind CSS and shadcn/ui components
- Responsive Design: Works seamlessly on desktop and mobile devices
- Accessibility: Full keyboard navigation and screen reader support
- Performance: Optimized for large datasets with pagination and virtual scrolling
- Backend: PHP 7.4+, WordPress 6.2+, OOP architecture
- Frontend: React 18, TypeScript, Tailwind CSS, shadcn/ui
- Build Tools: Vite, Composer, Node.js
- Testing: PHPUnit, Vitest, React Testing Library
- Code Quality: PHPStan, PHP_CodeSniffer, ESLint, Prettier
- PHP: 7.4 or higher
- WordPress: 6.2 or higher
- Node.js: 16.0 or higher
- Composer: Latest version
- MySQL: 5.7 or higher
git clone https://github.com/your-username/wcf-data-replacer.git
cd wcf-data-replacercomposer installnpm install# Development build
npm run dev
# Production build
npm run build- Copy the plugin folder to your WordPress
wp-content/plugins/directory - Activate the plugin from the WordPress admin panel
- Navigate to "Data Replacer" in the admin menu
- Local WordPress development environment (e.g., Local by Flywheel, XAMPP)
- Node.js and npm
- Composer
- Git
# Install dependencies
composer install
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Run tests
npm test
composer test
# Code quality checks
npm run lint
composer phpcs
composer phpstan
# Fix code style issues
npm run lint:fix
composer phpcbfwcf-data-replacer/
βββ includes/ # PHP backend classes
β βββ Core/ # Core functionality
β βββ Search/ # Search engine
β βββ Replace/ # Replace engine
β βββ Backup/ # Backup management
β βββ Admin/ # Admin interface
β βββ REST/ # REST API endpoints
βββ src/ # React frontend
β βββ components/ # React components
β βββ hooks/ # Custom React hooks
β βββ stores/ # State management
β βββ services/ # API services
β βββ types/ # TypeScript types
β βββ styles/ # CSS and styling
βββ templates/ # PHP templates
βββ dist/ # Built assets
βββ tests/ # Test files
βββ languages/ # Internationalization
βββ composer.json # PHP dependencies
βββ package.json # Node.js dependencies
βββ vite.config.ts # Vite configuration
βββ tailwind.config.js # Tailwind CSS configuration
βββ README.md # This file
The plugin can be configured through the WordPress admin panel:
- Max Results Per Page: Limit results per page (default: 200)
- Max Bulk Rows: Maximum rows for bulk operations (default: 5000)
- Regex Timeout: Maximum time for regex operations (default: 5000ms)
- Backup Retention: Number of backups to keep per meta key (default: 10)
# Development
WP_DEBUG=true
WP_DEBUG_LOG=true
# Production
WP_DEBUG=false
WP_DEBUG_LOG=false- Select a post type from the dropdown
- Enter a meta key (with autosuggest support)
- Optionally add a value filter
- Choose search options (case-sensitive, regex)
- Click "Search" to find matching posts
- Preview Mode: Test replacements without making changes
- Live Tester: Experiment with patterns using sample data
- Execute Replacements: Apply changes with confirmation
- Bulk Operations: Process multiple posts simultaneously
- Automatic backups are created before any replacement
- Restore individual posts or bulk restore
- View backup history and compare versions
- Manual backup creation for important changes
# Run all tests
composer test
# Run with coverage
composer test:coverage
# Run specific test file
./vendor/bin/phpunit tests/Search/SearchEngineTest.php# Run all tests
npm test
# Run with UI
npm run test:ui
# Run with coverage
npm run test:coverage
# Run specific test file
npm test -- src/components/SearchFilters.test.tsx# PHP CodeSniffer
composer phpcs
# PHPStan static analysis
composer phpstan
# ESLint
npm run lint
# TypeScript type checking
npm run type-check# Build frontend assets
npm run build
# Install production dependencies only
composer install --no-dev --optimize-autoloader
# Verify plugin activation
wp plugin activate wcf-data-replacer- Run production build (
npm run build) - Remove development dependencies (
composer install --no-dev) - Verify all tests pass
- Check code quality standards
- Update version numbers
- Test in staging environment
- Deploy to production
- Monitor error logs
- Capability Checks: All operations require appropriate WordPress capabilities
- Nonce Verification: CSRF protection for all AJAX requests
- Input Sanitization: All user inputs are properly sanitized
- SQL Injection Protection: Prepared statements for all database queries
- XSS Prevention: Output escaping for all displayed data
The plugin supports multiple languages:
- Text domain:
wcf-data-replacer - Language files:
languages/directory - Translation-ready strings throughout the codebase
- RTL language support
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow WordPress coding standards for PHP
- Use TypeScript for all frontend code
- Write tests for new functionality
- Update documentation for API changes
- Ensure accessibility compliance
- Test on multiple devices and browsers
This project is licensed under the GPL v2 or later - see the LICENSE file for details.
- Documentation: Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@yourwebsite.com
- WordPress community for the excellent platform
- React team for the amazing frontend framework
- Tailwind CSS for the utility-first CSS framework
- shadcn/ui for the beautiful component library
- All contributors and users of this plugin
- Advanced filtering options
- Export/import functionality
- Scheduled replacements
- Email notifications
- Multi-site support
- API rate limiting
- Advanced backup options
- Performance monitoring
- Plugin ecosystem
- Advanced workflow automation
- Machine learning suggestions
- Enterprise features
Made with β€οΈ for the WordPress community