84% manage-discount-in-admin-orders-for-woocommerce

Code Review | Manage Discount in Admin Orders for WooCommerce

WordPress plugin Manage Discount in Admin Orders for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: manage-discount-i...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7.2
  • WordPress version: 6.3.1
  • First release: Jun 15, 2021
  • Latest release: Jun 15, 2021
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: tiagohellodev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /543 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

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

Analyzing server-side resources used by Manage Discount in Admin Orders for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.06 ▲0.44
Dashboard /wp-admin3.32 ▼0.0247.93 ▼17.32
Posts /wp-admin/edit.php3.37 ▲0.0149.08 ▲0.41
Add New Post /wp-admin/post-new.php5.93 ▲0.0494.74 ▼4.05
Media Library /wp-admin/upload.php3.24 ▲0.0138.57 ▲3.50

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Manage Discount in Admin Orders for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲8014.38 ▲0.101.97 ▲0.0643.60 ▼0.24
Dashboard /wp-admin2,219 ▲485.66 ▲0.1293.99 ▲1.1342.93 ▼0.50
Posts /wp-admin/edit.php2,128 ▲282.01 ▼0.0243.09 ▲7.7239.71 ▲0.12
Add New Post /wp-admin/post-new.php1,548 ▲2223.08 ▼0.39620.24 ▼66.2873.62 ▲16.13
Media Library /wp-admin/upload.php1,430 ▲304.27 ▲0.04106.56 ▲4.3045.02 ▼2.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/manage-discount-in-admin-orders-for-woocommerce/admin/partials/manage-discount-in-admin-orders-for-woocommerce-admin-display.php

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 Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: item discounts, woocommerce, orders discounts, e-commerce, product discounts...

manage-discount-in-admin-orders-for-woocommerce/manage-discount-in-admin-orders-for-woocommerce.php Passed 13 tests

This is the main PHP file of "Manage Discount in Admin Orders for WooCommerce" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
90 characters long description:
This plugin allows you to manage discounts in WooCommerce orders placed in the backoffice.

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
Everything looks great! No dangerous files found in this plugin276 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP10120466225
JavaScript124051
CSS1040

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity4.00
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity1.72
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods25
▷ Static methods28.00%
▷ Public methods2080.00%
▷ Protected methods00.00%
▷ Private methods520.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected