(d) Any person who shall pay any owner, publisher, editor or employee or any newspaper or other periodical, to advocate or oppose editorially, any candidate for nomination or election, or any political party, or any measure to be submitted to the vote of the people; or any owner, publisher, editor or employee, who shall solicit or accept such payment: Is guilty of a misdemeanor, and, on conviction thereof, shall be fined not more than ten thousand dollars, or confined in jail for not more than one year, or, in the discretion of the court, shall be subject to both such fine and imprisonment.