A powerful WordPress plugin for persistent text translation and database replacement, specifically designed for Woodmart/WooCommerce themes and plugins.
- Persistent i18n Translations: Create custom .mo files without runtime filters
- Database Text Replacement: Safely replace text in database content with backup/restore
- MU Plugin Integration: Automatic loading of custom translation files
- RTL Support: Full right-to-left language support
- Modern Admin Interface: 5-tab admin panel with React-like components
- REST API: Complete API for external integrations
- Security: Nonce verification and capability checks
- Upload the plugin to
/wp-content/plugins/textmorpher/ - Activate the plugin through the 'Plugins' menu in WordPress
- Navigate to 'TextMorpher' in the admin menu
- Add Translation Overrides: Go to the "Custom Dictionary" tab
- Build Translation Files: Use the "Build & Load" tab to generate .mo files
- Database Replacement: Use the "Database Replacement" tab for safe text changes
textmorpher/
├── textmorpher.php # Main plugin file
├── includes/ # Core classes
│ ├── Plugin.php # Main plugin class
│ ├── Database.php # Database operations
│ ├── Builder.php # .po/.mo file generation
│ ├── DatabaseReplacer.php # Database text replacement
│ └── REST/ # REST API
│ └── RESTController.php # API endpoints
├── admin/ # Admin interface
│ └── Admin.php # Admin class
├── assets/ # Frontend assets
│ ├── css/admin.css # Admin styles
│ └── js/admin.js # Admin JavaScript
├── mu-plugins/ # Must-use plugins
│ └── textmorpher-l10n-loader.php # Translation loader
├── languages/ # Plugin translations
├── composer.json # Dependencies
└── README.md # This file
- Sample translation locale:
fa_IR(Persian example; plugin UI is English by default) - Required Capability:
manage_options - Auto-build: Disabled by default
- Backup Retention: 30 days
The plugin automatically creates:
- Custom languages directory:
wp-content/languages/custom/ - MU plugin:
wp-content/mu-plugins/textmorpher-l10n-loader.php - Database tables with prefix
Base URL: /wp-json/textmorpher/v1/
GET /overrides- List overrides with filtersPOST /overrides- Create new overridePUT /overrides/{id}- Update overrideDELETE /overrides/{id}- Delete overridePATCH /overrides/{id}/status- Update status
POST /build- Build translation filesPOST /mu-plugin/install- Install MU plugin
POST /db-replace/dry-run- Preview changesPOST /db-replace/apply- Apply changesPOST /db-replace/restore- Restore from backup
GET /jobs- List operation logsGET /jobs/{id}- Get job details
All endpoints require:
- WordPress authentication
manage_optionscapability- Valid nonce
id- Primary keydomain- Text domainlocale- Language localecontext- Translation contextoriginal_text- Original textreplacement- Replacement textstatus- Active/inactiveoriginal_hash- MD5 hash for uniquenessupdated_at- Last update timestampupdated_by- User ID
id- Primary keytype- Job type (build/replace/restore)payload- JSON job datastats- JSON statisticscreated_at- Creation timestampcreated_by- User ID
id- Primary keyjob_id- Reference to jobtable_name- Database tablerecord_id- Record IDoriginal_data- JSON backup datacreated_at- Creation timestamp
- Nonce Verification: All forms and AJAX requests
- Capability Checks:
manage_optionsrequired - Input Sanitization: All user inputs sanitized
- SQL Prepared Statements: Database queries protected
- File Access Control: .htaccess protection for custom languages
- Persian (fa_IR) - Default
- English (en_US)
- Any WordPress locale
- Full right-to-left language support
- Responsive design for mobile devices
- CSS classes for RTL layout
- No Runtime Filters: Uses file-based translations for maximum performance
- Efficient Database Queries: Indexed tables for fast searches
- Minimal Memory Usage: Only loads necessary components
- WordPress: 5.0+
- PHP: 7.4+
- MySQL: 5.6+
- Themes: Compatible with all themes
- Plugins: No conflicts with other plugins
- Requires write access to
wp-content/directory - MU plugins directory must be writable
- Some shared hosting environments may have restrictions
- PHP 7.4+
- Composer
- WordPress development environment
# Clone repository
git clone https://github.com/your-username/textmorpher.git
# Install dependencies
composer install
# Run tests
composer test
# Code style check
composer phpcs# Run PHPUnit tests
composer test
# Run with coverage
composer test -- --coverage-html coverage/- Initial release
- Core translation override functionality
- Database replacement tools
- MU plugin integration
- REST API endpoints
- Admin interface
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This plugin is licensed under the GPL v2 or later.
- Documentation: Plugin Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- WordPress community for the excellent platform
- Contributors and testers
- Open source projects that inspired this work
Made with ❤️ for the WordPress community