83% category-to-custom-post-type

Code Review | Category 2 Post Type

WordPress plugin Category 2 Post Type scored83%from 54 tests.

About plugin

  • Plugin page: category-to-custo...
  • Plugin version: 0.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4.2
  • WordPress version: 6.3.1
  • First release: Feb 16, 2016
  • Latest release: Mar 29, 2016
  • Number of updates: 8
  • Update frequency: every 20.9 days
  • Top authors: erikdmitchell (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /1,543 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Category 2 Post Type
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.46 ▼3.09
Dashboard /wp-admin3.31 ▲0.0147.88 ▼2.30
Posts /wp-admin/edit.php3.36 ▲0.0146.00 ▼2.77
Add New Post /wp-admin/post-new.php5.89 ▲0.0188.54 ▼5.79
Media Library /wp-admin/upload.php3.23 ▲0.0034.90 ▼2.89
Cat 2 Post Type /wp-admin/tools.php?page=cat2posttype3.2127.39

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Category 2 Post Type: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.28 ▼1.401.66 ▲0.0538.73 ▼2.03
Dashboard /wp-admin2,210 ▲214.84 ▼1.06113.24 ▲1.6541.66 ▼2.14
Posts /wp-admin/edit.php2,096 ▲42.03 ▼0.0260.33 ▲21.6653.06 ▲20.66
Add New Post /wp-admin/post-new.php1,536 ▲323.20 ▲0.04672.34 ▼6.7948.95 ▼5.06
Media Library /wp-admin/upload.php1,395 ▲74.21 ▼0.0098.93 ▼2.2742.39 ▼0.59
Cat 2 Post Type /wp-admin/tools.php?page=cat2posttype9241.7128.9526.13

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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 take a closer look at the following
  • 1× 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/category-to-custom-post-type/cat2posttype.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Donate link: Invalid URI found ("erikdmitchell@gmail.com")
You can take inspiration from this readme.txt

category-to-custom-post-type/cat2posttype.php 85% from 13 tests

The principal PHP file in "Category 2 Post Type" v. 0.1.5 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("category-to-custom-post-type.php" instead of "cat2posttype.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin240 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP15980229
JavaScript15011

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods562.50%
▷ Protected methods337.50%
▷ Private methods00.00%
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

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin