10% game-users-share-buttons

Code Review | Game Users Share Buttons

WordPress plugin Game Users Share Buttons scored 10% from 54 tests.

About plugin

  • Plugin page: game-users-share-...
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.1-4.9.4
  • WordPress version: 5.8.1
  • First release: Nov 11, 2017
  • Latest release: Feb 16, 2018
  • Number of updates: 40
  • Update frequency: every 2.5 days
  • Top authors: gameusers (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 1,213 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/game-users-share-buttons/game-users-share-buttons.php+1327
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.26MB] [CPU: ▼137.26ms] Passed 4 tests

Analyzing server-side resources used by Game Users Share Buttons
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.09 ▲0.3734.98 ▲15.32
Dashboard /wp-admin3.31 ▲0.2658.15 ▲11.19
Posts /wp-admin/edit.php3.42 ▲0.3142.26 ▼2.90
Add New Post /wp-admin/post-new.php5.67 ▲0.2497.62 ▼551.20
Media Library /wp-admin/upload.php3.25 ▲0.2536.15 ▼6.11
Game Users Share Buttons /wp-admin/options-general.php?page=game-users-share-buttons3.2329.21

Server storage [IO: ▲2.02MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
Please fix the following
  • There were 2 files (0.08KB) illegally modified outside of "wp-content/plugins/game-users-share-buttons/" and "wp-content/uploads/"
    • (new file) wp-content/game-users-share-buttons/json/option.json
    • (new file) wp-content/game-users-share-buttons/themes/.empty
Filesystem: 49 new files
Database: no new tables, 2 new options
New WordPress options
widget_game-users-share-buttons
game_users_option

Browser metrics Passed 4 tests

A check of browser resources used by Game Users Share Buttons
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲8815.97 ▲0.439.46 ▼1.0050.59 ▲6.77
Dashboard /wp-admin2,972 ▲385.91 ▼0.08143.97 ▼12.48109.44 ▲4.14
Posts /wp-admin/edit.php2,744 ▲52.70 ▼0.0262.77 ▼8.0383.68 ▼5.29
Add New Post /wp-admin/post-new.php3,690 ▲2,19015.13 ▼3.36491.99 ▲93.90111.53 ▼0.87
Media Library /wp-admin/upload.php1,812 ▲645.03 ▲0.00151.20 ▼9.24116.52 ▼1.43
Game Users Share Buttons /wp-admin/options-general.php?page=game-users-share-buttons2,0996.11148.13150.91

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/game-users-share-buttons/game-users-share-buttons.php+1277
    unlink(wp-content/game-users-share-buttons/json): Is a directory
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_game-users-share-buttons

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/game-users-share-buttons/views/option.php
    • > /wp-content/plugins/game-users-share-buttons/php/count.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/game-users-share-buttons/modules/widget.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/game-users-share-buttons/modules/widget.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/game-users-share-buttons/views/admin-function.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Please fix this invalid url: ""
The official readme.txt is a good inspiration

game-users-share-buttons/game-users-share-buttons.php 92% from 13 tests

The principal PHP file in "Game Users Share Buttons" v. 1.3.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 355 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
There were no executable files found in this plugin18,243 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
JSON3009,578
JSX162,8261,1607,007
PHP76273671,051
SVG100288
CSS48746225
JavaScript742294

PHP code Passed 2 tests

Analyzing 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.43
Average class complexity46.80
▷ Minimum class complexity1.00
▷ Maximum class complexity181.00
Average method complexity7.19
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods37
▷ Static methods410.81%
▷ Public methods37100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants14100.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
2 compressed PNG files occupy 0.01MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/free1.png2.67KB2.67KB0.00%
img/free2.png3.07KB3.07KB0.06%