10% cpt-list

Code Review | CPT List

WordPress plugin CPT List scored 10% from 54 tests.

About plugin

  • Plugin page: cpt-list
  • Plugin version: 0.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.9.4
  • WordPress version: 5.8.1
  • First release: Oct 21, 2015
  • Latest release: Mar 3, 2018
  • Number of updates: 3
  • Update frequency: every 288.4 days
  • Top authors: beek.yoshida (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 786 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/cpt-list/inc/cpt-list.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; CPTList has a deprecated constructor

Server metrics [RAM: ▼0.50MB] [CPU: ▼194.37ms] Passed 4 tests

Analyzing server-side resources used by CPT List
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.13 ▲0.419.34 ▼12.26
Dashboard /wp-admin3.15 ▲0.098.73 ▼34.81
Posts /wp-admin/edit.php3.15 ▲0.048.79 ▼36.05
Add New Post /wp-admin/post-new.php3.15 ▼2.298.47 ▼675.62
Media Library /wp-admin/upload.php3.15 ▲0.158.35 ▼30.99
CPT List /wp-admin/plugins.php?page=cpt-list/cpt-list.php3.257.39

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 62 new files
Database: no new tables, 1 new option
New WordPress options
widget_cptlist

Browser metrics Passed 4 tests

Checking browser requirements for CPT List
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,997 ▲40117.85 ▲2.2712.90 ▲4.8747.46 ▼1.40
Dashboard /wp-admin3,176 ▲2457.89 ▲1.68162.87 ▲13.96114.04 ▼3.93
Posts /wp-admin/edit.php2,971 ▲2324.29 ▲1.4579.17 ▲13.9395.61 ▲0.55
Add New Post /wp-admin/post-new.php1,679 ▲9818.79 ▲2.31344.07 ▼246.82124.65 ▼1,696.96
Media Library /wp-admin/upload.php1,820 ▲134.82 ▼0.24115.17 ▼107.01114.32 ▼88.11
CPT List /wp-admin/plugins.php?page=cpt-list/cpt-list.php2,8783.4068.62107.33

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/cpt-list/inc/cpt-list.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; CPTList has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_cptlist

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/plugins.php?page=cpt-list/cpt-list.php
    • > Deprecated in wp-content/plugins/cpt-list/inc/cpt-list.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; CPTList has a deprecated constructor
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=cpt-list/cpt-list.php
    • > Notice in wp-content/plugins/cpt-list/cpt-list.php+566
    Trying to access array offset on value of type bool

SRP 50% from 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
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cpt-list/cpt-list.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/cpt-list/inc/cpt-list.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: shortcode, widget, type, plugin, custom...

cpt-list/cpt-list.php Passed 13 tests

The main PHP file in "CPT List" ver. 0.1.1 adds more information about the plugin and also serves as the entry point for this plugin
61 characters long description:
Will add the custom post type list view shortcode and widget.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected10,130 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
CSS617453,032
LESS1854382,729
PHP288341,762
Sass1328241,520
SVG100640
PO File1149244327
JavaScript232120

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 251)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity313.00
▷ Minimum class complexity268.00
▷ Maximum class complexity358.00
Average method complexity15.86
▷ Minimum method complexity1.00
▷ Maximum method complexity251.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods42
▷ Static methods00.00%
▷ Public methods3992.86%
▷ Protected methods00.00%
▷ Private methods37.14%
Functions11
▷ Named functions1090.91%
▷ Anonymous functions19.09%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/default-thumbnail.png15.07KB5.47KB▼ 63.70%