84% untappd-checkins-widget

Code Review | Untappd WordPress Widget

WordPress plugin Untappd WordPress Widget scored84%from 54 tests.

About plugin

  • Plugin page: untappd-checkins-...
  • Plugin version: 1.3.3
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.4.2
  • WordPress version: 6.3.1
  • First release: Apr 23, 2013
  • Latest release: Jul 9, 2020
  • Number of updates: 23
  • Update frequency: every 114.5 days
  • Top authors: tw2113 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active /5,931 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.30MB] [CPU: ▼6.94ms] Passed 4 tests

A check of server-side resources used by Untappd WordPress Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3249.84 ▲6.24
Dashboard /wp-admin3.61 ▲0.2756.52 ▼10.84
Posts /wp-admin/edit.php3.73 ▲0.3747.95 ▼7.30
Add New Post /wp-admin/post-new.php6.19 ▲0.3184.06 ▼13.13
Media Library /wp-admin/upload.php3.53 ▲0.3139.42 ▲3.52
Untappd Widgets API /wp-admin/options-general.php?page=mb_untappd_settings3.5035.02

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 18 new files
Database: no new tables, 11 new options
New WordPress options
widget_mb_untappd_user_profile
widget_mb_untappd_brewery
widget_mb_untappd_user
widget_mb_untappd_venue
widget_recent-comments
db_upgraded
widget_mb_untappd_user_badge
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
...

Browser metrics Passed 4 tests

An overview of browser requirements for Untappd WordPress Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.35 ▼0.182.05 ▲0.2442.47 ▼4.74
Dashboard /wp-admin2,196 ▲225.54 ▼0.1696.65 ▼9.3342.11 ▼2.49
Posts /wp-admin/edit.php2,101 ▲11.99 ▼0.0134.73 ▼2.9932.46 ▼3.11
Add New Post /wp-admin/post-new.php1,531 ▲323.21 ▲0.12672.15 ▲28.7052.12 ▼4.62
Media Library /wp-admin/upload.php1,401 ▼24.19 ▼0.0799.05 ▼0.8844.74 ▲0.45
Untappd Widgets API /wp-admin/options-general.php?page=mb_untappd_settings7992.0325.0325.40

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 11 options in the database
    • widget_recent-comments
    • widget_mb_untappd_brewery
    • widget_theysaidso_widget
    • widget_mb_untappd_venue
    • theysaidso_admin_options
    • widget_mb_untappd_user
    • widget_mb_untappd_user_profile
    • widget_mb_untappd_user_badge
    • can_compress_scripts
    • db_upgraded
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 13× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/untappd-checkins-widget/widgets/user_profile.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'MB_Untappd_API' not found in wp-content/plugins/untappd-checkins-widget/classes/class-mb-untappd-brewery-checkins-api.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/untappd-checkins-widget/widgets/venue_checkins.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'MB_Untappd_API' not found in wp-content/plugins/untappd-checkins-widget/classes/class-mb-untappd-venue-checkins-api.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/untappd-checkins-widget/widgets/user_badge.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/untappd-checkins-widget/classes/class-mb-untappd-settings.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/untappd-checkins-widget/untappdwidget.php:50
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/untappd-checkins-widget/widgets/user_checkins.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'MB_Untappd_API' not found in wp-content/plugins/untappd-checkins-widget/classes/class-mb-untappd-badges-api.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'MB_Untappd_API' not found in wp-content/plugins/untappd-checkins-widget/classes/class-mb-untappd-user-profile-api.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: widgets, untappd, social drinking, beer

untappd-checkins-widget/untappdwidget.php 85% from 13 tests

This is the main PHP file of "Untappd WordPress Widget" version 1.3.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("untappd-checkins-widget.php" instead of "untappdwidget.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
There were no executable files found in this plugin1,531 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP142577791,527
Markdown1204

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity12.92
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity3.55
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods56
▷ Static methods00.00%
▷ Public methods56100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.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