84% atr-woo-global-price-options

Code Review | Woocommerce Global Price Options

WordPress plugin Woocommerce Global Price Options scored84%from 54 tests.

About plugin

  • Plugin page: atr-woo-global-pr...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Apr 5, 2018
  • Latest release: Dec 17, 2022
  • Number of updates: 32
  • Update frequency: every 53.7 days
  • Top authors: yehudaT (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

40+ active /2,348 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.20ms] Passed 4 tests

A check of server-side resources used by Woocommerce Global Price Options
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.57 ▼2.73
Dashboard /wp-admin3.31 ▲0.0041.51 ▼7.00
Posts /wp-admin/edit.php3.36 ▲0.0045.14 ▼0.60
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.32 ▼14.08
Media Library /wp-admin/upload.php3.23 ▲0.0033.53 ▼0.97

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Woocommerce Global Price Options: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.24 ▼1.371.73 ▼0.0139.99 ▼6.62
Dashboard /wp-admin2,206 ▲155.87 ▼0.04108.05 ▲3.8141.78 ▼3.66
Posts /wp-admin/edit.php2,092 ▲62.18 ▲0.1441.71 ▲6.1040.32 ▲2.93
Add New Post /wp-admin/post-new.php1,514 ▼2817.67 ▼0.64627.36 ▼18.8648.46 ▼9.03
Media Library /wp-admin/upload.php1,388 ▼04.25 ▲0.06106.60 ▲5.9045.73 ▲4.06

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/atr-woo-global-price-options/public/partials/atr-woo-global-price-options-public-display.php
    • > /wp-content/plugins/atr-woo-global-price-options/admin/partials/atr-woo-global-price-options-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: price options, photography, woocommerce, product options, global prices...

atr-woo-global-price-options/atr-woo-global-price-options.php 92% from 13 tests

The main PHP file in "Woocommerce Global Price Options" ver. 1.0.5 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.4.14" instead of "2.6.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected1,616 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP142537101,117
PO File1907,549271
JavaScript22836117
CSS259111

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity20.78
▷ Minimum class complexity1.00
▷ Maximum class complexity85.00
Average method complexity3.62
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods68
▷ Static methods22.94%
▷ Public methods5885.29%
▷ Protected methods00.00%
▷ Private methods1014.71%
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

All PNG images should be compressed to minimize bandwidth usage for end users
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/css/remove_option.png1.10KB1.31KB0.00%
public/css/add_option.png1.63KB1.45KB▼ 10.90%