Skip to content

Bug Fix: Don’t add roles on init


14 December 2020

17:01:37 GMT+0000

add_role can lead to database writes which, when called on init, can trigger on the frontend. That is not ideal as it can cause performance problems. It can also lead to undesirable circumstances with other roles being removed if there are intermittent database issues.

We still trigger our upgrade routine on admin_init so new installs still get the VIP Support roles added correctly.

https://github.com/Automattic/vip-go-mu-plugins/pull/1912