84% wpubg

Code Review | WPUBG

WordPress plugin WPUBG scored84%from 54 tests.

About plugin

  • Plugin page: wpubg
  • Plugin version: 0.8
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Oct 18, 2018
  • Latest release: Jan 22, 2020
  • Number of updates: 30
  • Update frequency: every 15.4 days
  • Top authors: janbpunkt (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,224 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼3.95ms] Passed 4 tests

A check of server-side resources used by WPUBG
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0638.26 ▼4.02
Dashboard /wp-admin3.37 ▲0.0246.00 ▼13.85
Posts /wp-admin/edit.php3.42 ▲0.0650.84 ▲6.01
Add New Post /wp-admin/post-new.php5.95 ▲0.0693.51 ▲3.01
Media Library /wp-admin/upload.php3.29 ▲0.0636.76 ▼0.95

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

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

Browser metrics Passed 4 tests

WPUBG: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.25 ▼1.391.88 ▼0.3643.41 ▲4.16
Dashboard /wp-admin2,206 ▲155.87 ▼0.03108.55 ▲6.8544.49 ▲4.40
Posts /wp-admin/edit.php2,089 ▼02.03 ▼0.0040.22 ▲3.6437.06 ▲0.03
Add New Post /wp-admin/post-new.php1,528 ▼518.59 ▼4.63639.64 ▼53.1057.54 ▼2.59
Media Library /wp-admin/upload.php1,388 ▼34.20 ▲0.00112.49 ▲6.9150.84 ▲4.52

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_wpubg
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however 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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wpubg/wpubg.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: statistics, pubg, battlegrounds, playerunknowns, statistik...

wpubg/wpubg.php Passed 13 tests

"WPUBG" version 0.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
58 characters long description:
Display your PUBG stats of the current season as a widget.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected292 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP26563292

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity7.50
▷ Minimum method complexity1.00
▷ Maximum method complexity20.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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.54MB with 0.36MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
gfx/skilled.png77.07KB21.73KB▼ 71.81%
gfx/specialist.png78.89KB22.46KB▼ 71.53%
gfx/novice.png59.53KB19.20KB▼ 67.75%
gfx/unranked.png31.19KB13.84KB▼ 55.62%
gfx/experienced.png65.21KB21.15KB▼ 67.57%