78% easy-beer-lister

Code Review | Easy Beer Lister

WordPress plugin Easy Beer Lister scored78%from 54 tests.

About plugin

  • Plugin page: easy-beer-lister
  • Plugin version: 1.23
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5.3
  • WordPress version: 6.3.1
  • First release: Apr 16, 2016
  • Latest release: Jul 8, 2016
  • Number of updates: 19
  • Update frequency: every 4.4 days
  • Top authors: alexstandiford (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /2,346 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.46MB] [CPU: ▼1.08ms] Passed 4 tests

Server-side resources used by Easy Beer Lister
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.96 ▲0.5052.35 ▲2.50
Dashboard /wp-admin3.80 ▲0.4658.96 ▼4.65
Posts /wp-admin/edit.php3.85 ▲0.5062.02 ▲11.74
Add New Post /wp-admin/post-new.php6.33 ▲0.45101.95 ▼13.74
Media Library /wp-admin/upload.php3.66 ▲0.4451.25 ▲11.58
Add New /wp-admin/post-new.php?post_type=beers3.8764.96
All Menus /wp-admin/edit.php?post_type=menus3.7748.90
Tags /wp-admin/edit-tags.php?taxonomy=tags&post_type=beers3.6644.14
Add New /wp-admin/post-new.php?post_type=menus3.8162.54
Beer Styles /wp-admin/edit-tags.php?taxonomy=style&post_type=beers3.6644.62
Easy Beer Lister Settings /wp-admin/options-general.php?page=ebl-settings3.6142.29
All Beers /wp-admin/edit.php?post_type=beers3.7744.89
Availability /wp-admin/edit-tags.php?taxonomy=availability&post_type=beers3.6744.50
Themes /wp-admin/edit.php?post_type=menus&page=easybeerlister-themes3.6337.61
Pairings /wp-admin/edit-tags.php?taxonomy=pairing&post_type=beers3.6645.19

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_ebl_on_tap
widget_ebl_random_beer
widget_recent-posts
can_compress_scripts
availability_children

Browser metrics Passed 4 tests

Easy Beer Lister: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,881 ▲12014.24 ▼0.042.05 ▼0.0639.21 ▼6.08
Dashboard /wp-admin2,277 ▲1065.66 ▲0.0788.54 ▲1.1057.63 ▲17.41
Posts /wp-admin/edit.php2,182 ▲822.02 ▲0.0236.86 ▲2.8335.20 ▼3.84
Add New Post /wp-admin/post-new.php1,604 ▲7818.23 ▼4.91735.81 ▼24.1755.31 ▼4.05
Media Library /wp-admin/upload.php1,482 ▲824.22 ▼0.0199.95 ▼9.0866.39 ▲19.18
Add New /wp-admin/post-new.php?post_type=beers2,9398.03192.28139.94
All Menus /wp-admin/edit.php?post_type=menus1,1431.9633.6229.96
Tags /wp-admin/edit-tags.php?taxonomy=tags&post_type=beers1,3282.2725.8233.44
Add New /wp-admin/post-new.php?post_type=menus2,2423.5965.3093.50
Beer Styles /wp-admin/edit-tags.php?taxonomy=style&post_type=beers1,3532.1226.2229.63
Easy Beer Lister Settings /wp-admin/options-general.php?page=ebl-settings1,2472.2940.6543.99
All Beers /wp-admin/edit.php?post_type=beers1,1521.9032.4129.04
Availability /wp-admin/edit-tags.php?taxonomy=availability&post_type=beers1,7202.2827.5531.79
Themes /wp-admin/edit.php?post_type=menus&page=easybeerlister-themes8382.0026.7027.42
Pairings /wp-admin/edit-tags.php?taxonomy=pairing&post_type=beers1,3312.1225.9031.51

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_ebl_random_beer
    • widget_theysaidso_widget
    • can_compress_scripts
    • availability_children
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_ebl_on_tap

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ebl-settings
    • > Notice in wp-content/plugins/easy-beer-lister/ebl-settings.php+28
    Undefined variable: active_tab

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/easy-beer-lister/ebl-beer-template.php:1

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

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
The official readme.txt is a good inspiration

easy-beer-lister/easy-beer-lister.php Passed 13 tests

The entry point to "Easy Beer Lister" version 1.23 is a PHP file that has certain tags in its header comment area
58 characters long description:
Manage Your Beers, Beer Pairings, and What's on Tap Easily

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
No dangerous file extensions were detected2,533 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP101511422,057
CSS4702378
JavaScript322298

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity8.38
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods27
▷ Static methods00.00%
▷ Public methods2177.78%
▷ Protected methods00.00%
▷ Private methods622.22%
Functions83
▷ Named functions83100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
media/untappd.png4.10KB2.50KB▼ 38.91%
media/beer-icon.png0.54KB0.45KB▼ 17.27%
media/menu-icon.png0.51KB0.69KB0.00%