Thanks for your reply. As I can see my code, I can find some typos and issues.
This line should be
And I forgot to add the filter which is
add_action ('admin_init', 'plugin_activation_check');
Now coming to your question, my plugin is using a page-builder which is available only in the theme (Elegant Themes Divi & Extra). Now I need to use the Page builder else this will not work. Now the problem is, not all themes will have that page-builder, of course. So, I just want to get the plugin deactivated if those themes (Divi or Extra) are not found since without that my plugin features will be useless and also, the site may crash as it’s calling a theme function.
Anyway, I am just jumping to your solution and see if it helps. Give you an update once tried.
Thanks a lot