5 | | Inside `install_package()`, it checks if the destination folder is protected - and during plugin update, destination is the path to `wp-content/plugins`. Since that's protected, it rewrites the destination based on `basename( $source )` - the temporary folder - so it becomes `wp-content/plugins/my-plugin.tmp/`. During plugin update, there's an array of "hook_extra" passed to the function, and it contains the plugin attribute in the syntax: "my-plugin/my-plugin.php". So, if that's available, I get the plugin's top directory and use it instead of the temporary one in $source. |
| 5 | Inside `install_package()`, it checks if the destination folder is protected - and during plugin update, destination is the path to `wp-content/plugins`. Since that's protected, it rewrites the destination based on `$source` - the temporary folder - so it becomes `wp-content/plugins/my-plugin.tmp/`. During plugin update, there's an array of "hook_extra" passed to the function, and it contains the plugin attribute in the syntax: "my-plugin/my-plugin.php". So, if that's available, I get the plugin's top directory and use it instead of the temporary one in $source. |