php - How WordPress core manage the plugin installation

admin2025-06-05  2

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?

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?

Share Improve this question asked Dec 2, 2018 at 19:32 user9741470user9741470 1115 bronze badges 5
  • What exactly do you want to know? – Krzysiek Dróżdż Commented Dec 2, 2018 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 Commented Dec 2, 2018 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 Commented Dec 3, 2018 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 Commented Dec 3, 2018 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 Commented Dec 3, 2018 at 19:21
Add a comment  | 

1 Answer 1

Reset to default 1

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.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749131232a316626.html

最新回复(0)