74% live-scores-for-sportspress

Code Review | Live Scores for SportsPress

WordPress plugin Live Scores for SportsPress scored74%from 54 tests.

About plugin

  • Plugin page: live-scores-for-s...
  • Plugin version: 1.9.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9.3
  • WordPress version: 6.3.1
  • First release: Nov 12, 2017
  • Latest release: Apr 17, 2022
  • Number of updates: 51
  • Update frequency: every 31.7 days
  • Top authors: ibenic (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

400+ active /22,752 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.47MB] [CPU: ▼0.70ms] Passed 4 tests

An overview of server-side resources used by Live Scores for SportsPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4943.26 ▲1.28
Dashboard /wp-admin3.79 ▲0.4947.70 ▼2.53
Posts /wp-admin/edit.php3.84 ▲0.4951.89 ▲5.09
Add New Post /wp-admin/post-new.php6.31 ▲0.4291.90 ▼2.64
Media Library /wp-admin/upload.php3.71 ▲0.4936.79 ▲1.08
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius3.8940.25

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 228 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-comments
fs_gdpr
widget_recent-posts
fs_debug_mode
fs_accounts
db_upgraded
fs_active_plugins
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Live Scores for SportsPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲10213.24 ▼1.212.01 ▲0.2828.98 ▼17.50
Dashboard /wp-admin2,243 ▲584.87 ▼0.22109.49 ▲4.2242.90 ▼1.76
Posts /wp-admin/edit.php2,126 ▲371.99 ▼0.0540.32 ▲3.9642.89 ▲7.79
Add New Post /wp-admin/post-new.php1,535 ▲223.16 ▼0.05695.28 ▲20.4153.48 ▼8.67
Media Library /wp-admin/upload.php1,419 ▲314.21 ▼0.0396.22 ▼9.9046.04 ▲1.28
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,0541.7026.8427.32

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/live-scores-for-sportspress/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 10 options
    • fs_active_plugins
    • fs_accounts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • fs_debug_mode
    • fs_gdpr
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/live-scores-for-sportspress/includes/class-lsfs-frontend-scripts.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/live-scores-for-sportspress/includes/admin/views/tabs/general.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/live-scores-for-sportspress/includes/admin/views/tabs/about.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/live-scores-for-sportspress/includes/admin/views/html-admin-live-matches.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/live-scores-for-sportspress/includes/integrations/views/html-integration-scorespro-free.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: sportspress, live

live-scores-for-sportspress/live-scores-for-sportspress.php Passed 13 tests

Analyzing the main PHP file in "Live Scores for SportsPress" version 1.9.2
72 characters long description:
Enhance SportsPress with Live Scores, Live Minutes, Commentary and other

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected37,620 lines of code in 182 files:
LanguageFilesBlank linesComment linesLines of code
PHP1558,58117,37035,560
JavaScript8151931,206
Sass21040834
CSS162819
SVG1001

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,911)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity63.34
▷ Minimum class complexity1.00
▷ Maximum class complexity2,911.00
Average method complexity4.66
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes74
▷ Abstract classes45.41%
▷ Concrete classes7094.59%
▷ Final classes11.43%
Methods1,289
▷ Static methods19014.74%
▷ Public methods94373.16%
▷ Protected methods151.16%
▷ Private methods33125.68%
Functions126
▷ Named functions12599.21%
▷ Anonymous functions10.79%
Constants129
▷ Global constants10480.62%
▷ Class constants2519.38%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.11MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-256x256.png3.62KB3.88KB0.00%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/images/integration-scorespro-free.png84.38KB16.97KB▼ 79.89%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%