This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| declare(strict_types=1); | |
| /** | |
| * Plugin Name: MU Plugin Loader | |
| * Plugin URI: https://orbital.co.uk | |
| * Description: Safely loads essential plugins as must-use plugins with proper error handling and logging. | |
| * Author: Adam Cullen | |
| * Version: 2.0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define( 'WP_DEBUG', true ); | |
| if ( WP_DEBUG ) { | |
| define( 'WP_DEBUG_LOG', true ); | |
| define( 'WP_DEBUG_DISPLAY', false ); | |
| define( 'SCRIPT_DEBUG', true ); | |
| define( 'SAVEQUERIES', true ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (!function_exists('write_log')) { | |
| /** | |
| * Write to Debug Log with Optional Context | |
| * | |
| * Logs the provided variable to the PHP error log, always prefixed with the file and line number. | |
| * Optionally includes function, class, and call type context if $show_context is true. | |
| * | |
| * @param mixed $log The content to log (string, array, object, etc). | |
| * @param bool $show_context Whether to include function, class, and type context. Default false. | |
| * @return void |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| $original = '+44 (0)1234 567 890'; | |
| $original = '0044 01234 567 890'; | |
| $original = '01234 567 890'; | |
| $original = '44 1234 567 890'; | |
| Result should always be: +441234567890 | |
| */ | |
| // Strip out all characters apart from numbers |