Skip to content

Fix per-site activation/deactivation logic on multisite #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Postman/PostmanInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function activatePostman() {
}
}

if ( function_exists( 'is_multisite' ) && is_multisite() ) {
if ( is_multisite() && is_network_admin() && is_plugin_active_for_network( plugin_basename( __FILE__ ) ) ) {

$network_options = get_site_option( PostmanOptions::POSTMAN_NETWORK_OPTIONS );

Expand Down Expand Up @@ -120,7 +120,7 @@ public function activatePostman() {
* Handle deactivation of the plugin
*/
public function deactivatePostman() {
if ( function_exists( 'is_multisite' ) && is_multisite() ) {
if ( is_multisite() && is_network_admin() && is_plugin_active_for_network( plugin_basename( __FILE__ ) ) ) {
// handle network deactivation
// from https://wordpress.org/support/topic/new-function-wp_get_sites?replies=11
// run the deactivation function for each blog id
Expand Down
2 changes: 1 addition & 1 deletion postman-smtp.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Plugin Name: Post SMTP
* Plugin URI: https://wordpress.org/plugins/post-smtp/
* Description: Email not reliable? Post SMTP is the first and only WordPress SMTP plugin to implement OAuth 2.0 for Gmail, Hotmail and Yahoo Mail. Setup is a breeze with the Configuration Wizard and integrated Port Tester. Enjoy worry-free delivery even if your password changes!
* Version: 3.2.0
* Version: 3.2.1
* Author: Post SMTP
* Text Domain: post-smtp
* Author URI: https://postmansmtp.com
Expand Down