84% disable-custom-post-types

Code Review | Disable Custom Post Types

WordPress plugin Disable Custom Post Types scored84%from 54 tests.

About plugin

  • Plugin page: disable-custom-po...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 19, 2018
  • Latest release: Mar 19, 2018
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: XpertOne (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /792 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼3.17ms] Passed 4 tests

Server-side resources used by Disable Custom Post Types
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.0844.51 ▼4.38
Dashboard /wp-admin3.53 ▲0.1863.10 ▲12.75
Posts /wp-admin/edit.php3.58 ▲0.1856.03 ▲1.33
Add New Post /wp-admin/post-new.php6.02 ▲0.0988.10 ▼9.75
Media Library /wp-admin/upload.php3.36 ▲0.0939.21 ▲0.12
Disable Post Types /wp-admin/options-general.php?page=disable_post_types3.3637.34

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Disable Custom Post Types
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,949 ▲18814.97 ▲0.801.85 ▲0.1442.46 ▲1.91
Dashboard /wp-admin2,358 ▲1786.35 ▲0.76124.39 ▲37.5153.02 ▲7.52
Posts /wp-admin/edit.php2,286 ▲1893.49 ▲1.4749.38 ▲13.2631.74 ▼1.53
Add New Post /wp-admin/post-new.php1,543 ▲1523.53 ▲0.50643.70 ▼30.0634.78 ▼14.32
Media Library /wp-admin/upload.php1,420 ▲204.32 ▲0.1083.78 ▼29.2646.37 ▲2.31
Disable Post Types /wp-admin/options-general.php?page=disable_post_types1,0363.5446.0725.00

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • hmk_excl_ptypes

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)
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
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/disable-custom-post-types/settings.php:125
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/disable-custom-post-types/settings.php:125

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 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Requires at least: Invalid plugin version format
  • Requires php: Invalid plugin version format
You can take inspiration from this readme.txt

disable-custom-post-types/disable-custom-post-types.php Passed 13 tests

The principal PHP file in "Disable Custom Post Types" v. 1.0 is loaded by WordPress automatically on each request
52 characters long description:
Simple plugin to disable unwanted custom post types.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin489 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3157209489

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity36.50
▷ Minimum class complexity4.00
▷ Maximum class complexity69.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods36
▷ Static methods00.00%
▷ Public methods36100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
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
No PNG files were detected