Wordpress Automatic Plugin Update Renames Plugin Directory

So I have hooked the wordpress plugin auto updated to effectively redirect my plugin to autoupdate from my own site rath

So I have hooked the wordpress plugin auto updated to effectively redirect my plugin to autoupdate from my own site rather than wordpress.

The updating process works seemlessly aside from one wierd hitch - the wordpress updater downloads the my_plugin.zip file from my server, saves it in a temp directory as my_plugin-3sd123.tmp (where the random string is generated by the wp updater to avoid file conflicts) and unzips it to wp-content/upgrades which leaves a directory my_plugin-3sd123 in updates and then it copies this directory to plugins and removes the old directory BUT never renames the new one to the old plugin slug.. Should I be writing my plugins to expect this? because I dont see it happening with other plugin updates?

So I have hooked the wordpress plugin auto updated to effectively redirect my plugin to autoupdate from my own site rather than wordpress.

The updating process works seemlessly aside from one wierd hitch - the wordpress updater downloads the my_plugin.zip file from my server, saves it in a temp directory as my_plugin-3sd123.tmp (where the random string is generated by the wp updater to avoid file conflicts) and unzips it to wp-content/upgrades which leaves a directory my_plugin-3sd123 in updates and then it copies this directory to plugins and removes the old directory BUT never renames the new one to the old plugin slug.. Should I be writing my plugins to expect this? because I dont see it happening with other plugin updates?

Share Improve this question asked Nov 13, 2019 at 7:57 NarrimNarrim 1337 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

It turns out the answer was simple I didnt have my plugins content in a subdirectory slug inside the zip file eg. I had :

my_plugin.zip
   |- my_plugin.php
   |- admin
        |-admin.php

I should have had

my_plugin.zip
   |-my_plugin
        |-my-plugin.php
        |-admin
            |-admin.php

Once you add that sub directory the auto updated will work as expected

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745000967a4605489.html

相关推荐

  • Wordpress Automatic Plugin Update Renames Plugin Directory

    So I have hooked the wordpress plugin auto updated to effectively redirect my plugin to autoupdate from my own site rath

    22小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信