A Commentary, Critical, Practical, and Explanatory on the Old and New Testaments, by Robert Jamieson, A.R. Fausset and David Brown  at sacred-texts.com
psa 50:1In the grandeur and solemnity of a divine judgment, God is introduced as instructing men in the nature of true worship, exposing hypocrisy, warning the wicked, and encouraging the pious. (Psa. 50:1-23)
The description of this majestic appearance of God resembles that of His giving the law (compare Exo 19:16; Exo 20:18; Deu 32:1).
psa 50:4above--literally, "above" (Gen 1:7).
heavens . . . earth--For all creatures are witnesses (Deu 4:26; Deu 30:19; Isa 1:2).
psa 50:5my saints-- (Psa 4:3).
a covenant, &c.--alluding to the dividing of a victim of sacrifice, by which covenants were ratified, the parties passing between the divided portions (compare Gen 15:10, Gen 15:18).
psa 50:6The inhabitants of heaven, who well know God's character, attest His righteousness as a judge.
psa 50:7I will testify--that is, for failure to worship aught.
thy God--and so, by covenant as well as creation, entitled to a pure worship.
psa 50:8However scrupulous in external worship, it was offered as if they conferred an obligation in giving God His own, and with a degrading view of Him as needing it [Psa 50:9-13]. Reproving them for such foolish and blasphemous notions, He teaches them to offer, or literally, "sacrifice," thanksgiving, and pay, or perform, their vows--that is, to bring, with the external symbolical service, the homage of the heart, and faith, penitence, and love. To this is added an invitation to seek, and a promise to afford, all needed help in trouble.
psa 50:16the wicked--that is, the formalists, as now exposed, and who lead vicious lives (compare Rom 2:21, Rom 2:23). They are unworthy to use even the words of God's law. Their hypocrisy and vice are exposed by illustrations from sins against the seventh, eighth, and ninth commandments.
psa 50:21God, no longer (even in appearance) disregarding such, exposes their sins and threatens a terrible punishment.
psa 50:22forget God--This denotes unmindfulness of His true character.
psa 50:23offereth praise-- (Psa 50:14), so that the external worship is a true index of the heart.
ordereth . . . aright--acts in a straight, right manner, opposed to turning aside (Psa 25:5). In such, pure worship and a pure life evince their true piety, and they will enjoy God's presence and favor.