Additional comments, from "Les corsaires barbaresques", Daniel Panzac :
The previous year, Decatur captured an algerian frigate and corvette, and anchored in front of Algiers, for negociation, not bombing.
Pellew did the same in april and may 1816.
The day of the bombardment, a delegation was sent under a flag of truce to negotiate with the dey. Algerian gunmen were at the mole, but not in casemate, observing the dutch and english fleet, which could cross the dangerous approach and conveniently anchor before the fire started.
A manoeuvre strongly ressented by the algerians, who declared that any attack would have been otherwise unsuccessfull.
An opinion strenghtened when another english attack in 1824, against immediate fire, could not even sail at efficient range and had to withdraw.
So the plain fact is that Algiers was accostumed to negotiation with foreign fleet in front of its guns, but that Pellew used 2 hours of fake "negotiation" to take position under a flag of truce. Due to the heavy current parallel to the shore, and the formidable battery of the "city of thousand guns", he could not have raked the defence otherwise.