84% woo-wrong-coupon-notification

Code Review | Woocommerce Wrong Coupon Notification

WordPress plugin Woocommerce Wrong Coupon Notification scored84%from 54 tests.

About plugin

  • Plugin page: woo-wrong-coupon-...
  • Plugin version: 0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9.0
  • WordPress version: 6.3.1
  • First release: Dec 25, 2017
  • Latest release: Dec 25, 2017
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: r4kib.hbo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /546 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 successfully, without throwing any errors or notices

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

Server-side resources used by Woocommerce Wrong Coupon Notification
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0042.61 ▼0.93
Dashboard /wp-admin3.31 ▲0.0147.40 ▼4.86
Posts /wp-admin/edit.php3.36 ▲0.0045.51 ▼3.87
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.13 ▼42.69
Media Library /wp-admin/upload.php3.23 ▲0.0039.04 ▼2.27

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Woocommerce Wrong Coupon Notification
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.74 ▲0.221.67 ▼0.1040.79 ▼11.30
Dashboard /wp-admin2,208 ▲345.61 ▼0.0684.12 ▼13.4938.92 ▼3.72
Posts /wp-admin/edit.php2,117 ▲172.02 ▲0.0237.68 ▲1.6234.61 ▼1.37
Add New Post /wp-admin/post-new.php1,539 ▲1322.94 ▼0.16649.46 ▼106.6057.94 ▲1.98
Media Library /wp-admin/upload.php1,416 ▲164.18 ▼0.08112.91 ▼2.2847.54 ▼0.74

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-wrong-coupon-notification/woocommerce-wrong-coupon-notification.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: woocommerce, coupon, notification

woo-wrong-coupon-notification/woocommerce-wrong-coupon-notification.php 92% from 13 tests

The primary PHP file in "Woocommerce Wrong Coupon Notification" version 0.5 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-wrong-coupon-notification.php" instead of "woocommerce-wrong-coupon-notification.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin46 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP116946

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.04
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.17
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods466.67%
▷ Protected methods233.33%
▷ Private methods00.00%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin