PHPackages                             automattic/jetpack-plugin-deactivation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. automattic/jetpack-plugin-deactivation

ActiveJetpack-library[Utility &amp; Helpers](/categories/utility)

automattic/jetpack-plugin-deactivation
======================================

Ask for feedback while deactivating a plugin

v0.3.25(2mo ago)34.2k11GPL-2.0-or-laterPHPPHP &gt;=7.2CI passing

Since Nov 22Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/Automattic/jetpack-plugin-deactivation)[ Packagist](https://packagist.org/packages/automattic/jetpack-plugin-deactivation)[ RSS](/packages/automattic-jetpack-plugin-deactivation/feed)WikiDiscussions trunk Synced 1mo ago

READMEChangelogDependencies (8)Versions (39)Used By (1)

plugin-deactivation
===================

[](#plugin-deactivation)

Intercept the plugin deactivation with a dialog

[![](https://camo.githubusercontent.com/e53a9802cadc4e32a995a30aa58511d7eb682d654f93bc2f945413d2b4ede3c8/68747470733a2f2f642e70722f692f454a636657682b)](https://camo.githubusercontent.com/e53a9802cadc4e32a995a30aa58511d7eb682d654f93bc2f945413d2b4ede3c8/68747470733a2f2f642e70722f692f454a636657682b)

How to install plugin-deactivation
----------------------------------

[](#how-to-install-plugin-deactivation)

Instantiate the `Deactivation_Handler` by providing the `$plugin_slug`, and `$dialog_view_file_path` as parameters.

```
add_action( 'init', function() {
	Automattic\Jetpack\Plugin_Deactivation\Deactivation_Handler::init( $plugin_slug, $dialog_view_file_path );
} );
```

ParameterDescription`$plugin_slug`Slug of the plugin, e.g. `jetpack`, `jetpack-boost`.`$dialog_view_file_path`The path to a PHP file that contains the markup for your dialog. Copy `src/dialog-template.php` to your plugin, customize it, and pass its path as the `$dialog_view_file_path`.### Controlling the dialog

[](#controlling-the-dialog)

#### Using attribute

[](#using-attribute)

You can use `data-jp-plugin-deactivation-action` attribute with the values `close`|`deactivate` on any element. Adding this attribute will observe the element and close or deactivate the plugin based on the attribute value.

Example of a button that closes the dialog:

```
Cancel
```

#### Using the instance

[](#using-the-instance)

You can access the deactivation dialog instance in `window.JetpackPluginDeactivationData[]`. It has access to the following methods:

- `showDialog()` - Open the deactivation dialog
- `hideDialog()` - Close the deactivation dialog
- `deactivate()` - Deactivate the plugin and close the dialog

Using this package in your WordPress plugin
-------------------------------------------

[](#using-this-package-in-your-wordpress-plugin)

If you plan on using this package in your WordPress plugin, we would recommend that you use [Jetpack Autoloader](https://packagist.org/packages/automattic/jetpack-autoloader) as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.

Security
--------

[](#security)

Need to report a security vulnerability? Go to  or directly to our security bug bounty site .

License
-------

[](#license)

plugin-deactivation is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt)

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance89

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community28

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~33 days

Recently: every ~21 days

Total

37

Last Release

65d ago

PHP version history (2 changes)v0.2.0PHP &gt;=7.0

v0.3.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c5869ecbb8e0eac7e8b8e0f3cf7bdd8d5fcdc4abc10a72281872c53f8639d44?d=identicon)[automattic](/maintainers/automattic)

![](https://www.gravatar.com/avatar/11609890f6e7a840715f4cfc9622d77ea64b7dfc024df5643fbf8471a18c00f3?d=identicon)[kraft](/maintainers/kraft)

![](https://www.gravatar.com/avatar/6e220e167e341c28b1aa10bf0bb0374999068329f8683d3187ee3cf6749b8837?d=identicon)[dereksmart](/maintainers/dereksmart)

![](https://www.gravatar.com/avatar/62dfbfcb6fed563989595d0f4e0a0de6c05e5fc7a37dbcf7f3a93de4d6e75793?d=identicon)[bindlegirl](/maintainers/bindlegirl)

---

Top Contributors

[![anomiex](https://avatars.githubusercontent.com/u/1030580?v=4)](https://github.com/anomiex "anomiex (140 commits)")[![tbradsha](https://avatars.githubusercontent.com/u/32492176?v=4)](https://github.com/tbradsha "tbradsha (53 commits)")[![zinigor](https://avatars.githubusercontent.com/u/374293?v=4)](https://github.com/zinigor "zinigor (22 commits)")[![manzoorwanijk](https://avatars.githubusercontent.com/u/18226415?v=4)](https://github.com/manzoorwanijk "manzoorwanijk (21 commits)")[![gmjuhasz](https://avatars.githubusercontent.com/u/36671565?v=4)](https://github.com/gmjuhasz "gmjuhasz (13 commits)")[![dilirity](https://avatars.githubusercontent.com/u/11799079?v=4)](https://github.com/dilirity "dilirity (13 commits)")[![samiff](https://avatars.githubusercontent.com/u/15803018?v=4)](https://github.com/samiff "samiff (10 commits)")[![coder-karen](https://avatars.githubusercontent.com/u/16754605?v=4)](https://github.com/coder-karen "coder-karen (9 commits)")[![jeherve](https://avatars.githubusercontent.com/u/426388?v=4)](https://github.com/jeherve "jeherve (9 commits)")[![kraftbj](https://avatars.githubusercontent.com/u/88897?v=4)](https://github.com/kraftbj "kraftbj (8 commits)")[![ice9js](https://avatars.githubusercontent.com/u/8056203?v=4)](https://github.com/ice9js "ice9js (7 commits)")[![bindlegirl](https://avatars.githubusercontent.com/u/1242807?v=4)](https://github.com/bindlegirl "bindlegirl (6 commits)")[![haqadn](https://avatars.githubusercontent.com/u/3737780?v=4)](https://github.com/haqadn "haqadn (5 commits)")[![sdixon194](https://avatars.githubusercontent.com/u/33553323?v=4)](https://github.com/sdixon194 "sdixon194 (5 commits)")[![LiamSarsfield](https://avatars.githubusercontent.com/u/43409125?v=4)](https://github.com/LiamSarsfield "LiamSarsfield (5 commits)")[![gogdzl](https://avatars.githubusercontent.com/u/37049295?v=4)](https://github.com/gogdzl "gogdzl (3 commits)")[![thingalon](https://avatars.githubusercontent.com/u/1369626?v=4)](https://github.com/thingalon "thingalon (3 commits)")[![chihsuan](https://avatars.githubusercontent.com/u/4344253?v=4)](https://github.com/chihsuan "chihsuan (3 commits)")[![ArSn](https://avatars.githubusercontent.com/u/2803693?v=4)](https://github.com/ArSn "ArSn (2 commits)")[![dhasilva](https://avatars.githubusercontent.com/u/8486249?v=4)](https://github.com/dhasilva "dhasilva (2 commits)")

### Embed Badge

![Health badge](/badges/automattic-jetpack-plugin-deactivation/health.svg)

```
[![Health](https://phpackages.com/badges/automattic-jetpack-plugin-deactivation/health.svg)](https://phpackages.com/packages/automattic-jetpack-plugin-deactivation)
```

###  Alternatives

[automattic/jetpack

Jetpack supercharges your self‑hosted WordPress site with the awesome cloud power of WordPress.com

3621.9k](/packages/automattic-jetpack)[xi/algorithm

General purpose algorithms

113.0k](/packages/xi-algorithm)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
