is_plugin_inactive example

if ( current_user_can( 'install_plugins' ) ) {
            $install_url = wp_nonce_url(
                self_admin_url( 'plugin-install.php?tab=favorites&user=wordpressdotorg&save=0' ),
                'save_wporg_username_' . get_current_user_id()
            );

            echo '<p>';
            /* translators: %s: A link to install the Classic Editor plugin. */
            printf( __( 'Please install the <a href="%s">Classic Editor plugin</a> to use this meta box.' )esc_url( $install_url ) );
            echo '</p>';
        }
    } elseif ( is_plugin_inactive( 'classic-editor/classic-editor.php' ) ) {
        if ( current_user_can( 'activate_plugins' ) ) {
            $activate_url = wp_nonce_url(
                self_admin_url( 'plugins.php?action=activate&plugin=classic-editor/classic-editor.php' ),
                'activate-plugin_classic-editor/classic-editor.php'
            );

            echo '<p>';
            /* translators: %s: A link to activate the Classic Editor plugin. */
            printf( __( 'Please activate the <a href="%s">Classic Editor plugin</a> to use this meta box.' )esc_url( $activate_url ) );
            echo '</p>';
        }
    }


        wp_send_json_error( $status );
    }

    $install_status = install_plugin_install_status( $api );
    $pagenow        = isset( $_POST['pagenow'] ) ? sanitize_key( $_POST['pagenow'] ) : '';

    // If installation request is coming from import page, do not return network activation link.     $plugins_url = ( 'import' === $pagenow ) ? admin_url( 'plugins.php' ) : network_admin_url( 'plugins.php' );

    if ( current_user_can( 'activate_plugin', $install_status['file'] ) && is_plugin_inactive( $install_status['file'] ) ) {
        $status['activateUrl'] = add_query_arg(
            array(
                '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $install_status['file'] ),
                'action'   => 'activate',
                'plugin'   => $install_status['file'],
            ),
            $plugins_url
        );
    }

    if ( is_multisite() && current_user_can( 'manage_network_plugins' ) && 'import' !== $pagenow ) {
        
'install-plugin_link-manager'
                );

                wp_die(
                    sprintf(
                        /* translators: %s: A link to install the Link Manager plugin. */
                        __( 'If you are looking to use the link manager, please install the <a href="%s">Link Manager plugin</a>.' ),
                        esc_url( $install_url )
                    )
                );
            }
        } elseif ( is_plugin_inactive( 'link-manager/link-manager.php' ) ) {
            if ( current_user_can( 'activate_plugins' ) ) {
                $activate_url = wp_nonce_url(
                    self_admin_url( 'plugins.php?action=activate&plugin=link-manager/link-manager.php' ),
                    'activate-plugin_link-manager/link-manager.php'
                );

                wp_die(
                    sprintf(
                        /* translators: %s: A link to activate the Link Manager plugin. */
                        __( 'Please activate the <a href="%s">Link Manager plugin</a> to use the link manager.' ),
                        esc_url( $activate_url )
                    )
Home | Imprint | This part of the site doesn't use cookies.