Can projects with a Treeware requirement be considered open source?
Not according to the Open Source Definition ("OSD") published by the Open Source Initiative.
Rule 1 of the OSD:
The license shall not restrict any party from selling or giving away the software as a component of an aggregate software distribution containing programs from several different sources. The license shall not require a royalty or other fee for such sale.
Violated, since the Treeware license [requires] that I "buy the world a tree" using the Ecologi web site, and this action requires paying a fee.
Rule 6 of the OSD:
The license must not restrict anyone from making use of the program in
a specific field of endeavor. For example, it may not restrict the
program from being used in a business, or from being used for genetic
research.
The Treeware license is conditioned on whether you use the software "in production". That's what Rule 6 is about -- so Treeware cannot condition a [requirement] like this that depends on whether you use the software in production or not.
Is Treeware GPL-compatible?
If it's GPLv2, the Treeware notice is not compatible. GPLv2 states in section 6:
You may not impose any further restrictions on the recipients'
exercise of the rights granted herein.
Treeware introduces a further restriction, since normally, users of GPL programs would have the right to use the program in a production environment as well, even if they did not buy the world a tree. Treeware says that if you use the program in production, that you [must] buy the world a tree. That is a further restriction on the software's use.
In the case of GPLv3, Section 7 says that you may remove such further restrictions:
If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.
So, for a GPLv3 program that includes the Treeware license term, Section 7 says that you may remove the Treeware term, if you wish.
Is the Treeware condition optional or required?
A major problem with Treeware is that it's not generally clear whether the phrase "buy the world a tree" is a supposed to be required thing to do or an optional thing to do. For example, the version on the Treeware web site is worded this way:
This package is Treeware. If you use it in
production, then we ask that you buy the world a
tree [with a hyperlink to plant.treeware.earth, which eventually leads to Ecologi.com] to thank us for our work.
In my opinion, in the above version, the phrasing indicates what action is to be done, on the condition that you use the software in a certain environment ("if you use it in production, then ..."). So I would interpret the phrase "then we ask that you buy the world a tree" in this version as a thing that you are being asked to do if the preceding condition is true. In other words, it's a requirement in the case that you use the software in a production environment.
However, if the "buy the world a tree" suggestion in Treeware turns out to be an optional clause, then this would most likely resolve any doubts about GPL compatibility and Open Source compliance. If we do a quick search on GitHub we can find that there are indeed multiple ways that the Treeware condition is worded in practice. For example:
https://github.com/fyggi/laravel-simple-uuid
You're free to use this package, but if it makes it to your production
environment you are required to buy the world a tree.
This version of Treeware seems to be clearly GPL-incompatible, and not Open Source, because the "the buy the world a tree" requirement is clearly required by the license text itself.
https://github.com/Astrotomic/ignition-github
You're free to use this package, but if it makes it to your production
environment I would highly appreciate you buying the world a tree.
In this version of Treeware, it's more likely that it could be considered GPL-compatible and Open Source-compatible, because phrasing the request in this way seems to signal the intention of making the clause optional. I personally would be more comfortable with the above wording if the word "but" were removed.
At present, I cannot find any projects who have commented about Treeware in particular, but there is a license which contains a similar optional condition which is in the wild, the Beerware license. In the Beerware license text, the licensee is asked to buy the author a beer, but that suggestion is clearly made optional in the license text. Because it is an optional clause, the Fedora Project consider the Beerware license to be Free and GPL compatible.
See also: Contra proferentem.
Can I fork the software and then remove the Treeware license from my forked version?
For most open source licenses, the answer is probably yes. If you read the Treeware license itself, there is nothing written there that requires that you retain the Treeware notice itself when you copy and modify the software. So, according to most open source licenses, there's nothing preventing you from copying the project and deleting the Treeware notice in your version, effectively creating your own non-Treeware'd version which does not include that requirement/suggestion.