84% beer-directory

Code Review | Beer Directory

WordPress plugin Beer Directory scored 84% from 54 tests.

About plugin

  • Plugin page: beer-directory
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2.2
  • WordPress version: 6.3.1
  • First release: Mar 22, 2015
  • Latest release: Aug 14, 2019
  • Number of updates: 21
  • Update frequency: every 76.5 days
  • Top authors: rescuethemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 3,772 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼7.24ms] Passed 4 tests

This is a short check of server-side resources used by Beer Directory
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1338.60 ▼6.72
Dashboard /wp-admin3.35 ▲0.0534.71 ▼14.39
Posts /wp-admin/edit.php3.58 ▲0.2241.49 ▼5.23
Add New Post /wp-admin/post-new.php6.04 ▲0.1692.71 ▼2.62
Media Library /wp-admin/upload.php3.38 ▲0.1537.34 ▲6.64
Beer /wp-admin/edit.php?post_type=beer3.4332.98
Beer Categories /wp-admin/edit-tags.php?taxonomy=beer-category&post_type=beer3.3833.52
Add Beer /wp-admin/post-new.php?post_type=beer3.5252.25

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Beer Directory
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲6513.22 ▼1.341.77 ▼0.1237.28 ▼6.49
Dashboard /wp-admin2,240 ▲524.89 ▲0.01101.35 ▼16.5537.76 ▼7.17
Posts /wp-admin/edit.php2,123 ▲342.05 ▼0.1139.15 ▲3.8035.09 ▼0.87
Add New Post /wp-admin/post-new.php1,560 ▲2223.39 ▲0.06631.95 ▼12.8451.40 ▼13.20
Media Library /wp-admin/upload.php1,419 ▲284.20 ▼0.06100.59 ▲2.3143.06 ▼1.26
Beer /wp-admin/edit.php?post_type=beer1,1341.9534.1931.95
Beer Categories /wp-admin/edit-tags.php?taxonomy=beer-category&post_type=beer1,2932.1326.4428.14
Add Beer /wp-admin/post-new.php?post_type=beer2,7607.70170.6971.65

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% 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 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
The following issues need your attention
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/beer-directory/includes/single-beer.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/beer-directory/includes/scripts.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/beer-directory/includes/class-post-shortcodes.php:9

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 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
8 plugin tags: directory, malt, beer, hops, yeast...

beer-directory/beer-post-type.php 92% from 13 tests

"Beer Directory" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("beer-directory.php" instead of "beer-post-type.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected763 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP9227309721
CSS131742

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity11.17
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods32
▷ Static methods00.00%
▷ Public methods2268.75%
▷ Protected methods1031.25%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected