83% woocommerce-darwin-pricing-integration

Code Review | WooCommerce Darwin Pricing Integration

WordPress plugin WooCommerce Darwin Pricing Integration scored83%from 54 tests.

About plugin

  • Plugin page: woocommerce-darwi...
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.8.0
  • WordPress version: 6.3.1
  • First release: Feb 11, 2015
  • Latest release: May 31, 2017
  • Number of updates: 19
  • Update frequency: every 44.3 days
  • Top authors: Sebastien Fauvel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,343 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.52ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Darwin Pricing Integration
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0137.33 ▼3.90
Dashboard /wp-admin3.32 ▲0.0146.28 ▲0.82
Posts /wp-admin/edit.php3.37 ▲0.0146.31 ▼0.73
Add New Post /wp-admin/post-new.php5.90 ▲0.0190.71 ▼4.72
Media Library /wp-admin/upload.php3.24 ▲0.0133.50 ▼0.71

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Darwin Pricing Integration
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3413.92 ▼0.361.72 ▲0.0547.41 ▲2.78
Dashboard /wp-admin2,198 ▲215.55 ▼0.1083.19 ▼8.0535.32 ▼4.99
Posts /wp-admin/edit.php2,103 ▲31.97 ▼0.0336.89 ▲0.5733.48 ▲2.19
Add New Post /wp-admin/post-new.php1,533 ▲523.04 ▼0.07599.10 ▼40.6154.35 ▼32.64
Media Library /wp-admin/upload.php1,397 ▲34.17 ▼0.0497.17 ▼5.6443.76 ▼4.11

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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 following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Integration' not found in wp-content/plugins/woocommerce-darwin-pricing-integration/includes/class-wc-darwin-pricing.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% 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
10 plugin tags: dynamic pricing, woocommerce, widget, coupon, darwin pricing...

woocommerce-darwin-pricing-integration/woocommerce-darwin-pricing-integration.php 77% from 13 tests

This is the main PHP file of "WooCommerce Darwin Pricing Integration" version 1.3.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 151 characters long)
  • Domain Path: Prefix the domain path with a forward slash character ("/languages/")
  • Domain Path: The domain path should use only dashes and lowercase characters ("languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin522 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP265200429
JavaScript13663
JSON10021
XML1009

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity15.00
▷ Minimum class complexity3.00
▷ Maximum class complexity29.00
Average method complexity1.89
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods48
▷ Static methods24.17%
▷ Public methods3470.83%
▷ Protected methods1327.08%
▷ Private methods12.08%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin