Skip to content

Commit f977ff1

Browse files
committed
Initial commit
0 parents  commit f977ff1

File tree

13 files changed

+1149
-0
lines changed

13 files changed

+1149
-0
lines changed

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
4+
# Ignore everything.
5+
/* export-ignore
6+
7+
# Export white-listed production code only.
8+
/src -export-ignore
9+
/composer.json -export-ignore
10+
/wp-force-lowercase-urls.php -export-ignore
11+
/LICENSE -export-ignore
12+
/README.md -export-ignore

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: composer
5+
directory: "/"
6+
schedule:
7+
interval: daily
8+
time: "00:00"
9+
timezone: Europe/London

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
on: push
4+
5+
jobs:
6+
php:
7+
name: PHP ${{ matrix.php }}
8+
runs-on: ubuntu-latest
9+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
10+
strategy:
11+
matrix:
12+
php: ['7.4']
13+
14+
steps:
15+
- name: Checkout the project
16+
uses: actions/checkout@v2
17+
18+
- name: Setup the PHP ${{ matrix.php }} environment on ${{ runner.os }}
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php }}
22+
coverage: xdebug
23+
24+
- name: Restore the Composer cache directory
25+
id: composercache
26+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
27+
28+
- uses: actions/cache@v2
29+
with:
30+
path: ${{ steps.composercache.outputs.dir }}
31+
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
32+
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
33+
34+
- name: Install Composer dependencies
35+
run: composer install --no-progress --prefer-dist --optimize-autoloader
36+
37+
- name: Execute the PHP lint script
38+
run: composer run-script style:check

.github/workflows/releases.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Releases
2+
3+
on:
4+
push:
5+
tags:
6+
- "*.*.*"
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
16+
- name: Get the version
17+
id: get_version
18+
run: echo ::set-output name=value::${GITHUB_REF/refs\/tags\//}
19+
20+
- name: Setup the PHP 7.4 environment on ${{ runner.os }}
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
# Build with our minimum supported PHP version
24+
php-version: '7.4'
25+
coverage: xdebug
26+
27+
- name: Build
28+
run: composer run-script release:build
29+
30+
- name: Release
31+
uses: softprops/action-gh-release@v1
32+
with:
33+
body: Version ${{ steps.get_version.outputs.value }}
34+
files: release/wp-force-lowercase-urls.zip

.github_changelog_generator

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
unreleased=true
2+
future-release=0.1.0
3+
user=itinerisltd
4+
project=wp-force-lowercase-urls

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### Build ###
2+
/release/
3+
4+
### Composer ###
5+
/vendor/
6+
7+
#phpstorm
8+
.idea

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
4+
5+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

README.md

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# WP Force Lowercase URLs
2+
3+
[![CircleCI](https://circleci.com/gh/ItinerisLtd/wp-force-lowercase-urls.svg?style=svg)](https://circleci.com/gh/ItinerisLtd/wp-force-lowercase-urls)
4+
[![Packagist Version](https://img.shields.io/packagist/v/itinerisltd/wp-force-lowercase-urls.svg?label=release&style=flat-square)](https://packagist.org/packages/itinerisltd/wp-force-lowercase-urls)
5+
[![PHP from Packagist](https://img.shields.io/packagist/php-v/itinerisltd/wp-force-lowercase-urls.svg?style=flat-square)](https://packagist.org/packages/itinerisltd/wp-force-lowercase-urls)
6+
[![Packagist Downloads](https://img.shields.io/packagist/dt/itinerisltd/wp-force-lowercase-urls.svg?label=packagist%20downloads&style=flat-square)](https://packagist.org/packages/itinerisltd/wp-force-lowercase-urls/stats)
7+
[![GitHub License](https://img.shields.io/github/license/itinerisltd/wp-force-lowercase-urls.svg?style=flat-square)](https://github.com/ItinerisLtd/wp-force-lowercase-urls/blob/master/LICENSE)
8+
[![Hire Itineris](https://img.shields.io/badge/Hire-Itineris-ff69b4.svg?style=flat-square)](https://www.itineris.co.uk/contact/)
9+
[![Twitter Follow @itineris_ltd](https://img.shields.io/twitter/follow/itineris_ltd?style=flat-square&color=1da1f2)](https://twitter.com/itineris_ltd)
10+
[![Twitter Follow @_codepuncher](https://img.shields.io/twitter/follow/_codepuncher?style=flat-square&color=1da1f2)](https://twitter.com/_codepuncher)
11+
12+
Force uppercase URLs to lowercase.
13+
14+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
15+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
16+
17+
- [Goal](#goal)
18+
- [Features](#features)
19+
- [Minimum Requirements](#minimum-requirements)
20+
- [Installation](#installation)
21+
- [Composer (Recommended)](#composer-recommended)
22+
- [Build from Source (Not Recommended)](#build-from-source-not-recommended)
23+
- [Common Issues](#common-issues)
24+
- [FAQ](#faq)
25+
- [Will you add support for older PHP versions?](#will-you-add-support-for-older-php-versions)
26+
- [It looks awesome. Where can I find more goodies like this?](#it-looks-awesome-where-can-i-find-more-goodies-like-this)
27+
- [Where can I give :star::star::star::star::star: reviews?](#where-can-i-give-starstarstarstarstar-reviews)
28+
- [Developing](#developing)
29+
- [Testing](#testing)
30+
- [Feedback](#feedback)
31+
- [Change Log](#change-log)
32+
- [Security](#security)
33+
- [Credits](#credits)
34+
- [License](#license)
35+
36+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
37+
38+
## Goal
39+
40+
Prevent issues caused by pages existing on URLs of various casing.
41+
42+
## Features
43+
44+
- Forces URLs to lowercase
45+
- Ignores file URLs
46+
47+
[Pull requests](https://github.com/ItinerisLtd/wp-force-lowercase-urls) are welcomed.
48+
49+
## Minimum Requirements
50+
51+
- PHP v7.4
52+
- WordPress v5.8
53+
54+
## Installation
55+
56+
### Composer (Recommended)
57+
58+
```bash
59+
composer require itinerisltd/wp-force-lowercase-urls
60+
```
61+
62+
### Build from Source (Not Recommended)
63+
64+
```bash
65+
# Make sure you use the same PHP version as remote servers.
66+
# Building inside docker images is recommended.
67+
php -v
68+
69+
# Checkout source code
70+
git clone https://github.com/ItinerisLtd/wp-force-lowercase-urls.git
71+
cd wp-force-lowercase-urls
72+
git checkout <the-tag-or-the-branch-or-the-commit>
73+
74+
# Build the zip file
75+
composer release:build
76+
```
77+
78+
Then, install `release/wp-force-lowercase-urls.zip` [as usual](https://codex.wordpress.org/Managing_Plugins#Installing_Plugins).
79+
80+
## Common Issues
81+
82+
N/A
83+
84+
## FAQ
85+
86+
### Will you add support for older PHP versions?
87+
88+
Never! This plugin will only work on [actively supported PHP versions](https://secure.php.net/supported-versions.php).
89+
90+
Don't use it on **end of life** or **security fixes only** PHP versions.
91+
92+
### It looks awesome. Where can I find more goodies like this?
93+
94+
- Articles on [Itineris' blog](https://www.itineris.co.uk/blog/)
95+
- More projects on [Itineris' GitHub profile](https://github.com/itinerisltd)
96+
- More plugins on [Itineris](https://profiles.wordpress.org/itinerisltd/#content-plugins) and [_codepuncher](https://profiles.wordpress.org/codepuncher/#content-plugins) wp.org profiles
97+
- Follow [@itineris_ltd](https://twitter.com/itineris_ltd) and [@_codepuncher](https://twitter.com/_codepuncher) on Twitter
98+
- Hire [Itineris](https://www.itineris.co.uk/services/) to build your next awesome site
99+
100+
### Where can I give :star::star::star::star::star: reviews?
101+
102+
Thanks! Glad you like it. It's important to let my boss knows somebody is using this project. Please consider:
103+
104+
- leave a 5-star review on [wordpress.org](https://wordpress.org/support/plugin/wp-force-lowercase-urls/reviews/)
105+
- tweet something good with mentioning [@itineris_ltd](https://twitter.com/itineris_ltd) and [@_codepuncher](https://twitter.com/_codepuncher)
106+
- :star: star this [Github repo](https://github.com/ItinerisLtd/wp-force-lowercase-urls)
107+
- :eyes: watch this [Github repo](https://github.com/ItinerisLtd/wp-force-lowercase-urls)
108+
- write blog posts
109+
- submit [pull requests](https://github.com/ItinerisLtd/wp-force-lowercase-urls)
110+
- [hire Itineris](https://www.itineris.co.uk/services/)
111+
112+
## Developing
113+
114+
### Testing
115+
116+
```bash
117+
composer style:check
118+
```
119+
120+
Pull requests without tests will not be accepted!
121+
122+
## Feedback
123+
124+
**Please provide feedback!** We want to make this library useful in as many projects as possible.
125+
Please submit an [issue](https://github.com/ItinerisLtd/wp-force-lowercase-urls/issues/new) and point out what you do and don't like, or fork the project and make suggestions.
126+
**No issue is too small.**
127+
128+
## Change Log
129+
130+
Please see [CHANGELOG](./CHANGELOG.md) for more information on what has changed recently.
131+
132+
## Security
133+
134+
If you discover any security related issues, please email [[email protected]](mailto:[email protected]) instead of using the issue tracker.
135+
136+
## Credits
137+
138+
[wp-force-lowercase-urls](https://github.com/ItinerisLtd/wp-force-lowercase-urls) is a [Itineris Limited](https://www.itineris.co.uk/) project created by [Lee Hanbury-Pickett](https://github.com/codepuncher).
139+
140+
Full list of contributors can be found [here](https://github.com/ItinerisLtd/wp-force-lowercase-urls/graphs/contributors).
141+
142+
## License
143+
144+
[WP Force Lowercase URLs](https://github.com/ItinerisLtd/wp-force-lowercase-urls) is released under the [MIT License](https://opensource.org/licenses/MIT).

composer.json

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"name": "itinerisltd/wp-force-lowercase-urls",
3+
"type": "wordpress-plugin",
4+
"description": "Force uppercase URLs to lowercase.",
5+
"keywords": [
6+
"lowercase",
7+
"uppercase",
8+
"url",
9+
"plugin",
10+
"wordpress",
11+
"wp"
12+
],
13+
"homepage": "https://github.com/ItinerisLtd/wp-force-lowercase-urls",
14+
"license": "MIT",
15+
"authors": [
16+
{
17+
"name": "Itineris Limited",
18+
"email": "[email protected]",
19+
"homepage": "https://itineris.co.uk/",
20+
"role": "Company"
21+
},
22+
{
23+
"name": "Lee Hanbury-Pickett",
24+
"email": "[email protected]",
25+
"homepage": "https://github.com/codepuncher",
26+
"role": "Developer"
27+
}
28+
],
29+
"require": {
30+
"php": "^7.4"
31+
},
32+
"require-dev": {
33+
"itinerisltd/itineris-wp-coding-standards": "^0.4.0",
34+
"roave/security-advisories": "dev-master"
35+
},
36+
"config": {
37+
"platform": {
38+
"php": "7.4"
39+
},
40+
"sort-packages": true
41+
},
42+
"extra": {
43+
"branch-alias": {
44+
"dev-master": "0.1.x-dev"
45+
}
46+
},
47+
"autoload": {
48+
"psr-4": {
49+
"Itineris\\WpForceLowercaseUrls\\": "src/"
50+
}
51+
},
52+
"archive": {
53+
"exclude": [
54+
"*",
55+
"!*LICENSE*",
56+
"!*.php",
57+
"!/README.txt",
58+
"!src",
59+
"test",
60+
"tests"
61+
]
62+
},
63+
"prefer-stable": true,
64+
"scripts": {
65+
"pretag": [
66+
"composer update",
67+
"@style:check",
68+
"composer normalize",
69+
"github_changelog_generator --no-verbose",
70+
"npx doctoc README.md"
71+
],
72+
"release:build": [
73+
"rm -fr vendor",
74+
"composer install --no-dev --prefer-dist --optimize-autoloader",
75+
"rm -fr release wordpress",
76+
"composer archive --format=zip --dir=release --file=wp-force-lowercase-urls"
77+
],
78+
"style:check": "phpcs",
79+
"style:fix": "phpcbf"
80+
},
81+
"support": {
82+
"email": "[email protected]",
83+
"issues": "https://github.com/ItinerisLtd/wp-force-lowercase-urls/issues",
84+
"source": "https://github.com/ItinerisLtd/wp-force-lowercase-urls"
85+
}
86+
}

0 commit comments

Comments
 (0)