Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 20480 bytes)

Add the following at the top of wp-config.php: ini_set(‘memory_limit’,’128M’); Although you should use WP_MEMORY_LIMIT when you can, we see in /wp-includes/default-constants.php that WordPress doesn’t do much more than use ini_set itself. Note: This is just one more thing to try, but you’ll likely end up having to have your host fix this issue.

Catch own Exceptions

Your exception isn’t caught by the try{} catch(){} block, because it isn’t thrown inside the try catch block. This demonstrates a lack of understanding of asynchronous events and the WordPress hook/action/event system. The methods of your object are attached to the init action hook, and are thrown when the init hook is fired, not when … Read more

How to disable automated E-Mail on PHP error/exception?

There was some discussion on it a few weeks ago you can find here: https://make.wordpress.org/core/2019/04/16/fatal-error-recovery-mode-in-5-2/ According to that and looking through the core, you can accomplish that with one of two methods: define(‘RECOVERY_MODE_EMAIL’, ‘[email protected]’); OR add_filter( ‘recovery_mode_email’, ‘recovery_email_update’, 10, 2 ); function recovery_email_update( $email, $url ) { $email[‘to’] = ‘[email protected]’; return $email; } Hope that … Read more

wordpress plugin error handling

WordPress have WP_Error class for checking WordPress errors and error messages since version 2.1.0. WordPress use object of WP_Error class for reporting error from several WP function. However, we can use this object in plugin or theme to handle error within WordPress. This class containing verious useful method for managing error. All methods <?php //Creating … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)