84% travel-game

Code Review | Travel Game - Vacation Widget

WordPress plugin Travel Game - Vacation Widget scored84%from 54 tests.

About plugin

  • Plugin page: travel-game
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.4
  • WordPress version: 6.3.1
  • First release: Dec 30, 2015
  • Latest release: Jan 3, 2016
  • Number of updates: 6
  • Update frequency: every 0.7 days
  • Top authors: idealesc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,288 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
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼11.96ms] Passed 4 tests

Server-side resources used by Travel Game - Vacation Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.64 ▼1.89
Dashboard /wp-admin3.34 ▼0.0150.34 ▼15.43
Posts /wp-admin/edit.php3.45 ▲0.1049.07 ▼2.89
Add New Post /wp-admin/post-new.php5.94 ▲0.0582.56 ▼27.61
Media Library /wp-admin/upload.php3.26 ▲0.0338.31 ▲1.20
Travel Game /wp-admin/options-general.php?page=wscg-plugin-menu3.2632.55

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 61 new files
Database: no new tables, 8 new options
New WordPress options
widget_wscg_game_widget
WSCG_SETTING
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Travel Game - Vacation Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,906 ▲14513.58 ▼0.778.31 ▲6.4140.99 ▼0.14
Dashboard /wp-admin2,224 ▲445.54 ▼0.1384.99 ▼3.1041.11 ▼0.59
Posts /wp-admin/edit.php2,133 ▲362.01 ▲0.0235.83 ▼1.8837.97 ▲6.04
Add New Post /wp-admin/post-new.php1,624 ▲9521.83 ▼1.09667.13 ▲3.7237.57 ▼13.69
Media Library /wp-admin/upload.php1,432 ▲384.29 ▲0.03100.42 ▼2.6043.10 ▲0.04
Travel Game /wp-admin/options-general.php?page=wscg-plugin-menu8522.0627.6425.92

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_wscg_game_widget
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/travel-game/classes/wscg-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/travel-game/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/travel-game/travel-game.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% 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:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Game in big dimension - screenshot-1.jpg), #2 (Game in small dimension - screenshot-2.jpg)
  • Tags: There are too many tags (12 tag instead of maximum 10)
Please take inspiration from this readme.txt

travel-game/travel-game.php Passed 13 tests

"Travel Game - Vacation Widget" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
91 characters long description:
Try to hit the hottest destination and plan vacation early with a recreational travel game.

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
No dangerous file extensions were detected581 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP55147329
JavaScript2387153
CSS223199

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity10.00
Average method complexity1.57
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods21
▷ Static methods14.76%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
47 compressed PNG files occupy 1.43MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/card38.png36.65KB37.15KB0.00%
images/winner.png12.94KB13.94KB0.00%
images/card20.png31.64KB32.38KB0.00%
images/card1.png35.57KB36.47KB0.00%
images/card17.png28.48KB29.17KB0.00%