78% marijuana-menu-by-wheres-weed

Code Review | Where's Weed Menu

WordPress plugin Where's Weed Menu scored78%from 54 tests.

About plugin

  • Plugin page: marijuana-menu-by...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2
  • WordPress version: 6.3.1
  • First release: Nov 5, 2015
  • Latest release: Nov 12, 2015
  • Number of updates: 3
  • Update frequency: every 2.3 days
  • Top authors: wheresweed (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,043 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.03MB] [CPU: ▼6.34ms] Passed 4 tests

An overview of server-side resources used by Where's Weed Menu
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0338.37 ▼2.60
Dashboard /wp-admin3.34 ▲0.0447.08 ▼5.14
Posts /wp-admin/edit.php3.39 ▲0.0359.54 ▲4.24
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.87 ▼15.23
Media Library /wp-admin/upload.php3.26 ▲0.0335.77 ▼2.37
Wheres Weed Menu /wp-admin/options-general.php?page=ww_menu3.2231.00

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

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

Browser metrics Passed 4 tests

Where's Weed Menu: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.28 ▼0.071.91 ▼0.0945.75 ▼0.21
Dashboard /wp-admin2,202 ▲255.64 ▲0.1189.32 ▼2.2740.92 ▼2.58
Posts /wp-admin/edit.php2,107 ▲42.03 ▲0.0336.34 ▼4.1433.31 ▼1.49
Add New Post /wp-admin/post-new.php1,529 ▲323.18 ▼0.37664.22 ▲30.8352.27 ▼11.08
Media Library /wp-admin/upload.php1,404 ▲44.28 ▲0.08100.13 ▼14.1841.55 ▼6.59
Wheres Weed Menu /wp-admin/options-general.php?page=ww_menu6971.518.6518.16

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=ww_menu
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/marijuana-menu-by-wheres-weed/templates/settings.php on line 5 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/marijuana-menu-by-wheres-weed/templates/settings.php(5): do_settings_fields()
    #1 wp-content/plugins/marijuana-menu-by-wheres-weed/settings.php(116): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): WW_Menu_Settings->plugin_settings_page()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

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
The following issues need your attention
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/marijuana-menu-by-wheres-weed/templates/settings.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/marijuana-menu-by-wheres-weed/ww_menu.php:78
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/marijuana-menu-by-wheres-weed/shortcode.php:45

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: A description for screenshot #2 is required in marijuana-menu-by-wheres-weed/assets to your readme.txt
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === marijuana-menu-by-wheres-weed === )
The official readme.txt is a good inspiration

marijuana-menu-by-wheres-weed/ww_menu.php 92% from 13 tests

The main file in "Where's Weed Menu" v. 0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("marijuana-menu-by-wheres-weed.php" instead of "ww_menu.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected215 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP53671214
JavaScript1171

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity1.50
▷ Minimum class complexity1.00
▷ Maximum class complexity2.00
Average method complexity1.09
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods218.18%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin