TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins). It allows your users to install, update and even automatically activate plugins in singular or bulk fashion using native WordPress classes, functions and interfaces. You can reference bundled plugins, plugins from the WordPress Plugin Repository or even plugins hosted elsewhere on the internet.
I started using a theme called Strata, which included a plugin called LayerSlider, which included TGM-Plugin-Activation version 2.4.1, which I realize is not the current version.
TLDR: That version seemed to assume the plugin directory would be all lower case. Renaming the plugin to all lower case fixed the issue.
If this is no longer an issue, please close this. I just wanted to document it for others who might be using the old version.
Further detail...
When I tried activating it, I got the message:
Plugin file does not exist
I turned on debugging and tried activating again:
Undefined offset: 0 in /var/www/html/wp-content/themes/strata/includes/plugins/class-tgm-plugin-activation.php
Looking at that code:
// Populate $plugin array with necessary information.
$plugin['name'] = $_GET['plugin_name']; // @todo needs sanitizing, figure out how
$plugin['slug'] = sanitize_title( $_GET['plugin'] );
$plugin['source'] = $_GET['plugin_source']; // @todo needs sanitizing, figure out how
$plugin_data = get_plugins( '/' . $plugin['slug'] ); // Retrieve all plugins.
It seemed odd that it would build the file path from the slug (which was lowercased somewhere), so I tried renaming the folder to be all lowercase:
mv LayerSlider layerslider
Greetings,
I started using a theme called Strata, which included a plugin called LayerSlider, which included TGM-Plugin-Activation version 2.4.1, which I realize is not the current version.
TLDR: That version seemed to assume the plugin directory would be all lower case. Renaming the plugin to all lower case fixed the issue.
If this is no longer an issue, please close this. I just wanted to document it for others who might be using the old version.
Further detail...
When I tried activating it, I got the message:
Plugin file does not exist
I turned on debugging and tried activating again:
Undefined offset: 0 in /var/www/html/wp-content/themes/strata/includes/plugins/class-tgm-plugin-activation.php
Looking at that code:
It seemed odd that it would build the file path from the slug (which was lowercased somewhere), so I tried renaming the folder to be all lowercase:
mv LayerSlider layerslider
Tried reactivating, and it worked.
Hope it's useful to someone. Have a great day!