68% after-order-discounts-for-woocommerce

Code Review | After order discounts for woocommerce

WordPress plugin After order discounts for woocommerce scored68%from 54 tests.

About plugin

  • Plugin page: after-order-disco...
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2.1
  • WordPress version: 6.3.1
  • First release: May 21, 2019
  • Latest release: Jun 23, 2019
  • Number of updates: 17
  • Update frequency: every 2.1 days
  • Top authors: premiumwoo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /967 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

Analyzing server-side resources used by After order discounts for woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.01 ▼7.19
Dashboard /wp-admin3.31 ▲0.0046.74 ▼7.34
Posts /wp-admin/edit.php3.36 ▲0.0049.43 ▼6.70
Add New Post /wp-admin/post-new.php5.89 ▲0.0096.12 ▼12.23
Media Library /wp-admin/upload.php3.23 ▲0.0035.82 ▼3.41

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for After order discounts for woocommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▼0.071.63 ▼0.0643.01 ▼5.23
Dashboard /wp-admin2,192 ▲155.51 ▼0.1687.32 ▼11.7842.46 ▼1.05
Posts /wp-admin/edit.php2,097 ▼31.97 ▼0.0238.31 ▼0.1936.08 ▼2.72
Add New Post /wp-admin/post-new.php1,533 ▲723.46 ▲0.12627.33 ▼29.8865.95 ▲16.22
Media Library /wp-admin/upload.php1,394 ▼34.19 ▼0.0497.42 ▼4.0341.37 ▼3.18

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class '$base_controller' not found
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/after-order-discounts-for-woocommerce/App/Views/Site/Spins/login_to_spin.php
    • > /wp-content/plugins/after-order-discounts-for-woocommerce/App/Views/Site/Spins/menu.php
    • > /wp-content/plugins/after-order-discounts-for-woocommerce/App/Views/Admin/no_discount_types.php
    • > /wp-content/plugins/after-order-discounts-for-woocommerce/App/Views/Site/Spins/prize_list.php
  • 106× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: language in wp-content/plugins/after-order-discounts-for-woocommerce/App/Views/Admin/Rules/Conditions/order_category.php on line 2
    • > PHP Notice
      Undefined variable: language in wp-content/plugins/after-order-discounts-for-woocommerce/App/Views/Admin/Rules/Conditions/order_customers.php on line 2
    • > PHP Notice
      Trying to get property 'condition_order_payment_methods' of non-object in wp-content/plugins/after-order-discounts-for-woocommerce/App/Views/Admin/Rules/Conditions/order_payment_method.php on line 10
    • > PHP Notice
      Undefined variable: language in wp-content/plugins/after-order-discounts-for-woocommerce/App/Views/Admin/Rules/Discounts/order_spin.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Waod\\App\\Models\\Base' not found in wp-content/plugins/after-order-discounts-for-woocommerce/App/Models/SpinLogModel.php:4
    • > PHP Notice
      Trying to get property 'condition_order_customers_note' of non-object in wp-content/plugins/after-order-discounts-for-woocommerce/App/Views/Admin/Rules/Conditions/order_customers.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Waod\\App\\Controllers\\Base' not found in wp-content/plugins/after-order-discounts-for-woocommerce/App/Controllers/Admin/Manage.php:12
    • > PHP Notice
      Trying to get property 'condition_order_customers' of non-object in wp-content/plugins/after-order-discounts-for-woocommerce/App/Views/Admin/Rules/Conditions/order_customers.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to a member function button() on null in wp-content/plugins/after-order-discounts-for-woocommerce/App/Views/Admin/Rules/Conditions/order_category.php:44
    • > PHP Notice
      Undefined variable: roulette in wp-content/plugins/after-order-discounts-for-woocommerce/App/Views/Site/Spins/menu.php on line 10

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes: The official readme.txt might help

after-order-discounts-for-woocommerce/after-order-discounts-for-woocommerce.php Passed 13 tests

The main PHP script in "After order discounts for woocommerce" version 1.0.4 is automatically included on every request by WordPress
98 characters long description:
This WooCommerce Coupon Plugin helps you to Create Discount Coupon Code for your Regular Customer.

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
Success! There were no dangerous files found in this plugin8,032 lines of code in 69 files:
LanguageFilesBlank linesComment linesLines of code
PHP512999964,418
CSS7565243,065
JavaScript102146548
JSON1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity19.40
▷ Minimum class complexity1.00
▷ Maximum class complexity84.00
Average method complexity3.87
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces9
Interfaces0
Traits0
Classes30
▷ Abstract classes310.00%
▷ Concrete classes2790.00%
▷ Final classes00.00%
Methods202
▷ Static methods2612.87%
▷ Public methods19797.52%
▷ Protected methods20.99%
▷ Private methods31.49%
Functions5
▷ Named functions120.00%
▷ Anonymous functions480.00%
Constants11
▷ Global constants981.82%
▷ Class constants218.18%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
Assets/Images/win-wheel-icon.png10.97KB4.63KB▼ 57.76%