Skip to content

johngodley/redirection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2,025 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redirection

Redirection is a WordPress plugin to manage 301 redirections, keep track of 404 errors, and generally tidy up any loose ends your site may have. This is particularly useful if you are migrating pages from an old website, or are changing the directory of your WordPress installation.

Note: this is the current 'trunk' version of Redirection. It may be newer than what is in the WordPress.org plugin repository, and should be considered experimental.

Installation

Redirection can be installed by visiting the WordPress.org plugin page:

https://wordpress.org/plugins/redirection/

Customisation

Redirection provides a large set of WordPress action and filter hooks that can be used to extend or customise the plugin. These can found on the Redirection Hooks page.

Permissions

Access to the Redirection admin interface is given to users who can manage_options. You can modify this with permission filters, described on the Redirection permissions page.

Building

Redirection is mostly a PHP plugin, but does contain files that need to be built. For this you'll need Node and pnpm installed.

Requirements

  • Node.js >= 12.14.0
  • pnpm
  • Composer (for PHP development)

Setup

Install JavaScript dependencies:

pnpm install

Install PHP dependencies (for linting and testing):

composer install

Development

The UI is built with React using @wordpress/scripts. To start development with hot-reload:

pnpm start

To create a production build:

pnpm build

Linting

Run all linters:

pnpm lint

Or run individually:

  • pnpm lint:php - PHP linting (PHPCS and PHPStan)
  • pnpm lint:js - JavaScript linting
  • pnpm lint:css - CSS linting
  • pnpm lint:ts - TypeScript type checking

PHP code can be auto-formatted with:

composer format

Testing

PHP Unit tests:

pnpm test:unit

Or directly via Composer:

composer test-unit

PHP Integration tests (requires WordPress):

First, start the WordPress environment:

pnpm wp-env:start

Then run the integration tests:

pnpm test:integration

To stop the environment:

pnpm wp-env:destroy

JavaScript tests:

pnpm test:js

End-to-end tests:

pnpm test:e2e

Run all tests:

pnpm test

Releasing

Create a release build (builds assets and creates a zip file):

pnpm release

Create just the plugin zip without releasing:

pnpm plugin:zip

Release to WordPress.org SVN:

pnpm release:svn

API Documentation

Generate API documentation:

pnpm doc

Support

Please raise any bug reports or enhancement requests here. Pull requests are always welcome.

You can find a more detailed description of the plugin on the Redirection home page

Translations can be added here:

https://translate.wordpress.org/projects/wp-plugins/redirection

About

Manage all your WordPress 301 redirects and monitor 404 errors

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 31