84% dispensary-coupons

Code Review | Dispensary Coupons

WordPress plugin Dispensary Coupons scored84%from 54 tests.

About plugin

  • Plugin page: dispensary-coupons
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.3
  • WordPress version: 6.3.1
  • First release: Apr 19, 2016
  • Latest release: Nov 27, 2019
  • Number of updates: 36
  • Update frequency: every 36.6 days
  • Top authors: deviodigital (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /3,200 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.28MB] [CPU: ▼2.66ms] Passed 4 tests

An overview of server-side resources used by Dispensary Coupons
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2648.26 ▲4.63
Dashboard /wp-admin3.62 ▲0.3149.49 ▼3.46
Posts /wp-admin/edit.php3.67 ▲0.3252.61 ▼3.34
Add New Post /wp-admin/post-new.php6.20 ▲0.3194.96 ▼8.46
Media Library /wp-admin/upload.php3.48 ▲0.2542.68 ▲4.88
Coupons /wp-admin/edit.php?post_type=coupons3.5244.86

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
widget_wpd_coupons_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Dispensary Coupons
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6413.43 ▼0.921.71 ▼0.1341.51 ▼3.80
Dashboard /wp-admin2,214 ▲265.86 ▲0.95104.27 ▼0.8438.63 ▼5.71
Posts /wp-admin/edit.php2,097 ▲52.05 ▲0.0439.63 ▲2.0035.46 ▲0.91
Add New Post /wp-admin/post-new.php1,672 ▲15821.89 ▲4.42674.26 ▲3.8758.41 ▲2.77
Media Library /wp-admin/upload.php1,396 ▲84.18 ▲0.00100.46 ▼0.6643.39 ▼4.84
Coupons /wp-admin/edit.php?post_type=coupons1,0661.9931.9931.68

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_wpd_coupons_widget
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/dispensary-coupons/inc/class-dispensary-coupons-permalinks.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
8 plugin tags: weed, marijuana, mmj, discounts, coupons...

dispensary-coupons/dispensary-coupons.php 85% from 13 tests

The main PHP script in "Dispensary Coupons" version 2.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: Keep the plugin description shorter than 140 characters (currently 239 characters long)

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
Success! There were no dangerous files found in this plugin1,321 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP62252711,130
CSS23623102
Markdown243089

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity6.30
▷ Minimum class complexity4.00
▷ Maximum class complexity26.00
Average method complexity2.08
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods49
▷ Static methods00.00%
▷ Public methods49100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
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
images/menu-icon.png0.28KB0.23KB▼ 17.65%