Site Counts
Coding Test By XWP
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/rehanurrashid/coding-challenge-xwp/archive/refs/heads/main.zipA WordPress block showing counts of posts and taxonomies.
To test, add this 'Site Counts' block in the block editor.
Requirements
We suggest using a software package manager for installing the development dependencies such as Homebrew on MacOS:
brew install php composer node
or Chocolatey for Windows:
choco install php composer node nodejs
Development
-
Clone the plugin repository.
-
Set up the development environment and tools using Node.js and Composer:
npm installNote that both Node.js and PHP 7.3 or later are required on your computer for running the
npmscripts.
Scripts
We use npm as the canonical task runner for the project. Some of the PHP related scripts are defined in composer.json.
-
npm run buildto build the plugin JavaScript file. Usenpm run devto watch and re-build as you work. -
npm run lintto lint both PHP and JS files. Usenpm run lint:jsandnpm run lint:phpto lint JS and PHP separately. -
npm run testto run both PHP and JS tests without coverage reporting. Usenpm run test:jsandnpm run test:phpto run tests for JS and PHP seperately. -
npm run test:coverageto run both PHP and JS tests with coverage reporting.
Continuous Integration
We use GitHub Actions to lint all code, run tests and report test coverage to Coveralls as defined in ci.yaml.