Skip to content

Commit

Permalink
Add deactivation feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
gdarko committed Mar 15, 2024
1 parent a1862f0 commit aae9416
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"defuse/php-encryption": "^2.2",
"ignitekit/wp-notices": "^1.0",
"ignitekit/wp-query-builder": "^1.1",
"ignitekit/wp-deactivate-feedback-client": "dev-master",
"spipu/html2pdf": "^5.2",
"tecnickcom/tcpdf": "^6.4"
},
Expand Down
28 changes: 28 additions & 0 deletions includes/Boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,32 @@ public function pluginActionLinks( $links ) {
return $links;
}

/**
* Show deactivate feedback form on plugin deactivation
*
* @since 1.6.0
*
* @return void
*/
public function initPluginDeactivateFeedback() {
if ( ! class_exists( '\IgniteKit\WP\DeactivateFeedbackClient\Main' ) ) {
return;
}
try {
new \IgniteKit\WP\DeactivateFeedbackClient\Main( [
'name' => 'Digital License Manager',
'slug' => 'digital-license-manager',
'version' => DLM_PLUGIN_VERSION,
'prefix' => 'dlmcore_',
'public_path' => str_replace( '/', DIRECTORY_SEPARATOR, DLM_ABSPATH . 'vendor/ignitekit/wp-deactivate-feedback-client/public/' ),
'public_url' => DLM_PLUGIN_URL . 'vendor/ignitekit/wp-deactivate-feedback-client/public/',
'api_url' => 'https://codeverve.com/wp-json/deactivate-feedback/v1/send/',
'data' => [ 'website', 'system', 'contact' ],
] );
} catch ( \Exception $e ) {
}
}

/**
* Hook into actions and filters.
*
Expand All @@ -501,6 +527,8 @@ private function initHooks() {
register_deactivation_hook( DLM_PLUGIN_ROOT_FILE, array( '\IdeoLogix\DigitalLicenseManager\Setup', 'deactivate' ) );
register_uninstall_hook( DLM_PLUGIN_ROOT_FILE, array( '\IdeoLogix\DigitalLicenseManager\Setup', 'uninstall' ) );

$this->initPluginDeactivateFeedback();

add_action( 'admin_enqueue_scripts', array( $this, 'registerAssets' ), 10 );
add_action( 'wp_enqueue_scripts', array( $this, 'registerAssets' ), 10 );
add_action( 'admin_enqueue_scripts', array( $this, 'adminEnqueueScripts' ), 11 );
Expand Down

0 comments on commit aae9416

Please sign in to comment.