79% custom-post-type-cleanup

Code Review | Custom Post Type Cleanup

WordPress plugin Custom Post Type Cleanup scored79%from 54 tests.

About plugin

  • Plugin page: custom-post-type-...
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-5.5
  • WordPress version: 6.3.1
  • First release: Aug 19, 2017
  • Latest release: Aug 28, 2020
  • Number of updates: 22
  • Update frequency: every 50.2 days
  • Top authors: keesiemeijer (100%)

Code review

54 tests

User reviews

30 reviews

Install metrics

1,000+ active /20,641 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
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼2.07ms] Passed 4 tests

An overview of server-side resources used by Custom Post Type Cleanup
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0033.55 ▼6.94
Dashboard /wp-admin3.37 ▲0.0745.43 ▼4.61
Posts /wp-admin/edit.php3.43 ▲0.0746.43 ▲0.84
Add New Post /wp-admin/post-new.php5.96 ▲0.0789.85 ▲2.43
Media Library /wp-admin/upload.php3.30 ▲0.0635.83 ▲2.45

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

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

Browser metrics Passed 4 tests

Custom Post Type Cleanup: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.24 ▼1.021.69 ▼0.0841.22 ▼3.93
Dashboard /wp-admin2,210 ▲224.84 ▼1.01107.41 ▼12.7541.57 ▼1.80
Posts /wp-admin/edit.php2,093 ▲42.03 ▲0.0439.81 ▲2.3835.64 ▲1.67
Add New Post /wp-admin/post-new.php1,531 ▲1218.31 ▼4.84650.77 ▼72.4148.92 ▼7.92
Media Library /wp-admin/upload.php1,386 ▼24.20 ▲0.0098.33 ▼9.6743.73 ▼2.76
Custom Post Type Cleanup /wp-admin/custom-post-type-cleanup.php260.440.1014.27

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 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
Please fix the following
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/custom-post-type-cleanup/includes/templates/admin-form.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/custom-post-type-cleanup/custom-post-type-cleanup.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/custom-post-type-cleanup/includes/templates/admin-registered-post-types.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/custom-post-type-cleanup/includes/templates/admin-no-posts.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-post-type-cleanup/includes/register-post-type.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/custom-post-type-cleanup.php
    • > Network (severe)
    wp-admin/custom-post-type-cleanup.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
There were not plugin tags detected

custom-post-type-cleanup/custom-post-type-cleanup.php Passed 13 tests

The main PHP script in "Custom Post Type Cleanup" version 1.3.0 is automatically included on every request by WordPress
73 characters long description:
Detect and delete posts from custom post types that are no longer in use.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin541 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP8101186511
JavaScript112030

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity24.00
▷ Minimum class complexity24.00
▷ Maximum class complexity24.00
Average method complexity4.83
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods583.33%
▷ Protected methods00.00%
▷ Private methods116.67%
Functions12
▷ Named functions12100.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
No PNG images were found in this plugin