78% custom-posts-for-product

Code Review | Custom Posts For Product

WordPress plugin Custom Posts For Product scored78%from 54 tests.

About plugin

  • Plugin page: custom-posts-for-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.3
  • WordPress version: 6.3.1
  • First release: Dec 24, 2017
  • Latest release: Sep 26, 2019
  • Number of updates: 14
  • Update frequency: every 45.8 days
  • Top authors: milindpd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /816 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.71MB] [CPU: ▼27.40ms] Passed 4 tests

A check of server-side resources used by Custom Posts For Product
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0639.65 ▼0.86
Dashboard /wp-admin3.24 ▼0.0635.00 ▼21.46
Posts /wp-admin/edit.php3.30 ▼0.0540.93 ▼13.68
Add New Post /wp-admin/post-new.php3.14 ▼2.7437.23 ▼73.60
Media Library /wp-admin/upload.php3.25 ▲0.0236.62 ▲1.09
Add New /wp-admin/post-new.php?post_type=product3.1439.16
All Products /wp-admin/edit.php?post_type=product3.2834.19
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=product3.2434.89
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=product3.2431.59

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: 2 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
category_children
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Posts For Product
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲6614.25 ▼0.341.69 ▲0.0341.91 ▲2.52
Dashboard /wp-admin2,227 ▲505.64 ▼0.0182.51 ▼10.3540.23 ▼4.22
Posts /wp-admin/edit.php2,151 ▲511.99 ▲0.0135.24 ▼3.9136.06 ▲3.12
Add New Post /wp-admin/post-new.php1,555 ▲2923.55 ▲0.62682.74 ▲19.3360.73 ▼0.31
Media Library /wp-admin/upload.php1,429 ▲324.22 ▲0.0499.62 ▼1.4445.77 ▲1.79
Add New /wp-admin/post-new.php?post_type=product2,7757.78182.1571.72
All Products /wp-admin/edit.php?post_type=product1,2312.0530.7232.63
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=product1,4932.1327.5834.34
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=product1,3512.1227.6932.86

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
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • category_children
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/post-new.php?post_type=product
    • > Notice in wp-content/plugins/custom-posts-for-product/Custom-Posts-For-Product.php+70
    Undefined index: product_price_box_content_nonce
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=product
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.

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
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-posts-for-product/Custom-Posts-For-Product.php:55

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: posts, custom, price, product, category

custom-posts-for-product/Custom-Posts-For-Product.php 85% from 13 tests

This is the main PHP file of "Custom Posts For Product" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("custom-posts-for-product.php" instead of "Custom-Posts-For-Product.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected125 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12424125

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin