From 552dc80013766cca0dd9cbdfe1596c5cfb8be32a Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 14 Apr 2026 08:17:15 +0000 Subject: [PATCH] Fix sanitizeHTML performance overhead and HTML-in-translation strings (issue #2043) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Addresses three problems reported by @sbomsdorf: 1. Performance: commonsbooking_sanitizeHTML() rebuilt its $allowed_atts array and mutated the global $allowedposttags on every single call. On an admin settings page this runs ~200 times. Replace both with a static variable that merges the tags list once per request and passes it directly to wp_kses(), leaving the global untouched. 2. Translation complexity (OptionsArray.php, CB1UserFields.php): 111 'title', 'name', 'default', and 'group_title' array entries wrapped plain text strings in commonsbooking_sanitizeHTML() at definition time. Plain text requires no sanitization; the wrapper added CPU cost and confused static analysis. Removed the wrapper — escaping at render time is handled by CMB2 and the calling template (late escape pattern from issue #2043). 3. HTML-in-translation strings: - UserWidget:
  • ...
  • patterns replaced with explicit HTML construction + esc_url()/esc_html__(), so translators only see the link label, not fragile markup. - CB1UserFields::get_termsservices_string(): inside __() replaced with esc_url() + esc_html__(); also fixes a pre-existing malformed attribute (target=_blank" → target="_blank"). https://claude.ai/code/session_01P1DDnvRKzHdx7jepeTf3ju --- ...tml-performance-and-translation-complexity | 4 + includes/Admin.php | 153 ++++++------ includes/OptionsArray.php | 222 +++++++++--------- src/CB/CB1UserFields.php | 30 ++- src/Wordpress/Widget/UserWidget.php | 23 +- 5 files changed, 221 insertions(+), 211 deletions(-) create mode 100644 changelog/fix-sanitize-html-performance-and-translation-complexity diff --git a/changelog/fix-sanitize-html-performance-and-translation-complexity b/changelog/fix-sanitize-html-performance-and-translation-complexity new file mode 100644 index 000000000..6d3866b13 --- /dev/null +++ b/changelog/fix-sanitize-html-performance-and-translation-complexity @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Refactor commonsbooking_sanitizeHTML() to cache its allowed-tags array with a static variable instead of rebuilding it on every call, eliminating redundant work on admin pages that invoke it hundreds of times. Move HTML markup out of translatable strings in UserWidget and CB1UserFields so translators only handle plain text, and fix a malformed HTML attribute (target=_blank" → target="_blank") in the terms-and-services link. diff --git a/includes/Admin.php b/includes/Admin.php index 82a3c628e..1d48fdba0 100644 --- a/includes/Admin.php +++ b/includes/Admin.php @@ -133,81 +133,94 @@ function commonsbooking_admin() { * @return string */ function commonsbooking_sanitizeHTML( $string ): string { - global $allowedposttags; + // Cache the merged allowed-tags array for the lifetime of the request. + // Without this, $allowed_atts was rebuilt and $allowedposttags mutated on + // every single call — hundreds of times per admin page load (issue #2043). + static $allowed_tags = null; if ( empty( $string ) ) { return ''; } - $allowed_atts = array( - 'align' => array(), - 'checked' => array(), - 'class' => array(), - 'type' => array(), - 'id' => array(), - 'dir' => array(), - 'lang' => array(), - 'style' => array(), - 'xml:lang' => array(), - 'src' => array(), - 'alt' => array(), - 'href' => array(), - 'rel' => array(), - 'rev' => array(), - 'target' => array(), - 'novalidate' => array(), - 'value' => array(), - 'name' => array(), - 'tabindex' => array(), - 'action' => array(), - 'method' => array(), - 'for' => array(), - 'width' => array(), - 'height' => array(), - 'data' => array(), - 'title' => array(), - 'cellspacing' => array(), - 'cellpadding' => array(), - 'border' => array(), - ); - $allowedposttags['form'] = $allowed_atts; - $allowedposttags['label'] = $allowed_atts; - $allowedposttags['input'] = $allowed_atts; - $allowedposttags['textarea'] = $allowed_atts; - $allowedposttags['iframe'] = $allowed_atts; - $allowedposttags['script'] = $allowed_atts; - $allowedposttags['style'] = $allowed_atts; - $allowedposttags['strong'] = $allowed_atts; - $allowedposttags['small'] = $allowed_atts; - $allowedposttags['table'] = $allowed_atts; - $allowedposttags['span'] = $allowed_atts; - $allowedposttags['abbr'] = $allowed_atts; - $allowedposttags['code'] = $allowed_atts; - $allowedposttags['pre'] = $allowed_atts; - $allowedposttags['div'] = $allowed_atts; - $allowedposttags['img'] = $allowed_atts; - $allowedposttags['h1'] = $allowed_atts; - $allowedposttags['h2'] = $allowed_atts; - $allowedposttags['h3'] = $allowed_atts; - $allowedposttags['h4'] = $allowed_atts; - $allowedposttags['h5'] = $allowed_atts; - $allowedposttags['h6'] = $allowed_atts; - $allowedposttags['ol'] = $allowed_atts; - $allowedposttags['ul'] = $allowed_atts; - $allowedposttags['li'] = $allowed_atts; - $allowedposttags['em'] = $allowed_atts; - $allowedposttags['hr'] = $allowed_atts; - $allowedposttags['br'] = $allowed_atts; - $allowedposttags['tr'] = $allowed_atts; - $allowedposttags['td'] = $allowed_atts; - $allowedposttags['p'] = $allowed_atts; - $allowedposttags['a'] = $allowed_atts; - $allowedposttags['b'] = $allowed_atts; - $allowedposttags['i'] = $allowed_atts; - $allowedposttags['select'] = $allowed_atts; - $allowedposttags['option'] = $allowed_atts; - - return wp_kses( $string, $allowedposttags ); + if ( null === $allowed_tags ) { + global $allowedposttags; + + $allowed_atts = array( + 'align' => array(), + 'checked' => array(), + 'class' => array(), + 'type' => array(), + 'id' => array(), + 'dir' => array(), + 'lang' => array(), + 'style' => array(), + 'xml:lang' => array(), + 'src' => array(), + 'alt' => array(), + 'href' => array(), + 'rel' => array(), + 'rev' => array(), + 'target' => array(), + 'novalidate' => array(), + 'value' => array(), + 'name' => array(), + 'tabindex' => array(), + 'action' => array(), + 'method' => array(), + 'for' => array(), + 'width' => array(), + 'height' => array(), + 'data' => array(), + 'title' => array(), + 'cellspacing' => array(), + 'cellpadding' => array(), + 'border' => array(), + ); + + $extra_tags = array( + 'form' => $allowed_atts, + 'label' => $allowed_atts, + 'input' => $allowed_atts, + 'textarea' => $allowed_atts, + 'iframe' => $allowed_atts, + 'script' => $allowed_atts, + 'style' => $allowed_atts, + 'strong' => $allowed_atts, + 'small' => $allowed_atts, + 'table' => $allowed_atts, + 'span' => $allowed_atts, + 'abbr' => $allowed_atts, + 'code' => $allowed_atts, + 'pre' => $allowed_atts, + 'div' => $allowed_atts, + 'img' => $allowed_atts, + 'h1' => $allowed_atts, + 'h2' => $allowed_atts, + 'h3' => $allowed_atts, + 'h4' => $allowed_atts, + 'h5' => $allowed_atts, + 'h6' => $allowed_atts, + 'ol' => $allowed_atts, + 'ul' => $allowed_atts, + 'li' => $allowed_atts, + 'em' => $allowed_atts, + 'hr' => $allowed_atts, + 'br' => $allowed_atts, + 'tr' => $allowed_atts, + 'td' => $allowed_atts, + 'p' => $allowed_atts, + 'a' => $allowed_atts, + 'b' => $allowed_atts, + 'i' => $allowed_atts, + 'select' => $allowed_atts, + 'option' => $allowed_atts, + ); + + // Merge with the WordPress core allowed-tags list rather than mutating it. + $allowed_tags = array_merge( $allowedposttags, $extra_tags ); + } + + return wp_kses( $string, $allowed_tags ); } /** diff --git a/includes/OptionsArray.php b/includes/OptionsArray.php index 0601828bc..cffc0cab3 100644 --- a/includes/OptionsArray.php +++ b/includes/OptionsArray.php @@ -35,13 +35,13 @@ /* Tab: main start*/ 'main' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Welcome', 'commonsbooking' ) ), + 'title' => __( 'Welcome', 'commonsbooking' ), 'id' => 'main', 'is_top_level' => true, /* indicate first tab */ 'field_groups' => array( /* welcome group start */ 'welcome' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Welcome to CommonsBooking', 'commonsbooking' ) ), + 'title' => __( 'Welcome to CommonsBooking', 'commonsbooking' ), 'id' => 'welcome', 'desc' => sprintf( @@ -78,7 +78,7 @@ /* Tab: general start*/ 'general' => array( - 'title' => commonsbooking_sanitizeHTML( _x( 'General', 'The general settings category', 'commonsbooking' ) ), + 'title' => _x( 'General', 'The general settings category', 'commonsbooking' ), 'id' => 'general', 'field_groups' => array( /* posttype: naming, rewrite, archives start */ @@ -95,7 +95,7 @@ ), 'fields' => array( array( - 'name' => commonsbooking_sanitizeHTML( __( 'Items slug', 'commonsbooking' ) ), + 'name' => __( 'Items slug', 'commonsbooking' ), 'id' => 'posttypes_items-slug', 'description' => sprintf( @@ -154,18 +154,18 @@ array( 'name' => esc_html__( 'Activate booking comments in booking page', 'commonsbooking' ), 'id' => 'booking-comment-active', - 'description' => commonsbooking_sanitizeHTML( __( 'If enabled, users can enter an internal comment about their booking on the booking confirmation page. This comment can be included in the booking confirmation email.', 'commonsbooking' ) ), + 'description' => __( 'If enabled, users can enter an internal comment about their booking on the booking confirmation page. This comment can be included in the booking confirmation email.', 'commonsbooking' ), 'type' => 'checkbox', ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Headline above the comment field in frontend', 'commonsbooking' ) ), + 'name' => __( 'Headline above the comment field in frontend', 'commonsbooking' ), 'id' => 'booking-comment-title', - 'description' => commonsbooking_sanitizeHTML( __( 'Text that will be shown above the comment field in the booking confirmation page.', 'commonsbooking' ) ), + 'description' => __( 'Text that will be shown above the comment field in the booking confirmation page.', 'commonsbooking' ), 'type' => 'text', 'default' => __( 'Booking comment', 'commonsbooking' ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Description', 'commonsbooking' ) ), + 'name' => __( 'Description', 'commonsbooking' ), 'id' => 'booking-comment-description', 'description' => commonsbooking_sanitizeHTML( __( 'Short infotext to inform the user how the comment field will be used (e.g. only internal comment etc.) ', 'commonsbooking' ) ), 'type' => 'textarea_small', @@ -185,11 +185,11 @@ /* Tab booking codes start */ 'bookingcodes' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Booking codes', 'commonsbooking' ) ), + 'title' => __( 'Booking codes', 'commonsbooking' ), 'id' => 'bookingcodes', 'field_groups' => array( 'bookingcodes' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Booking codes', 'commonsbooking' ) ), + 'title' => __( 'Booking codes', 'commonsbooking' ), 'id' => 'bookingcodes', 'desc' => commonsbooking_sanitizeHTML( @@ -205,12 +205,12 @@ ), 'fields' => array( array( - 'name' => commonsbooking_sanitizeHTML( __( 'Booking codes', 'commonsbooking' ) ), + 'name' => __( 'Booking codes', 'commonsbooking' ), 'id' => 'bookingcodes', 'type' => 'textarea', ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Show booking codes for x days', 'commonsbooking' ) ), + 'name' => __( 'Show booking codes for x days', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( __( 'Displays booking codes for the next x days on the timeframe page', 'commonsbooking' ) ), 'id' => 'bookingcodes-listed-timeframe', 'type' => 'text_small', @@ -223,19 +223,19 @@ ), ), 'mail_booking_codes' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Booking codes by email', 'commonsbooking' ) ), + 'title' => __( 'Booking codes by email', 'commonsbooking' ), 'id' => 'mail-booking-codes', 'desc' => commonsbooking_sanitizeHTML( __( 'Send booking codes by email to location email(s) (automated by cron or ad hoc)', 'commonsbooking' ) ), 'fields' => array( array( - 'name' => commonsbooking_sanitizeHTML( __( 'Subject for booking codes email', 'commonsbooking' ) ), + 'name' => __( 'Subject for booking codes email', 'commonsbooking' ), 'id' => 'mail-booking-codes-subject', 'type' => 'text', - 'default' => commonsbooking_sanitizeHTML( __( 'Booking codes for {{codes:formatDateRange}} {{item:post_title}}', 'commonsbooking' ) ), + 'default' => __( 'Booking codes for {{codes:formatDateRange}} {{item:post_title}}', 'commonsbooking' ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Body for booking codes email', 'commonsbooking' ) ), + 'name' => __( 'Body for booking codes email', 'commonsbooking' ), 'id' => 'mail-booking-codes-body', 'type' => 'textarea', 'default' => commonsbooking_sanitizeHTML( @@ -254,15 +254,15 @@ ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Backup E-Mail for booking codes email', 'commonsbooking' ) ), + 'name' => __( 'Backup E-Mail for booking codes email', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( __( 'Email address that receives a bcc copy of booking codes mailing (not used if empty)', 'commonsbooking' ) ), 'id' => 'mail-booking-codes-bcc', 'type' => 'text', ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Attach iCalendar file to booking codes email', 'commonsbooking' ) ), + 'name' => __( 'Attach iCalendar file to booking codes email', 'commonsbooking' ), 'id' => 'mail-booking-codes-attach-ical', - 'description' => commonsbooking_sanitizeHTML( __( 'Will attach an iCalendar compatible file with booking codes per day to import in their respective calendar application.', 'commonsbooking' ) ), + 'description' => __( 'Will attach an iCalendar compatible file with booking codes per day to import in their respective calendar application.', 'commonsbooking' ), 'type' => 'checkbox', ), ), @@ -272,30 +272,30 @@ /* Tab: templates start*/ 'templates' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Templates', 'commonsbooking' ) ), + 'title' => __( 'Templates', 'commonsbooking' ), 'id' => 'templates', 'field_groups' => array( /* field group email templates start */ 'emailtemplates' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Email templates', 'commonsbooking' ) ), + 'title' => __( 'Email templates', 'commonsbooking' ), 'id' => 'emailtemplates', 'fields' => array( array( - 'name' => commonsbooking_sanitizeHTML( __( 'Mail-Header from E-Mail', 'commonsbooking' ) ), + 'name' => __( 'Mail-Header from E-Mail', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( __( 'E-Mail that will be shown as sender in generated emails', 'commonsbooking' ) ), 'id' => 'emailheaders_from-email', 'type' => 'text', 'default' => get_option( 'admin_email' ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Mail-Header from Name', 'commonsbooking' ) ), + 'name' => __( 'Mail-Header from Name', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( __( 'Name that will be shown as sender in generated emails', 'commonsbooking' ) ), 'id' => 'emailheaders_from-name', 'type' => 'text', 'default' => get_option( 'blogname' ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Mail-Signature', 'commonsbooking' ) ), + 'name' => __( 'Mail-Signature', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( __( 'E-Mail signature that will appear wherever you put {{booking:getEmailSignature}}', 'commonsbooking' ) ), 'id' => 'emailbody_signature', 'type' => 'textarea', @@ -311,7 +311,7 @@ ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Booking confirmed email subject', 'commonsbooking' ) ), + 'name' => __( 'Booking confirmed email subject', 'commonsbooking' ), 'id' => 'emailtemplates_mail-booking-confirmed-subject', 'cb1_legacy_id' => 'commons-booking-settings-mail:commons-booking_mail_confirmation_subject', 'type' => 'text', @@ -323,7 +323,7 @@ ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Booking confirmed email body', 'commonsbooking' ) ), + 'name' => __( 'Booking confirmed email body', 'commonsbooking' ), 'id' => 'emailtemplates_mail-booking-confirmed-body', 'cb1_legacy_id' => 'commons-booking-settings-mail:commons-booking_mail_confirmation_body', 'type' => 'textarea', @@ -360,13 +360,13 @@ ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Attach iCalendar file to booking email', 'commonsbooking' ) ), + 'name' => __( 'Attach iCalendar file to booking email', 'commonsbooking' ), 'id' => 'emailtemplates_mail-booking_ics_attach', 'type' => 'checkbox', 'desc' => esc_html__( 'Will attach an iCalendar compatible file for users to import in their respective calendar application.', 'commonsbooking' ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'iCalendar event title', 'commonsbooking' ) ), + 'name' => __( 'iCalendar event title', 'commonsbooking' ), 'id' => 'emailtemplates_mail-booking_ics_event-title', 'type' => 'text', 'desc' => esc_html__( 'The title of the attached event', 'commonsbooking' ), @@ -378,7 +378,7 @@ ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'iCalendar event description', 'commonsbooking' ) ), + 'name' => __( 'iCalendar event description', 'commonsbooking' ), 'id' => 'emailtemplates_mail-booking_ics_event-description', 'type' => 'textarea', 'desc' => esc_html__( 'The description for the attached event.', 'commonsbooking' ), @@ -393,13 +393,13 @@ ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Booking canceled email subject', 'commonsbooking' ) ), + 'name' => __( 'Booking canceled email subject', 'commonsbooking' ), 'id' => 'emailtemplates_mail-booking-canceled-subject', 'type' => 'text', - 'default' => commonsbooking_sanitizeHTML( __( 'Booking canceled: {{item:post_title}} at {{location:post_title}} {{booking:formattedBookingDate}}', 'commonsbooking' ) ), + 'default' => __( 'Booking canceled: {{item:post_title}} at {{location:post_title}} {{booking:formattedBookingDate}}', 'commonsbooking' ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Booking canceled email body', 'commonsbooking' ) ), + 'name' => __( 'Booking canceled email body', 'commonsbooking' ), 'id' => 'emailtemplates_mail-booking-canceled-body', 'type' => 'textarea', 'default' => commonsbooking_sanitizeHTML( @@ -421,19 +421,19 @@ /* field group template and booking message templates start */ 'messagetemplates' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Template and booking process messages', 'commonsbooking' ) ), + 'title' => __( 'Template and booking process messages', 'commonsbooking' ), 'id' => 'messagetemplates', 'desc' => '', 'fields' => array( array( - 'name' => commonsbooking_sanitizeHTML( __( 'Booking confirmed message', 'commonsbooking' ) ), + 'name' => __( 'Booking confirmed message', 'commonsbooking' ), 'id' => 'booking-confirmed-notice', 'type' => 'textarea_small', 'desc' => commonsbooking_sanitizeHTML( __( 'This text is shown as a status message on booking page after a user has confirmed the booking', 'commonsbooking' ) ), 'default' => esc_html__( 'Your booking is confirmed. A confirmation mail has been sent to you.', 'commonsbooking' ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Item not available', 'commonsbooking' ) ), + 'name' => __( 'Item not available', 'commonsbooking' ), 'id' => 'item-not-available', 'type' => 'textarea_small', 'desc' => commonsbooking_sanitizeHTML( __( 'This text is shown on item listings (shortcode cb_items) and item detail page if there is no valid bookable timeframe set for this item', 'commonsbooking' ) ), @@ -478,7 +478,7 @@ 'id' => 'user_details_template', 'type' => 'textarea', 'desc' => esc_html__( 'This textblock is displayed on the booking details page. Please use template-tags to fill in user details', 'commonsbooking' ), - 'default' => commonsbooking_sanitizeHTML( __( '{{[Phone: ]user:phone}}
    {{[Address: ]user:address}}', 'commonsbooking' ) ), + 'default' => __( '{{[Phone: ]user:phone}}
    {{[Address: ]user:address}}', 'commonsbooking' ), ), ), ), @@ -488,7 +488,7 @@ /* field group image options */ 'imageoptions' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Image formatting', 'commonsbooking' ) ), + 'title' => __( 'Image formatting', 'commonsbooking' ), 'id' => 'imageoptions', 'desc' => '', 'fields' => array( @@ -533,7 +533,7 @@ ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Crop images', 'commonsbooking' ) ), + 'name' => __( 'Crop images', 'commonsbooking' ), 'id' => 'image_listing_crop', 'type' => 'checkbox', 'desc' => commonsbooking_sanitizeHTML( __( 'If checked the image will be cropped to specified dimensions using center crop positions', 'commonsbooking' ) ), @@ -545,33 +545,33 @@ /* field group color setting */ 'colorscheme' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Color schemes', 'commonsbooking' ) ), + 'title' => __( 'Color schemes', 'commonsbooking' ), 'id' => 'colorscheme', 'desc' => '', 'fields' => array( array( - 'name' => commonsbooking_sanitizeHTML( __( 'Base color', 'commonsbooking' ) ), + 'name' => __( 'Base color', 'commonsbooking' ), 'id' => 'colorscheme_primarycolor', 'type' => 'colorpicker', 'desc' => commonsbooking_sanitizeHTML( __( 'Defines the color that is used in headings and buttons', 'commonsbooking' ) ), 'default' => '#84AE53', ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Secondary color', 'commonsbooking' ) ), + 'name' => __( 'Secondary color', 'commonsbooking' ), 'id' => 'colorscheme_secondarycolor', 'type' => 'colorpicker', 'desc' => commonsbooking_sanitizeHTML( __( 'The color shown when hovering a button or a link', 'commonsbooking' ) ), 'default' => '#506CA9', ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Button color', 'commonsbooking' ) ), + 'name' => __( 'Button color', 'commonsbooking' ), 'id' => 'colorscheme_buttoncolor', 'type' => 'colorpicker', 'desc' => commonsbooking_sanitizeHTML( __( 'The default color for buttons', 'commonsbooking' ) ), 'default' => '#74ce3c', ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Confirmation / Available Color', 'commonsbooking' ) ), + 'name' => __( 'Confirmation / Available Color', 'commonsbooking' ), 'id' => 'colorscheme_acceptcolor', 'type' => 'colorpicker', 'desc' => commonsbooking_sanitizeHTML( __( 'The color that is used to signify if an item is available or that an action has been completed successfully', 'commonsbooking' ) ), @@ -579,7 +579,7 @@ ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Cancel / Not Available Color', 'commonsbooking' ) ), + 'name' => __( 'Cancel / Not Available Color', 'commonsbooking' ), 'id' => 'colorscheme_cancelcolor', 'type' => 'colorpicker', 'desc' => commonsbooking_sanitizeHTML( __( 'The color that is used to signify if an item is unavailable or for buttons to abort actions', 'commonsbooking' ) ), @@ -587,7 +587,7 @@ ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Temporarily Unavailable Color', 'commonsbooking' ) ), + 'name' => __( 'Temporarily Unavailable Color', 'commonsbooking' ), 'id' => 'colorscheme_holidaycolor', 'type' => 'colorpicker', 'desc' => commonsbooking_sanitizeHTML( __( 'The color that is used to signify if an item is temporarily unbookable (i.e. holiday)', 'commonsbooking' ) ), @@ -595,7 +595,7 @@ ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Greyed out Color', 'commonsbooking' ) ), + 'name' => __( 'Greyed out Color', 'commonsbooking' ), 'id' => 'colorscheme_greyedoutcolor', 'type' => 'colorpicker', 'desc' => commonsbooking_sanitizeHTML( __( 'The color used to signify that no timeframe has been created for an item or a button that is not yet clickable', 'commonsbooking' ) ), @@ -603,7 +603,7 @@ ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Background Color', 'commonsbooking' ) ), + 'name' => __( 'Background Color', 'commonsbooking' ), 'id' => 'colorscheme_backgroundcolor', 'type' => 'colorpicker', 'desc' => commonsbooking_sanitizeHTML( __( 'The color used for the background of tables and similar elements', 'commonsbooking' ) ), @@ -611,21 +611,21 @@ ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Notice Background Color', 'commonsbooking' ) ), + 'name' => __( 'Notice Background Color', 'commonsbooking' ), 'id' => 'colorscheme_noticebackgroundcolor', 'type' => 'colorpicker', 'desc' => commonsbooking_sanitizeHTML( __( 'The color used for the background of notices', 'commonsbooking' ) ), 'default' => '#FFF9C5', ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Light text color', 'commonsbooking' ) ), + 'name' => __( 'Light text color', 'commonsbooking' ), 'id' => 'colorscheme_lighttext', 'type' => 'colorpicker', 'desc' => commonsbooking_sanitizeHTML( __( 'The color used for light text on dark backgrounds', 'commonsbooking' ) ), 'default' => '#a0a0a0', ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Dark text color', 'commonsbooking' ) ), + 'name' => __( 'Dark text color', 'commonsbooking' ), 'id' => 'colorscheme_darktext', 'type' => 'colorpicker', 'desc' => commonsbooking_sanitizeHTML( __( 'The color used for dark text on light backgrounds', 'commonsbooking' ) ), @@ -641,12 +641,12 @@ /* Tab: restrictions start*/ 'restrictions' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Restrictions', 'commonsbooking' ) ), + 'title' => __( 'Restrictions', 'commonsbooking' ), 'id' => 'restrictions', 'field_groups' => array( /* field group email templates start */ 'emailtemplates' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Manage Item Restriction Templates', 'commonsbooking' ) ), + 'title' => __( 'Manage Item Restriction Templates', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( sprintf( __( 'Templates for restriction emails.
    %1$sMore Information in the documentation%2$s', 'commonsbooking' ), @@ -657,14 +657,14 @@ 'id' => 'restricition-templates', 'fields' => array( array( - 'name' => commonsbooking_sanitizeHTML( __( 'Mail-Header from E-Mail', 'commonsbooking' ) ), + 'name' => __( 'Mail-Header from E-Mail', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( __( 'E-Mail that will be shown as sender in generated emails', 'commonsbooking' ) ), 'id' => 'restrictions-from-email', 'type' => 'text', 'default' => get_option( 'admin_email' ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Mail-Header from Name', 'commonsbooking' ) ), + 'name' => __( 'Mail-Header from Name', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( __( 'Name that will be shown as sender in generated emails', 'commonsbooking' ) ), 'id' => 'restrictions-from-name', 'type' => 'text', @@ -673,13 +673,13 @@ // E-Mail repair array( - 'name' => commonsbooking_sanitizeHTML( __( 'Breakdown email subject', 'commonsbooking' ) ), + 'name' => __( 'Breakdown email subject', 'commonsbooking' ), 'id' => 'restrictions-repair-subject', 'type' => 'text', - 'default' => commonsbooking_sanitizeHTML( __( 'Breakdown of {{item:post_title}} for your booking {{booking:formattedBookingDate}}', 'commonsbooking' ) ), + 'default' => __( 'Breakdown of {{item:post_title}} for your booking {{booking:formattedBookingDate}}', 'commonsbooking' ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Breakdown email body', 'commonsbooking' ) ), + 'name' => __( 'Breakdown email body', 'commonsbooking' ), 'id' => 'restrictions-repair-body', 'type' => 'textarea', 'default' => commonsbooking_sanitizeHTML( @@ -704,13 +704,13 @@ // E-Mail hint array( - 'name' => commonsbooking_sanitizeHTML( __( 'Usage restriction email subject', 'commonsbooking' ) ), + 'name' => __( 'Usage restriction email subject', 'commonsbooking' ), 'id' => 'restrictions-hint-subject', 'type' => 'text', - 'default' => commonsbooking_sanitizeHTML( __( 'Restriction of use for {{item:post_title}} for your booking {{booking:formattedBookingDate}}', 'commonsbooking' ) ), + 'default' => __( 'Restriction of use for {{item:post_title}} for your booking {{booking:formattedBookingDate}}', 'commonsbooking' ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Restriction email body', 'commonsbooking' ) ), + 'name' => __( 'Restriction email body', 'commonsbooking' ), 'id' => 'restrictions-hint-body', 'type' => 'textarea', 'default' => commonsbooking_sanitizeHTML( @@ -741,13 +741,13 @@ // E-Mail restriction cancellation array( - 'name' => commonsbooking_sanitizeHTML( __( 'Restriction cancelled subject', 'commonsbooking' ) ), + 'name' => __( 'Restriction cancelled subject', 'commonsbooking' ), 'id' => 'restrictions-restriction-cancelled-subject', 'type' => 'text', - 'default' => commonsbooking_sanitizeHTML( __( 'Restriction for article {{item:post_title}} no longer exists', 'commonsbooking' ) ), + 'default' => __( 'Restriction for article {{item:post_title}} no longer exists', 'commonsbooking' ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Restriction cancelled email body', 'commonsbooking' ) ), + 'name' => __( 'Restriction cancelled email body', 'commonsbooking' ), 'id' => 'restrictions-restriction-cancelled-body', 'type' => 'textarea', 'default' => commonsbooking_sanitizeHTML( @@ -768,7 +768,7 @@ ), /* field group restriction settings start */ 'restrictionsettings' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Restriction settings', 'commonsbooking' ) ), + 'title' => __( 'Restriction settings', 'commonsbooking' ), 'id' => 'restrictionsettings', 'desc' => commonsbooking_sanitizeHTML( sprintf( @@ -779,7 +779,7 @@ ), 'fields' => array( array( - 'name' => commonsbooking_sanitizeHTML( __( 'Do not cancel bookings on total breakdown', 'commonsbooking' ) ), + 'name' => __( 'Do not cancel bookings on total breakdown', 'commonsbooking' ), 'id' => 'restrictions-no-cancel-on-total-breakdown', 'type' => 'checkbox', 'desc' => commonsbooking_sanitizeHTML( __( 'If checked, bookings will not be cancelled if the item has broken down. The user will be notified and once the item becomes available again, the old bookings are still valid.', 'commonsbooking' ) ), @@ -788,12 +788,12 @@ ), /* field group restriction settings end */ 'bookingRules' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Restrict bookings by booking rules', 'commonsbooking' ) ), + 'title' => __( 'Restrict bookings by booking rules', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( __( 'You can apply rules to individual items or categories of items/locations, which will restrict how users are able to book and, if violated, abort the booking process', 'commonsbooking' ) ), 'id' => 'bookingrules', 'fields' => array( array( - 'name' => commonsbooking_sanitizeHTML( __( 'Count cancelled bookings towards quota', 'commonsbooking' ) ), + 'name' => __( 'Count cancelled bookings towards quota', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( sprintf( __( 'Check if bookings that have been cancelled in the booking period shall be counted towards the amount of booked days for the user. %1$sMore info in the documentation%2$s', 'commonsbooking' ), @@ -809,13 +809,13 @@ 'type' => 'group', 'repeatable' => true, 'options' => array( - 'group_title' => commonsbooking_sanitizeHTML( __( 'Rule ', 'commonsbooking' ) ) . '{#}', + 'group_title' => __( 'Rule ', 'commonsbooking' ) . '{#}', 'add_button' => commonsbooking_sanitizeHTML( __( 'Add another rule', 'commonsbooking' ) ), 'remove_button' => commonsbooking_sanitizeHTML( __( 'Remove rule', 'commonsbooking' ) ), ), 'fields' => array( array( - 'name' => commonsbooking_sanitizeHTML( __( 'Rule type', 'commonsbooking' ) ), + 'name' => __( 'Rule type', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( __( 'Select the kind of rule', 'commonsbooking' ) ), 'id' => 'rule-type', 'type' => 'select', @@ -826,37 +826,37 @@ ), // The following labels are not translated because they are replaced by the rule array( - 'name' => commonsbooking_sanitizeHTML( __( 'Rule description', 'commonsbooking' ) ), + 'name' => __( 'Rule description', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( 'You shall be replaced' ), 'id' => 'rule-description', 'type' => 'title', ), array( - 'name' => commonsbooking_sanitizeHTML( 'Parameter 1' ), + 'name' => 'Parameter 1', 'desc' => 'Parameter description', 'id' => 'rule-param1', 'type' => 'text_small', ), array( - 'name' => commonsbooking_sanitizeHTML( 'Parameter 2' ), + 'name' => 'Parameter 2', 'desc' => 'Parameter description', 'id' => 'rule-param2', 'type' => 'text_small', ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Select an option', 'commonsbooking' ) ), + 'name' => __( 'Select an option', 'commonsbooking' ), 'desc' => 'Select parameter description', 'id' => 'rule-select-param', 'type' => 'select', ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Applies to all', 'commonsbooking' ) ), + 'name' => __( 'Applies to all', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( __( 'Check if this rule applies to all items', 'commonsbooking' ) ), 'id' => 'rule-applies-all', 'type' => 'checkbox', ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Applies to categories', 'commonsbooking' ) ), + 'name' => __( 'Applies to categories', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( __( 'Check the categories that these rules apply to', 'commonsbooking' ) ), 'id' => 'rule-applies-categories', 'type' => 'multicheck', @@ -868,7 +868,7 @@ ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Groups exempt from rule', 'commonsbooking' ) ), + 'name' => __( 'Groups exempt from rule', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( __( 'Here you can define if the rule should not apply to a specific user group. Will apply to all groups if left empty (Administrators and item / location admins are always excluded).', 'commonsbooking' ) ), 'id' => 'rule-exempt-roles', 'type' => 'pw_multiselect', @@ -888,13 +888,13 @@ /* Tab: reminder start*/ 'reminder' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Reminder', 'commonsbooking' ) ), + 'title' => __( 'Reminder', 'commonsbooking' ), 'id' => 'reminder', 'field_groups' => array( /* field group pre booking reminder */ 'pre-booking-reminder' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Booking reminder', 'commonsbooking' ) ), + 'title' => __( 'Booking reminder', 'commonsbooking' ), 'id' => 'pre-booking-reminder', 'desc' => commonsbooking_sanitizeHTML( sprintf( @@ -915,13 +915,13 @@ ), // E-Mail pre booking reminder array( - 'name' => commonsbooking_sanitizeHTML( __( 'E-mail subject', 'commonsbooking' ) ), + 'name' => __( 'E-mail subject', 'commonsbooking' ), 'id' => 'pre-booking-reminder-subject', 'type' => 'text', - 'default' => commonsbooking_sanitizeHTML( __( 'Upcoming booking of {{item:post_title}} {{booking:formattedBookingDate}}', 'commonsbooking' ) ), + 'default' => __( 'Upcoming booking of {{item:post_title}} {{booking:formattedBookingDate}}', 'commonsbooking' ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'email body', 'commonsbooking' ) ), + 'name' => __( 'email body', 'commonsbooking' ), 'id' => 'pre-booking-reminder-body', 'type' => 'textarea', 'default' => commonsbooking_sanitizeHTML( @@ -943,7 +943,7 @@ // settings pre booking reminder -- min days array( - 'name' => commonsbooking_sanitizeHTML( __( 'Sent reminder x days before booking start', 'commonsbooking' ) ), + 'name' => __( 'Sent reminder x days before booking start', 'commonsbooking' ), 'id' => 'pre-booking-days-before', 'desc' => '

    ' . commonsbooking_sanitizeHTML( __( @@ -1008,7 +1008,7 @@ /* field group post booking notice */ 'post-booking-notice' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'email after booking has ended', 'commonsbooking' ) ), + 'title' => __( 'email after booking has ended', 'commonsbooking' ), 'id' => 'post-booking-notice', 'desc' => commonsbooking_sanitizeHTML( __( @@ -1026,13 +1026,13 @@ ), // E-Mail post booking reminder array( - 'name' => commonsbooking_sanitizeHTML( __( 'E-mail subject', 'commonsbooking' ) ), + 'name' => __( 'E-mail subject', 'commonsbooking' ), 'id' => 'post-booking-notice-subject', 'type' => 'text', - 'default' => commonsbooking_sanitizeHTML( __( 'Your booking of {{item:post_title}} {{booking:formattedBookingDate}} has ended', 'commonsbooking' ) ), + 'default' => __( 'Your booking of {{item:post_title}} {{booking:formattedBookingDate}} has ended', 'commonsbooking' ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'email body', 'commonsbooking' ) ), + 'name' => __( 'email body', 'commonsbooking' ), 'id' => 'post-booking-notice-body', 'type' => 'textarea', 'default' => commonsbooking_sanitizeHTML( @@ -1053,7 +1053,7 @@ /* field group booking start reminder for locations */ 'booking-start-location-reminder' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Reminder for locations before booking starts', 'commonsbooking' ) ), + 'title' => __( 'Reminder for locations before booking starts', 'commonsbooking' ), 'id' => 'booking-start-location-reminder', 'desc' => commonsbooking_sanitizeHTML( sprintf( @@ -1075,13 +1075,13 @@ ), // E-Mail booking start reminder for locations array( - 'name' => commonsbooking_sanitizeHTML( __( 'E-mail subject', 'commonsbooking' ) ), + 'name' => __( 'E-mail subject', 'commonsbooking' ), 'id' => 'booking-start-location-reminder-subject', 'type' => 'text', - 'default' => commonsbooking_sanitizeHTML( __( 'Upcoming booking of {{item:post_title}} {{booking:formattedBookingDate}}', 'commonsbooking' ) ), + 'default' => __( 'Upcoming booking of {{item:post_title}} {{booking:formattedBookingDate}}', 'commonsbooking' ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'email body', 'commonsbooking' ) ), + 'name' => __( 'email body', 'commonsbooking' ), 'id' => 'booking-start-location-reminder-body', 'type' => 'textarea', 'default' => commonsbooking_sanitizeHTML( @@ -1140,7 +1140,7 @@ /* field group booking end reminder for locations */ 'booking-end-location-reminder' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Reminder for locations before booking ends', 'commonsbooking' ) ), + 'title' => __( 'Reminder for locations before booking ends', 'commonsbooking' ), 'id' => 'booking-end-location-reminder', 'desc' => commonsbooking_sanitizeHTML( sprintf( @@ -1162,13 +1162,13 @@ ), // E-Mail booking end reminder for locations array( - 'name' => commonsbooking_sanitizeHTML( __( 'E-mail subject', 'commonsbooking' ) ), + 'name' => __( 'E-mail subject', 'commonsbooking' ), 'id' => 'booking-end-location-reminder-subject', 'type' => 'text', - 'default' => commonsbooking_sanitizeHTML( __( 'Booking of {{item:post_title}} {{booking:formattedBookingDate}}', 'commonsbooking' ) ), + 'default' => __( 'Booking of {{item:post_title}} {{booking:formattedBookingDate}}', 'commonsbooking' ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'email body', 'commonsbooking' ) ), + 'name' => __( 'email body', 'commonsbooking' ), 'id' => 'booking-end-location-reminder-body', 'type' => 'textarea', 'default' => commonsbooking_sanitizeHTML( @@ -1242,7 +1242,7 @@ 'desc' => commonsbooking_sanitizeHTML( __( 'Click here to finish the upgrade to the latest version.
    This needs to be done after updating the plugin to a new version.
    If you do not do this, the plugin may not work correctly.', 'commonsbooking' ) ), 'fields' => [ array( - 'name' => commonsbooking_sanitizeHTML( __( 'Finish upgrade', 'commonsbooking' ) ), + 'name' => __( 'Finish upgrade', 'commonsbooking' ), 'id' => 'upgrade-custom-field', 'type' => 'text', 'render_row_cb' => array( Migration::class, 'renderUpgradeForm' ), @@ -1262,7 +1262,7 @@ ), 'fields' => [ array( - 'name' => commonsbooking_sanitizeHTML( __( 'Start Migration', 'commonsbooking' ) ), + 'name' => __( 'Start Migration', 'commonsbooking' ), 'id' => 'migration-custom-field', 'type' => 'text', 'render_row_cb' => array( Migration::class, 'renderMigrationForm' ), @@ -1273,7 +1273,7 @@ // cb1 user fields 'cb1-user-fields' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'CommonsBooking Version 0.X profile fields', 'commonsbooking' ) ), + 'title' => __( 'CommonsBooking Version 0.X profile fields', 'commonsbooking' ), 'id' => 'cb1-user-fields', 'desc' => commonsbooking_sanitizeHTML( __( 'Enable the following legacy CommonsBooking Version 0.X user profile fields:', 'commonsbooking' ) ) . '
    first_name, last_name, phone, address, terms_accepted ', 'fields' => [ @@ -1297,7 +1297,7 @@ 'desc' => commonsbooking_sanitizeHTML( __( 'Migrate bookings to new format so that they are listed at bookings menu item.
    This function is only for special cases during migration. Please use it only in case of problems with migration.', 'commonsbooking' ) ), 'fields' => [ array( - 'name' => commonsbooking_sanitizeHTML( __( 'Migrate bookings', 'commonsbooking' ) ), + 'name' => __( 'Migrate bookings', 'commonsbooking' ), 'id' => 'booking-migration-custom-field', 'type' => 'text', 'render_row_cb' => array( Migration::class, 'renderBookingMigrationForm' ), @@ -1325,7 +1325,7 @@ 'options' => Timeframe::getTypes( true ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Location-Fields', 'commonsbooking' ) ), + 'name' => __( 'Location-Fields', 'commonsbooking' ), 'desc' => sprintf( // translators: %s formatted meta field as an var_dump-like assoc array string commonsbooking_sanitizeHTML( __( 'Just add field names, no matter if its a post- or a meta-field. Comma separated list. Beside the standard post fields and standard postmeta-fields, the following custom meta fields are available. Copy only the values in [] in the field without the brackets. %s', 'commonsbooking' ) ), @@ -1335,7 +1335,7 @@ 'type' => 'text', ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Item-Fields', 'commonsbooking' ) ), + 'name' => __( 'Item-Fields', 'commonsbooking' ), 'desc' => sprintf( // translators: %s formatted meta field as an var_dump-like assoc array string commonsbooking_sanitizeHTML( __( 'Just add field names, no matter if its a post- or a meta-field. Comma separated list. Beside the standard post fields and standard postmeta-fields, the following custom meta fields are available. Copy only the values in [] in the field without the brackets. %s', 'commonsbooking' ) ), @@ -1345,7 +1345,7 @@ 'type' => 'text', ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'User-Fields', 'commonsbooking' ) ), + 'name' => __( 'User-Fields', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( __( 'Just add field names, no matter if its a userfield or a meta-field. Comma separated list.', 'commonsbooking' ) ), 'id' => TimeframeExport::USER_FIELD, 'type' => 'text', @@ -1370,7 +1370,7 @@ ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Export', 'commonsbooking' ) ), + 'name' => __( 'Export', 'commonsbooking' ), 'id' => 'export-custom-field', 'type' => 'text', 'render_row_cb' => array( TimeframeExport::class, 'renderExportButton' ), @@ -1407,7 +1407,7 @@ ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Filepath', 'commonsbooking' ) ), + 'name' => __( 'Filepath', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( __( 'Absolute path on your webserver (including trailing slash) where export file will be saved to.', 'commonsbooking' ) ), 'id' => 'export-filepath', 'type' => 'text', @@ -1466,7 +1466,7 @@ 'type' => 'group', 'repeatable' => true, 'options' => array( - 'group_title' => commonsbooking_sanitizeHTML( __( 'API', 'commonsbooking' ) ) . '{#}', + 'group_title' => __( 'API', 'commonsbooking' ) . '{#}', 'add_button' => commonsbooking_sanitizeHTML( __( 'Add Another API', 'commonsbooking' ) ), 'remove_button' => commonsbooking_sanitizeHTML( __( 'Remove API', 'commonsbooking' ) ), 'closed' => false, // Repeater fields closed by default - neat & compact. @@ -1565,7 +1565,7 @@ array( 'name' => esc_html__( 'Event title', 'commonsbooking' ), 'desc' => esc_html__( 'This is the event title that will be given to bookings that do not belong to the current user. This is what the CB-Manager will see when they subscribe to the station calendar. You can use template tags here as well', 'commonsbooking' ), - 'default' => commonsbooking_sanitizeHTML( '{{item:post_title}} @ {{user:first_name}} {{user:last_name}}' ), + 'default' => '{{item:post_title}} @ {{user:first_name}} {{user:last_name}}', 'id' => 'event_title', 'type' => 'text', ), @@ -1588,39 +1588,39 @@ ], ), 'experimental' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Advanced caching settings', 'commonsbooking' ) ), + 'title' => __( 'Advanced caching settings', 'commonsbooking' ), 'id' => 'caching_group', 'desc' => commonsbooking_sanitizeHTML( __( 'Allows you to change options regarding the caching system', 'commonsbooking' ) ), 'fields' => array( array( - 'name' => commonsbooking_sanitizeHTML( __( 'Clear Cache', 'commonsbooking' ) ), + 'name' => __( 'Clear Cache', 'commonsbooking' ), 'id' => 'commonsbooking-clear_cache-button', 'type' => 'text', 'render_row_cb' => array( \CommonsBooking\Plugin::class, 'renderClearCacheButton' ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Cache Adapter', 'commonsbooking' ) ), + 'name' => __( 'Cache Adapter', 'commonsbooking' ), 'id' => 'cache_adapter', 'type' => 'select', 'options' => \CommonsBooking\Plugin::getAdapters( true ), 'default' => 'filesystem', ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Location of cache', 'commonsbooking' ) ), + 'name' => __( 'Location of cache', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( __( 'The location of the cache. A directory for the filesystem cache, a REDIS DSN, ...', 'commonsbooking' ) ), 'id' => 'cache_location', 'type' => 'text', 'default' => sys_get_temp_dir() . \DIRECTORY_SEPARATOR . 'symfony-cache', ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Current connection status', 'commonsbooking' ) ), + 'name' => __( 'Current connection status', 'commonsbooking' ), 'id' => 'cache_status', 'type' => 'text', 'render_row_cb' => array( \CommonsBooking\Plugin::class, 'renderCacheStatus' ), ), array( - 'name' => commonsbooking_sanitizeHTML( __( 'Periodical warmup through cronjob', 'commonsbooking' ) ), + 'name' => __( 'Periodical warmup through cronjob', 'commonsbooking' ), 'desc' => commonsbooking_sanitizeHTML( __( 'Will periodically warm up the cache through a cronjob. This can be useful, when you have a lot of timeframes / bookings but your site is rarely accessed.
    You NEED to hook WP-Cron Into the System Task Scheduler for this to have any positive effect. You probably don\'t want this. ', 'commonsbooking' ) ), 'id' => 'warmup_cron', 'show_option_none' => true, diff --git a/src/CB/CB1UserFields.php b/src/CB/CB1UserFields.php index ab13df649..8bc4790af 100644 --- a/src/CB/CB1UserFields.php +++ b/src/CB/CB1UserFields.php @@ -66,38 +66,38 @@ public function __construct() { $this->extra_profile_fields = array( 'first_name' => array( 'field_name' => 'first_name', - 'title' => commonsbooking_sanitizeHTML( __( 'First Name', 'commonsbooking' ) ), + 'title' => __( 'First Name', 'commonsbooking' ), 'type' => 'input', 'description' => '', - 'errormessage' => commonsbooking_sanitizeHTML( __( 'Please enter your first name', 'commonsbooking' ) ), + 'errormessage' => __( 'Please enter your first name', 'commonsbooking' ), ), 'last_name' => array( 'field_name' => 'last_name', - 'title' => commonsbooking_sanitizeHTML( __( 'Last Name', 'commonsbooking' ) ), + 'title' => __( 'Last Name', 'commonsbooking' ), 'type' => 'input', 'description' => '', - 'errormessage' => commonsbooking_sanitizeHTML( __( 'Please enter your last name', 'commonsbooking' ) ), + 'errormessage' => __( 'Please enter your last name', 'commonsbooking' ), ), 'phone' => array( 'field_name' => 'phone', - 'title' => commonsbooking_sanitizeHTML( __( 'Phone Number', 'commonsbooking' ) ), + 'title' => __( 'Phone Number', 'commonsbooking' ), 'type' => 'input', 'description' => '', - 'errormessage' => commonsbooking_sanitizeHTML( __( 'Please enter your phone number', 'commonsbooking' ) ), + 'errormessage' => __( 'Please enter your phone number', 'commonsbooking' ), ), 'address' => array( 'field_name' => 'address', - 'title' => commonsbooking_sanitizeHTML( __( 'Address', 'commonsbooking' ) ), + 'title' => __( 'Address', 'commonsbooking' ), 'type' => 'input', 'description' => '', - 'errormessage' => commonsbooking_sanitizeHTML( __( 'Please enter your address', 'commonsbooking' ) ), + 'errormessage' => __( 'Please enter your address', 'commonsbooking' ), ), 'terms_accepted' => array( - 'title' => commonsbooking_sanitizeHTML( __( 'Terms and Conditions', 'commonsbooking' ) ), + 'title' => __( 'Terms and Conditions', 'commonsbooking' ), 'field_name' => 'terms_accepted', 'type' => 'checkbox', - 'description' => commonsbooking_sanitizeHTML( __( 'I accept the terms & conditions', 'commonsbooking' ) ), - 'errormessage' => commonsbooking_sanitizeHTML( __( 'Please accept the terms & conditions', 'commonsbooking' ) ), + 'description' => __( 'I accept the terms & conditions', 'commonsbooking' ), + 'errormessage' => __( 'Please accept the terms & conditions', 'commonsbooking' ), ), ); @@ -183,11 +183,9 @@ public function registration_add_fields() { */ public function get_termsservices_string(): string { if ( ! empty( $this->termsservices_url ) ) { - // translators: %s = terms and service url - $string = sprintf( - commonsbooking_sanitizeHTML( __( '
    Read the terms and services', 'commonsbooking' ) ), - commonsbooking_sanitizeHTML( $this->termsservices_url ) - ); + $string = '' + . esc_html__( 'Read the terms and services', 'commonsbooking' ) + . ''; } else { $string = ''; } diff --git a/src/Wordpress/Widget/UserWidget.php b/src/Wordpress/Widget/UserWidget.php index 7dcaafe0a..148fb0f35 100644 --- a/src/Wordpress/Widget/UserWidget.php +++ b/src/Wordpress/Widget/UserWidget.php @@ -79,23 +79,18 @@ public function renderWidgetContent() { $loginname = $current_user->user_email; } - // translators: $s = user first name or email - $content .= sprintf( __( 'Welcome %s', 'commonsbooking' ), $loginname ); - $content .= '