10% beer-recommender

Code Review | Beer Recommender

WordPress plugin Beer Recommender scored10%from 54 tests.

About plugin

  • Plugin page: beer-recommender
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Jan 28, 2014
  • Latest release: Jan 28, 2014
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: bzweimueller (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /696 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/beer-recommender/beerrecommender.php+86
    Methods with the same name as their class will not be constructors in a future version of PHP; beerRecommenderWidget has a deprecated constructor

Server metrics [RAM: ▼1.92MB] [CPU: ▼58.22ms] Passed 4 tests

Server-side resources used by Beer Recommender
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.404.12 ▼40.62
Dashboard /wp-admin2.08 ▼1.226.75 ▼47.97
Posts /wp-admin/edit.php2.08 ▼1.277.39 ▼46.34
Add New Post /wp-admin/post-new.php2.08 ▼3.805.77 ▼97.93
Media Library /wp-admin/upload.php2.08 ▼1.145.90 ▼30.91

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_beerrecommenderwidget
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Beer Recommender
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.81 ▲0.431.95 ▲0.1940.33 ▼7.00
Dashboard /wp-admin2,206 ▲295.85 ▲0.93126.80 ▲3.9045.55 ▼0.85
Posts /wp-admin/edit.php2,092 ▲32.01 ▲0.0150.82 ▲10.7339.19 ▲1.85
Add New Post /wp-admin/post-new.php1,534 ▲123.12 ▲0.13665.86 ▲20.3952.44 ▼5.02
Media Library /wp-admin/upload.php1,388 ▲34.12 ▼0.20111.25 ▼0.9141.70 ▼6.34

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/beer-recommender/beerrecommender.php+86
    Methods with the same name as their class will not be constructors in a future version of PHP; beerRecommenderWidget has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_beerrecommenderwidget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/beer-recommender/beerrecommender.php:50

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 94% from 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
Please fix the following attributes:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === beer-recommender === )
The official readme.txt might help

beer-recommender/beerrecommender.php 92% from 13 tests

The principal PHP file in "Beer Recommender" v. 1.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("beer-recommender.php" instead of "beerrecommender.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected79 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1352567
JavaScript14512

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
beerglass.png0.88KB0.73KB▼ 17.44%