Dynamically Disable a Plugin

Is it possible to dynamically “disable” a plugin with a condition determined by some visitor attributes? Like the presence of a cookie? Of course without changing the plugin code! Recently I faced this problem: a rather weight plugin that integrates a chat (and more) in a WP site was make Read more…

The WordPress Plugin Activation Hook

WordPress fires and activation action when a plugin is activated. Or at least it should. To be notified of its activation, a plugin can register itself to that even, using the register_activation_hook() function. There are some background concept that must be clear before start to use that action. It is Read more…

How to disable the new WordPress block style CSS in 3 lines

If you don’t use the new WordPress blocks, you should avoid to load the block style CSS on your page to optimize the page load speed. Here the three lines you need:

Adding the action with priority 100, it will be executed after the style has been enqueued by Read more…

How to change the WordPress authentication cookie expiration in 3 lines

Never needed to change the standard (2 week) login cookie expiration time of WordPress? Here the 3 line of code you need.

You can add those line in the functions.php file of your theme. DAY_IN_SECONDS is a constant defined by WordPress and represents the number of seconds in a Read more…

How to change the WordPress mail sender in 3 lines

Shortly: I needed to change the “sender” of all emails from a blog so every delivery error would have been sent to a specific mailbox. Without installing plugins, the three lines of code needed are:

They can be added in the theme functions.php  file for example, even if I Read more…