10% wp-clanwars

Code Review | WP-ClanWars

WordPress plugin WP-ClanWars scored10%from 54 tests.

About plugin

  • Plugin page: wp-clanwars
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.9.6
  • WordPress version: 6.3.1
  • First release: Oct 5, 2014
  • Latest release: Jun 29, 2018
  • Number of updates: 31
  • Update frequency: every 44.0 days
  • Top authors: andddd (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

40+ active /8,927 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/wp-clanwars/classes/api.class.php+351
    Trying to get property 'success' of non-object

Server metrics [RAM: ▲0.13MB] [CPU: ▼3.14ms] Passed 4 tests

An overview of server-side resources used by WP-ClanWars
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1144.56 ▲2.28
Dashboard /wp-admin3.48 ▲0.1846.90 ▼1.04
Posts /wp-admin/edit.php3.53 ▲0.1852.98 ▼0.88
Add New Post /wp-admin/post-new.php6.00 ▲0.1198.56 ▼12.90
Media Library /wp-admin/upload.php3.34 ▲0.1136.63 ▲2.91
Clanwars Cloud /wp-admin/admin.php?page=wp-clanwars-cloud3.7337.50
Teams /wp-admin/admin.php?page=wp-clanwars-teams3.3436.21
Games /wp-admin/admin.php?page=wp-clanwars-games3.3430.77
Matches /wp-admin/admin.php?page=wp-clanwars-matches3.3433.95
Settings /wp-admin/admin.php?page=wp-clanwars-settings3.3436.89

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 444 new files
Database: 5 new tables, 10 new options
New tables
wp_cw_teams
wp_cw_games
wp_cw_rounds
wp_cw_maps
wp_cw_matches
New WordPress options
widget_recent-comments
_wp_clanwars_category
db_upgraded
_wp_clanwars_defaultcss
widget_theysaidso_widget
theysaidso_admin_options
_wp_clanwars_dbversion
widget_clanwars
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for WP-ClanWars
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,974 ▲23913.72 ▼0.616.35 ▲4.5442.40 ▼6.88
Dashboard /wp-admin2,267 ▲794.89 ▼1.03110.41 ▲11.1942.05 ▼3.77
Posts /wp-admin/edit.php2,147 ▲582.01 ▼0.0141.92 ▼0.0134.27 ▼0.37
Add New Post /wp-admin/post-new.php1,563 ▲2123.43 ▲4.94585.12 ▼52.0047.40 ▼2.14
Media Library /wp-admin/upload.php1,446 ▲584.23 ▲0.0296.21 ▼11.8241.18 ▼4.99
Clanwars Cloud /wp-admin/admin.php?page=wp-clanwars-cloud1,9302.0534.6632.23
Teams /wp-admin/admin.php?page=wp-clanwars-teams1,9052.0936.5530.21
Games /wp-admin/admin.php?page=wp-clanwars-games1,9292.0936.0730.02
Matches /wp-admin/admin.php?page=wp-clanwars-matches1,9292.0936.9326.04
Settings /wp-admin/admin.php?page=wp-clanwars-settings1,9292.2134.6828.30

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-comments
    • widget_recent-posts
    • _wp_clanwars_dbversion
    • widget_theysaidso_widget
    • widget_clanwars
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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 fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-clanwars/views/login_complete.php
  • 47× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-clanwars/views/game_table.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-clanwars/views/edit_game.php:5
    • > PHP Notice
      Undefined variable: partial in wp-content/plugins/wp-clanwars/views/import_publish.php on line 3
    • > PHP Notice
      Undefined variable: partial in wp-content/plugins/wp-clanwars/views/import_browse.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-clanwars/views/partials/account_header.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-clanwars/views/edit_team.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-clanwars/views/edit_map.php:4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-clanwars/classes/teams_table.class.php on line 28
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/wp-clanwars/classes/maps_table.class.php on line 28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-clanwars/views/edit_match.php:38

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (Score card and widget), #2 (Install & share games), #3 (View matches), #4 (Edit match)
You can look at the official readme.txt

wp-clanwars/wp-clanwars.php Passed 13 tests

The main PHP file in "WP-ClanWars" ver. 2.0.1 adds more information about the plugin and also serves as the entry point for this plugin
50 characters long description:
Content manager for e-sports teams and communities

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin62,728 lines of code in 336 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1828,3094,15332,682
PO File225,4715,74411,538
PHP441,6555945,490
CSS143501313,893
HTML1263603,460
Sass25198302,128
LESS1328341,510
SVG4001,162
Markdown6910298
JSON1000262
ERB1870253
YAML24028
Ruby16024

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity29.11
▷ Minimum class complexity2.00
▷ Maximum class complexity309.00
Average method complexity2.96
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes15.26%
Methods262
▷ Static methods10540.08%
▷ Public methods22987.40%
▷ Protected methods134.96%
▷ Private methods207.63%
Functions13
▷ Named functions17.69%
▷ Anonymous functions1292.31%
Constants38
▷ Global constants1231.58%
▷ Class constants2668.42%
▷ Public constants26100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
57 PNG files occupy 3.34MB with 1.78MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
components/select2/docs/vendor/images/flags/ca.png6.99KB3.36KB▼ 51.92%
components/select2/docs/vendor/images/flags/hi.png3.10KB1.25KB▼ 59.46%
components/select2/docs/vendor/images/flags/nc.png3.90KB2.15KB▼ 44.83%
components/select2/docs/vendor/images/flags/ok.png7.12KB3.33KB▼ 53.22%
components/select2/docs/vendor/images/flags/or.png9.31KB4.06KB▼ 56.38%