Self-employed “employer” contributions to 401k

Can the “employer” contribution to a solo401k be in 2023 for income earned in 2022 or does it have to be made the same year? The account is already open.

Also, to confirm, it’s a max of 25% of gross earned after half of SE taxes are subtracted from gross earned, correct?