Skip to content

Commit 3f9b452

Browse files
committed
Fixed some missing prefixes.
1 parent a74d852 commit 3f9b452

13 files changed

+174
-178
lines changed

helper/class-wkuvdesk-api-handler.php

+11-9
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public static function wkuvdesk_create_new_ticket( $post_array = array() ) {
149149
'Authorization' => 'Bearer ' . $uv->get_access_token(),
150150
'Content-Type' => 'application/json',
151151
);
152+
152153
// Perform the request.
153154
$response = wp_remote_post(
154155
$url,
@@ -159,6 +160,7 @@ public static function wkuvdesk_create_new_ticket( $post_array = array() ) {
159160
'timeout' => self::$timeout,
160161
)
161162
);
163+
162164
// Check for errors.
163165
if ( is_wp_error( $response ) ) {
164166
return $response->get_error_message();
@@ -186,7 +188,7 @@ public static function wkuvdesk_create_new_ticket( $post_array = array() ) {
186188
*
187189
* @return string|false API response or error message.
188190
*/
189-
public static function wk_uvdesk_post_thread_data_api( $thread_url_param = '', $thread_param = array() ) {
191+
public static function wkuvdesk_post_thread_data_api( $thread_url_param = '', $thread_param = array() ) {
190192
// Initialize UVDesk helper.
191193
$uv = new WKUVDESK_Protected();
192194

@@ -268,7 +270,7 @@ public static function wk_uvdesk_post_thread_data_api( $thread_url_param = '', $
268270
*
269271
* @return mixed
270272
*/
271-
public static function wk_uvdesk_post_thread_data_api_with_attachment( $thread_url_param = '', $thread_param = array(), $post_image = array() ) {
273+
public static function wkuvdesk_post_thread_data_api_with_attachment( $thread_url_param = '', $thread_param = array(), $post_image = array() ) {
272274
// Ensure we have required WordPress functions.
273275
if ( ! function_exists( 'wp_parse_args' ) ) {
274276
require_once ABSPATH . 'wp-includes/functions.php';
@@ -389,7 +391,7 @@ public static function wk_uvdesk_post_thread_data_api_with_attachment( $thread_u
389391
*
390392
* @return mixed
391393
*/
392-
public function wk_uvdesk_post_tag_ticket( $url_param = '', $param = array() ) {
394+
public function wkuvdesk_post_tag_ticket( $url_param = '', $param = array() ) {
393395
$uv = new WKUVDESK_Protected();
394396
$domain = $uv->get_company_domain();
395397
// Construct the URL.
@@ -443,7 +445,7 @@ public function wk_uvdesk_post_tag_ticket( $url_param = '', $param = array() ) {
443445
*
444446
* @return mixed|WP_Error Response data or WP_Error on failure.
445447
*/
446-
public static function wk_uvdesk_get_customer_data_api( $url_param = '', $query_params = array() ) {
448+
public static function wkuvdesk_get_customer_data_api( $url_param = '', $query_params = array() ) {
447449
$uv = new WKUVDESK_Protected();
448450

449451
// Build the query string from query parameters.
@@ -493,7 +495,7 @@ public static function wk_uvdesk_get_customer_data_api( $url_param = '', $query_
493495
*
494496
* @return mixed
495497
*/
496-
public static function wk_uvdesk_delete_tag_ticket( $tag_url_param = '', $tag_params = array() ) {
498+
public static function wkuvdesk_delete_tag_ticket( $tag_url_param = '', $tag_params = array() ) {
497499
$uv = new WKUVDESK_Protected();
498500
$domain = $uv->get_company_domain();
499501
$url = 'https://' . $domain . '.uvdesk.com/en/api/' . $tag_url_param;
@@ -542,7 +544,7 @@ public static function wk_uvdesk_delete_tag_ticket( $tag_url_param = '', $tag_pa
542544
*
543545
* @return mixed
544546
*/
545-
public static function wk_uvdesk_threds_delete_tag_ticket( $tag_url_param = '', $tag_prm = array() ) {
547+
public static function wkuvdesk_threds_delete_tag_ticket( $tag_url_param = '', $tag_prm = array() ) {
546548
// Initialize UVDesk helper.
547549
$uv = new WKUVDESK_Protected();
548550
$domain = $uv->get_company_domain();
@@ -607,7 +609,7 @@ public static function wk_uvdesk_threds_delete_tag_ticket( $tag_url_param = '',
607609
*
608610
* @return mixed
609611
*/
610-
public static function wk_uvdesk_update_ticket( $ticket_url_param = '', $ticket_params = array() ) {
612+
public static function wkuvdesk_update_ticket( $ticket_url_param = '', $ticket_params = array() ) {
611613
$uv = new WKUVDESK_Protected();
612614
$domain = $uv->get_company_domain();
613615
$url = 'https://' . $domain . '.uvdesk.com/en/api/' . $ticket_url_param;
@@ -648,7 +650,7 @@ public static function wk_uvdesk_update_ticket( $ticket_url_param = '', $ticket_
648650
*
649651
* @return mixed
650652
*/
651-
public static function wk_uvdesk_get_attachment_data_api( $attachment_url_param = '' ) {
653+
public static function wkuvdesk_get_attachment_data_api( $attachment_url_param = '' ) {
652654
// Validate input.
653655
if ( empty( $attachment_url_param ) ) {
654656
return new \WP_Error(
@@ -730,7 +732,7 @@ public static function wk_uvdesk_get_attachment_data_api( $attachment_url_param
730732
*
731733
* @return mixed
732734
*/
733-
public function wk_uvdesk_get_patch_data_api( $patch_url_param = '', $ticket_prm = array() ) {
735+
public function wkuvdesk_get_patch_data_api( $patch_url_param = '', $ticket_prm = array() ) {
734736
// Validate input.
735737
if ( empty( $patch_url_param ) ) {
736738
return new \WP_Error(

includes/admin/class-wkuvdesk-admin-function.php

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public function wkuvdesk_admin_menu() {
3535
add_submenu_page( 'uvdesk_ticket_system', esc_html__( 'Services', 'wk-uvdesk' ), esc_html__( 'Services', 'wk-uvdesk' ), 'manage_options', 'uvdesk_services', array( $this, 'wkuvdesk_services_menu' ) );
3636
}
3737

38-
3938
/**
4039
* Show setting links.
4140
*

includes/class-wkuvdesk-file-handler.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ class WKUVDESK_File_Handler {
3232
* @return void
3333
*/
3434
public function __construct() {
35-
$this->wk_uvdesk_native_files();
35+
$this->wkuvdesk_native_files();
3636
}
3737

3838
/**
3939
* Native files.
4040
*
4141
* @return void
4242
*/
43-
public function wk_uvdesk_native_files() {
43+
public function wkuvdesk_native_files() {
4444
if ( is_admin() ) {
4545
Admin\WKUVDESK_Admin_Hook::get_instance();
4646
} else {

includes/common/class-wkuvdesk-common-function.php

+17-17
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function wkuvdesk_change_ticket_agent() {
4343

4444
if ( $json_data ) {
4545
$function_handler = new Helper\WKUVDESK_Api_Handler();
46-
$data_customerapi = $function_handler->wk_uvdesk_update_ticket( 'tickets/agent.json', $json_data );
46+
$data_customerapi = $function_handler->wkuvdesk_update_ticket( 'tickets/agent.json', $json_data );
4747

4848
if ( ! empty( $data_customerapi ) ) {
4949
wp_send_json_success( $data_customerapi );
@@ -74,7 +74,7 @@ public function wkuvdesk_change_ticket_priority() {
7474
);
7575
if ( $json_data ) {
7676
$function_handler = new Helper\WKUVDESK_Api_Handler();
77-
$data_customerapi = $function_handler->wk_uvdesk_update_ticket( 'tickets/priority.json', $json_data );
77+
$data_customerapi = $function_handler->wkuvdesk_update_ticket( 'tickets/priority.json', $json_data );
7878

7979
if ( ! empty( $data_customerapi ) ) {
8080
wp_send_json_success( $data_customerapi );
@@ -101,7 +101,7 @@ public function wkuvdesk_sort_customer_ticket_via_status() {
101101
$m_id = filter_input( INPUT_POST, 'member_id', FILTER_SANITIZE_NUMBER_INT );
102102
$m_id = empty( $m_id ) ? $current_user->ID : wp_unslash( $m_id );
103103
$function_handler = new Helper\WKUVDESK_Api_Handler();
104-
$data_assign_api = $function_handler->wk_uvdesk_get_customer_data_api( 'tickets.json', array( 'agent' => $m_id ) );
104+
$data_assign_api = $function_handler->wkuvdesk_get_customer_data_api( 'tickets.json', array( 'agent' => $m_id ) );
105105
$c_email = $current_user->user_email;
106106

107107
if ( $field ) {
@@ -111,9 +111,9 @@ public function wkuvdesk_sort_customer_ticket_via_status() {
111111
'actAsEmail' => $c_email,
112112
'actAsType' => 'customer',
113113
);
114-
$data_customerapi = $function_handler->wk_uvdesk_get_customer_data_api( 'tickets.json', $arr_sum );
114+
$data_customerapi = $function_handler->wkuvdesk_get_customer_data_api( 'tickets.json', $arr_sum );
115115
if ( ! empty( $data_customerapi ) ) {
116-
$content = $this->wk_uvdesk_final_json_data_customer( $data_customerapi );
116+
$content = $this->wkuvdesk_final_json_data_customer( $data_customerapi );
117117
wp_send_json_success( $content );
118118
} else {
119119
wp_send_json_error( $data_assign_api );
@@ -147,16 +147,16 @@ public function wkuvdesk_sort_ticket_via_api() {
147147
$function_handler = new Helper\WKUVDESK_Api_Handler();
148148
if ( ! $is_admin ) {
149149
$m_id = filter_input( INPUT_POST, 'member_id', FILTER_SANITIZE_NUMBER_INT ) ? filter_input( INPUT_POST, 'member_id', FILTER_SANITIZE_NUMBER_INT ) : $current_user->ID;
150-
$data_assign_api = $function_handler->wk_uvdesk_get_customer_data_api( 'tickets.json', array( 'agent' => $m_id ) );
151-
$data_customerapi = $function_handler->wk_uvdesk_get_customer_data_api(
150+
$data_assign_api = $function_handler->wkuvdesk_get_customer_data_api( 'tickets.json', array( 'agent' => $m_id ) );
151+
$data_customerapi = $function_handler->wkuvdesk_get_customer_data_api(
152152
'tickets.json',
153153
array(
154154
'sort' => $field,
155155
'direction' => $order,
156156
)
157157
);
158158
} else {
159-
$data_customerapi = $function_handler->wk_uvdesk_get_customer_data_api(
159+
$data_customerapi = $function_handler->wkuvdesk_get_customer_data_api(
160160
'tickets.json',
161161
array(
162162
'sort' => $field,
@@ -166,7 +166,7 @@ public function wkuvdesk_sort_ticket_via_api() {
166166
);
167167
}
168168
if ( ! empty( $data_customerapi ) ) {
169-
$content = $this->wk_uvdesk_final_json_data_customer( $data_customerapi, $link_page );
169+
$content = $this->wkuvdesk_final_json_data_customer( $data_customerapi, $link_page );
170170
wp_send_json_success( $content );
171171
} else {
172172
wp_send_json_error( $data_assign_api );
@@ -190,10 +190,10 @@ public function wkuvdesk_get_thread_data_customer() {
190190
$tid = $page[0];
191191
$page_no = $page[1] + 1;
192192
if ( 0 !== $tid ) {
193-
$data_assign_api = Helper\WKUVDESK_Api_Handler::wk_uvdesk_get_customer_data_api( 'ticket/' . $tid . '/threads.json', array( 'page' => $page_no ) );
193+
$data_assign_api = Helper\WKUVDESK_Api_Handler::wkuvdesk_get_customer_data_api( 'ticket/' . $tid . '/threads.json', array( 'page' => $page_no ) );
194194

195195
if ( $data_assign_api ) {
196-
$content = $this->wk_uvdesk_final_thread_json_data( $data_assign_api, $tid );
196+
$content = $this->wkuvdesk_final_thread_json_data( $data_assign_api, $tid );
197197
wp_send_json_success( $content );
198198
} else {
199199
wp_send_json_error( $data_assign_api );
@@ -261,7 +261,7 @@ public function wkuvdesk_toggle_the_starred() {
261261
'editType' => 'star',
262262
'value' => $ticket_stared,
263263
);
264-
$data_starred_ticket = $function_handler->wk_uvdesk_get_patch_data_api( 'ticket/' . $t_id . '.json', $json_data );
264+
$data_starred_ticket = $function_handler->wkuvdesk_get_patch_data_api( 'ticket/' . $t_id . '.json', $json_data );
265265

266266
if ( $data_starred_ticket ) {
267267
wp_send_json_success( $data_starred_ticket );
@@ -373,7 +373,7 @@ public function wkuvdesk_final_thread_json_data( $data_api = array(), $tid = ''
373373
<div class="thread-created-info">
374374
<div class="msg-header">
375375
<span class="img-icon">
376-
<?php echo wp_kses_post( '<img ' . wp_kses( Includes\WKUVDESK::wk_uvdesk_convert_attributes_to_html( $img_url ), $allowed_html ) . '>' ); ?>
376+
<?php echo wp_kses_post( '<img ' . wp_kses( Includes\WKUVDESK::wkuvdesk_convert_attributes_to_html( $img_url ), $allowed_html ) . '>' ); ?>
377377
</span>
378378
<span class="info">
379379
<span class="rpy-name">
@@ -410,7 +410,7 @@ public function wkuvdesk_final_thread_json_data( $data_api = array(), $tid = ''
410410
$wk_image = str_replace( '/company/', '/thread_image_orignal/', $wk_image );
411411
?>
412412
<a href="<?php echo esc_url( $wk_image ); ?>" title="<?php echo esc_attr( $anamea ); ?>" target="_blank">
413-
<img <?php echo wp_kses( Includes\WKUVDESK::wk_uvdesk_convert_attributes_to_html( $wk_image ), $allowed_html ); ?> class="fa fa-file zip" title="<?php echo esc_attr( $anamea ); ?>" data-toggle="<?php echo esc_attr( 'tooltip' ); ?>" data-original-title="<?php echo esc_attr( $attchment_value->name ); ?>">
413+
<img <?php echo wp_kses( Includes\WKUVDESK::wkuvdesk_convert_attributes_to_html( $wk_image ), $allowed_html ); ?> class="fa fa-file zip" title="<?php echo esc_attr( $anamea ); ?>" data-toggle="<?php echo esc_attr( 'tooltip' ); ?>" data-original-title="<?php echo esc_attr( $attchment_value->name ); ?>">
414414
</a>
415415
<?php
416416
} elseif ( 'zip' === $aname ) {
@@ -451,7 +451,7 @@ public function wkuvdesk_final_thread_json_data( $data_api = array(), $tid = ''
451451
$img_url = ! empty( $thread_value->user->smallThumbnail ) ? esc_url( $thread_value->user->smallThumbnail ) : esc_url( 'https://cdn.uvdesk.com/uvdesk/images/e09dabf.png' );
452452
echo '<div class="wk-cards tkt-replay " data-thread-id="' . esc_attr( $thread_value->id ) . '">';
453453
echo '<div class= "uv-uvdesk-replay-inline" >';
454-
echo '<img ' . wp_kses( Includes\WKUVDESK::wk_uvdesk_convert_attributes_to_html( $img_url ), $allowed_html ) . ' alt="' . esc_attr( $img_url ) . '" />';
454+
echo '<img ' . wp_kses( Includes\WKUVDESK::wkuvdesk_convert_attributes_to_html( $img_url ), $allowed_html ) . ' alt="' . esc_attr( $img_url ) . '" />';
455455
?>
456456
<span class="tkt-name">
457457
<?php echo esc_attr( ! empty( $thread_value->user->detail->agent ) ? $thread_value->user->detail->agent : $thread_value->user->detail->customer->name ); ?>
@@ -482,7 +482,7 @@ public function wkuvdesk_final_thread_json_data( $data_api = array(), $tid = ''
482482
$wk_image = str_replace( '/company/', '/thread_image_orignal/', $wk_image );
483483
?>
484484
<a href="<?php echo esc_url( $wk_image ); ?>" title="<?php echo esc_attr( $anamea ); ?>" target="_blank">
485-
<img <?php echo wp_kses( Includes\WKUVDESK::wk_uvdesk_convert_attributes_to_html( $wk_image ), $allowed_html ); ?> class="fa fa-file zip" title="<?php echo esc_attr( $anamea ); ?>" data-toggle="<?php echo esc_attr( 'tooltip' ); ?>" data-original-title="<?php echo esc_attr( $attchment_value->name ); ?>"/>
485+
<img <?php echo wp_kses( Includes\WKUVDESK::wkuvdesk_convert_attributes_to_html( $wk_image ), $allowed_html ); ?> class="fa fa-file zip" title="<?php echo esc_attr( $anamea ); ?>" data-toggle="<?php echo esc_attr( 'tooltip' ); ?>" data-original-title="<?php echo esc_attr( $attchment_value->name ); ?>"/>
486486
</a>
487487
<?php
488488
} elseif ( 'zip' === $aname ) {
@@ -525,7 +525,7 @@ public function wkuvdesk_final_thread_json_data( $data_api = array(), $tid = ''
525525
/**
526526
* Final json data customer.
527527
*
528-
* @param array $data_api data.
528+
* @param object $data_api data.
529529
* @param string $link_page link page.
530530
*
531531
* @return mixed

0 commit comments

Comments
 (0)