78% my-custom-post-type

Code Review | My Custom Post Type

WordPress plugin My Custom Post Type scored78%from 54 tests.

About plugin

  • Plugin page: my-custom-post-type
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.0.3
  • WordPress version: 6.3.1
  • First release: Feb 6, 2023
  • Latest release: Feb 6, 2023
  • Number of updates: 2
  • Update frequency: every 2.5 days
  • Top authors: nbmblueeye (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /166 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼1.37ms] Passed 4 tests

Analyzing server-side resources used by My Custom Post Type
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0941.68 ▼4.12
Dashboard /wp-admin3.38 ▲0.0850.56 ▼2.54
Posts /wp-admin/edit.php3.44 ▲0.0854.22 ▲1.34
Add New Post /wp-admin/post-new.php6.11 ▲0.22104.94 ▲7.65
Media Library /wp-admin/upload.php3.31 ▲0.0838.91 ▼0.14
Categories /wp-admin/edit-tags.php?taxonomy=news_cat&post_type=news3.3038.59
Tags /wp-admin/edit-tags.php?taxonomy=news_tag&post_type=news3.3037.04
Add New /wp-admin/post-new.php?post_type=news6.1080.59
All News /wp-admin/edit.php?post_type=news3.3542.12

Server storage [IO: ▲0.02MB] [DB: ▲0.31MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: 1 new table, 6 new options
New tables
wp_my_custom_post_type
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for My Custom Post Type
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲8214.29 ▼0.061.47 ▼0.5739.45 ▼6.63
Dashboard /wp-admin2,246 ▲665.61 ▼0.0788.64 ▼6.6442.13 ▼5.90
Posts /wp-admin/edit.php2,151 ▲481.96 ▼0.0439.06 ▲4.2336.83 ▲0.21
Add New Post /wp-admin/post-new.php1,579 ▲4018.32 ▲0.06620.25 ▼44.5068.49 ▲10.40
Media Library /wp-admin/upload.php1,451 ▲574.18 ▲0.02100.73 ▼1.6044.87 ▼0.61
Categories /wp-admin/edit-tags.php?taxonomy=news_cat&post_type=news1,3222.1226.8732.89
Tags /wp-admin/edit-tags.php?taxonomy=news_tag&post_type=news1,3002.1227.7530.35
Add New /wp-admin/post-new.php?post_type=news6,26422.70903.8230.93
All News /wp-admin/edit.php?post_type=news1,1791.9930.9232.24

Uninstaller [IO: ▲0.00MB] [DB: ▲0.31MB] 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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

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

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/my-custom-post-type/plugin-my-custom-post-type.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/my-custom-post-type/library/my-custom-post-type-rest-route.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'My_Custom_Post_Type' not found in wp-content/plugins/my-custom-post-type/views/my-custom-post-type-input-form.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

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
Attributes that require attention: Please take inspiration from this readme.txt

my-custom-post-type/plugin-my-custom-post-type.php 92% from 13 tests

"My Custom Post Type" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("my-custom-post-type.php" instead of "plugin-my-custom-post-type.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected304 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP410016223
CSS16041
JavaScript115040

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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 are no PNG files in this plugin