I'm writing a plugin that needs to check a few things for every shapefile layer in the current project. I am iterating over the layers as shown below, but cant figure out how to check if it is a shapefile. I don't consider using the URI to be a reliable method.
for layer in QgsProject.instance().mapLayers().values():
dp = layer.dataProvider()
uri = dp.dataSourceUri()
if dp.storageFormat() == 'shapefile': # not valid code
print(dp)
#verify stuff