52% em-beer-manager

Code Review | EM Beer Manager

WordPress plugin EM Beer Manager scored 52% from 54 tests.

About plugin

  • Plugin page: em-beer-manager
  • Plugin version: 3.2.3
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.5
  • WordPress version: 5.8.1
  • First release: Jun 21, 2013
  • Latest release: Jan 6, 2019
  • Number of updates: 100
  • Update frequency: every 20.3 days
  • Top authors: ErinMorelli (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

300+ active / 10,332 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼1.76MB] [CPU: ▼186.04ms] Passed 4 tests

Analyzing server-side resources used by EM Beer Manager
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.83 ▼1.006.63 ▼26.94
Dashboard /wp-admin1.89 ▼1.1612.59 ▼30.04
Posts /wp-admin/edit.php1.90 ▼1.216.48 ▼31.38
Add New Post /wp-admin/post-new.php1.89 ▼3.548.50 ▼651.42
Media Library /wp-admin/upload.php1.89 ▼1.117.71 ▼31.31
Add New /wp-admin/post-new.php?post_type=embm_beer1.897.75
Menus /wp-admin/edit-tags.php?taxonomy=embm_menu&post_type=embm_beer1.907.46
EM Beer Manager /wp-admin/options-general.php?page=embm-settings1.907.80
Groups /wp-admin/edit-tags.php?taxonomy=embm_group&post_type=embm_beer1.907.94
All Beers /wp-admin/edit.php?post_type=embm_beer1.908.02
Styles /wp-admin/edit-tags.php?taxonomy=embm_style&post_type=embm_beer1.906.92

Server storage [IO: ▲0.83MB] [DB: ▲0.02MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 59 new files
Database: no new tables, 5 new options
New WordPress options
widget_embm_recent_untappd_widget
embm_options
embm_styles_loaded
embm_version
widget_embm_beer_list_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for EM Beer Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,797 ▲20116.29 ▲0.6410.86 ▲1.2947.33 ▼1.51
Dashboard /wp-admin3,058 ▲1246.98 ▲1.00142.92 ▼1.26112.06 ▼4.44
Posts /wp-admin/edit.php2,828 ▲922.87 ▲0.1668.66 ▲6.4796.66 ▲2.39
Add New Post /wp-admin/post-new.php1,689 ▲1722.94 ▲4.12264.01 ▼116.45125.06 ▲10.79
Media Library /wp-admin/upload.php1,894 ▲845.57 ▲0.54122.37 ▼20.78118.10 ▼7.87
Add New /wp-admin/post-new.php?post_type=embm_beer6,18916.67464.82164.84
Menus /wp-admin/edit-tags.php?taxonomy=embm_menu&post_type=embm_beer1,9082.7064.5898.65
EM Beer Manager /wp-admin/options-general.php?page=embm-settings3,2832.6067.10184.89
Groups /wp-admin/edit-tags.php?taxonomy=embm_group&post_type=embm_beer1,8472.6959.42109.16
All Beers /wp-admin/edit.php?post_type=embm_beer1,7753.0172.6198.02
Styles /wp-admin/edit-tags.php?taxonomy=embm_style&post_type=embm_beer3,0632.7968.40111.11

Uninstaller [IO: ▲0.83MB] [DB: ▲0.02MB] 25% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/em-beer-manager/includes/widgets/embm-widget-list.php+179
    Function create_function() is deprecated
  • The plugin did not uninstall correctly, leaving 59 files (0.83MB) in the plugin directory
    • (new file) assets/fonts/beer-icons.eot
    • (new file) assets/fonts/beer-icons.woff
    • (new file) assets/fonts/beer-icons.ttf
    • (new file) README.txt
    • (new file) assets/css/widgets.css
    • (new file) assets/css/admin.css
    • (new file) assets/fonts/beer-icons.svg
    • (new file) assets/css/output.css
    • (new file) assets/beer-styles.txt
    • (new file) assets/img/checkin-button-1.png
    • ...
  • This plugin does not fully uninstall, leaving 5 options in the database
    • embm_options
    • embm_styles_loaded
    • widget_embm_beer_list_widget
    • embm_version
    • widget_embm_recent_untappd_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=embm_style&post_type=embm_beer
    • > Deprecated in wp-content/plugins/em-beer-manager/includes/widgets/embm-widget-list.php+179
    Function create_function() is deprecated
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=embm_beer
    • > Notice in wp-content/plugins/em-beer-manager/includes/embm-core.php+663
    Undefined index: abv
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=embm_beer
    • > Notice in wp-content/plugins/em-beer-manager/includes/embm-core.php+664
    Undefined index: ibu
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=embm_beer
    • > Notice in wp-content/plugins/em-beer-manager/includes/embm-core.php+668
    Undefined index: malts
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=embm_beer
    • > Notice in wp-content/plugins/em-beer-manager/includes/embm-core.php+669
    Undefined index: hops
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=embm_beer
    • > Notice in wp-content/plugins/em-beer-manager/includes/embm-core.php+670
    Undefined index: adds
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=embm_beer
    • > Notice in wp-content/plugins/em-beer-manager/includes/embm-core.php+671
    Undefined index: yeast
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=embm_beer
    • > Notice in wp-content/plugins/em-beer-manager/includes/embm-core.php+680
    Undefined index: beer_num
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=embm_beer
    • > Notice in wp-content/plugins/em-beer-manager/includes/embm-core.php+684
    Undefined index: avail
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=embm_beer
    • > Notice in wp-content/plugins/em-beer-manager/includes/embm-core.php+685
    Undefined index: notes
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=embm_beer
    • > Notice in wp-content/plugins/em-beer-manager/includes/embm-core.php+693
    Undefined index: untappd_id
    • > GET request to /wp-admin/post-new.php?post_type=embm_beer
    • > Notice in wp-content/plugins/em-beer-manager/includes/metaboxes/embm-metabox-untappd.php+176
    Undefined variable: utfb_id
    • > GET request to /wp-admin/post-new.php?post_type=embm_beer
    • > Notice in wp-content/plugins/em-beer-manager/includes/metaboxes/embm-metabox-untappd.php+206
    Undefined variable: menus
    • > GET request to /wp-admin/post-new.php?post_type=embm_beer
    • > Warning in wp-content/plugins/em-beer-manager/includes/metaboxes/embm-metabox-untappd.php+206
    Invalid argument supplied for foreach()

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
Please fix the following items
  • 34× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/em-beer-manager/includes/output/embm-output-shortcodes.php:54
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/em-beer-manager/includes/metaboxes/embm-metabox-menus.php:57
    • > PHP Warning
      require(EMBM_PLUGIN_DIRincludes/admin/tabs/embm-tabs-labs.php): failed to open stream: No such file or directory in wp-content/plugins/em-beer-manager/includes/admin/tabs/embm-tabs-untappd.php on line 22
    • > PHP Warning
      Use of undefined constant EMBM_PLUGIN_DIR - assumed 'EMBM_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/em-beer-manager/includes/admin/embm-admin-settings.php on line 23
    • > PHP Fatal error
      require(): Failed opening required 'EMBM_PLUGIN_DIRincludes/admin/tabs/embm-tabs-labs.php' (include_path='.:/usr/share/php') in wp-content/plugins/em-beer-manager/includes/admin/tabs/embm-tabs-utfb.php on line 22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/em-beer-manager/includes/admin/embm-admin-actions.php:51
    • > PHP Fatal error
      require(): Failed opening required 'EMBM_PLUGIN_DIRincludes/admin/embm-admin-notices.php' (include_path='.:/usr/share/php') in wp-content/plugins/em-beer-manager/includes/admin/embm-admin-settings.php on line 23
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/em-beer-manager/includes/widgets/embm-widget-untappd.php:31
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/em-beer-manager/includes/admin/integrations/embm-integrations-untappd.php on line 27
    • > PHP Fatal error
      require(): Failed opening required 'EMBM_PLUGIN_DIRincludes/admin/tabs/embm-tabs-labs.php' (include_path='.:/usr/share/php') in wp-content/plugins/em-beer-manager/includes/admin/tabs/embm-tabs-untappd.php on line 22

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/edit-tags.php?taxonomy=embm_menu&post_type=embm_beer
    • > Intervention (severe) in unknown
    /wp-admin/post-new.php?post_type=embm_beer - Blocked attempt to show a 'beforeunload' confirmation panel for a frame that never had a user gesture since its load. https://www.chromestatus.com/feature/5082396709879808

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: beer, beers, brew, homebrew, untappd for business...

em-beer-manager/em-beer-manager.php 92% from 13 tests

The entry point to "EM Beer Manager" version 3.2.3 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 166 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected11,154 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP261,4523,2586,585
PO File51,1861,3382,988
CSS327991,069
JavaScript1129153488
SVG60024

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity18.50
▷ Minimum class complexity10.00
▷ Maximum class complexity27.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions201
▷ Named functions19094.53%
▷ Anonymous functions115.47%
Constants41
▷ Global constants41100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/checkin-button-1.png3.95KB2.24KB▼ 43.33%
assets/img/ut-icon-2.png1.58KB0.79KB▼ 49.57%
assets/img/checkin-button-2.png5.39KB2.99KB▼ 44.46%
assets/img/ut-credit.png3.44KB2.50KB▼ 27.45%
assets/img/ut-icon-1.png1.61KB1.55KB▼ 4.06%