64% oms-coupon

Code Review | OMS Coupon

WordPress plugin OMS Coupon scored64%from 54 tests.

About plugin

  • Plugin page: oms-coupon
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 2, 2022
  • Latest release: Dec 2, 2022
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: lelinhtinh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /191 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼6.29ms] Passed 4 tests

Server-side resources used by OMS Coupon
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1237.02 ▼3.09
Dashboard /wp-admin3.42 ▲0.1145.88 ▼1.53
Posts /wp-admin/edit.php3.53 ▲0.1746.25 ▼1.72
Add New Post /wp-admin/post-new.php6.02 ▲0.1383.12 ▼18.81
Media Library /wp-admin/upload.php3.34 ▲0.1134.93 ▲4.31
Coupon List /wp-admin/admin.php?page=oms-coupon/public/partials/coupon-public-display.php3.3735.56
Coupon Manager /wp-admin/admin.php?page=oms-coupon/admin/partials/coupon-admin-display.php3.3834.57

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 30 new files
Database: 2 new tables, 7 new options
New tables
wp_oms_coupons_user
wp_oms_coupons
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
oms_coupon_version
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for OMS Coupon
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,947 ▲20113.66 ▼0.716.08 ▲4.4739.79 ▲0.07
Dashboard /wp-admin2,243 ▲555.88 ▲0.8296.99 ▼0.3139.06 ▼5.14
Posts /wp-admin/edit.php2,123 ▲342.03 ▲0.0236.09 ▼3.7233.93 ▼2.31
Add New Post /wp-admin/post-new.php1,543 ▲2923.13 ▲5.44619.10 ▼53.1051.96 ▼2.41
Media Library /wp-admin/upload.php1,419 ▲284.23 ▼0.0394.55 ▼4.1140.36 ▼2.68
Coupon List /wp-admin/admin.php?page=oms-coupon/public/partials/coupon-public-display.php1,0201.7623.8128.22
Coupon Manager /wp-admin/admin.php?page=oms-coupon/admin/partials/coupon-admin-display.php1,3131.6924.9139.15

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Incomplete uninstall procedure, leaving 30 files (0.14MB) in the plugin directory
    • (new file) admin/partials/coupon-admin-table.php
    • (new file) admin/class-coupon-admin.php
    • (new file) LICENSE.txt
    • (new file) includes/class-coupon-activator.php
    • (new file) coupon.php
    • (new file) includes/class-coupon-deactivator.php
    • (new file) admin/css/coupon-admin.css
    • (new file) admin/index.php
    • (new file) admin/partials/coupon-admin-display.php
    • (new file) admin/js/coupon-admin.js
    • ...
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_oms_coupons
    • wp_oms_coupons_user
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • oms_coupon_version
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% 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 50% 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
The following issues need your attention
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/oms-coupon/admin/partials/coupon-admin-table.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/oms-coupon/public/partials/coupon-public-table.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/oms-coupon/public/partials/coupon-public-table.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function tz_strtodate() in wp-content/plugins/oms-coupon/admin/partials/coupon-admin-display.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 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: affiliate, deal, deals, coupons, coupon

oms-coupon/coupon.php 92% from 13 tests

The main PHP script in "OMS Coupon" version 1.0.2 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("oms-coupon.php" instead of "coupon.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin1,719 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP182191,1481,191
JavaScript3140187
PO File267102177
CSS2258164

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity15.44
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity3.10
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods62
▷ Static methods812.90%
▷ Public methods3353.23%
▷ Protected methods1829.03%
▷ Private methods1117.74%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.00%
Constants2
▷ Global constants2100.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 images were found in this plugin