84% unique-coupons

Code Review | Unique Coupons

WordPress plugin Unique Coupons scored84%from 54 tests.

About plugin

  • Plugin page: unique-coupons
  • Plugin version: 0.1.3
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.7
  • WordPress version: 6.3.1
  • First release: May 6, 2021
  • Latest release: May 13, 2021
  • Number of updates: 11
  • Update frequency: every 0.6 days
  • Top authors: josefwittmann (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /406 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.31MB] [CPU: ▲0.79ms] Passed 4 tests

Server-side resources used by Unique Coupons
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3142.22 ▼3.45
Dashboard /wp-admin3.62 ▲0.3151.85 ▼1.40
Posts /wp-admin/edit.php3.67 ▲0.3156.17 ▲3.56
Add New Post /wp-admin/post-new.php6.32 ▲0.43100.96 ▲6.93
Media Library /wp-admin/upload.php3.54 ▲0.3141.04 ▲4.45

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 42 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Unique Coupons
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.35 ▼0.211.80 ▼0.5047.34 ▲0.95
Dashboard /wp-admin2,214 ▲435.62 ▲0.1288.96 ▼14.3239.61 ▼4.94
Posts /wp-admin/edit.php2,119 ▲192.03 ▲0.0340.73 ▲4.9535.76 ▲1.52
Add New Post /wp-admin/post-new.php1,539 ▲1123.03 ▼0.34605.44 ▲13.1462.36 ▲1.97
Media Library /wp-admin/upload.php1,413 ▲134.16 ▼0.06100.29 ▲0.5348.81 ▲2.35

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

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 everything seems fine, this is not 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
Please fix the following
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/unique-coupons/src/Routes/RetrieveCouponRoute.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'UniqueCoupons\\Admin\\Menu\\AssetLoader' not found in wp-content/plugins/unique-coupons/src/Admin/Menu/DevAssetLoader.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/unique-coupons/src/Routes/OptionsRoute.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/unique-coupons/unique-coupons.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/unique-coupons/src/Routes/PopupActionsRoute.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'UniqueCoupons\\Admin\\Menu\\AssetLoader' not found in wp-content/plugins/unique-coupons/src/Admin/Menu/LiveAssetLoader.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

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
3 plugin tags: unique, coupon, coupons

unique-coupons/unique-coupons.php 92% from 13 tests

The main PHP file in "Unique Coupons" ver. 0.1.3 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

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
Good job! No executable or dangerous file extensions detected2,004 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP262944341,759
JavaScript72211172
CSS27055
JSON20018

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity6.19
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.63
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes21
▷ Abstract classes14.76%
▷ Concrete classes2095.24%
▷ Final classes00.00%
Methods173
▷ Static methods3218.50%
▷ Public methods14382.66%
▷ Protected methods95.20%
▷ Private methods2112.14%
Functions19
▷ Named functions210.53%
▷ Anonymous functions1789.47%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected