78% dispensary-tinctures

Code Review | Dispensary Tinctures

WordPress plugin Dispensary Tinctures scored78%from 54 tests.

About plugin

  • Plugin page: dispensary-tinctures
  • Plugin version: 2.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.3.2
  • WordPress version: 6.3.1
  • First release: Mar 6, 2018
  • Latest release: Mar 24, 2020
  • Number of updates: 40
  • Update frequency: every 18.7 days
  • Top authors: deviodigital (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,397 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.34MB] [CPU: ▼0.95ms] Passed 4 tests

Server-side resources used by Dispensary Tinctures
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3344.39 ▲1.19
Dashboard /wp-admin3.67 ▲0.3753.62 ▼1.29
Posts /wp-admin/edit.php3.73 ▲0.3753.70 ▲7.01
Add New Post /wp-admin/post-new.php6.31 ▲0.4389.16 ▼6.53
Media Library /wp-admin/upload.php3.53 ▲0.3040.54 ▲2.84
Tinctures /wp-admin/edit.php?post_type=tinctures3.5843.51

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 34 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_wpd_tinctures_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Dispensary Tinctures
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,918 ▲17213.63 ▼0.355.96 ▲3.9544.43 ▼0.01
Dashboard /wp-admin2,216 ▲314.87 ▼1.0399.19 ▼16.5738.49 ▼6.83
Posts /wp-admin/edit.php2,096 ▲42.01 ▼0.0434.39 ▼0.6433.76 ▼2.10
Add New Post /wp-admin/post-new.php1,521 ▼1323.25 ▲0.16681.55 ▲1.4254.62 ▼4.39
Media Library /wp-admin/upload.php1,389 ▲44.21 ▲0.0096.97 ▼41.3044.23 ▼12.68
Tinctures /wp-admin/edit.php?post_type=tinctures1,0761.9234.1538.92

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_wpd_tinctures_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/dispensary-tinctures/public/partials/wpd-tinctures-public-display.php
    • > /wp-content/plugins/dispensary-tinctures/admin/partials/wpd-tinctures-admin-display.php
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dispensary-tinctures/admin/wpd-tinctures-functions.php:91
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/dispensary-tinctures/admin/class-wpd-tinctures-data-output.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dispensary-tinctures/admin/class-wpd-tinctures-post-type.php:96
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/dispensary-tinctures/admin/class-wpd-tinctures-widgets.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/dispensary-tinctures/admin/class-wpd-tinctures-rest-api.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dispensary-tinctures/admin/class-wpd-tinctures-taxonomies.php:52
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/dispensary-tinctures/admin/class-wpd-tinctures-settings.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dispensary-tinctures/admin/class-wpd-tinctures-metaboxes.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/dispensary-tinctures/admin/class-wpd-tinctures-shortcodes.php:135

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 90% 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
6 plugin tags: dispensary, cbd, marijuana, cannabis, wp-dispensary...

dispensary-tinctures/wpd-tinctures.php 77% from 13 tests

This is the main PHP file of "Dispensary Tinctures" version 2.0.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("dispensary-tinctures.php" instead of "wpd-tinctures.php")
  • 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 212 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin1,011 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP22328933975
CSS361028
JavaScript24546
Markdown1002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity3.56
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity1.72
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods32
▷ Static methods26.25%
▷ Public methods2784.38%
▷ Protected methods00.00%
▷ Private methods515.62%
Functions42
▷ Named functions42100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in 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
admin/images/menu-icon.png0.28KB0.23KB▼ 17.65%