-
+
'',
- 'today' => __( 'Today', WE_LS_SLUG ),
- 'last-7' => __( 'Last 7 Days', WE_LS_SLUG ),
- 'last-31' => __( 'Last 31 Days', WE_LS_SLUG ),
- 'custom' => __( 'Custom date range', WE_LS_SLUG )
+ 'today' => esc_html__( 'Today', WE_LS_SLUG ),
+ 'last-7' => esc_html__( 'Last 7 Days', WE_LS_SLUG ),
+ 'last-31' => esc_html__( 'Last 31 Days', WE_LS_SLUG ),
+ 'custom' => esc_html__( 'Custom date range', WE_LS_SLUG )
];
}
@@ -205,10 +205,10 @@ function ws_ls_export_column_names( $export_criteria ) {
'user_nicename' => 'Nicename',
'date-display' => 'Date',
'weight' => ws_ls_settings_weight_unit_readable(),
- 'difference_from_start_display' => __( 'Difference from start', WE_LS_SLUG ),
- 'bmi' => __( 'BMI', WE_LS_SLUG ),
- 'bmi-readable' => __( 'BMI Label', WE_LS_SLUG ),
- 'weight_notes' => __( 'Notes', WE_LS_SLUG )
+ 'difference_from_start_display' => esc_html__( 'Difference from start', WE_LS_SLUG ),
+ 'bmi' => esc_html__( 'BMI', WE_LS_SLUG ),
+ 'bmi-readable' => esc_html__( 'BMI Label', WE_LS_SLUG ),
+ 'weight_notes' => esc_html__( 'Notes', WE_LS_SLUG )
];
$options = ( false === empty( $export_criteria[ 'options' ] ) ) ? $export_criteria[ 'options' ] : NULL;
diff --git a/pro-features/export/hooks.php b/pro-features/export/hooks.php
index e2f2e3a2..6ded9ad9 100644
--- a/pro-features/export/hooks.php
+++ b/pro-features/export/hooks.php
@@ -7,7 +7,7 @@
*/
function ws_ls_export_admin_menu() {
- add_submenu_page( 'ws-ls-data-home', __( 'Export Data', WE_LS_SLUG ), __( 'Export Data', WE_LS_SLUG ), ws_ls_permission_export_delete_role(), 'ws-ls-export-data', 'ws_ls_export_admin_page', 5 );
+ add_submenu_page( 'ws-ls-data-home', esc_html__( 'Export Data', WE_LS_SLUG ), esc_html__( 'Export Data', WE_LS_SLUG ), ws_ls_permission_export_delete_role(), 'ws-ls-export-data', 'ws_ls_export_admin_page', 5 );
}
add_action( 'admin_menu', 'ws_ls_export_admin_menu' );
@@ -26,13 +26,13 @@ function ws_ls_export_ajax_process() {
$id = ws_ls_post_value( 'id' );
if ( true === empty( $id ) ) {
- ws_ls_export_ajax_error( $return, __( 'Export ID could not be determined.' , WE_LS_SLUG ) );
+ ws_ls_export_ajax_error( $return, esc_html__( 'Export ID could not be determined.' , WE_LS_SLUG ) );
}
$export = ws_ls_db_export_criteria_get( $id );
if ( true === empty( $export ) ) {
- ws_ls_export_ajax_error( $return, __( 'Export criteria could not be loaded.' , WE_LS_SLUG ) );
+ ws_ls_export_ajax_error( $return, esc_html__( 'Export criteria could not be loaded.' , WE_LS_SLUG ) );
}
$current_step = (int) $export[ 'step' ];
@@ -43,7 +43,7 @@ function ws_ls_export_ajax_process() {
if ( 0 === $current_step ) {
ws_ls_db_export_identify_weight_entries( $id );
- $return[ 'message' ] = __( 'Initialising: Rows have been identified for the export.', WE_LS_SLUG );
+ $return[ 'message' ] = esc_html__( 'Initialising: Rows have been identified for the export.', WE_LS_SLUG );
$return[ 'percentage' ] = 40;
ws_ls_db_export_criteria_step( $id, 1 );
@@ -55,16 +55,16 @@ function ws_ls_export_ajax_process() {
$physical_path = ws_ls_export_file_physical_folder( $id );
if ( false === wp_mkdir_p( $physical_path ) ) {
- ws_ls_export_ajax_error( $return, __( 'There was an issue creating the export folder: ' , WE_LS_SLUG ) . $physical_path );
+ ws_ls_export_ajax_error( $return, esc_html__( 'There was an issue creating the export folder: ' , WE_LS_SLUG ) . $physical_path );
}
$physical_path_to_file = ws_ls_export_file_physical_path( $id );
if ( false === touch( $physical_path_to_file ) ) {
- ws_ls_export_ajax_error( $return, __( 'There was an issue creating the export file: ' , WE_LS_SLUG ) . $physical_path_to_file );
+ ws_ls_export_ajax_error( $return, esc_html__( 'There was an issue creating the export file: ' , WE_LS_SLUG ) . $physical_path_to_file );
}
- $return[ 'message' ] = __( 'Initialising: created empty file on disk.', WE_LS_SLUG );
+ $return[ 'message' ] = esc_html__( 'Initialising: created empty file on disk.', WE_LS_SLUG );
$return[ 'percentage' ] = 70;
ws_ls_db_export_criteria_step( $id, 2 );
@@ -78,7 +78,7 @@ function ws_ls_export_ajax_process() {
ws_ls_db_export_criteria_count( $id, $number_of_records );
- $return['message'] = sprintf( 'Initialising: %d %s', $number_of_records, __( 'records have been identified for this report.', WE_LS_SLUG ) );
+ $return['message'] = sprintf( 'Initialising: %d %s', $number_of_records, esc_html__( 'records have been identified for this report.', WE_LS_SLUG ) );
$return['percentage'] = 100;
ws_ls_db_export_criteria_step( $id, 20 );
@@ -94,7 +94,7 @@ function ws_ls_export_ajax_process() {
// There are no more rows to process
if ( true === empty( $rows_to_process ) ) {
- $return['message'] = __( 'Preparing data: Complete.', WE_LS_SLUG );
+ $return['message'] = esc_html__( 'Preparing data: Complete.', WE_LS_SLUG );
$return['percentage'] = 100;
ws_ls_db_export_criteria_step( $id, 40 );
@@ -104,7 +104,7 @@ function ws_ls_export_ajax_process() {
foreach ( $rows_to_process as $row ) {
if ( false === ws_ls_export_update_export_row( $export, $row ) ) {
- ws_ls_export_ajax_error( $return, __( 'There was an error processing weight entry', WE_LS_SLUG ) . ': ' . $row['entry_id'] );
+ ws_ls_export_ajax_error( $return, esc_html__( 'There was an error processing weight entry', WE_LS_SLUG ) . ': ' . $row['entry_id'] );
}
}
@@ -140,7 +140,7 @@ function ws_ls_export_ajax_process() {
}
ws_ls_db_export_criteria_step( $id, 42 );
- $return['message'] = __( 'Saving to disk: Column headers', WE_LS_SLUG );
+ $return['message'] = esc_html__( 'Saving to disk: Column headers', WE_LS_SLUG );
$return['percentage'] = 5;
// ------------------------------------------------------------------------------------------------------
@@ -152,7 +152,7 @@ function ws_ls_export_ajax_process() {
if ( true === empty( $rows_to_write ) ) {
- $return['message'] = __( 'Saving to disk: Complete.', WE_LS_SLUG );
+ $return['message'] = esc_html__( 'Saving to disk: Complete.', WE_LS_SLUG );
$return['percentage'] = 100;
ws_ls_db_export_criteria_step( $id, 47 );
@@ -218,7 +218,7 @@ function ws_ls_export_ajax_process() {
ws_ls_db_export_criteria_step( $id, 100 );
- $return[ 'message' ] = sprintf( '
%s', ws_ls_export_file_url( $id ), __( 'Download', WE_LS_SLUG ) );
+ $return[ 'message' ] = sprintf( '
%s', ws_ls_export_file_url( $id ), esc_html__( 'Download', WE_LS_SLUG ) );
$return[ 'percentage' ] = 100;
$return[ 'continue' ] = false;
}
diff --git a/pro-features/feature-list.php b/pro-features/feature-list.php
index 62a0ae16..00d44daa 100755
--- a/pro-features/feature-list.php
+++ b/pro-features/feature-list.php
@@ -8,18 +8,18 @@
*/
function ws_ls_feature_list_pro_plus() {
return [
- __('
All of the features that come with a standard Pro license.', WE_LS_SLUG ),
- __( '
[wt-kiosk] - allowing your administrators and staff to search and edit a user\'s record on the front end of your website.' , WE_LS_SLUG ),
- __( '
Barcode scanner - Beta. Barcode scanner for scanning user IDs when using [wt-kiosk].' , WE_LS_SLUG ),
- __('
Basal Metabolic Rate (BMR) calculations per user. Shortcodes and extended admin screens to display a user\'s BMR. For further information on BMR and how it is calculated visit
our calculations page.', WE_LS_SLUG ),
- __('
Harris Benedict formula. Shortcodes and extended admin screens to a view a person\'s calorie intake required to maintain and lose weight. For further information on Harris Benedict Formula and how it is calculated visit
our calculations page.', WE_LS_SLUG ),
- __('
Recommended calorie intake per meal time. Shortcodes and extended admin screens to recommend how a person should split their daily calorie intake across meals. For further information on how this is calculated please visit
our calculations page.', WE_LS_SLUG ),
- __('
Macronutrients Calculator. Shortcodes and extended admin screens to recommend how their calorie consumption should be split into fats, carbohydrates and proteins. For further information on the Macronutrients Calculator and how these calculations are performed please visit
our calculations page.', WE_LS_SLUG ),
- __('
Additional user preference fields. Additional user preference fields and shortcodes to display them: Activity Level, Date of Birth and Gender.', WE_LS_SLUG ),
- __('
Awards. Awards and Badges! Set awards for: BMI Change, BMI Equals, Weight Gain / Loss from start and Percentage of weight lost from start.', WE_LS_SLUG ),
- __('
Challenges. Set challenges for your user\'s within a given time period? Display Total Weight Lost, BMI Change, %Body Weight, Weight Tracker Streaks and Meal Tracker streaks achieved by each user in a league table. Besides viewing all your challenges and their data, the shortcode will allow you to display the league table in the public facing website.', WE_LS_SLUG ),
- __('
BMI CalculatorA quick tool to allow your users to enter their measurements/weight to calculate their BMI.', WE_LS_SLUG ),
- __('
Waist-to-Hip ratio CalculatorA quick tool to allow your users to enter their measurements to calculate their Waist-to-Hip ratio.', WE_LS_SLUG )
+ esc_html__('
All of the features that come with a standard Pro license.', WE_LS_SLUG ),
+ esc_html__( '
[wt-kiosk] - allowing your administrators and staff to search and edit a user\'s record on the front end of your website.' , WE_LS_SLUG ),
+ esc_html__( '
Barcode scanner - Beta. Barcode scanner for scanning user IDs when using [wt-kiosk].' , WE_LS_SLUG ),
+ esc_html__('
Basal Metabolic Rate (BMR) calculations per user. Shortcodes and extended admin screens to display a user\'s BMR. For further information on BMR and how it is calculated visit
our calculations page.', WE_LS_SLUG ),
+ esc_html__('
Harris Benedict formula. Shortcodes and extended admin screens to a view a person\'s calorie intake required to maintain and lose weight. For further information on Harris Benedict Formula and how it is calculated visit
our calculations page.', WE_LS_SLUG ),
+ esc_html__('
Recommended calorie intake per meal time. Shortcodes and extended admin screens to recommend how a person should split their daily calorie intake across meals. For further information on how this is calculated please visit
our calculations page.', WE_LS_SLUG ),
+ esc_html__('
Macronutrients Calculator. Shortcodes and extended admin screens to recommend how their calorie consumption should be split into fats, carbohydrates and proteins. For further information on the Macronutrients Calculator and how these calculations are performed please visit
our calculations page.', WE_LS_SLUG ),
+ esc_html__('
Additional user preference fields. Additional user preference fields and shortcodes to display them: Activity Level, Date of Birth and Gender.', WE_LS_SLUG ),
+ esc_html__('
Awards. Awards and Badges! Set awards for: BMI Change, BMI Equals, Weight Gain / Loss from start and Percentage of weight lost from start.', WE_LS_SLUG ),
+ esc_html__('
Challenges. Set challenges for your user\'s within a given time period? Display Total Weight Lost, BMI Change, %Body Weight, Weight Tracker Streaks and Meal Tracker streaks achieved by each user in a league table. Besides viewing all your challenges and their data, the shortcode will allow you to display the league table in the public facing website.', WE_LS_SLUG ),
+ esc_html__('
BMI CalculatorA quick tool to allow your users to enter their measurements/weight to calculate their BMI.', WE_LS_SLUG ),
+ esc_html__('
Waist-to-Hip ratio CalculatorA quick tool to allow your users to enter their measurements to calculate their Waist-to-Hip ratio.', WE_LS_SLUG )
];
}
@@ -29,33 +29,33 @@ function ws_ls_feature_list_pro_plus() {
*/
function ws_ls_feature_list_pro() {
return [
- __('
Access your user\'s data. Admin can view, edit and delete user data. Various tools for viewing user\'s graphs, tables of entries, BMI, targets, weight lost / gained stats and much more.', WE_LS_SLUG ),
- __('
Challenges. Create and display challenges for users over different time periods.', WE_LS_SLUG ),
- __('
Custom Fields. Create and add your own questions to weight entry forms to gather additional information.', WE_LS_SLUG ),
- __('
Photo Custom Fields. Add one or more photo fields to your weight entry forms and allow your users to upload photos of their progress. Photos can be viewed, updated and removed by the end user and administrators. Handy shortcodes are provided for displaying galleries, most recent and oldest photo.', WE_LS_SLUG ),
- __('
Export all data or a particular user. Export in JSON or CSV format.', WE_LS_SLUG ),
- __('
Webhooks, Zapier & Slack. Push weight entry data and targets to Slack channels, Zapier or your own custom Webhooks!', WE_LS_SLUG ),
- __('
Groups. Define user groups and assign your user\'s to them. View Weight Difference statistics for the group as a whole.', WE_LS_SLUG ),
- __('
Admin notes. Administrators have the ability to store notes against their users. If set to visible, the user can view these via [wt-notes] or receive emails with their content.', WE_LS_SLUG ),
- __('
Gamification. Support for myCred, a popular gamification plugin. Reward your users for weight entries and setting their targets.', WE_LS_SLUG ),
- __('
BMI. Allows a user to specify their height. Once specified, their BMI is displayed next to each weight entry. There is also a shortcode to render the latest BMI.', WE_LS_SLUG ),
- __('
Email notifications. Receive email notifications when a person updates their target or adds / edits a weight.', WE_LS_SLUG ),
- __('
Birthday Emails. Automatically send your user\'s a birthday email (when they have entered a date of birth)', WE_LS_SLUG ),
- __('
Overall user stats. Shortcodes that allow you to display the total lost / gained for the community and another to display a league table.', WE_LS_SLUG ),
- __('
Widgets. Widgets that allow you to display the graph and quick weight entry form within any widget area.', WE_LS_SLUG ),
- __('
Chart and form Shortcodes. That allow you to display the graph and quick weight entry form by placing a shortcode on any post or page.', WE_LS_SLUG ),
- __('
Progress Bar shortcode. A shortcode that visually displays the logged in user\'s progress towards their target', WE_LS_SLUG ),
- __('
Reminder shortcode. A shortcode that can be used to remind the user to enter their target or weight for today.', WE_LS_SLUG ),
- __('
Message shortcode A shortcode that allows you to congratulate a user when they lose weight x number of times. It also provides the opposite allowing you to provide encouragement when someone gains weight.', WE_LS_SLUG ),
- __('
Text Shortcodes. Additional shortcodes for earliest and most recent dates entered.', WE_LS_SLUG ),
- __('
Progress Bar shortcode / widget. Display a user\'s progress towards their weight target.', WE_LS_SLUG ),
- __('
Reminder shortcode. Display a reminder to enter their weight for the given day or enter a target.', WE_LS_SLUG ),
- __('
Admin: View / Delete user data. Admin will be able to view and delete existing user data.', WE_LS_SLUG ),
- __('
User preferences. If enabled, the user will be able to select which unit they wish to store their weight in Metric or Imperial. They will also be able to specify date format and clear all their weight data.', WE_LS_SLUG ),
- __('
Bar Charts. Fancy something different to a line chart? The plugin will also support Bar Charts.', WE_LS_SLUG ),
- __('
Decimals. Decimals will be allowed weight in Pounds only or Kg modes.', WE_LS_SLUG ),
- __('
Delete existing entry. A logged in user will be able to delete or edit an existing weight entry.', WE_LS_SLUG ),
- __('
Better Tables.. Data tables in front end and admin will support paging and sorting.', WE_LS_SLUG ),
- __('
Admin: Extra Settings. Extra settings to customise the plugin will be added e.g. number of plot points on graph, rows per page, etc.', WE_LS_SLUG )
+ esc_html__('
Access your user\'s data. Admin can view, edit and delete user data. Various tools for viewing user\'s graphs, tables of entries, BMI, targets, weight lost / gained stats and much more.', WE_LS_SLUG ),
+ esc_html__('
Challenges. Create and display challenges for users over different time periods.', WE_LS_SLUG ),
+ esc_html__('
Custom Fields. Create and add your own questions to weight entry forms to gather additional information.', WE_LS_SLUG ),
+ esc_html__('
Photo Custom Fields. Add one or more photo fields to your weight entry forms and allow your users to upload photos of their progress. Photos can be viewed, updated and removed by the end user and administrators. Handy shortcodes are provided for displaying galleries, most recent and oldest photo.', WE_LS_SLUG ),
+ esc_html__('
Export all data or a particular user. Export in JSON or CSV format.', WE_LS_SLUG ),
+ esc_html__('
Webhooks, Zapier & Slack. Push weight entry data and targets to Slack channels, Zapier or your own custom Webhooks!', WE_LS_SLUG ),
+ esc_html__('
Groups. Define user groups and assign your user\'s to them. View Weight Difference statistics for the group as a whole.', WE_LS_SLUG ),
+ esc_html__('
Admin notes. Administrators have the ability to store notes against their users. If set to visible, the user can view these via [wt-notes] or receive emails with their content.', WE_LS_SLUG ),
+ esc_html__('
Gamification. Support for myCred, a popular gamification plugin. Reward your users for weight entries and setting their targets.', WE_LS_SLUG ),
+ esc_html__('
BMI. Allows a user to specify their height. Once specified, their BMI is displayed next to each weight entry. There is also a shortcode to render the latest BMI.', WE_LS_SLUG ),
+ esc_html__('
Email notifications. Receive email notifications when a person updates their target or adds / edits a weight.', WE_LS_SLUG ),
+ esc_html__('
Birthday Emails. Automatically send your user\'s a birthday email (when they have entered a date of birth)', WE_LS_SLUG ),
+ esc_html__('
Overall user stats. Shortcodes that allow you to display the total lost / gained for the community and another to display a league table.', WE_LS_SLUG ),
+ esc_html__('
Widgets. Widgets that allow you to display the graph and quick weight entry form within any widget area.', WE_LS_SLUG ),
+ esc_html__('
Chart and form Shortcodes. That allow you to display the graph and quick weight entry form by placing a shortcode on any post or page.', WE_LS_SLUG ),
+ esc_html__('
Progress Bar shortcode. A shortcode that visually displays the logged in user\'s progress towards their target', WE_LS_SLUG ),
+ esc_html__('
Reminder shortcode. A shortcode that can be used to remind the user to enter their target or weight for today.', WE_LS_SLUG ),
+ esc_html__('
Message shortcode A shortcode that allows you to congratulate a user when they lose weight x number of times. It also provides the opposite allowing you to provide encouragement when someone gains weight.', WE_LS_SLUG ),
+ esc_html__('
Text Shortcodes. Additional shortcodes for earliest and most recent dates entered.', WE_LS_SLUG ),
+ esc_html__('
Progress Bar shortcode / widget. Display a user\'s progress towards their weight target.', WE_LS_SLUG ),
+ esc_html__('
Reminder shortcode. Display a reminder to enter their weight for the given day or enter a target.', WE_LS_SLUG ),
+ esc_html__('
Admin: View / Delete user data. Admin will be able to view and delete existing user data.', WE_LS_SLUG ),
+ esc_html__('
User preferences. If enabled, the user will be able to select which unit they wish to store their weight in Metric or Imperial. They will also be able to specify date format and clear all their weight data.', WE_LS_SLUG ),
+ esc_html__('
Bar Charts. Fancy something different to a line chart? The plugin will also support Bar Charts.', WE_LS_SLUG ),
+ esc_html__('
Decimals. Decimals will be allowed weight in Pounds only or Kg modes.', WE_LS_SLUG ),
+ esc_html__('
Delete existing entry. A logged in user will be able to delete or edit an existing weight entry.', WE_LS_SLUG ),
+ esc_html__('
Better Tables.. Data tables in front end and admin will support paging and sorting.', WE_LS_SLUG ),
+ esc_html__('
Admin: Extra Settings. Extra settings to customise the plugin will be added e.g. number of plot points on graph, rows per page, etc.', WE_LS_SLUG )
];
}
diff --git a/pro-features/footable.php b/pro-features/footable.php
index 8e3c2125..d973f8af 100755
--- a/pro-features/footable.php
+++ b/pro-features/footable.php
@@ -67,7 +67,7 @@ function ws_ls_data_table_render( $arguments = [] ) {
$html .= sprintf( '
< %s
',
ws_ls_wt_link_goto_tab( 'history' ),
- __( 'return to all entries', WE_LS_SLUG ) );
+ esc_html__( 'return to all entries', WE_LS_SLUG ) );
}
$html .= ws_ls_form_weight( [ 'entry-id' => $entry_id, 'redirect-url' => $redirect_url, 'weight-mandatory' => $arguments[ 'weight-mandatory' ],
@@ -124,13 +124,13 @@ function ws_ls_data_table_render( $arguments = [] ) {
esc_attr( $arguments[ 'custom-field-restrict-rows' ] ),
true === ws_ls_to_bool( $arguments[ 'uikit' ] ) ? 'true' : 'false',
true === ws_ls_to_bool( $arguments[ 'show-refresh-button' ] ) ?
- sprintf( '
', __( 'Data has changed, refresh screen', WE_LS_SLUG ) ) : '',
+ sprintf( '
', esc_html__( 'Data has changed, refresh screen', WE_LS_SLUG ) ) : '',
esc_attr( $arguments[ 'name' ] ),
esc_attr( $arguments[ 'table-id' ] )
);
if ( true === empty( $arguments[ 'user-id' ] ) ) {
- $html .= sprintf( '
%s
', __( 'Please note: For performance reasons, this table will only update every 5 minutes.', WE_LS_SLUG ) );
+ $html .= sprintf( '
%s
', esc_html__( 'Please note: For performance reasons, this table will only update every 5 minutes.', WE_LS_SLUG ) );
}
}
@@ -214,7 +214,7 @@ function ws_ls_datatable_rows( $arguments ) {
if ( true === empty( $entry[ 'kg' ] ) ) {
$gain_class = 'same';
- $gain_loss = __( 'No weight recorded', WE_LS_SLUG );
+ $gain_loss = esc_html__( 'No weight recorded', WE_LS_SLUG );
} elseif( false === empty( $previous_user_weight[ $entry[ 'user_id' ] ] ) ) {
if ( false === empty( $entry[ 'kg' ] ) ) {
@@ -227,16 +227,16 @@ function ws_ls_datatable_rows( $arguments ) {
$gain_class = 'loss';
} elseif ( $entry['kg'] == $previous_user_weight[ $entry[ 'user_id' ] ] ) {
$gain_class = 'same';
- $gain_loss = __( 'No Change', WE_LS_SLUG );
+ $gain_loss = esc_html__( 'No Change', WE_LS_SLUG );
}
$row[ 'previous-weight-diff' ] = $entry['kg'] - $previous_user_weight[ $entry[ 'user_id' ] ];
}
} elseif ( true === empty( $arguments[ 'user-id' ] )) {
- $gain_loss = $entry[ 'user_profile' ] = sprintf('
%s', ws_ls_get_link_to_user_profile( $entry[ 'user_id' ] ), __( 'Check record', WE_LS_SLUG ) );
+ $gain_loss = $entry[ 'user_profile' ] = sprintf('
%s', ws_ls_get_link_to_user_profile( $entry[ 'user_id' ] ), esc_html__( 'Check record', WE_LS_SLUG ) );
} elseif ( false === empty( $entry[ 'kg' ] ) ) {
- $gain_loss = __( 'First weight entry', WE_LS_SLUG );
+ $gain_loss = esc_html__( 'First weight entry', WE_LS_SLUG );
}
if ( false === empty( $entry[ 'kg' ] ) ) {
@@ -254,7 +254,7 @@ function ws_ls_datatable_rows( $arguments ) {
if ( true === empty( $entry[ 'kg' ] ) ) {
$gain_class = 'same';
- $gain_loss = __( 'No weight recorded', WE_LS_SLUG );
+ $gain_loss = esc_html__( 'No weight recorded', WE_LS_SLUG );
} elseif( false === empty( $start_weight ) ) {
$start_weight = (float) $start_weight;
@@ -271,14 +271,14 @@ function ws_ls_datatable_rows( $arguments ) {
$gain_class = 'loss';
} elseif ( $entry['kg'] == $start_weight ) {
$gain_class = 'same';
- $gain_loss = __( 'No Change', WE_LS_SLUG );
+ $gain_loss = esc_html__( 'No Change', WE_LS_SLUG );
}
}
} elseif ( true === empty( $arguments[ 'user-id' ] )) {
- $gain_loss = $entry[ 'user_profile' ] = sprintf('
%s', ws_ls_get_link_to_user_profile( $entry[ 'user_id' ] ), __( 'Check record', WE_LS_SLUG ) );
+ $gain_loss = $entry[ 'user_profile' ] = sprintf('
%s', ws_ls_get_link_to_user_profile( $entry[ 'user_id' ] ), esc_html__( 'Check record', WE_LS_SLUG ) );
} elseif ( false === empty( $entry[ 'kg' ] ) ) {
- $gain_loss = __( 'First weight entry', WE_LS_SLUG );
+ $gain_loss = esc_html__( 'First weight entry', WE_LS_SLUG );
}
if ( true === is_numeric( $gain_loss ) ) {
@@ -297,7 +297,7 @@ function ws_ls_datatable_rows( $arguments ) {
true === ws_ls_bmi_in_tables() ) {
if ( false === empty( $entry[ 'kg' ] ) ) {
- $row[ 'bmi' ] = [ 'value' => ws_ls_get_bmi_for_table( ws_ls_user_preferences_get( 'height', $entry[ 'user_id' ] ), $entry[ 'kg' ], __( 'No height', WE_LS_SLUG ), $arguments[ 'bmi-format'] ),
+ $row[ 'bmi' ] = [ 'value' => ws_ls_get_bmi_for_table( ws_ls_user_preferences_get( 'height', $entry[ 'user_id' ] ), $entry[ 'kg' ], esc_html__( 'No height', WE_LS_SLUG ), $arguments[ 'bmi-format'] ),
'options' => [ 'classes' => '' ]
];
} else {
@@ -399,19 +399,19 @@ function ws_ls_datatable_columns( $arguments = [] ) {
// If not front end, add nice name
if ( false === $arguments[ 'front-end' ] ) {
- $columns[] = [ 'name' => 'user_nicename', 'title' => __( 'User', WE_LS_SLUG ), 'breakpoints'=> '', 'type' => 'text' ];
+ $columns[] = [ 'name' => 'user_nicename', 'title' => esc_html__( 'User', WE_LS_SLUG ), 'breakpoints'=> '', 'type' => 'text' ];
} else {
// If in the front end, switch to smaller width (hide meta fields etc)
$arguments[ 'small-width' ] = $arguments[ 'front-end' ];
}
- $columns[] = [ 'name' => 'date', 'title' => __( 'Date', WE_LS_SLUG ), 'breakpoints'=> '', 'type' => 'date' ];
+ $columns[] = [ 'name' => 'date', 'title' => esc_html__( 'Date', WE_LS_SLUG ), 'breakpoints'=> '', 'type' => 'date' ];
if ( true === $arguments[ 'enable-weight' ] ) {
- $columns[] = [ 'name' => 'kg', 'title' => __( 'Weight', WE_LS_SLUG ), 'visible'=> true, 'type' => 'text' ];
+ $columns[] = [ 'name' => 'kg', 'title' => esc_html__( 'Weight', WE_LS_SLUG ), 'visible'=> true, 'type' => 'text' ];
if ( false === $arguments[ 'front-end' ] || true === WS_LS_IS_PRO ) {
- $columns[] = [ 'name' => 'gainloss', 'title' => ws_ls_tooltip('+/-', __( 'Difference', WE_LS_SLUG ) ), 'visible'=> true, 'breakpoints'=> 'xs', 'type' => 'text' ];
+ $columns[] = [ 'name' => 'gainloss', 'title' => ws_ls_tooltip('+/-', esc_html__( 'Difference', WE_LS_SLUG ) ), 'visible'=> true, 'breakpoints'=> 'xs', 'type' => 'text' ];
}
}
@@ -419,7 +419,7 @@ function ws_ls_datatable_columns( $arguments = [] ) {
if( true === $arguments[ 'enable-bmi' ] &&
true === ws_ls_bmi_in_tables() ) {
- $columns[] = [ 'name' => 'bmi', 'title' => ws_ls_tooltip( __( 'BMI', WE_LS_SLUG ), __( 'Body Mass Index', WE_LS_SLUG ) ), 'breakpoints'=> 'xs', 'type' => 'text' ];
+ $columns[] = [ 'name' => 'bmi', 'title' => ws_ls_tooltip( esc_html__( 'BMI', WE_LS_SLUG ), esc_html__( 'Body Mass Index', WE_LS_SLUG ) ), 'breakpoints'=> 'xs', 'type' => 'text' ];
}
if ( true === $arguments[ 'enable-meta' ] &&
@@ -456,7 +456,7 @@ function ws_ls_datatable_columns( $arguments = [] ) {
}
if ( true === $arguments[ 'enable-notes' ] ) {
- $columns[] = [ 'name' => 'notes', 'title' => __( 'Notes', WE_LS_SLUG ), 'breakpoints'=> 'lg', 'type' => 'text' ];
+ $columns[] = [ 'name' => 'notes', 'title' => esc_html__( 'Notes', WE_LS_SLUG ), 'breakpoints'=> 'lg', 'type' => 'text' ];
}
return apply_filters( 'wlt-filter-front-end-data-table-columns', $columns, $arguments[ 'front-end' ] );
@@ -487,13 +487,13 @@ function ws_ls_data_js_config() {
'base-url' => ws_ls_get_link_to_user_data(),
'base-url-meta-fields' => ws_ls_meta_fields_base_url(),
'base-url-awards' => ws_ls_awards_base_url(),
- 'label-add' => __( 'Add' , WE_LS_SLUG ),
- 'label-meta-fields-add-button' => __( 'Add Custom Field', WE_LS_SLUG ),
- 'label-awards-add-button' => __( 'Add Award', WE_LS_SLUG ),
- 'label-confirm-delete' => __( 'Are you sure you want to delete the row?', WE_LS_SLUG ),
- 'label-error-delete' => __( 'Unfortunately there was an error deleting the row.', WE_LS_SLUG ),
- 'locale-search-text' => __( 'Search', WE_LS_SLUG ),
- 'locale-no-results' => __( 'No data found', WE_LS_SLUG ),
+ 'label-add' => esc_html__( 'Add' , WE_LS_SLUG ),
+ 'label-meta-fields-add-button' => esc_html__( 'Add Custom Field', WE_LS_SLUG ),
+ 'label-awards-add-button' => esc_html__( 'Add Award', WE_LS_SLUG ),
+ 'label-confirm-delete' => esc_html__( 'Are you sure you want to delete the row?', WE_LS_SLUG ),
+ 'label-error-delete' => esc_html__( 'Unfortunately there was an error deleting the row.', WE_LS_SLUG ),
+ 'locale-search-text' => esc_html__( 'Search', WE_LS_SLUG ),
+ 'locale-no-results' => esc_html__( 'No data found', WE_LS_SLUG ),
'hide-display-name' => false
];
// Add some extra config settings if not in admin
diff --git a/pro-features/functions-pages.php b/pro-features/functions-pages.php
index 3a850196..48bfb995 100644
--- a/pro-features/functions-pages.php
+++ b/pro-features/functions-pages.php
@@ -8,7 +8,7 @@
function ws_ls_box_user_search_form( $ajax_mode = false ) {
- ?>
+ ?>