84% custom-permalinks

Code Review | Custom Permalinks

WordPress plugin Custom Permalinks scored 84% from 54 tests.

About plugin

  • Plugin page: custom-permalinks
  • Plugin version: 2.3.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-5.8
  • WordPress version: 5.8.1
  • First release: Nov 1, 2008
  • Latest release: Sep 21, 2021
  • Number of updates: 179
  • Update frequency: every 26.3 days
  • Top authors: sasiddiqui (66.48%)michaeltyson (34.08%)

Code review

54 tests

User reviews

99 reviews

Install metrics

100,000+ active / 1,806,728 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.38MB] [CPU: ▼140.10ms] Passed 4 tests

An overview of server-side resources used by Custom Permalinks
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.19 ▲0.3641.80 ▲5.85
Dashboard /wp-admin3.49 ▲0.4340.51 ▼11.70
Posts /wp-admin/edit.php3.54 ▲0.4350.86 ▲3.25
Add New Post /wp-admin/post-new.php5.78 ▲0.3590.57 ▼557.78
Media Library /wp-admin/upload.php3.37 ▲0.3740.39 ▲6.02
Taxonomies Permalinks /wp-admin/admin.php?page=cp-taxonomy-permalinks3.3231.11
Post Types Permalinks /wp-admin/admin.php?page=cp-post-permalinks3.3532.21
About /wp-admin/admin.php?page=cp-about-plugins3.3931.25

Server storage [IO: ▲1.09MB] [DB: ▲0.00MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 44 new files
Database: no new tables, 1 new option
New WordPress options
custom_permalinks_plugin_version

Browser metrics Passed 4 tests

Checking browser requirements for Custom Permalinks
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,742 ▲17016.23 ▲0.5812.05 ▼0.1746.98 ▼0.07
Dashboard /wp-admin3,009 ▲725.96 ▼0.09143.10 ▼12.58104.30 ▼9.05
Posts /wp-admin/edit.php2,778 ▲392.72 ▲0.0274.77 ▲4.3886.69 ▲4.38
Add New Post /wp-admin/post-new.php1,760 ▲16918.30 ▼0.64371.15 ▼59.04107.73 ▼4.03
Media Library /wp-admin/upload.php1,846 ▲395.05 ▲0.00156.65 ▲6.80114.96 ▲1.17
Taxonomies Permalinks /wp-admin/admin.php?page=cp-taxonomy-permalinks1,3052.0956.1454.76
Post Types Permalinks /wp-admin/admin.php?page=cp-post-permalinks1,3482.1059.4154.49
About /wp-admin/admin.php?page=cp-about-plugins2,5302.0959.0499.15

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 1 option in the database
    • custom_permalinks_plugin_version

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=cp-taxonomy-permalinks
    • > Warning in wp-content/plugins/custom-permalinks/admin/class-custom-permalinks-taxonomies.php+60
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/admin.php?page=cp-taxonomy-permalinks
    • > Warning in wp-content/plugins/custom-permalinks/admin/class-custom-permalinks-taxonomies.php+102
    uasort() expects parameter 1 to be array, bool given
    • > GET request to /wp-admin/admin.php?page=cp-taxonomy-permalinks
    • > Warning in wp-content/plugins/custom-permalinks/admin/class-custom-permalinks-taxonomies.php+106
    Invalid argument supplied for foreach()

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: custom post type, custom, gdpr compliant, redirect, address...

custom-permalinks/custom-permalinks.php Passed 13 tests

"Custom Permalinks" version 2.3.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
42 characters long description:
Set custom permalinks on a per-post basis.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin10,947 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
SVG9118,119
PHP134501,1662,502
PO File6132212324
CSS1001
JavaScript1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity32.70
▷ Minimum class complexity1.00
▷ Maximum class complexity117.00
Average method complexity4.45
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes440.00%
Methods93
▷ Static methods1212.90%
▷ Public methods6772.04%
▷ Protected methods1212.90%
▷ Private methods1415.05%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/media-post-permalink.png24.03KB11.56KB▼ 51.92%
assets/images/prevent-xss-vulnerability.png7.36KB7.25KB▼ 1.51%