10% wp-dispensary

Code Review | WP Dispensary

WordPress plugin WP Dispensary scored10%from 54 tests.

About plugin

  • Plugin page: wp-dispensary
  • Plugin version: 4.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.0
  • WordPress version: 6.3.1
  • First release: Nov 20, 2015
  • Latest release: Aug 9, 2022
  • Number of updates: 183
  • Update frequency: every 13.4 days
  • Top authors: deviodigital (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

100+ active /21,082 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
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/wp-dispensary/admin/metaboxes/wpd-metabox-product-type.php+88
    Trying to get property 'ID' of non-object

Server metrics [RAM: ▲0.05MB] [CPU: ▲1.07ms] Passed 4 tests

This is a short check of server-side resources used by WP Dispensary
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.14 ▲0.6859.20 ▲20.53
Dashboard /wp-admin4.11 ▲0.8064.23 ▲17.91
Posts /wp-admin/edit.php4.17 ▲0.8272.65 ▲24.03
Add New Post /wp-admin/post-new.php3.87 ▼2.0146.57 ▼51.98
Media Library /wp-admin/upload.php3.96 ▲0.7350.08 ▲17.83
Products /wp-admin/edit.php?post_type=products4.1156.15
Categories /wp-admin/edit-tags.php?taxonomy=wpd_categories4.0449.80
Settings /wp-admin/admin.php?page=wpd-settings3.9546.65
Vendors /wp-admin/edit-tags.php?taxonomy=vendors3.9850.06

Server storage [IO: ▲4.10MB] [DB: ▲0.03MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 179 new files
Database: no new tables, 11 new options
New WordPress options
widget_theysaidso_widget
wpdas_display
wpdas_advanced
db_upgraded
widget_wp_dispensary_widget
can_compress_scripts
widget_wp_dispensary_product_search_widget
wpdas_general
widget_recent-posts
theysaidso_admin_options
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Dispensary
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,223 ▲47715.43 ▲1.056.47 ▲4.6243.27 ▼0.09
Dashboard /wp-admin2,504 ▲3196.69 ▲1.82133.43 ▲20.2640.92 ▲0.22
Posts /wp-admin/edit.php2,411 ▲3223.58 ▲1.5459.16 ▲17.6237.59 ▲1.80
Add New Post /wp-admin/post-new.php1,612 ▲9823.15 ▲5.48636.51 ▼17.4536.83 ▼10.64
Media Library /wp-admin/upload.php1,497 ▲1094.40 ▲0.2082.99 ▼15.9744.41 ▼0.02
Products /wp-admin/edit.php?post_type=products1,4773.8046.4228.63
Categories /wp-admin/edit-tags.php?taxonomy=wpd_categories1,5373.6245.8631.94
Settings /wp-admin/admin.php?page=wpd-settings1,5123.5155.1783.10
Vendors /wp-admin/edit-tags.php?taxonomy=vendors1,5363.5243.9430.73

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 11 options in the database
    • can_compress_scripts
    • widget_wp_dispensary_widget
    • wpdas_advanced
    • widget_theysaidso_widget
    • widget_wp_dispensary_product_search_widget
    • wpdas_display
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • wpdas_general
    • ...

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 0% 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
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-dispensary/admin/partials/wp-dispensary-admin-display.php
    • > /wp-content/plugins/wp-dispensary/public/partials/wp-dispensary-public-display.php
  • 67× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-dispensary/admin/class-wp-dispensary-admin.php:123
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wp-dispensary/admin/wp-dispensary-metaboxes.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-dispensary/admin/wp-dispensary-taxonomies.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-dispensary/admin/deprecated/wp-dispensary-categories.php:138
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wp-dispensary/wp-dispensary.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wp-dispensary/admin/deprecated/deprecated-rest-api.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-dispensary/admin/deprecated/wp-dispensary-concentrates.php:94
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wp-dispensary/admin/wp-dispensary-plugin-upgrade.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wp-dispensary/includes/functions/wp-dispensary-settings-functions.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wp-dispensary/admin/deprecated/deprecated-shortcodes.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
The official readme.txt is a good inspiration

wp-dispensary/wp-dispensary.php Passed 13 tests

Analyzing the main PHP file in "WP Dispensary" version 4.3.0
75 characters long description:
The complete marijuana menu solution for dispensaries and delivery services

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 detected26,694 lines of code in 118 files:
LanguageFilesBlank linesComment linesLines of code
PHP793,0366,71313,399
PO File104,3117,2359,576
CSS9228981,203
HTML21730850
Markdown2970684
Sass101450591
JavaScript524115378
SVG11013

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity15.13
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity3.21
▷ Minimum method complexity1.00
▷ Maximum method complexity55.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes31
▷ Abstract classes00.00%
▷ Concrete classes31100.00%
▷ Final classes00.00%
Methods191
▷ Static methods31.57%
▷ Public methods18496.34%
▷ Protected methods00.00%
▷ Private methods73.66%
Functions277
▷ Named functions27599.28%
▷ Anonymous functions20.72%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
21 PNG files occupy 1.33MB with 0.42MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/ad_dispensary-menusync.png17.10KB8.16KB▼ 52.32%
admin/deprecated/images/menu-icon.png0.61KB0.95KB0.00%
public/assets/images/menu-icon.png0.61KB0.95KB0.00%
assets/screenshot-8.png110.12KB43.69KB▼ 60.32%
admin/assets/images/wpd-logo.png8.69KB4.88KB▼ 43.88%