It basically depends on who is doing the translation and how trusted can he be as if you will not filter things out the translator can add JS code, still cookies and whatever.
In most of the places translation is done you will have in any case a call to esc_html
or esc_attr
which will mitigate the problem, but obviously if you need an actual link, you can not use those functions. The use of wp_kses
just makes sure there are no surprises in the translation.
For example, there is nothing that prevent a translator from translating __('Hi there
) into Hi there <script>alert('evil laugh')</script>
. translations are never verified to not include such type of things when they are submitted by translators, and while the example is easy to catch, it might be possible to do more complex things that are harder to spot.
Related Posts:
- What is the difference between esc_html and wp_filter_nohtml_kses?
- Escaping built-in WP function return strings
- What is the difference between strip_tags and wp_filter_nohtml_kses?
- WordPress security issue to output data from user input from theme option form
- wp_nonce_field displaying twice
- Is it necessary to do validation again when retrieving data from database?
- Why would you use esc_attr() on internal functions?
- Using password protection to load different page elements?
- Include external po file for 3th party plugin to theme
- HTML Elements in my WP Plugin being generated in JS. Security and Translated Text Question about this method being used
- Problem with Poedit [closed]
- Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
- Plugin is not generating title tags on any pages or posts
- How to Control CSS of Admin On Creating only a Specific Custom Post Type
- Can’t change the style of a submit input type? [closed]
- Make a plugin page out of influence of the theme’s style
- Update Data parameter of a wp_localize_script() call
- Custom entity search and display
- WP Plugin Running before jQuery
- Template directory in plugin
- get_the_tags with separator control?
- How to only load css for used blocks on frontend
- Checking a WordPress for OWASP top 10 vulnerabilities [closed]
- 400 Bad Request, in wordpress theme development, wp_ajax
- How do I have now a duplicated user entry if this is not allowed (and I cannot replicate it)?
- esc_html__() and __() not working within arrays
- add_submenu_page hooked function must explicitly check user capabilities – why?
- How to prevent someone from entering strings without making it available for translation?
- Readme.txt seems to be cached but not the version
- Add child pages to submenu automatically
- Are there any security risks when submitting data-attribute data through AJAX?
- Return Value of load_plugin_textdomain
- Why in this archive page that call query_posts() function show only the last 10 posts?
- my own SVN for a plugin/theme
- Issue on Setting $icon_url Parameter on WP add_menu_page()
- Why enqueue styles on hook?
- Getting a WordPress Debug Strategy
- unable to wp_enqueue_script(‘suggest’);
- Drawing the line between theme & plugin on large scale bespoke projects
- Apply styles to blockquote element with the WYSIWYG editor
- Translate javascript with WordPress built-in localization API for static strings
- PHP File_exist() not working – Checking if File Exist in WordPress Theme Directory
- Invalid hook call on save, not edit when using swiper slider
- Proper way to use useSelect
- Conditional Generation of Image Sizes using add_image_size
- How to add plugin options in wp editor page
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Plugin language always shows WP site language, not profile language
- Is hint for translator compulsory while internationalizing a string containing variables?
- How to find where an object first instantiatiation
- Gutenberg blocks error: Each child in a list should have a unique “key” prop
- Translating plugin settings page – dropdown list
- Make dynamic string translatable
- Full documentation about $args for register_rest_route?
- WP Still Generating 150×150 Thumbnail Size Even After Un-Setting Small Size in Functions.php
- Is it possible to use WP-CLI in a plugin (or theme)?
- Secruity Questions on a timer
- modify show UI of a registered taxonomy
- Using function from enqueued .js file in theme in plugin?
- Does WordPress default CSS have Grids?
- How to resize WordPress images on upload to specific height and width without cropping it
- Create fixed static pages
- How to get terms for taxonomy
- How to translate wordpress backend to another language
- How can I save a password securely as a settings field
- How to replace settings in WordPress plugin from a theme
- Save temporary registration data
- How to remove/replace current page template?
- WordPress dynamic widget by location?
- Borrowing of Previously Translated Strings by Child Plugin
- WordPress Page Reload Takes forever during theme development
- Adjust query on single
- Setting a post’s category
- rewrite_rules problem
- Anyone using unzip_file successfully? It uploads the zip but doesn’t extract it!
- How can the_excerpt (or equivalent) be called on a category description?
- Why does website stretch and white space on load? [duplicate]
- Change the behaviour of a button
- WP_Query order posts by category
- Configuring Xdebug with docker compose
- Why my theme’s css not working on another site
- How to access index file in Block Themes?
- How to show comments from different Plugins to same post type?
- Pass custom props to
- Translations only load from `wp-content/languages/plugins` but not from the plugin’s languages folder
- WordPress Favicon not Working For Images/Videos/PDFs
- Content-Security-Policy implementation with WordPress W3Total Cache plugin installed
- How to make premium plugin? I want to limit it until verification
- Google Web Core Vitals – management, how to in wordpress and advice
- How to add quick edit on the list of users to edit custom fields?
- Impossible to declare box-shadow with wp.customize?
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Override category archive page title (not the head title)
- How do I add filter with woocommerce categories?
- How to store sensitive user data (passwords)
- Can’t upload image via submitting custom post from frontend
- Need Help to make a logic for editing posts in Frontend
- Redirection from a specific page for users logged in but not with membership
- How can we stop showing short code in create or edit post section
- Metabox types list