majormfr/majormfr-whitelist

Library to assist whitelisting of posts and pages

Maintainers

Package info

github.com/majormfr/majormfr-whitelist

Issues

pkg:composer/majormfr/majormfr-whitelist

Statistics

Installs: 18

Dependents: 0

Suggesters: 0

Stars: 0

v1.1 2023-07-31 18:58 UTC

This package is auto-updated.

Last update: 2026-03-01 00:42:38 UTC


README

Library to remove unauthorized plugins. Specify url that with following route

https://{my_domain}.com/whitelist/plugins

Above should return an array with key "whitelist_plugins"

Install Composer in wordpress project

Installation

To deploy this project run

  composer init

Install package

  composer require majormfr/majormfr-whitelist

In your custom plugin or functions.php file

    Gates::specifyWhitelistedUrl("https://{my_domains}.com/whitelist/plugins");

   $whitelistPlugins = Gates::fetch_whitelisted_plugins()['whitelist_plugins'] ?? [];
    $installed_plugins = Gates::fetch_plugins_bpd_from_db();
    

and

  if (count($whitelistPlugins) > 0) {
        echo count($whitelistPlugins);
        add_action('admin_init', array('Majormfr\MajormfrWhitelist\Includes\Gates\Gates', 'disableUnknownPlugins'));
    }

Expected array from your mentioned url should be:

['wordpress-importer/wordpress-importer.php','google-captcha/google-captcha.php'...]