Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WordPress actions, filters and performance

I am creating a WordPress plugin, which I would like to make as customizable as possible for other developers by providing actions and filter hooks in several places.

Can having too many hooks adversely impact the end user web site performance?

like image 736
KodeFor.Me Avatar asked Nov 29 '25 23:11

KodeFor.Me


1 Answers

Having unused hooks (calls to do_action, apply_filters, etc), will not significantly decrease performance. Those are function calls with almost no overhead (other than the function call itself and checking for existence of a key in an array).

And providing action and filter hooks is the right thing to do in any code, used in Wordpress.

like image 166
Maxim Krizhanovsky Avatar answered Dec 01 '25 14:12

Maxim Krizhanovsky