Skip to content

Commit

Permalink
wip: clean extra codes
Browse files Browse the repository at this point in the history
  • Loading branch information
pronob1010 committed Nov 12, 2023
1 parent 37bdf3e commit 3295d1a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
2 changes: 0 additions & 2 deletions includes/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ function remove_thrivedesk_cache_by_key(string $key) {

if (!function_exists('remove_thrivedesk_all_cache')) {
function remove_thrivedesk_all_cache() {

global $wpdb;

$wpdb->query(
"DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_thrivedesk_%'
OR option_name LIKE '_transient_timeout_thrivedesk_%'");
Expand Down
11 changes: 5 additions & 6 deletions includes/views/pages/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,14 @@
<div class="space-y-1">
<div class="text-base font-bold"><?php _e( 'WP Post Sync', 'thrivedesk' ); ?></div>
<p><?php _e( 'Sync your WordPress posts with ThriveDesk for faster support',
'thrivedesk'
); ?></p>
'thrivedesk'); ?></p>
<div class="td-card">
<div class="flex space-x-4" id="td_post_sync">
<div class="flex-1">
<div class="space-y-2">
<div class="flex items-center space-x-2">
<?php if ($wppostsync && $wppostsync->get_plugin_data('connected')) : ?>
<?php foreach ($wp_post_sync_types as $post_sync) : ?>
<?php foreach ( $wp_post_sync_types as $post_sync ) : ?>
<div>
<input class="td_helpdesk_post_sync" type="checkbox" name="td_helpdesk_post_sync[]" value="<?php echo esc_attr($post_sync); ?>" <?php echo in_array(
$post_sync,
Expand All @@ -115,7 +114,7 @@

<!-- portal -->
<div class="space-y-1">
<div class="text-base font-bold"><?php _e('Portal', 'thrivedesk'); ?></div>
<div class="text-base font-bold"><?php _e( 'Portal', 'thrivedesk' ); ?></div>
<p><?php _e('Help center inside your website. Customer can create and reply tickets, access Knowledge base.','thrivedesk'); ?></p>
<div class="td-card">
<div class="text-center text-base" id="api_key_alert">
Expand All @@ -132,8 +131,8 @@
<div class="space-y-2">
<label for="td_helpdesk_page_id" class="font-medium text-black text-sm"><?php _e('New Ticket Page', 'thrivedesk'); ?></label>
<select id="td_helpdesk_page_id" class="mt-1 bg-gray-50 border border-gray-300 rounded px-2 py-1 w-full max-w-full">
<option value=""> <?php _e('Select a page', 'thrivedesk'); ?> </option>
<?php foreach (get_pages() as $key => $page) : ?>
<option value=""> <?php _e( 'Select a page', 'thrivedesk' ); ?> </option>
<?php foreach ( get_pages() as $key => $page ) : ?>
<option value="<?php echo $page->ID; ?>" <?php echo array_key_exists( 'td_helpdesk_page_id',
$td_helpdesk_selected_option) && $td_helpdesk_selected_option['td_helpdesk_page_id'] == $page->ID ? 'selected' : '' ?>>
<?php echo $page->post_title; ?>
Expand Down
1 change: 0 additions & 1 deletion resources/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ jQuery(document).ready(($) => {
},
})
.success(function (response) {
console.log(response);
if(response.status === 'success'){
let parsedResponse = JSON.parse(response);
let data = parsedResponse?.data;
Expand Down
2 changes: 1 addition & 1 deletion src/Conversations/Conversation.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function td_verify_helpdesk_api_key( ): void {
}

$apiService = new TDApiService();
$apiService->setApiKey($apiKey);
$apiService->setApiKey( $apiKey );

$data = $apiService->getRequest( THRIVEDESK_API_URL . '/v1/me' );
if(!isset($data['company'])){
Expand Down

0 comments on commit 3295d1a

Please sign in to comment.