We aim to optimize the performance of the title solar cells by altering the frontier orbital energy gaps. This was done by adding low-cost metal atoms (Zn, Ni, Fe, Ti) to the free-base porphyrin, and increasing the length and conjugation of the thiophene substituent. The results reveal that cell efficiency can be enhanced by metal functionalization of the free-base porphyrin, and increasing the p-conjugation and electron-withdrawing capability of the thiophene-substituted side chain. While Ti-porphyrin was found to be the most efficient dye sensitizer for dye-sensitized solar cells (DSSCs) based on metalloporphyrin donors and conjugated thiophene side chain acceptors, Fe-porphyrin was found to be the most efficient sensitizer for DSSCs based on metalloporphyrin donors and a series of oxide semiconductor acceptors. Metal atoms and thiophene side chains facilitate rapid electron injection from the donor moiety to the acceptor moiety, narrow the band gaps of the donors, acceptors, and donor-acceptor dyads, and alter the density of states near the Fermi levels. The highest occupied molecular orbitals (HOMOs) of the dyads are close to the HOMOs of the donors, and lowest unoccupied molecular orbitals (LUMOs) are close to the LUMOs of the acceptors. The HOMOs are localized on the donor moieties, and the LUMOs on the acceptor moieties. The introduction of low-cost Fe and Ti to the free-base porphyrin leads to more active nonlinear optical performance, stronger response to the external electric field, and induces higher photo-to-current conversion efficiency. They also red shift the absorption bands of the free-base porphyrin, and make it a potential candidate for harvesting light in the entire UV-Vis region of solar spectrum. Size ranges: dyes (0.1-1 nm) and pore diameters of a dye-sensitized mesoporous film of TiO2 (2-50 nm).