There could be multiple reasons for disabling updates of plugin or a theme. For example, in time constraint, you have reached for desperate measures and edited the source of a third party plugin or theme. Now, that is the practice that is bad on so many levels, but sometimes you just have to deliver in time, no matter what.
Anyway, you have done the unimaginable and edited the code of the third party plug-in or theme. And, of course, you don’t have time to make up with another solution later, and any update to that theme or plugin would overwrite your changes. It would be pretty neat if you could somehow disable updates of that part of your website.
Another situation when it would be suitable to do something like this is when you create custom plugin and/or there for the client and don’t want to send additional requests to WordPress servers.
I just added a few lines to this code which are used to check if HTTPS protocol is used.
Use this code for a theme (put in functions.php):
And this code for plugins: