Have been to some of the ports on your cruise.... Gibraltar is easy to do on your own...the ship docks close to the port gates where there will be numerous taxis waiting who will do tours if you want to and very cheap compared to the ships tours. Or you can walk into the town about 20 minute level walk but quite busy
traffic..get a street map if you can.
Barcelona ...get the ships shuttle to the bottom of Las Ramblas and its a lovely walk up to the big square at the top where there are open topped hop on hop off buses outside El Corte Ingles department store. If you get on the north circuit one it goes to the Camp Nous football stadium where a lot of people go and have a look around...also to Gaudi's unfinished cathedral..lots of nice architecture to look at. 19 euros for the day!
Florence we got the ships trip to the city and then did our own thing (the cheapest trip). it actually went past the leaning tower of Pisa (at a distance) so we saw that as well!
Malaga...I'm not sure where the ship berths but I think it is fairly close to the city which again is easy to explore on foot although you will need comfy shoes as it is spread out. there is a nice old area. The ship will probably give you street maps or you may find some on the web!
thats all I can help you with as we haven't been to the other ports...my tip is to do your research before you go and it will save you alot of money!
Research the ports of call section on cruise critic.