72% sports-news

Code Review | Sports News Headlines Widget Box In Any Language

WordPress plugin Sports News Headlines Widget Box In Any Language scored72%from 54 tests.

About plugin

  • Plugin page: sports-news
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.4
  • WordPress version: 6.3.1
  • First release: Nov 27, 2015
  • Latest release: Dec 26, 2015
  • Number of updates: 23
  • Update frequency: every 1.3 days
  • Top authors: lswjohn (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

50+ active /5,947 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.07MB] [CPU: ▼13.01ms] Passed 4 tests

Server-side resources used by Sports News Headlines Widget Box In Any Language
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1040.45 ▼4.48
Dashboard /wp-admin3.29 ▼0.0134.61 ▼16.46
Posts /wp-admin/edit.php3.36 ▲0.0040.90 ▼10.75
Add New Post /wp-admin/post-new.php5.54 ▼0.3577.13 ▼20.34
Media Library /wp-admin/upload.php3.30 ▲0.0733.19 ▼4.42
Sports News /wp-admin/options-general.php?page=sports-news-plugin-menu3.2731.08

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 27 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
Sports_News_Options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Sports News Headlines Widget Box In Any Language
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,920 ▲15913.82 ▼0.798.38 ▲6.5145.81 ▼1.78
Dashboard /wp-admin2,243 ▲665.60 ▼0.0789.76 ▼12.7340.32 ▼3.77
Posts /wp-admin/edit.php2,148 ▲482.03 ▲0.0740.54 ▲3.2134.72 ▼1.81
Add New Post /wp-admin/post-new.php1,570 ▲4323.10 ▲0.00638.04 ▼49.8953.79 ▼11.47
Media Library /wp-admin/upload.php1,442 ▲484.23 ▲0.0499.07 ▼7.0243.12 ▲0.03
Sports News /wp-admin/options-general.php?page=sports-news-plugin-menu1,0731.8226.2434.97

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • Sports_News_Options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=sports-news-plugin-menu
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method snwp_Main::show_admin_notice() should not be called statically

SRP 0% 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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/sports-news/views/global-settings/page-header.php
    • > /wp-content/plugins/sports-news/includes/admin-notice-helper/admin-notice-helper.php
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'snwp_Main' not found in wp-content/plugins/sports-news/views/global-settings/page-notice.php:62
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/sports-news/includes/admin-notice-helper/admin-notice.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'snwp_Module' not found in wp-content/plugins/sports-news/classes/snwp-show.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/sports-news/settings.php:2
    • > PHP Notice
      Undefined variable: setting_logo_path in wp-content/plugins/sports-news/views/global-settings/page-header.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'snwp_Module' not found in wp-content/plugins/sports-news/classes/snwp-main.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/sports-news/sportsnews.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Sports News 300x250 in action.), #2 (Sports news 728x90 in action.), #3 (Sports News 220x150 in action.), #4 (Sports News 550x70 in action.)
  • Tags: You are using too many tags: 53 tag instead of maximum 10
You can take inspiration from this readme.txt

sports-news/sportsnews.php 85% from 13 tests

Analyzing the main PHP file in "Sports News Headlines Widget Box In Any Language" version 1.5
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("sports-news.php" instead of "sportsnews.php")
  • Description: The description should be shorter than 140 characters (currently 164 characters long)

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
Everything looks great! No dangerous files found in this plugin849 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP11196167780
CSS23025
JavaScript16225
Markdown17019

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity5.40
▷ Minimum class complexity3.00
▷ Maximum class complexity8.00
Average method complexity1.92
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods25
▷ Static methods1040.00%
▷ Public methods2184.00%
▷ Protected methods416.00%
▷ Private methods00.00%
Functions38
▷ Named functions3797.37%
▷ Anonymous functions12.63%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/blank.png0.27KB0.10KB▼ 61.68%