wpdesk/wp-wpdesk-tracker-deactivation
最新稳定版本:2.1.0
Composer 安装命令:
composer require wpdesk/wp-wpdesk-tracker-deactivation
包简介
README 文档
README
Deactivation Tracker
A WordPress Library containing interfaces, abstracts and implementations to be used for plugin deactivations data tracking.
Requirements
PHP 7.0 or later.
Installation via Composer
In order to install the bindings via Composer run the following command:
composer require wpdesk/wp-wpdesk-tracker-deactivation
Example usage
Creating deactivation tracker
The following code creates deactivation tracker. Once the site admin deactivates the plugin, a pop-up containing the deactivation reasons will appear. Right after the relevant deactivation reason is selected, the site admin's response will be sent to the tracker server.
$deactivation_tracker = \WPDesk\Tracker\Deactivation\TrackerFactory::createDefaultTracker(
'my-beautiful-plugin',
'my-beautiful-plugin/my-beautiful-plugin.php',
__( 'My Beautiful Plugin' )
);
$deactivation_tracker->hooks();
Replacing the default sender
class MySender implements WPDesk_Tracker_Sender {
public function send_payload(array $payload){
// implement send_payload method.
}
}
$plugin_slug = 'my-example-plugin';
add_filter( 'wpdesk/tracker/sender/' . $plugin_slug, 'replace_sender' );
function replace_sender() {
return new MySender();
}
统计信息
- 总下载量: 26.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-10-22