90% woocommerce-gold-price

Code Review | WooCommerce Gold Price

WordPress plugin WooCommerce Gold Price scored90%from 54 tests.

About plugin

  • Plugin page: woocommerce-gold-...
  • Plugin version: 7.6.1
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.2
  • WordPress version: 6.3.1
  • First release: Dec 19, 2012
  • Latest release: May 3, 2023
  • Number of updates: 30
  • Update frequency: every 126.3 days
  • Top authors: Gabriel Reguly (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

300+ active /6,479 total downloads

Benchmarks

Plugin footprint 83% 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.09MB] [CPU: ▼6.28ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Gold Price
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1043.64 ▲1.84
Dashboard /wp-admin3.40 ▲0.0648.69 ▼23.15
Posts /wp-admin/edit.php3.45 ▲0.1050.54 ▼0.91
Add New Post /wp-admin/post-new.php5.98 ▲0.1098.53 ▼1.38
Media Library /wp-admin/upload.php3.32 ▲0.1036.92 ▲0.34

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Gold Price
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲3214.34 ▼0.051.79 ▼0.3845.49 ▼11.34
Dashboard /wp-admin2,192 ▲155.63 ▲0.0384.97 ▼9.5638.25 ▼2.95
Posts /wp-admin/edit.php2,103 ▲62.04 ▼0.0941.72 ▲2.0535.93 ▼3.25
Add New Post /wp-admin/post-new.php1,535 ▼218.02 ▼0.55605.89 ▼20.3178.06 ▲19.53
Media Library /wp-admin/upload.php1,403 ▲34.23 ▲0.03103.64 ▼2.3244.63 ▼1.54

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: Screenshot #1 (Updating gold values and product prices) image required
Please take inspiration from this readme.txt

woocommerce-gold-price/woocommerce-gold-price.php Passed 13 tests

Analyzing the main PHP file in "WooCommerce Gold Price" version 7.6.1
93 characters long description:
Adds a Gold Price for 24k, 22k, 18k and 14k gold products, making easy to update their prices

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin628 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP125045521
PO File14046107

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
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%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png39.93KB14.63KB▼ 63.37%
screenshot-2.png25.10KB25.56KB0.00%