78% beerxml-shortcode

Code Review | BeerXML Shortcode

WordPress plugin BeerXML Shortcode scored78%from 54 tests.

About plugin

  • Plugin page: beerxml-shortcode
  • Plugin version: 0.7.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.9
  • WordPress version: 6.3.1
  • First release: Aug 14, 2012
  • Latest release: Nov 10, 2017
  • Number of updates: 49
  • Update frequency: every 39.1 days
  • Top authors: derekspringer (91.84%)martinremy (10.2%)

Code review

54 tests

User reviews

9 reviews

Install metrics

100+ active /5,822 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.22MB] [CPU: ▼10.34ms] Passed 4 tests

A check of server-side resources used by BeerXML Shortcode
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1837.25 ▼6.58
Dashboard /wp-admin3.60 ▲0.2545.91 ▼20.51
Posts /wp-admin/edit.php3.65 ▲0.2946.12 ▲0.92
Add New Post /wp-admin/post-new.php6.11 ▲0.2290.89 ▼9.23
Media Library /wp-admin/upload.php3.46 ▲0.2234.95 ▼5.05
BeerXML Shortcode /wp-admin/options-general.php?page=beerxml-shortcode3.4029.28
Beer Style /wp-admin/edit-tags.php?taxonomy=beer_style3.4534.65

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

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

Browser metrics Passed 4 tests

A check of browser resources used by BeerXML Shortcode
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6214.76 ▲0.361.69 ▼0.0639.82 ▼2.51
Dashboard /wp-admin2,217 ▲264.86 ▼0.01106.55 ▲2.7143.33 ▲5.82
Posts /wp-admin/edit.php2,145 ▲532.02 ▲0.0438.96 ▲0.4934.05 ▼1.11
Add New Post /wp-admin/post-new.php1,539 ▲1923.21 ▲0.08616.21 ▼5.3752.51 ▼5.77
Media Library /wp-admin/upload.php1,396 ▲114.31 ▲0.1496.69 ▼4.0842.56 ▲0.93
BeerXML Shortcode /wp-admin/options-general.php?page=beerxml-shortcode8962.0523.7027.41
Beer Style /wp-admin/edit-tags.php?taxonomy=beer_style1,2452.1327.7728.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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=beerxml-shortcode
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=beerxml-shortcode
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
Please take a closer look at the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/beerxml-shortcode/beerxml-shortcode.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/beerxml-shortcode/includes/mime.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/beerxml-shortcode/includes/admin.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: beer, homebrew, recipe, beerxml, shortcode

beerxml-shortcode/beerxml-shortcode.php 92% from 13 tests

The primary PHP file in "BeerXML Shortcode" version 0.7.1 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 169 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,266 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP51681851,266

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity7.36
▷ Minimum class complexity1.00
▷ Maximum class complexity57.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods42
▷ Static methods921.43%
▷ Public methods42100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
PNG images were not found in this plugin