The governing body of any city, town, village, or county of the first classification and any county of the first class with a charter form of government may enact orders or ordinances to provide for vacation and the mandatory demolition of buildings and structures or mandatory repair and maintenance of buildings or structures within the corporate limits of the city, town, village or county which are detrimental to the health, safety or welfare of the residents and declared to be a public nuisance.