84% dynamic-custom-post-type

Code Review | Dynamic Custom Post Type

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

About plugin

  • Plugin page: dynamic-custom-po...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.5
  • WordPress version: 6.3.1
  • First release: Nov 23, 2015
  • Latest release: Dec 27, 2018
  • Number of updates: 20
  • Update frequency: every 56.5 days
  • Top authors: m.tuhin (55%)codesolz (50%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,020 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼0.54MB] [CPU: ▼15.68ms] Passed 4 tests

A check of server-side resources used by Dynamic Custom Post Type
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1439.08 ▼2.87
Dashboard /wp-admin3.44 ▲0.1351.30 ▼0.88
Posts /wp-admin/edit.php3.49 ▲0.1451.57 ▼2.26
Add New Post /wp-admin/post-new.php3.30 ▼2.5939.68 ▼56.70
Media Library /wp-admin/upload.php3.37 ▲0.1446.28 ▲8.13
All CPT /wp-admin/edit.php?post_type=cpt3.4140.58
Add New CPT /wp-admin/post-new.php?post_type=cpt3.2935.80

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Dynamic Custom Post Type
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.25 ▼0.381.54 ▼0.3841.00 ▲1.22
Dashboard /wp-admin2,226 ▲495.67 ▲0.0993.48 ▼1.2478.50 ▲35.98
Posts /wp-admin/edit.php2,134 ▲312.00 ▼0.0138.69 ▼0.8935.13 ▲2.41
Add New Post /wp-admin/post-new.php1,714 ▲18824.16 ▲1.00627.34 ▼53.4353.26 ▲1.26
Media Library /wp-admin/upload.php1,428 ▲284.27 ▲0.05102.00 ▼4.7577.65 ▲30.16
All CPT /wp-admin/edit.php?post_type=cpt1,0981.9332.3828.15
Add New CPT /wp-admin/post-new.php?post_type=cpt1,8092.5659.4455.04

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/post-new.php?post_type=cpt
    • > Notice in wp-content/plugins/dynamic-custom-post-type/dynamic-custom-post-type.php+254
    Undefined index: post_type
    • > GET request to /wp-admin/post-new.php?post_type=cpt
    • > Notice in wp-content/plugins/dynamic-custom-post-type/dynamic-custom-post-type.php+261
    Undefined index: dynamicCustomPostType_noncename

SRP Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
8 plugin tags: custom post type, custom post types and taxonomies, custom post types, simple custom post types, free custom post types...

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

"Dynamic Custom Post Type" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 216 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin579 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP24831572
CSS1147

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity26.00
▷ Minimum class complexity21.00
▷ Maximum class complexity31.00
Average method complexity8.14
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/icon.png0.74KB0.72KB▼ 2.78%