{"id":20930061,"url":"https://github.com/level-level/ll-plugin-autoloader","last_synced_at":"2025-05-13T18:32:39.874Z","repository":{"id":25525756,"uuid":"104325932","full_name":"level-level/ll-plugin-autoloader","owner":"level-level","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-10T14:07:56.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-18T02:46:53.984Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/level-level.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-21T09:07:00.000Z","updated_at":"2024-09-10T14:14:50.000Z","dependencies_parsed_at":"2024-08-20T12:07:00.651Z","dependency_job_id":null,"html_url":"https://github.com/level-level/ll-plugin-autoloader","commit_stats":{"total_commits":22,"total_committers":4,"mean_commits":5.5,"dds":0.4545454545454546,"last_synced_commit":"1b620013b9c88938ce5369262144cc08714315a0"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/level-level%2Fll-plugin-autoloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/level-level%2Fll-plugin-autoloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/level-level%2Fll-plugin-autoloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/level-level%2Fll-plugin-autoloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/level-level","download_url":"https://codeload.github.com/level-level/ll-plugin-autoloader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254003425,"owners_count":21997886,"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":[],"created_at":"2024-11-18T21:28:37.991Z","updated_at":"2025-05-13T18:32:39.513Z","avatar_url":"https://github.com/level-level.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Level Level plugin autoloader\n\nWhen `0-loader.php` is inserted into the `mu-plugins` directory it will load all subdirectory plugin as it would normal plugins. \n\n## Configuration options\n\nYou have multiple options to manipulate where the Plugin Loader will look for a vendor folder. Define one of the following values in wp-config:\n\n### 1. Default == wp-content directory\nIf you define **nothing** it will load the same as 2. `wp-content` directory.\n\n### 2. wp-content directory\n\nLoad from the parent directory above `mu-plugins` (should be the `wp-content` dir). This is only used when no `LL_AUTOLOAD_DIR` is set.\n\n```\ndefine('LL_AUTOLOAD_CONTENT_DIR', true);\n```\n\n### 3. Child theme\nUse the current Child theme via `get_stylesheet_directory` as the theme folder containing the vendor folder. This is only used when no `LL_AUTOLOAD_DIR` is set.\n\n```\ndefine('LL_AUTOLOAD_USE_CHILD', true);\n```\n\n### 4. Parent/default theme\nUse the current parent theme via `get_template_directory` as the theme folder containing the vendor folder. This is only used when no `LL_AUTOLOAD_DIR` is set.\n\n```\ndefine('LL_AUTOLOAD_USE_PARENT', true);\n```\n\n### 5. Custom path\nUse a specific directory. The script will still append `/vendor/autoload.php` to this path.\n\n```\ndefine('LL_AUTOLOAD_DIR', '/path/to/wordpress/theme/');\n```\n\n### Overview\n\n| **Setting**                                  | **Result**                         |\n|----------------------------------------------|------------------------------------|\n| Nothing                                      | wp-content directory               |\n| `define( 'LL_AUTOLOAD_DIR', '/tmp/' );`      | `/tmp/`                            |\n| `define( 'LL_AUTOLOAD_CONTENT_DIR', true );` | wp-content directory               |\n| `define( 'LL_AUTOLOAD_USE_CHILD', true );`   | Stylesheet directory (child theme) |\n| `define( 'LL_AUTOLOAD_USE_PARENT', true );`  | Template directory (parent theme)  |\n\n## Pre and Post autoload\n\n### Pre autoload\nRight before the vendor autoload file is loaded, the `pre-autoload.php` file in the directory specified as the autoload directory is required if it exists. \n\nThis file can be used to set environment variables required in composer loaded dependencies.\n\n### Post autoload\nRight after the vendor autoload file is loaded, but before the `mu-plugins` are loaded, the `post-autoload.php` file in the directory specified as the autoload directory is required if it exists.\n\nThis file can be used to bootstrap/configure mu-plugin loaded dependencies, or trigger actions that need to happen as early as possible, but autoloading to be set up. \n\nAdding logging is an example of this. You probably require the Monolog composer dependency, but want it to be bootstrapped before we load the mu-plugins.\n\n## Force load normal plugins\nIn some cases, loading a plugin as must-use plugin can cause issues with the plugin.\nInstead, you have the option to force load plugins like normal plugins.\n\nIn the path where also your vendor folder is, create a file called `ll-forced-plugins.json`.\nInside, paste the following content.\n\n```json\n{\n\t\"forced_plugins\": [\n\t\t{\n\t\t\t\"slug\": \"first-plugin/first-plugin.php\",\n\t\t\t\"network\": false\n\t\t},\n\t\t{\n\t\t\t\"slug\": \"second-plugin/second-plugin.php\",\n\t\t\t\"network\": true\n\t\t}\n\t]\n}\n```\n\nThe slug references the plugin file to load.\nNetwork determines if a plugin should be network activated if it's a multisite installation.\n\nPlease note these force activated plugins will only be activated when visiting the WP-admin.\nThis is needed because some plugins want to perform actions like redirects directly after activation.\n\n## Upgrading from v2.x to v3.x\nIn v3, the `wp-content` directory loads by default, instead of the template directory in v2. To restore behaviour, set `define( 'LL_AUTOLOAD_USE_PARENT', true );` in `wp-config.php`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevel-level%2Fll-plugin-autoloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flevel-level%2Fll-plugin-autoloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevel-level%2Fll-plugin-autoloader/lists"}