Why is my activator class adding the files/running the actions I add?

You code is almost certainly loading those files and adding the notice, but you’ve misunderstood how PHP works so they’re not happening when you expect them to happen.

You need to keep two things in mind with PHP:

  1. Admin notices and require_once are not persistent across multiple requests. If you want to load a file or display a notice you need to run that code for every request for which you want the notice to appear or the files to be loaded.
  2. Your plugin code will run for every page request in the browser, but the activation hook will only run once: when the plugin is activated.

So keep those in mind when you consider the sequence of activating a plugin through the UI:

  1. You visit wp-admin/plugins.php and click Activate on a plugin.
  2. You are taken to /wp-admin/plugins.php?action=activate&plugin=plugin-name.php, where the plugin is activated.
  3. You are redirected back to to /wp-admin/plugins.php?activate=true.

Your activate() method is only going to run for step 2. This means that the framework you’re trying to load is only going to load during step 2, and your notice is only going to be during step 2.

So you need to do 2 things:

  1. Run load_files() on every request. In the WP Plugin Boilerplate there is already a load_dependencies() method of the Plugin_Name class that seems to be intended for loading files.
  2. Run your add_action() for admin_notices on every request. In the boilerplate the define_admin_hooks() method of the Plugin_Name class seems the appropriate place for this. In your admin_notices method you will need to implement logic to hide the notice if it’s been dismissed.