2.5l was less prone to pinging with it's 9.1:1 compression
2.3L's were up to 9.4:1 compression
Above 9.5:1 is were regular gas(87 octane) can start to ping
Pinging on a cold engine is caused by lean fuel/air mix and spark timing being too advanced.
On warm engine a lean fuel mix
Pinging only under load, accelerating, is usually an EGR issue.
If it doesn't ping cold and only pings when under load then EGR system is at fault.
A perfect air/fuel mix will always ping, and will melt pistons and valves, which is why we don't use a perfect(on paper) fuel mix, lol.
You need to have a slightly rich mix at 14:1, which for gas engines is the "perfect" long term air/fuel mix.
And just FYI, pinging also pits the head gaskets cylinder ring, which will cause head gasket failure, if pinging is allowed to go on long term.
If you have had pinging since new then there is a problem with something.
An air leak between MAF sensor and intake valves will add enough extra air to get a 15:1 mix, since this is unmetered air computer can not compensate for it.
But once on-line(after about 5 minutes of running) the O2 sensors should see the lean exhaust and computer should richen the mix.
If computer can not richen the mix enough then it would turn on the CEL to notify you of the lean issue.
When engine is cold the computer runs a "choke mode", Open Loop, it raises the idle and runs a preset fuel/air mix that is richer, it also advances the spark timing.
If you have much less pinging when cold then fuel mix is the most likely issue.
This could be from an air leak or MAF sensor but most likely the computer is the issue, since O2 sensors are not correcting the mix.
Now the 4cyl just has the one O2 sensor for fuel/air, the 2nd O2 tests if cat convertor is working.
Maybe that O2 sensor was just a bad one from the start, maybe it tends to read rich so computer is running engine too lean.