register_activation_hook
requires the main plugin file as its first parameter, and __FILE__
is an easy way to get this.
But by moving this code into a sub-file you’ve changed the value of __FILE__
and it no longer matches your plugin main file ( includes/class-id-crm-contacts-user.php
is not the main file of your plugin with the plugin header that got activated ).
Instead, you must pass the value as a parameter. This will be difficult as you have chosen to both define, use, and create objects in the same file. Instead if you move the creation of the object back out of the file, you’ll be able to pass it the needed value via the constructor.