89% price-field

Code Review | Price Field

WordPress plugin Price Field scored89%from 54 tests.

About plugin

  • Plugin page: price-field
  • Plugin version: 1.1.20
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-6.3
  • WordPress version: 6.3.1
  • First release: Oct 13, 2015
  • Latest release: Aug 2, 2023
  • Number of updates: 57
  • Update frequency: every 50.0 days
  • Top authors: impleCode (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /11,688 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.40MB] [CPU: ▼6.33ms] Passed 4 tests

An overview of server-side resources used by Price Field
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.4055.32 ▲10.58
Dashboard /wp-admin3.76 ▲0.4151.13 ▼18.17
Posts /wp-admin/edit.php3.81 ▲0.4552.73 ▲2.53
Add New Post /wp-admin/post-new.php6.29 ▲0.4083.90 ▼7.90
Media Library /wp-admin/upload.php3.62 ▲0.3939.94 ▼1.79
Price Field /wp-admin/options-general.php?page=ic_price3.5937.22

Server storage [IO: ▲0.13MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
It is recommended to fix the following issues
  • The plugin illegally modified 1 file (4.00KB) outside of "wp-content/plugins/price-field/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 46 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Price Field
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6413.34 ▼1.022.29 ▲0.5744.10 ▲1.35
Dashboard /wp-admin2,228 ▲284.84 ▼1.01110.01 ▲9.8039.44 ▼2.82
Posts /wp-admin/edit.php2,110 ▲102.06 ▲0.0639.59 ▲1.1935.90 ▲2.73
Add New Post /wp-admin/post-new.php1,541 ▼417.59 ▼5.64696.81 ▲2.0760.30 ▲3.19
Media Library /wp-admin/upload.php1,410 ▲134.30 ▲0.0798.49 ▼36.9441.13 ▼23.83
Price Field /wp-admin/options-general.php?page=ic_price1,7631.7929.7529.06

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === price-field === )
  • Screenshots: These screenshots require images: #1 (Price Field box), #2 (Price on front-end), #3 (Price Settings)
The official readme.txt is a good inspiration

price-field/price-field.php Passed 13 tests

"Price Field" version 1.1.20's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
91 characters long description:
Add Price Field to posts, pages or any custom post type. Full integration with Post Type X.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin2,089 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP282796052,003
JSON20071
CSS40811
JavaScript40224

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity17.50
▷ Minimum class complexity9.00
▷ Maximum class complexity26.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods1372.22%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions85
▷ Named functions8498.82%
▷ Anonymous functions11.18%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/implecode.png11.70KB5.04KB▼ 56.91%