| @@ -5,8 +5,10 @@ | ||
| 5 | 5 | * @package Timetics |
| 6 | 6 | */ |
| 7 | 7 | namespace Timetics\Core\Services; |
| 8 | 8 | |
| 9 | +defined( 'ABSPATH' ) || exit; | |
| 10 | + | |
| 9 | 11 | use Timetics\Base\Api; |
| 10 | 12 | use Timetics\Utils\Singleton; |
| 11 | 13 | use WP_REST_Request; |
| 12 | 14 | |
| @@ -147,9 +149,9 @@ | ||
| 147 | 149 | $service = new Service( $service_id ); |
| 148 | 150 | |
| 149 | 151 | if ( ! $service->is_service() ) { |
| 150 | 152 | return [ |
| 151 | - 'message' => __( 'Invalid service id.', 'timetics' ), | |
| 153 | + 'message' => esc_html__( 'Invalid service id.', 'timetics' ), | |
| 152 | 154 | 'data' => [ |
| 153 | 155 | 'status' => 404, |
| 154 | 156 | ], |
| 155 | 157 | ]; |
| @@ -170,9 +172,9 @@ | ||
| 170 | 172 | $service = new Service( $service_id ); |
| 171 | 173 | |
| 172 | 174 | if ( ! $service->is_service() ) { |
| 173 | 175 | return [ |
| 174 | - 'message' => __( 'Invalid service id.', 'timetics' ), | |
| 176 | + 'message' => esc_html__( 'Invalid service id.', 'timetics' ), | |
| 175 | 177 | 'data' => [ |
| 176 | 178 | 'status' => 404, |
| 177 | 179 | ], |
| 178 | 180 | ]; |
| @@ -198,9 +200,9 @@ | ||
| 198 | 200 | $service = new Service( $service_id ); |
| 199 | 201 | |
| 200 | 202 | if ( ! $service->is_service() ) { |
| 201 | 203 | return [ |
| 202 | - 'message' => __( 'Invalid service id.', 'timetics' ), | |
| 204 | + 'message' => esc_html__( 'Invalid service id.', 'timetics' ), | |
| 203 | 205 | 'data' => [ |
| 204 | 206 | 'status' => 404, |
| 205 | 207 | ], |
| 206 | 208 | ]; |
| @@ -208,9 +210,9 @@ | ||
| 208 | 210 | |
| 209 | 211 | $service->delete(); |
| 210 | 212 | |
| 211 | 213 | $response = [ |
| 212 | - 'message' => __( 'Successfully deleted service', 'timetics' ), | |
| 214 | + 'message' => esc_html__( 'Successfully deleted service', 'timetics' ), | |
| 213 | 215 | 'data' => [ |
| 214 | 216 | 'status' => 200, |
| 215 | 217 | ], |
| 216 | 218 | ]; |
| @@ -283,9 +285,9 @@ | ||
| 283 | 285 | $item = $this->prepare_item( $service ); |
| 284 | 286 | |
| 285 | 287 | $response = [ |
| 286 | 288 | 'success' => 1, |
| 287 | - 'message' => __( 'Succssfully created service', 'timetics' ), | |
| 289 | + 'message' => esc_html__( 'Succssfully created service', 'timetics' ), | |
| 288 | 290 | 'data' => $item, |
| 289 | 291 | ]; |
| 290 | 292 | |
| 291 | 293 | return rest_ensure_response( $response ); |