{"id":17004218,"url":"https://github.com/ppfeufer/wp-development","last_synced_at":"2026-04-09T08:02:36.087Z","repository":{"id":231139617,"uuid":"781001322","full_name":"ppfeufer/wp-development","owner":"ppfeufer","description":"WP Development","archived":false,"fork":false,"pushed_at":"2024-04-14T07:38:45.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-14T08:00:16.950Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ppfeufer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"ko_fi":"ppfeufer"}},"created_at":"2024-04-02T15:07:29.000Z","updated_at":"2024-04-17T14:32:24.196Z","dependencies_parsed_at":"2024-04-17T14:42:28.778Z","dependency_job_id":null,"html_url":"https://github.com/ppfeufer/wp-development","commit_stats":null,"previous_names":["ppfeufer/wp-development"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppfeufer%2Fwp-development","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppfeufer%2Fwp-development/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppfeufer%2Fwp-development/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppfeufer%2Fwp-development/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppfeufer","download_url":"https://codeload.github.com/ppfeufer/wp-development/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244937835,"owners_count":20535127,"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-10-14T04:43:06.001Z","updated_at":"2026-04-09T08:02:36.080Z","avatar_url":"https://github.com/ppfeufer.png","language":"JavaScript","funding_links":["https://ko-fi.com/ppfeufer"],"categories":[],"sub_categories":[],"readme":"# WP Development\u003ca name=\"wp-development\"\u003e\u003c/a\u003e\n\nThis is a setup for WordPress development using Git repositories for plugins and themes.\n\n______________________________________________________________________\n\n\u003c!-- mdformat-toc start --slug=github --maxlevel=6 --minlevel=2 --\u003e\n\n- [Requirements](#requirements)\n  - [Folder Structure](#folder-structure)\n    - [Soft Links](#soft-links)\n  - [Software](#software)\n    - [Install Apache2](#install-apache2)\n      - [Apache Configuration](#apache-configuration)\n    - [Install PHP](#install-php)\n    - [Install MariaDB](#install-mariadb)\n    - [Install Git](#install-git)\n    - [Install Composer](#install-composer)\n    - [Install PHP Code Sniffer](#install-php-code-sniffer)\n    - [Install WP-CLI](#install-wp-cli)\n  - [PhpStorm](#phpstorm)\n    - [Settings to Double-Check](#settings-to-double-check)\n      - [Composer](#composer)\n      - [PHP Code Sniffer](#php-code-sniffer)\n      - [File Watchers (Optional)](#file-watchers-optional)\n- [Makefile](#makefile)\n  - [Clear Transient Caches](#clear-transient-caches)\n  - [Install pre-commit Hook](#install-pre-commit-hook)\n  - [Run pre-commit Checks](#run-pre-commit-checks)\n  - [Update pre-commit Configuration](#update-pre-commit-configuration)\n  - [Install WP-CLI](#install-wp-cli-1)\n  - [Update WP-CLI](#update-wp-cli)\n\n\u003c!-- mdformat-toc end --\u003e\n\n______________________________________________________________________\n\n\u003e [!NOTE]\n\u003e\n\u003e This setup is optimized for Linux, with the shell commands to install packages\n\u003e targeted at Debian- or Ubuntu-based distributions.\n\u003e If you use a different distribution, you might have to adjust the commands\n\u003e and/or package names.\n\u003e\n\u003e If you use a different operating system, you might have to make some adjustments.\\\n\u003e If you use Windows, you can use the Windows Subsystem for Linux (WSL) to run this setup.\n\u003e You can find more information about WSL [here](https://docs.microsoft.com/en-us/windows/wsl/).\n\u003e\n\u003e It is suggested to fork this repository and adjust the setup to your needs.\n\u003e This way, you can keep your setup in sync with your repository.\n\u003e You can find more information about forking a repository [here](https://docs.github.com/en/get-started/quickstart/fork-a-repo).\n\n## Requirements\u003ca name=\"requirements\"\u003e\u003c/a\u003e\n\n### Folder Structure\u003ca name=\"folder-structure\"\u003e\u003c/a\u003e\n\nThis setup expects the following folder structure:\n\n```text\n~/Development/\n│-- WordPress/\n│   │-- Repositories/ # «-- This is where the plugin and theme Git repositories are located\n│   │   │-- wp-content/\n│   │   │   │-- plugins/ # «-- This is where the plugins are located\n│   │   │   │-- themes/ # «-- This is where the themes are located\n│   │-- WP-Development/ # «-- This git repository and the project root folder\n│   │   │-- wp-content/ # «-- This is a soft link to the `wp-content` folder in the Repositories folder\n│   │-- WP-Sources/ # «-- This is where the WordPress sources are located and where we will run our WordPress instance (Apache vhost configuration points to this folder)\n│   │   │-- …\n│   │   │-- wp-content/\n│   │   │   │-- plugins/ # «-- This is a soft link to the `plugins` folder in the Repositories folder\n│   │   │   │-- themes/ # «-- This is a soft link to the `themes` folder in the Repositories folder\n│   │   │-- …\n```\n\n#### Soft Links\u003ca name=\"soft-links\"\u003e\u003c/a\u003e\n\nNow we have to create a couple of soft links to make this work.\n\nFirst, we need to link the `plugins` and `themes` from the repositories to the\nWordPress sources.\n\n```shell\n# First move the plugins and themes folders to the repositories\nmv ~/Development/WordPress/WP-Sources/wp-content/plugins/ ~/Development/WordPress/Repositories/wp-content/\nmv ~/Development/WordPress/WP-Sources/wp-content/themes/ ~/Development/WordPress/Repositories/wp-content/\n\n# Now create the soft links\nln -s ~/Development/WordPress/Repositories/wp-content/plugins/ ~/Development/WordPress/WP-Sources/wp-content/plugins\nln -s ~/Development/WordPress/Repositories/wp-content/themes/ ~/Development/WordPress/WP-Sources/wp-content/themes\n```\n\nThen we need to link the `wp-content` folder from the repositories to\nthe `WP-Development` folder.\n\n```shell\nln -s ~/Development/WordPress/Repositories/wp-content/ ~/Development/WordPress/WP-Development/wp-content\n```\n\n### Software\u003ca name=\"software\"\u003e\u003c/a\u003e\n\nThis setup requires the following software installed on your machine:\n\n- Apache2\n- Composer\n- Git\n- MariaDB 10.11 or newer\n- PHP 8.2 or newer\n- PHP Code Sniffer\n- WP-CLI\n\n#### Install Apache2\u003ca name=\"install-apache2\"\u003e\u003c/a\u003e\n\nTo install Apache2, run the following command:\n\n```shell\nsudo apt install apache2\n```\n\nNow enable the required Apache modules:\n\n```shell\nsudo a2enmod rewrite\nsudo a2enmod vhost_alias\n```\n\n##### Apache Configuration\u003ca name=\"apache-configuration\"\u003e\u003c/a\u003e\n\nThe Apache configuration for the WordPress instance should look like this:\n\n```apache\n\u003cVirtualHost *:80\u003e\n    ServerName wp-development.local\n    DocumentRoot \"/home/username/Development/WordPress/WP-Sources\"\n\n    SetEnv APPLICATION_ENV \"development\"\n\n    ErrorLog ${APACHE_LOG_DIR}/wp-development-error.log\n    CustomLog ${APACHE_LOG_DIR}/wp-development-access.log combined\n\n    \u003cDirectory \"/home/username/Development/WordPress/WP-Sources\"\u003e\n        Options FollowSymLinks\n        DirectoryIndex index.php\n        AllowOverride All\n        Require all granted\n    \u003c/Directory\u003e\n\u003c/VirtualHost\u003e\n```\n\nRemember to add the domain to your `/etc/hosts` file.\n\n```text\n127.0.0.1    wp-development.local\n```\n\nNow restart Apache.\n\n```shell\nsudo systemctl restart apache2.service\n```\n\n#### Install PHP\u003ca name=\"install-php\"\u003e\u003c/a\u003e\n\nTo install PHP, run the following command:\n\n```shell\nsudo apt install php libapache2-mod-php php-mysql php-xml php-mbstring php-curl php-zip php-gd php-imagick php-intl php-xmlrpc\n```\n\nNow restart Apache.\n\n```shell\nsudo systemctl restart apache2.service\n```\n\n#### Install MariaDB\u003ca name=\"install-mariadb\"\u003e\u003c/a\u003e\n\nTo install MariaDB, run the following command:\n\n```shell\nsudo apt install mariadb-server\n```\n\nNow secure the MariaDB installation.\n\n```shell\nsudo mysql_secure_installation\n```\n\nNow restart MariaDB.\n\n```shell\nsudo systemctl restart mariadb.service\n```\n\n#### Install Git\u003ca name=\"install-git\"\u003e\u003c/a\u003e\n\nTo install Git, run the following command:\n\n```shell\nsudo apt install git\n```\n\n#### Install Composer\u003ca name=\"install-composer\"\u003e\u003c/a\u003e\n\nComposer might be needed for some plugins or themes.\nNot all distributions come with Composer pre-installed,\nso you might have to install it yourself.\n\nTo install Composer, run the following command from the `~/Development/WordPress/WP-Development` folder.\n\n```shell\nmake install-composer\n```\n\nThis will download the Composer phar file and make it executable and create a\nsymlink to the `/usr/local/bin` folder as `composer`.\n\n#### Install PHP Code Sniffer\u003ca name=\"install-php-code-sniffer\"\u003e\u003c/a\u003e\n\nPHP Code Sniffer is a tool to help you write clean code. It checks your code against a set of coding standards.\n\nTo install PHP Code Sniffer, run the following command from the `~/Development/WordPress/WP-Development` folder.\n\n```shell\nmake install-phpcs\n```\n\nThis will install PHP Code Sniffer globally and make it available as a global command under `/usr/local/bin/phpcs`.\n\n#### Install WP-CLI\u003ca name=\"install-wp-cli\"\u003e\u003c/a\u003e\n\nWP-CLI is a command-line interface for WordPress. It allows you to do many tasks\nwithout using the WordPress admin interface.\n\nTo install WP-CLI, run the following command from the `~/Development/WordPress/WP-Development` folder.\n\n```shell\nmake install-wp-cli\n```\n\nThis will download the WP-CLI phar file and make it executable and create a\nsymlink to the `/usr/local/bin` folder as `wp-cli`.\n\n### PhpStorm\u003ca name=\"phpstorm\"\u003e\u003c/a\u003e\n\nThis setup is optimized for JetBrains [PhpStorm](https://www.jetbrains.com/phpstorm/).\nIf you use another IDE, you might have to adjust the setup a bit.\n\n\u003e [!NOTE]\n\u003e\n\u003e The IDE settings are stored in the `.idea` folder in `~/Development/WordPress/WP-Development`.\n\u003e\n\u003e Due to the nature of PhpStorm, you might have to adjust the settings to your needs when\n\u003e forking this repository.\n\u003e Not all settings accept a relative path (e.g., `~/Development/WordPress/WP-Development`),\n\u003e so there is a good change some of them containing the absolute path to my home folder.\n\u003e\n\u003e You can find more information about PhpStorm settings [here](https://www.jetbrains.com/help/phpstorm/settings-preferences-dialog.html).\n\n#### Settings to Double-Check\u003ca name=\"settings-to-double-check\"\u003e\u003c/a\u003e\n\n\u003e [!NOTE]\n\u003e\n\u003e Some settings need node modules to be installed.\\\n\u003e For this setup, the node modules are assumed to be installed in\n\u003e the `~/Development/node_modules/` folder.\n\n##### Composer\u003ca name=\"composer\"\u003e\u003c/a\u003e\n\nSee how to install composer [here](#install-composer).\n\n- **Settings \u003e PHP \u003e Composer**\n  - **Composer executable**: `/usr/local/bin/composer`\n  - **Path to composer.json**: Leave empty\n\n##### PHP Code Sniffer\u003ca name=\"php-code-sniffer\"\u003e\u003c/a\u003e\n\nSee how to install PHP Code Sniffer [here](#install-php-code-sniffer).\n\n- **Settings \u003e PHP \u003e Quality Tools \u003e PHP Code Sniffer**\n  - **PHP Code Sniffer (phpcs) path**: `/usr/local/bin/phpcs`\n  - **PHP Code Beautifier and Fixer (phpcbf) path**: `/usr/local/bin/phpcbf`\n  - **Coding standard**: `Custom`\n  - **Configuration file**: `~/Development/WordPress/WP-Development/phpcs.xml`\n\n##### File Watchers (Optional)\u003ca name=\"file-watchers-optional\"\u003e\u003c/a\u003e\n\nThe file watchers are completely optional.\nThey are used to minify and optimize CSS and JavaScript files.\n\nTo use them, you need to have the following node modules installed:\n\n- [csso-cli](https://www.npmjs.com/package/csso-cli)\n- [terser](https://www.npmjs.com/package/terser)\n- [sass](https://www.npmjs.com/package/sass)\n\nFor simplicities’ sake, it is assumed that node modules are installed in the `~/Development/node_modules/` folder.\nYou can install them by running the following command from the `~/Development` folder.\n\n```shell\nnpm install csso-cli terser sass\n```\n\nTo configure the file watchers, go to:\n\n- **Settings \u003e Tools \u003e File Watchers**\n  - **CSSO CSS Optimizer**\n    - **Program**: `/home/your_user/Development/node_modules/csso-cli/bin/csso`\n    - **File type**: `Cascade Style Sheets`\n    - **Scope**: `Project Files`\n    - **Arguments**: `-i $FileName$ -o $FileNameWithoutExtension$.min.css -s file`\n    - **Output paths**: `$FileNameWithoutExtension$.min.css`\n    - **Working directory**: `$FileDir$`\n    - **Advanced options**: Nothing selected\n  - **Terser**\n    - **Program**: `/home/your_user/Development/node_modules/terser/bin/terser`\n    - **File type**: `JavaScript`\n    - **Scope**: `Project Files`\n    - **Arguments**: `$FileName$ -o $FileNameWithoutExtension$.min.js --source-map \"url='$FileNameWithoutExtension$.min.js.map'\" --compress reduce_vars=false --mangle --format quote_style=1`\n    - **Output paths**: `$FileNameWithoutExtension$.min.js`\n    - **Working directory**: `$FileDir$`\n    - **Advanced options**: Nothing selected\n  - **SCSS**\n    - **Program**: `/home/your_user/Development/node_modules/sass/sass.js`\n    - **File type**: `SCSS Style Sheets`\n    - **Scope**: `Project Files`\n    - **Arguments**: `--style=compressed $FileName$:../assets/css/$FileNameWithoutExtension$.css`\n    - **Output paths**: `$FileNameWithoutExtension$.css:$FileNameWithoutExtension$.css.map`\n    - **Working directory**: `$FileDir$`\n    - **Advanced options**: Nothing selected\n\n## Makefile\u003ca name=\"makefile\"\u003e\u003c/a\u003e\n\nThe Makefile contains a couple of useful commands.\n\nAll commands are run from the `~/Development/WordPress/WP-Development` folder.\n\n### Clear Transient Caches\u003ca name=\"clear-transient-caches\"\u003e\u003c/a\u003e\n\nThis will clear WordPress transient caches, which can be useful when developing.\n\n```shell\nmake clear-transients\n```\n\n### Install pre-commit Hook\u003ca name=\"install-pre-commit-hook\"\u003e\u003c/a\u003e\n\nThis will install the pre-commit hook for the project.\n\n```shell\nmake pre-commit-install\n```\n\n### Run pre-commit Checks\u003ca name=\"run-pre-commit-checks\"\u003e\u003c/a\u003e\n\nThis will run the pre-commit checks.\n\n```shell\nmake pre-commit-checks\n```\n\n### Update pre-commit Configuration\u003ca name=\"update-pre-commit-configuration\"\u003e\u003c/a\u003e\n\nThis will update the pre-commit configuration.\n\n```shell\nmake update-pre-commit\n```\n\n### Install WP-CLI\u003ca name=\"install-wp-cli-1\"\u003e\u003c/a\u003e\n\nThis will install WP-CLI and make it available as a global command under `/usr/local/bin/wp-cli`.\n\n```shell\nmake install-wp-cli\n```\n\n### Update WP-CLI\u003ca name=\"update-wp-cli\"\u003e\u003c/a\u003e\n\nThis will update WP-CLI to the latest version.\n\n```shell\nmake update-wp-cli\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppfeufer%2Fwp-development","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppfeufer%2Fwp-development","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppfeufer%2Fwp-development/lists"}