I've created my first Craft3 plugin and installed it locally via a composer.json path. After doing the composer require, the plugin showed up as installed (with a green dot) under Admin->Settings->Plugin.

However, the plugin has the following code:

error_log('We have version '.$this->getVersion().' and handle '.$this->getHandle());
if ($plugin==null) {
     error_log('Could not find self');
} else {
     error_log('Fond self with version: '.$plugin->getVersion());
/* @var PluginInterface $plugin */
foreach ($plugins as $plugin) {

calling any page and then checking storage/logs/phperrors.log shows:

22-Jan-2019 13:18:52 Europe/London] We have version 1.0.0 and handle craft-project-name
[22-Jan-2019 13:18:52 Europe/London] Could not find self
[22-Jan-2019 13:18:52 Europe/London] {
"description":"Example plugin",
"name":"Craft Project Name",

Why is the plugin unable to find itself using getPlugin even though it's confirm it's handle name and why, in the list of plugins does it come up isEnabled: false even though the admin front end shows it as installed+enabled and obviously the plugin is functioning?

  • 1
    I'd suggest generating your plugin scaffolding here: pluginfactory.io and then taking it from there. Jan 23, 2019 at 3:33

1 Answer 1


You seem to have discrepancies in your naming. There is craft-project-name and craftprojectname in there. Could it be that?

Fix the naming and try to delete the plugin row in the database, composer remove it then re install..?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.