I prefer licenses that are based on how much something gets used. So, free if your site has small traffic or maybe free if the number of developers using it is small. That lets me use it in experimental projects or personal side projects (which may or may not make money and hence may be commercial) but not have to pay until the project grows large enough to be worth buying something like this.
I think the only library I've ever bought for a web project was $30 for a site license. It was when I worked at a company and multiple projects were going to use it and run from the same domain.
In this licensing model, it is far from certain that the library will continue to be developed and supported.
I do understand that buying code can be a very good choice. But the decision isn't just "purchase price" vs "features".