How does WordPress update plugins, without running into permissions issues?

I am developing a plugin for PrestaShop, it works but the issue is with its autoupdate. Sometimes it fails on customers server due to permissions issues.

How exactly does WordPress handle plugin updates without running into permissions issues? And can they be replicated for something like a PrestaShop module?

1 Answer
1

WP routinely runs into permission issues with updates. Whenever its Filesystem API detects that file operations required cannot be performed it requests login credentials to perform update over FTP or SSH.

Since third party automated code cannot make such request interactively that’s the reason it likely just fails.

There is number of Upgrade Constants that allow to hardcode credential in configuration and be used automatically instead if interactive request. They still need code to be coded to use APIs rather than attempt direct writes.

Leave a Comment