10% dynamic-coupon-generator

Code Review | Dynamic Coupon Generator

WordPress plugin Dynamic Coupon Generator scored10%from 54 tests.

About plugin

  • Plugin page: dynamic-coupon-ge...
  • Plugin version: 0.5
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.7
  • WordPress version: 6.3.1
  • First release: Apr 25, 2021
  • Latest release: Apr 25, 2021
  • Number of updates: 3
  • Update frequency: every 1.3 days
  • Top authors: hippocampustech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /453 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/dynamic-coupon-generator/DynamicCouponGenerator_Plugin.php+38
    count(): Parameter must be an array or an object that implements Countable

Server metrics [RAM: ▲0.16MB] [CPU: ▼6.28ms] Passed 4 tests

A check of server-side resources used by Dynamic Coupon Generator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1641.96 ▼0.22
Dashboard /wp-admin3.46 ▲0.1650.78 ▼2.17
Posts /wp-admin/edit.php3.58 ▲0.2249.66 ▲2.58
Add New Post /wp-admin/post-new.php6.04 ▲0.1681.31 ▼25.29
Media Library /wp-admin/upload.php3.39 ▲0.1641.28 ▲3.43
Dynamic Coupon Generator /wp-admin/admin.php?page=DynamicCouponGenerator_PluginSettings3.3641.36

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 14 new files
Database: 1 new table, 11 new options
New tables
wp_dynamiccoupongenerator_plugin_options
New WordPress options
DynamicCouponGenerator_Plugin_ATextInput
DynamicCouponGenerator_Plugin__version
DynamicCouponGenerator_Plugin_CanDoSomething
can_compress_scripts
widget_recent-posts
DynamicCouponGenerator_Plugin__installed
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

An overview of browser requirements for Dynamic Coupon Generator
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲1514.13 ▼0.401.87 ▼0.4046.46 ▲1.04
Dashboard /wp-admin2,210 ▲305.62 ▲0.0294.04 ▲0.0142.76 ▼2.77
Posts /wp-admin/edit.php2,112 ▲121.96 ▼0.0633.40 ▼1.9935.05 ▼1.23
Add New Post /wp-admin/post-new.php1,538 ▲323.16 ▲5.06675.63 ▲27.4048.30 ▼15.68
Media Library /wp-admin/upload.php1,415 ▲214.23 ▲0.0399.48 ▲0.2747.05 ▲3.19
Dynamic Coupon Generator /wp-admin/admin.php?page=DynamicCouponGenerator_PluginSettings1,1722.1436.3327.12

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 11 options in the database
    • db_upgraded
    • DynamicCouponGenerator_Plugin_ATextInput
    • widget_recent-comments
    • DynamicCouponGenerator_Plugin_AmAwesome
    • widget_theysaidso_widget
    • DynamicCouponGenerator_Plugin__installed
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • DynamicCouponGenerator_Plugin__version
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dynamic-coupon-generator/dynamic-coupon-generator.php:57

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=DynamicCouponGenerator_PluginSettings
    • > Network (severe)
    wp-content/plugins/dynamic-coupon-generator/jquery-ui.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: copons, bogo, coupons, bulk-generate, free-product

dynamic-coupon-generator/dynamic-coupon-generator.php Passed 13 tests

The principal PHP file in "Dynamic Coupon Generator" v. 0.5 is loaded by WordPress automatically on each request
29 characters long description:
Bulk generate dynamic coupons

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin2,325 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
CSS141481,222
PHP8324441896
JavaScript2486207

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity13.83
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity1.99
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes233.33%
▷ Concrete classes466.67%
▷ Final classes00.00%
Methods80
▷ Static methods00.00%
▷ Public methods5366.25%
▷ Protected methods2733.75%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ 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
PNG images were not found in this plugin