84% cpt-editor

Code Review | Custom Post Type Editor

WordPress plugin Custom Post Type Editor scored84%from 54 tests.

About plugin

  • Plugin page: cpt-editor
  • Plugin version: 1.5
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.1
  • WordPress version: 6.3.1
  • First release: May 8, 2012
  • Latest release: Jan 18, 2023
  • Number of updates: 38
  • Update frequency: every 102.9 days
  • Top authors: jamescollins (94.74%)om4 (7.89%)

Code review

54 tests

User reviews

14 reviews

Install metrics

3,000+ active /59,238 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼6.06ms] Passed 4 tests

A check of server-side resources used by Custom Post Type Editor
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1040.58 ▼0.80
Dashboard /wp-admin3.41 ▲0.0648.37 ▼11.28
Posts /wp-admin/edit.php3.52 ▲0.1642.85 ▼7.41
Add New Post /wp-admin/post-new.php5.99 ▲0.1088.78 ▼4.75
Media Library /wp-admin/upload.php3.33 ▲0.1034.85 ▼0.68
Custom Post Types /wp-admin/options-general.php?page=cpt_editor3.3133.39

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
om4_cpt_editor

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Post Type Editor
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3313.21 ▼1.171.80 ▼0.2538.15 ▼4.42
Dashboard /wp-admin2,207 ▲195.83 ▼0.0596.80 ▼15.3839.34 ▼0.46
Posts /wp-admin/edit.php2,093 ▲42.01 ▲0.0134.49 ▼7.0233.12 ▼3.24
Add New Post /wp-admin/post-new.php1,522 ▲322.83 ▼0.42570.56 ▼106.5650.40 ▼2.16
Media Library /wp-admin/upload.php1,389 ▼24.27 ▲0.0796.17 ▲1.6941.60 ▼1.99
Custom Post Types /wp-admin/options-general.php?page=cpt_editor1,0992.0724.4134.24

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • om4_cpt_editor
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 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 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/cpt-editor/inc/OM4_CPT_List_Table.php on line 21
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/cpt-editor/inc/OM4_CPT_List_Table.php on line 21
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/cpt-editor/inc/OM4_CPT_List_Table.php on line 21

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: Add a description for screenshot #2 in cpt-editor/assets to your readme.txt
You can look at the official readme.txt

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

"Custom Post Type Editor" version 1.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
129 characters long description:
Customize the text labels, menu names or description for any registered custom post type using a simple Dashboard user interface.

Code Analysis Passed 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
Success! There were no dangerous files found in this plugin501 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2145279501

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity34.00
▷ Minimum class complexity3.00
▷ Maximum class complexity65.00
Average method complexity3.87
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods1460.87%
▷ Protected methods28.70%
▷ Private methods730.43%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin