83% custom-post-type-genarator

Code Review | Create Custom Post Type

WordPress plugin Create Custom Post Type scored83%from 54 tests.

About plugin

  • Plugin page: custom-post-type-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0-4.3
  • WordPress version: 6.3.1
  • First release: Oct 10, 2015
  • Latest release: Oct 10, 2015
  • Number of updates: 4
  • Update frequency: every 0.8 days
  • Top authors: anand23 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /919 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Create Custom Post Type
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0540.02 ▼1.38
Dashboard /wp-admin3.35 ▲0.0452.47 ▼2.91
Posts /wp-admin/edit.php3.41 ▲0.0554.47 ▲0.34
Add New Post /wp-admin/post-new.php5.93 ▲0.0490.84 ▼0.91
Media Library /wp-admin/upload.php3.28 ▲0.0551.35 ▲13.71
All Custom Post /wp-admin/edit.php?post_type=custom-post3.3239.04
Add New /wp-admin/post-new.php?post_type=custom-post3.3142.53

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Create Custom Post Type
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5814.34 ▼0.211.93 ▲0.2944.31 ▲1.84
Dashboard /wp-admin2,222 ▲455.63 ▲0.0193.34 ▼18.2042.01 ▼3.43
Posts /wp-admin/edit.php2,127 ▲272.04 ▲0.0337.99 ▼5.7734.58 ▼2.53
Add New Post /wp-admin/post-new.php1,560 ▲2318.19 ▼0.11609.31 ▼14.3470.08 ▼18.04
Media Library /wp-admin/upload.php1,427 ▲274.24 ▲0.0398.32 ▼4.7541.59 ▼0.79
All Custom Post /wp-admin/edit.php?post_type=custom-post1,0971.9533.1429.20
Add New /wp-admin/post-new.php?post_type=custom-post1,4352.5749.9950.43

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function flush_rewrite_rules() in wp-content/plugins/custom-post-type-genarator/uninstall.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-post-type-genarator/create-custom-post-type.php:96

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (The screenshot description corresponds to screenshot-1.(png|jpg|jpeg|gif).), #2 (The screenshot description corresponds to screenshot-2.(png|jpg|jpeg|gif).), #3 (The screenshot description corresponds to screenshot-3.(png|jpg|jpeg|gif).)
You can take inspiration from this readme.txt

custom-post-type-genarator/create-custom-post-type.php 77% from 13 tests

The primary PHP file in "Create Custom Post Type" version 1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 163 characters long)
  • Domain Path: The domain path folder was not found ("/languages")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("custom-post-type-genarator.php" instead of "create-custom-post-type.php")

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
No dangerous file extensions were detected90 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2181190

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin