83% hash-coupon

Code Review | HashCoupon

WordPress plugin HashCoupon scored83%from 54 tests.

About plugin

  • Plugin page: hash-coupon
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Feb 11, 2022
  • Latest release: Feb 19, 2022
  • Number of updates: 195
  • Update frequency: every 0.0 days
  • Top authors: hashcryptech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,739 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▼11.13MB] [CPU: ▼2,302,475.96ms] Passed 4 tests

Server-side resources used by HashCoupon
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▼44.5939.60 ▼9,209,876.90
Dashboard /wp-admin3.39 ▼0.0050.01 ▼18.73
Posts /wp-admin/edit.php3.50 ▲0.1049.49 ▼0.99
Add New Post /wp-admin/post-new.php5.97 ▲0.0490.24 ▼7.21
Media Library /wp-admin/upload.php3.31 ▲0.0339.66 ▲2.84

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by HashCoupon
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲4614.28 ▲0.131.64 ▼0.2043.90 ▲5.11
Dashboard /wp-admin2,195 ▲175.56 ▼0.0594.91 ▼10.7142.76 ▲0.96
Posts /wp-admin/edit.php2,103 ▼01.99 ▲0.0437.13 ▼4.4639.20 ▲2.74
Add New Post /wp-admin/post-new.php1,529 ▲123.29 ▲0.09688.23 ▲32.3155.44 ▲2.85
Media Library /wp-admin/upload.php1,403 ▲34.28 ▲0.07100.82 ▼0.4943.77 ▼1.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/hash-coupon/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Contributors: Plugin contributors field is missing
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This is the main screen of HashCoupon.You have to active the status of HashCoupon here.), #2 (Dashboard Widget of HashCoupon Will Show you the status of HashCoupon.), #3 (You Will see the apply coupon link like this.), #4 (The Pop Model will show all Available Coupon List.)
The official readme.txt is a good inspiration

hash-coupon/wp-hash-coupon.php 92% from 13 tests

"HashCoupon" version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("hash-coupon.php" instead of "wp-hash-coupon.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected1,732 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
CSS310025727
JavaScript211252586
PHP798207382
Markdown215036
SVG1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity3.25
▷ Minimum class complexity2.00
▷ Maximum class complexity4.00
Average method complexity1.35
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods26
▷ Static methods934.62%
▷ Public methods26100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants1090.91%
▷ Class constants19.09%
▷ Public constants1100.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
2 compressed PNG files occupy 0.02MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/favicon.png3.88KB3.72KB▼ 4.25%
assets/img/logo.png11.58KB10.38KB▼ 10.37%