83% woocommerce-dynamic-pricing-exclusions

Code Review | WooCommerce Dynamic Pricing Product Exclusions

WordPress plugin WooCommerce Dynamic Pricing Product Exclusions scored83%from 54 tests.

About plugin

  • Plugin page: woocommerce-dynam...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.9.2
  • WordPress version: 6.3.1
  • First release: Aug 8, 2014
  • Latest release: Aug 9, 2014
  • Number of updates: 7
  • Update frequency: every 0.1 days
  • Top authors: nathanfranklinau (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /2,907 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.01MB] [CPU: ▼9.38ms] Passed 4 tests

An overview of server-side resources used by WooCommerce Dynamic Pricing Product Exclusions
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.11 ▼5.43
Dashboard /wp-admin3.33 ▼0.0243.20 ▼28.47
Posts /wp-admin/edit.php3.38 ▲0.0247.61 ▲0.25
Add New Post /wp-admin/post-new.php5.91 ▲0.0294.84 ▼3.87
Media Library /wp-admin/upload.php3.25 ▲0.0235.20 ▲2.18

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Dynamic Pricing Product Exclusions
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▲0.101.81 ▼0.3738.74 ▼3.46
Dashboard /wp-admin2,206 ▲184.86 ▼0.03107.21 ▼7.4042.41 ▼1.04
Posts /wp-admin/edit.php2,089 ▼02.03 ▼0.0139.38 ▲2.1134.45 ▲0.67
Add New Post /wp-admin/post-new.php1,546 ▲2418.42 ▼4.83618.52 ▼56.2163.88 ▲6.47
Media Library /wp-admin/upload.php1,385 ▼34.25 ▲0.02100.38 ▼17.1442.52 ▼7.18

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-dynamic-pricing-exclusions/plugin.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (Module Exclusions on Edit Product page.)
The official readme.txt is a good inspiration

woocommerce-dynamic-pricing-exclusions/plugin.php 69% from 13 tests

The main file in "WooCommerce Dynamic Pricing Product Exclusions" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woocommerce-dynamic-pricing-exclusions.php" instead of "plugin.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: Keep the plugin description shorter than 140 characters (currently 178 characters long)
  • Requires at least: The required version number did not match the one declared in readme.txt ("3.5" instead of "3.3")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected117 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1172380
PO File19937

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.66
Average class complexity24.00
▷ Minimum class complexity24.00
▷ Maximum class complexity24.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods787.50%
▷ Protected methods00.00%
▷ Private methods112.50%
Functions0
▷ Named functions00.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
1 PNG file occupies 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png23.68KB7.22KB▼ 69.53%