10% worldcup-widget

Code Review | WorldCup Widget

WordPress plugin WorldCup Widget scored 10% from 54 tests.

About plugin

  • Plugin page: worldcup-widget
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.1-3.9.1
  • WordPress version: 5.8.1
  • First release: Jun 22, 2014
  • Latest release: Jun 30, 2014
  • Number of updates: 42
  • Update frequency: every 0.2 days
  • Top authors: ericnkatz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,581 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/worldcup-widget/worldcup-widget.php+169
    Function create_function() is deprecated

Server metrics [RAM: ▼1.80MB] [CPU: ▼193.92ms] Passed 4 tests

An overview of server-side resources used by WorldCup Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /1.83 ▼1.005.43 ▼34.33
Dashboard /wp-admin1.85 ▼1.2011.12 ▼40.30
Posts /wp-admin/edit.php1.85 ▼1.255.61 ▼43.24
Add New Post /wp-admin/post-new.php1.85 ▼3.586.00 ▼657.79
Media Library /wp-admin/upload.php1.85 ▼1.155.50 ▼30.78

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

A short overview of filesystem and database impact
Just a few items left to fix
  • Illegal file modification detected: 1 file (0.00KB) outside of "wp-content/plugins/worldcup-widget/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/worldcup-widget/flags/Co\314\202te d'Ivoire.png"
Filesystem: 52 new files
Database: no new tables, 3 new options
New WordPress options
widget_worldcup-widget-groups
widget_worldcup-widget-scorers
widget_worldcup-widget-main

Browser metrics Passed 4 tests

This is an overview of browser requirements for WorldCup Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,816 ▲23416.24 ▲0.6614.18 ▲0.8053.32 ▲5.04
Dashboard /wp-admin2,971 ▲376.00 ▼0.18149.22 ▼31.39113.84 ▼6.75
Posts /wp-admin/edit.php2,743 ▲42.72 ▲0.0075.98 ▲8.4393.06 ▼7.00
Add New Post /wp-admin/post-new.php1,619 ▲421.67 ▲0.66309.92 ▼10.83115.59 ▼2.29
Media Library /wp-admin/upload.php1,814 ▲75.06 ▲0.04161.82 ▲2.59124.82 ▼1.79

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/worldcup-widget/worldcup-widget.php+169
    Function create_function() is deprecated
  • Zombie WordPress options detected upon uninstall: 3 options
    • widget_worldcup-widget-main
    • widget_worldcup-widget-scorers
    • widget_worldcup-widget-groups

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 28× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/worldcup-widget/views/group-stage/admin.php:5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/worldcup-widget/views/scorers/widget.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/worldcup-widget/views/scorers/widget.php on line 6
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/worldcup-widget/views/scorers/widget.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/worldcup-widget/views/widget.php on line 3
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/worldcup-widget/views/scorers/widget.php on line 6
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/worldcup-widget/views/scorers/widget.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/worldcup-widget/views/widget.php:10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/worldcup-widget/views/widget.php on line 4
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/worldcup-widget/views/widget.php on line 3

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

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (Top Scorer Widget admin and display, with stats toggled.), #2 (Main Widget admin and display.), #3 (Group Stage/Stats widget.)
You can take inspiration from this readme.txt

worldcup-widget/worldcup-widget.php 92% from 13 tests

"WorldCup Widget" version 1.0.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Description: Make the plugin description longer than 10 characters (currently 0 characters long)

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 plugin826 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP10235216626
CSS2011180
JavaScript20019
JSON1101

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity6.75
▷ Minimum class complexity6.00
▷ Maximum class complexity8.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
33 PNG files occupy 0.07MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
flags/Honduras.png0.93KB0.87KB▼ 6.91%
flags/Korea Republic.png2.08KB1.55KB▼ 25.27%
flags/Ecuador.png1.59KB1.49KB▼ 6.20%
flags/Brazil.png2.49KB1.75KB▼ 29.74%
flags/United States.png1.08KB0.92KB▼ 14.44%