{"id":20532046,"url":"https://github.com/monogramm/wp-plugin-template","last_synced_at":"2025-08-01T01:12:33.484Z","repository":{"id":42033802,"uuid":"290051382","full_name":"Monogramm/wp-plugin-template","owner":"Monogramm","description":":elephant: :alembic: WordPress Plugin template","archived":false,"fork":false,"pushed_at":"2025-07-19T09:03:29.000Z","size":150,"stargazers_count":1,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-19T14:57:10.013Z","etag":null,"topics":["docker","javascript","jquery","php","plugin","template","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Monogramm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2020-08-24T22:14:34.000Z","updated_at":"2022-06-21T21:10:49.000Z","dependencies_parsed_at":"2024-01-28T01:32:24.900Z","dependency_job_id":"78dd28b6-3c66-4830-a87c-901219f2f7fd","html_url":"https://github.com/Monogramm/wp-plugin-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/Monogramm/wp-plugin-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monogramm%2Fwp-plugin-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monogramm%2Fwp-plugin-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monogramm%2Fwp-plugin-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monogramm%2Fwp-plugin-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Monogramm","download_url":"https://codeload.github.com/Monogramm/wp-plugin-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monogramm%2Fwp-plugin-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268152113,"owners_count":24204043,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["docker","javascript","jquery","php","plugin","template","wordpress","wordpress-plugin"],"created_at":"2024-11-16T00:12:18.937Z","updated_at":"2025-08-01T01:12:33.457Z","avatar_url":"https://github.com/Monogramm.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License: AGPL v3][uri_license_image]][uri_license]\n[![Docs](https://img.shields.io/badge/Docs-Github%20Pages-blue)](https://monogramm.github.io/wp-plugin-template/)\n[![gitmoji-changelog](https://img.shields.io/badge/Changelog-gitmoji-blue.svg)](https://github.com/frinyvonnick/gitmoji-changelog)\n[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/Monogramm/wp-plugin-template)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Monogramm/wp-plugin-template/Docker%20Image%20CI)](https://github.com/Monogramm/wp-plugin-template/actions)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/b1db1c7d98f949e2897ac0f41fbbfb30)](https://www.codacy.com/gh/Monogramm/wp-plugin-template?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=Monogramm/wp-plugin-template\u0026amp;utm_campaign=Badge_Grade)\n[![GitHub stars](https://img.shields.io/github/stars/Monogramm/wp-plugin-template?style=social)](https://github.com/Monogramm/wp-plugin-template)\n\n\u003c!--\n[TODO] If project uses Taiga.io for project management:\n\n[![Managed with Taiga.io](https://img.shields.io/badge/Managed%20with-TAIGA.io-709f14.svg)](https://tree.taiga.io/project/monogrammbot-monogrammwp-plugin-template/ \"Managed with Taiga.io\")\n--\u003e\n\n\u003c!--\n[TODO] If project uses Coveralls for code coverage:\n\n[![Coverage Status](https://coveralls.io/repos/github/Monogramm/wp-plugin-template/badge.svg?branch=master)](https://coveralls.io/github/Monogramm/wp-plugin-template?branch=master)\n--\u003e\n\n# **WP Plugin Template**\n\n\u003e :elephant: :alembic: WP Plugin Template\n\nCheck [readme.txt](readme.txt) for plugin usage documentation (required by WordPress.org).\n\nThis template is highly inspired from [hlashbrooke/WordPress Plugin Template](https://github.com/hlashbrooke/wordpress-plugin-template).\n\n## :blue_book: Docs\n\nSee WordPress.org plugin at [wordpress.org/plugins/wp-plugin-template](https://wordpress.org/plugins/wp-plugin-template/).\n\nA technical documentation is also available at \u003chttps://monogramm.github.io/wp-plugin-template/\u003e.\nYou can generate the PHP documentation using PHPDocumentor:\n\n```bash\ndocker run --rm -v \"${PWD}:/data\" phpdoc/phpdoc:3 run\n```\n\n## :chart_with_upwards_trend: Changes\n\nAll notable changes to this project will be documented in [CHANGELOG](./CHANGELOG.md) file.\n\nThis (technical) CHANGELOG is generated with :heart: by [gitmoji-changelog](https://github.com/frinyvonnick/gitmoji-changelog).\n\nThis project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n\u003c!--\n[TODO] If project uses Taiga.io for project management:\n\n## :bookmark: Roadmap\n\nSee [Taiga.io](https://tree.taiga.io/project/monogrammbot-monogrammwp-plugin-template/ \"Taiga.io monogrammbot-monogramm-wp-plugin-template\")\n--\u003e\n\n## :construction: Install\n\n### Gitpod\n\nYou can use [GitPod](https://gitpod.io/) to run a local development environment: [![open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/Monogramm/wp-plugin-template)\n\nIf you wish to sign your commits using GitPod, follow the instructions from [gitpod-io/gitpod#666](https://github.com/gitpod-io/gitpod/issues/666#issuecomment-534347856):\n\n-   Convert your source `.gnugpg` directory contents to base64 data: `tar -czvf - ./.gnupg | base64 -w 0`\n-   Place this data into a gitpod environment variable called `GNUGPG`\n-   Get your source signing key: `gpg --list-secret-keys --keyid-format LONG`\n-   Place this data into a gitpod environment variable called `GNUGPG_KEY`\n\n### Docker\n\nYou can use the docker test environment to install this plugin. Check tests section for details.\n\n### Git clone\n\nIf you already have a WordPress instance, you can clone this plugin directly:\n\n```\ncd wp-content/plugins/\ngit clone https://github.com/Monogramm/wp-plugin-template.git\n```\n\n### ZIP Archive\n\nYou can build the WordPress plugin zip file using the following command:\n\n```sh\n./bin/generate-plugin-zip.sh 'wp-plugin-template'\n```\n\nYou can then manually install the plugin on your WordPress.\n\n## :rocket: Usage\n\n### How to create a new plugin from this template\n\nYou can simply copy the files out of this repo and rename everything as you need it, but to make things easier I have included a [shell script](https://github.com/Monogramm/wp-plugin-template/blob/master/bin/build-plugin.sh) in this repo that will automatically copy the files to a new folder, remove all traces of the existing git repo, rename everything in the files according to your new plugin name, and initialise a new git repo in the folder if you choose to do so.\n\n#### Running the script\n\nYou can run the script just like you would run any shell script - it does not take any arguments, so you don't need to worry about that. Once you start the script it will ask for three things:\n\n1.  **Plugin name** - this must be the full name of your plugin, with correct capitalisation and spacing.\n2.  **Destination folder** - this will be the folder where your new plugin will be created - typically this will be your `wp-content/plugins` folder. You can provide a path that is relative to the script, or an absolute path - either will work.\n3.  **Include Grunt support (y/n)** - if you enter 'y' here then the Grunt files will be included in the new plugin folder.\n4.  **Initialize new git repo (y/n)** - if you enter 'y' here then a git repo will be initialised in the new plugin folder.\n\n### Easy management script\n\nThis template provides a shell script for easy management of your plugin.\n\n```shell\n./manage.sh\n```\n\n### API functions\n\nThere are a few libraries built into it that will make a number of common tasks a lot easier.\n\n#### Registering a new post type\n\nUsing the [post type API](https://github.com/hlashbrooke/wp-plugin-template/blob/master/includes/lib/class-wp-plugin-template-post-type.php) and the wrapper function from the main plugin class you can easily register new post types with one line of code. For example if you wanted to register a `listing` post type then you could do it like this:\n\n`WP_Plugin_Template()-\u003eregister_post_type( 'listing', __( 'Listings', 'wp-plugin-template' ), __( 'Listing', 'wp-plugin-template' ) );`\n\n_Note that the `WP_Plugin_Template()` function name and the `wp-plugin-template` text domain will each be unique to your plugin after you have used the cloning script._\n\nThis will register a new post type with all the standard settings. If you would like to modify the post type settings you can use the `{$post_type}_register_args` filter. See [the WordPress codex page](https://developer.wordpress.org/reference/functions/register_post_type/) for all available arguments.\n\n#### Registering a new taxonomy\n\nUsing the [taxonomy API](https://github.com/hlashbrooke/wp-plugin-template/blob/master/includes/lib/class-wp-plugin-template-taxonomy.php) and the wrapper function from the main plugin class you can easily register new taxonomies with one line of code. For example if you wanted to register a `location` taxonomy that applies to the `listing` post type then you could do it like this:\n\n`WP_Plugin_Template()-\u003eregister_taxonomy( 'location', __( 'Locations', 'wp-plugin-template' ), __( 'Location', 'wp-plugin-template' ), 'listing' );`\n\n_Note that the `WP_Plugin_Template()` function name and the `wp-plugin-template` text domain will each be unique to your plugin after you have used the cloning script._\n\nThis will register a new taxonomy with all the standard settings. If you would like to modify the taxonomy settings you can use the `{$taxonomy}_register_args` filter. See [the WordPress codex page](https://developer.wordpress.org/reference/functions/register_taxonomy/) for all available arguments.\n\n#### Defining your Settings Page Location\n\nUsing the filter `{base}menu_settings` you can define the placement of your settings page. Set the `location` key to `options`, `menu` or `submenu`. When using `submenu` also set the `parent_slug` key to your preferred parent menu, e.g `themes.php`. For example use the following code to let your options page display under the Appearance parent menu.\n\n```php\n$settings['location'] = 'submenu';\n$settings['parent_slug'] = 'themes.php';\n```\n\nSee respective codex pages for `location` option defined below:\n\n-   \u003chttps://codex.wordpress.org/Function_Reference/add_options_page\u003e\n-   \u003chttps://developer.wordpress.org/reference/functions/add_menu_page/\u003e\n-   \u003chttps://developer.wordpress.org/reference/functions/add_submenu_page/\u003e\n\n#### Calling your Options\n\nUsing the [Settings API](https://github.com/Monogramm/wp-plugin-template/blob/master/includes/class-wp-plugin-template-settings.php) and the wrapper function from the main plugin class you can easily store options from the WP admin like text boxes, radio options, dropdown, etc. You can call the values by using `id` that you have set under the `settings_fields` function. For example you have the `id` - `text_field`, you can call its value by using `get_option('wp_plugin_template_text_field')`. Take note that by default, this plugin is using a prefix of `wp_plugin_template_` before the id that you will be calling, you can override that value by changing it under the `__construct` function `$this-\u003ebase` variable;\n\n### What does this template offers\n\nThis template includes the following features:\n\n-   Plugin headers as required by WordPress \u0026 WordPress.org\n-   Readme.txt file as required by WordPress.org\n-   Main plugin class\n-   Full \u0026 minified Javascript files\n-   Grunt.js support\n-   Standard enqueue functions for the dashboard and the frontend\n-   A library for easily registering a new post type\n-   A library for easily registering a new taxonomy\n-   A library for handling common admin functions (including adding meta boxes to any post type, displaying settings fields and display custom fields for posts)\n-   A complete and versatile settings class like you see [here](http://www.hughlashbrooke.com/complete-versatile-options-page-class-wordpress-plugin/)\n-   A .pot generation / update to make localisation easier\n-   Full text of the AGPLv3 license\n-   Automated tests and code quality monitoring using PHPUnit, PHPCS and ESLint\n-   GitHub and GitLab templates for Issues and Pull Requests\n-   Docker dev and test environments for easy integration into any CI (with current integration to Travis CI and GitHub Actions)\n-   Plugin install and uninstall hooks\n-   Easy class to manage shortcodes\n\nSee the [changelog](https://github.com/Monogramm/wp-plugin-template/blob/master/changelog.txt) for a complete list of changes as the template develops.\n\n## :white_check_mark: Run tests\n\nYou can use the docker-compose file to run a dev / test environment:\n\n```sh\n./manage.sh start\n```\n\nYou can now access a local WordPress env at `http://localhost:8080`.\n\nFollow the tests logs (Ctrl + C to exit):\n\n```sh\n./manage.sh logs sut\n```\n\nThe `sut` container will run:\n\n-   PHPUnit for this plugin\n-   PHPCS for Code quality\n\nYou can also check Travis-CI [Travis-CI](https://travis-ci.org/Monogramm/wp-plugin-template) or [GitHub Actions](https://github.com/Monogramm/wp-plugin-template/actions) for the latest tests results.\n\nTo reset your test environment, you can just drop the containers and the persisted data:\n\n```sh\n./manage.sh reset\n```\n\n## :bust_in_silhouette: Authors\n\n**Monogramm**\n\n-   Website: \u003chttps://www.monogramm.io\u003e\n-   Github: [@Monogramm](https://github.com/Monogramm)\n\n## :handshake: Contributing\n\nContributions, issues and feature requests are welcome!\u003cbr /\u003eFeel free to check [issues page](https://github.com/Monogramm/wp-plugin-template/issues).\n[Check the contributing guide](./CONTRIBUTING.md).\u003cbr /\u003e\n\n## :thumbsup: Show your support\n\nGive a :star: if this project helped you!\n\n## :page_facing_up: License\n\nCopyright © 2020 [Monogramm](https://github.com/Monogramm).\u003cbr /\u003e\nThis project is [AGPL v3](uri_license) licensed.\n\n* * *\n\n_This README was generated with :heart: by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_\n\n[uri_license]: http://www.gnu.org/licenses/agpl.html\n\n[uri_license_image]: https://img.shields.io/badge/License-AGPL%20v3-blue.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonogramm%2Fwp-plugin-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonogramm%2Fwp-plugin-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonogramm%2Fwp-plugin-template/lists"}