I'm learning about wordpress plugin creation. I've found very useful the documentations found on wordpress codex about this argument, but I've a question: How the wordpress core manage the plugin installation?

  • What exactly do you want to know? – Krzysiek Dróżdż Dec 2 at 19:33
  • I want to understand how a plugin is installed after the related zip file is selected and then uploaded. I need to figure out what wordpress core function is called to manage this process – user9741470 Dec 2 at 19:37
  • WP unzips the file and places it in /wp-content/plugins/. From there, WP is set up to recognize every plugin in that folder, so it then appears in the Plugins screen on the dashboard and you have the option to activate it. – WebElaine Dec 3 at 18:53
  • Specifically, WP looks at the comments in PHP files in subfolders to determine whether a particular PHP file is a plugin or not. – WebElaine Dec 3 at 18:54
  • @WebElaine so the installation process of plugins is just a function that will unzip the plugin file and then place it insite the wp-content/plugin folder right? What comment will wordpress recognize for plugins? – user9741470 Dec 3 at 19:21

WP unzips the .zip file and places its contents inside of /wp-content/plugins/. From there, WP is set up to recognize plugins inside that folder with a specific comment:

<?php
/*
Plugin Name: Example Plugin
*/

The plugin can either be a single PHP file directly inside /wp-content/plugins/ or be a full subfolder such as /wp-content/plugins/example-plugin/ containing not only the main PHP plugin file but also additional required files.

Activating the plugin is a separate step - if the user has installed the plugin in wp-admin, they will see a success message once the plugin is installed with a link to activate. The plugin will also appear in the list of all plugins in wp-admin with a link to activate it there.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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