10% gna-woo-coupons

Code Review | GNA WooCommerce Coupons

WordPress plugin GNA WooCommerce Coupons scored10%from 54 tests.

About plugin

  • Plugin page: gna-woo-coupons
  • Plugin version: 0.9.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.7
  • WordPress version: 6.3.1
  • First release: Apr 14, 2016
  • Latest release: Sep 5, 2016
  • Number of updates: 7
  • Update frequency: every 35.2 days
  • Top authors: chris_dev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /909 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method GNA_WooCoupons::activate_handler() should not be called statically

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

An overview of server-side resources used by GNA WooCommerce Coupons
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0037.17 ▼4.26
Dashboard /wp-admin3.31 ▼0.0446.10 ▼20.29
Posts /wp-admin/edit.php3.36 ▲0.0046.11 ▼1.24
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.51 ▲8.62
Media Library /wp-admin/upload.php3.23 ▲0.0030.90 ▼3.30

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for GNA WooCommerce Coupons
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲6313.21 ▼1.481.62 ▼1.0238.46 ▼8.58
Dashboard /wp-admin2,206 ▲186.04 ▲1.1099.43 ▼15.2542.19 ▼0.27
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0238.92 ▲3.6236.51 ▼0.13
Add New Post /wp-admin/post-new.php1,528 ▲923.04 ▼0.22636.76 ▼18.5858.27 ▼7.52
Media Library /wp-admin/upload.php1,391 ▼04.23 ▲0.0495.72 ▼3.1641.14 ▼4.65

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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 | 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
Please fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gna-woo-coupons/inc/gna-woo-coupons-config.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GNA_WooCoupons_Admin_Menu' not found in wp-content/plugins/gna-woo-coupons/admin/gna-woo-coupons-admin-settings-menu.php:3

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Donate link: Please fix this invalid URI: "none"
The official readme.txt is a good inspiration

gna-woo-coupons/gna-woo-coupons.php Passed 13 tests

Analyzing the main PHP file in "GNA WooCommerce Coupons" version 0.9.2
134 characters long description:
Additional functionality for WooCommerce Coupons: Allow discounts with specific day, weekdays only, weekends only or day of week, etc.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin415 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP67836415

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity5.20
▷ Minimum class complexity1.00
▷ Maximum class complexity10.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods52
▷ Static methods59.62%
▷ Public methods52100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/gna_20x20.png2.98KB0.33KB▼ 88.89%