All is escaped, but i got data validation errors !!

When i check my plugin with Envato plugin check i got this error :

WARNING: Found echo esc_html__ in the file exp-file.php. Possible data validation issues found. All dynamic data must be correctly escaped for the context where it is rendered.

Line 27:

<?php echo esc_html__( ‘text here’, ‘text-domain’ ); ?

Is escaping data like that is wrong ??

Use in this way:
<?php esc_html_e( 'text here', 'TEXTDOMAIN'); ?>

I try it , but i got the same warning !

Use in this way:
<?php esc_html__( 'text here', 'TEXTDOMAIN'); ?>
without echo

1 Like

Perfect :slight_smile:
Thank you.

Thank you, it helped me too!

What about esc_url() and esc_attr() , i got Possible data validation issues found warnings too !?

Found echo admin_url in the file exp-file.php . Possible data validation issues found

<a href=’<?php echo esc_url( admin_url( admin.php?..) ); ?>
< input value =’<?php echo esc_attr( $id ); ?>

I just add printf() function and warnings resolved like that:

<a href="<?php printf('%s', esc_url( admin_url( 'admin.php?...' ) ) ); ?>
< input value ="<?php printf( '%d', esc_attr( $id ) ); ?>