90% cpt-single-redirects

Code Review | CPT Single Redirects

WordPress plugin CPT Single Redirects scored90%from 54 tests.

About plugin

  • Plugin page: cpt-single-redirects
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-5.4
  • WordPress version: 6.3.1
  • First release: Apr 29, 2020
  • Latest release: Apr 29, 2020
  • Number of updates: 9
  • Update frequency: N/A
  • Top authors: cortesfrau (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /404 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼0.13MB] [CPU: ▼11.30ms] Passed 4 tests

Server-side resources used by CPT Single Redirects
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.85 ▼0.6119.22 ▼32.00
Dashboard /wp-admin3.33 ▲0.0347.97 ▼8.72
Posts /wp-admin/edit.php3.38 ▲0.0351.02 ▼0.84
Add New Post /wp-admin/post-new.php5.91 ▲0.0290.93 ▼3.65
Media Library /wp-admin/upload.php3.25 ▲0.0339.13 ▲0.02
CPT Single Redirects /wp-admin/options-general.php?page=cpt-single-redirects3.2235.62

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for CPT Single Redirects
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.34 ▼0.011.51 ▼0.2240.35 ▼4.03
Dashboard /wp-admin2,199 ▲225.63 ▲0.0589.98 ▼11.1239.71 ▼5.19
Posts /wp-admin/edit.php2,104 ▲41.99 ▼0.0437.15 ▲1.8135.65 ▲1.51
Add New Post /wp-admin/post-new.php1,531 ▲123.22 ▲0.24692.31 ▲58.0656.25 ▲7.74
Media Library /wp-admin/upload.php1,404 ▲44.18 ▲0.0393.90 ▼10.3344.56 ▼4.85
CPT Single Redirects /wp-admin/options-general.php?page=cpt-single-redirects7952.0224.6428.96

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: single, template, redirect, custom post type

cpt-single-redirects/cpt-single-redirects.php 92% from 13 tests

The main file in "CPT Single Redirects" v. 1.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin131 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP26039107
CSS241424

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity1.78
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin