$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>php - How WordPress core manage the plugin installation|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

php - How WordPress core manage the plugin installation

matteradmin8PV0评论

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.

Post a comment

comment list (0)

  1. No comments so far