How to add custom menu item on plugin activation?

Plugins are activated in a sandbox and their output is captured to check for errors, and redirect if activation was successful. Adding something in an activation hook will cause it to run once in that “invisible” sandbox on activation, and that’s it.

When you add an action, you’re only adding it for that request, if you want your menu item to be visible on every admin page load, the add_action should be moved to the __construct function.

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