94% custom-post-type-lister-cpt-lister

Code Review | Custom Post Type Lister - CPT Lister

WordPress plugin Custom Post Type Lister - CPT Lister scored 94% from 53 tests.

About plugin

  • Plugin page: custom-post-type-...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4.1
  • WordPress version: 5.8.1
  • First release: Jan 14, 2016
  • Latest release: May 22, 2020
  • Number of updates: 18
  • Update frequency: every 88.8 days
  • Top authors: GeroNikolov (100%)

Code review

53 tests

User reviews

2 reviews

Install metrics

30+ active / 1,228 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼295.76ms] Passed 4 tests

This is a short check of server-side resources used by Custom Post Type Lister - CPT Lister
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0136.85 ▲4.52
Dashboard /wp-admin3.07 ▲0.0140.16 ▼3.99
Posts /wp-admin/edit.php3.12 ▲0.0143.43 ▼3.00
Add New Post /wp-admin/post-new.php5.43 ▲0.0089.26 ▼1,170.75
Media Library /wp-admin/upload.php3.01 ▲0.0032.30 ▼5.31

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Custom Post Type Lister - CPT Lister
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,674 ▲6815.83 ▲0.228.07 ▲1.2549.12 ▼1.47
Dashboard /wp-admin2,928 ▲755.92 ▲0.07139.67 ▼10.48103.85 ▲0.14
Posts /wp-admin/edit.php2,706 ▼02.69 ▼0.1365.51 ▼3.5996.32 ▲1.13
Add New Post /wp-admin/post-new.php1,653 ▼20018.80 ▲0.02363.57 ▼14.97110.99 ▲6.51
Media Library /wp-admin/upload.php1,775 ▼05.01 ▼0.00146.08 ▼9.26105.11 ▼7.94

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/custom-post-type-lister-cpt-lister/cpt-lister.php:100

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === custom-post-type-lister-cpt-lister === )
The official readme.txt might help

custom-post-type-lister-cpt-lister/cpt-lister.php 92% from 13 tests

The primary PHP file in "Custom Post Type Lister - CPT Lister" version 2.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("custom-post-type-lister-cpt-lister.php" instead of "cpt-lister.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin71 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP223871

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity11.00
▷ Minimum method complexity11.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods1
▷ Static methods00.00%
▷ Public methods1100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin