wpexpertsio / cf7-honeypot

Contact Form 7 Honeypot - Adds honeypot anti-spam functionality to CF7 forms.
Other
5 stars 5 forks source link

Don't use constant as text domain #10

Closed Zodiac1978 closed 3 years ago

Zodiac1978 commented 3 years ago

It is recommended to not use variables or constants as text domain.

See warning box here: https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/#basic-strings

nocean commented 3 years ago

You're absolutely right! I don't think this applies as much to plugins translated through the official Wordpress translate site, but maybe with multilingual plugins like WPML and the likes it's needed. Regardless, I've just released 2.0.2 to address this. Thanks again for all of this Torsten.

Zodiac1978 commented 3 years ago

If things haven't changed the problem is the WordPress.org string parser which extracts the translation strings, which is written in PHP and does not execute the PHP and therefore cannot handle variables or constants: https://wordpress.stackexchange.com/a/221147

nocean commented 3 years ago

Ah, I thought it parsed it. My mistake. Ok, VERY solid advice then! Thanks again.