Support » Fixing WordPress » Updating a plugin

  • Ok, I looked but getting the wording right in a search was next to impossible.

    I’m working on updating a plugin. In the process I’m essentially rewriting it with a new boilerplate. My question is, if I update the repository with the new version, will any non-matching files in the older versions get deleted when the user updates?

    Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator t-p

    (@t-p)

    will any non-matching files in the older versions get deleted when the user updates

    consider manually updating: https://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation

    Thread Starter datainterlock

    (@datainterlock)

    I don’t quite think you understand. I already have a plugin with 600+ installs. I don’t want my end users having to manually reinstall.

    Perhaps I worded it wrong.

    If the file names that I upload to the repository are different from the current install, will the automatic plugin update delete the files that don’t match the current repository files?

    Moderator bcworkz

    (@bcworkz)

    Essentially yes. Once everything is ready for upgrade, the upgrader deletes all previous files before writing the new files.

    I’ve no direct experience with repository plugins, but I came to this conclusion by reviewing the WP_Upgrader class source code. I was curious about something related. Deletion occurs in WP_Upgrader::clear_destination() at line 390.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Updating a plugin’ is closed to new replies.