Skip to content

Commit

Permalink
feat: custom deactivation reason for appsero tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviranik committed Nov 18, 2020
1 parent 7a6c782 commit 726183b
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions includes/Tracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public function appsero_init_tracker_dokan() {
);

$this->insights->init_plugin();

add_filter( 'appsero_custom_deactivation_reasons', [ $this, 'get_custom_deactivation_reasons' ] );
}

/**
Expand All @@ -63,4 +65,50 @@ protected function get_order_count() {

return (int) $wpdb->get_var( "SELECT count(ID) FROM $wpdb->posts WHERE post_type = 'shop_order' and post_status IN ('wc-completed', 'wc-processing', 'wc-on-hold', 'wc-refunded');" );
}

/**
* Gets custom deactivation reasons
*
* @since 3.0.14
*
* @param $reasons
*
* @return \array
*/
public function get_custom_deactivation_reasons( $reasons ) {
$reasons = [
[
'id' => 'temporary-deactivation',
'text' => 'I’m Testing/Temporarily deactivating/Debugging',
'placeholder' => '',
'icon' => '',
],
[
'id' => 'upgrading-to-dokan-pro',
'text' => 'I’m Upgrading to Dokan Pro',
'placeholder' => '',
'icon' => '',
],
[
'id' => 'encountered-issue-with-plugin',
'text' => 'I encountered an issue with the plugin',
'placeholder' => '',
'icon' => '',
],
[
'id' => 'encountered-error-with-plugin',
'text' => 'I encountered an error with the plugin',
'placeholder' => '',
'icon' => '',
],
[
'id' => 'conflicting-with-something',
'text' => 'The plugin is conflicting with something',
'placeholder' => '',
'icon' => '',
],

];
return $reasons;
}
}

0 comments on commit 726183b

Please sign in to comment.