{"id":21813081,"url":"https://github.com/webdevstudios/wds-required-plugins","last_synced_at":"2025-08-20T08:32:14.343Z","repository":{"id":19626974,"uuid":"22878772","full_name":"WebDevStudios/WDS-Required-Plugins","owner":"WebDevStudios","description":"Make certain plugins required so that they cannot be (easily) deactivated. | Gatekeeper: @aubreypwd","archived":false,"fork":false,"pushed_at":"2023-10-18T15:43:40.000Z","size":99,"stargazers_count":76,"open_issues_count":4,"forks_count":23,"subscribers_count":47,"default_branch":"master","last_synced_at":"2024-12-10T18:48:20.242Z","etag":null,"topics":["mu-plugins","plugins","require","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebDevStudios.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-08-12T13:44:00.000Z","updated_at":"2024-10-18T14:25:11.000Z","dependencies_parsed_at":"2022-08-07T09:15:28.173Z","dependency_job_id":"421d31bd-1f9a-4cfa-a5f6-e600985bfd78","html_url":"https://github.com/WebDevStudios/WDS-Required-Plugins","commit_stats":{"total_commits":85,"total_committers":12,"mean_commits":7.083333333333333,"dds":0.7529411764705882,"last_synced_commit":"102919f0f742f36f0048ae5b3ad1d0de8dca2656"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevStudios%2FWDS-Required-Plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevStudios%2FWDS-Required-Plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevStudios%2FWDS-Required-Plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevStudios%2FWDS-Required-Plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebDevStudios","download_url":"https://codeload.github.com/WebDevStudios/WDS-Required-Plugins/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230408170,"owners_count":18220974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mu-plugins","plugins","require","wordpress"],"created_at":"2024-11-27T14:27:09.228Z","updated_at":"2024-12-19T09:07:08.852Z","avatar_url":"https://github.com/WebDevStudios.png","language":"PHP","readme":"# WDS Required Plugins\n\nA library you can use to make any plugins required and auto-activate.\n\n* Nobody can de-activate the plugin from the WordPress Admin\n* They are auto-activated when required\n\nTo use, place this library in your `mu-plugins/` directory (if you don't have one, create one in `wp-content/`), then use the example below:\n\n\u003ca href=\"https://webdevstudios.com/contact/\"\u003e\u003cimg src=\"https://webdevstudios.com/wp-content/uploads/2018/04/wds-github-banner.png\" alt=\"WebDevStudios. WordPress for big brands.\"\u003e\u003c/a\u003e\n\n## Installation \u0026 Update\n\n### With Composer\n\nAdd the following to your `composer.json`\n\n```json\n{\n    \"extra\": {\n        \"installer-paths\": {\n            \"mu-plugins/{$name}/\": [\"type:wordpress-muplugin\"]\n        }\n    }\n}\n```\n\nThen use:\n\n```bash\ncomposer require webdevstudios/wds-required-plugins\n```\n\nThis will install the `mu-plugin`, e.g. `mu-plugins/wds-required-plugins` in `wp-content` based projects. \n\nYou will have to require it in e.g. `mu-plugins/wds-required-plugins-list.php`:\n\n```php\n\u003c?php\n\nrequire WPMU_PLUGIN_DIR . '/wds-required-plugins/wds-required-plugins.php';\n\nfunction wds_required_plugins_add( $required ) {\n    return array_merge(\n      $required,\n      [\n        'my-plugin/my-plugin.php',\n      ]\n    );\n}\nadd_filter( 'wds_network_required_plugins', 'wds_required_plugins_add' );\n\n```\n\n## Example Usage\n\n```php\n\u003c?php\n\n/**\n * Add required plugins to WDS_Required_Plugins.\n *\n * @param  array $required Array of required plugins in `plugin_dir/plugin_file.php` form.\n *\n * @return array           Modified array of required plugins.\n */\nfunction wds_required_plugins_add( $required ) {\n  return array_merge(\n    $required,\n    [\n      'jetpack/jetpack.php',\n      'sample-plugin/sample-plugin.php',\n    ]\n  );\n}\nadd_filter( 'wds_required_plugins', 'wds_required_plugins_add' );\n```\n\nUse the following filter **instead** to network activate plugins:\n\n```php\nadd_filter( 'wds_network_required_plugins', 'wds_required_plugins_add' );\n```\n\n### Change the Text:\n\nTo change the label from **Required Plugin** to something else, use the following filter/code:\n\n```php\n\n/**\n * Modify the required-plugin label.\n *\n * @param  string  $label Label markup.\n *\n * @return string         (modified) label markup.\n */\nfunction change_wds_required_plugins_text( $label ) {\n\n\t$label_text = __( 'Required Plugin for ACME', 'acme-prefix' );\n\t$label = sprintf( '\u003cspan style=\"color: #888\"\u003e%s\u003c/span\u003e', $label_text );\n\n\treturn $label;\n}\nadd_filter( 'wds_required_plugins_text', 'change_wds_required_plugins_text' );\n```\n\n### Hide Required Plugins (off by default)\n\nTo hide your required plugins from the plugins list, use the following filter/code:\n\n```php\nadd_filter( 'wds_required_plugins_remove_from_list', '__return_true' );\n```\n\nThis will make any plugin that is required simply not show in the plugins list.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdevstudios%2Fwds-required-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebdevstudios%2Fwds-required-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdevstudios%2Fwds-required-plugins/lists"}