78% league-table-importer-for-sportspress

Code Review | League Table Importer for SportsPress

WordPress plugin League Table Importer for SportsPress scored78%from 54 tests.

About plugin

  • Plugin page: league-table-impo...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4
  • WordPress version: 6.3.1
  • First release: Nov 20, 2015
  • Latest release: Jan 6, 2016
  • Number of updates: 19
  • Update frequency: every 2.5 days
  • Top authors: ibenic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /2,998 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.50MB] [CPU: ▲1.12ms] Passed 4 tests

Analyzing server-side resources used by League Table Importer for SportsPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.97 ▲0.5142.54 ▲0.39
Dashboard /wp-admin3.84 ▲0.5351.28 ▲2.54
Posts /wp-admin/edit.php3.89 ▲0.5351.26 ▲3.05
Add New Post /wp-admin/post-new.php6.36 ▲0.4795.48 ▲0.65
Media Library /wp-admin/upload.php3.70 ▲0.4740.70 ▲0.90
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins3.7741.55
Import Tables /wp-admin/admin.php?page=ibenic_sportspress_import3.6836.99

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 258 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for League Table Importer for SportsPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,856 ▲12114.45 ▲0.072.18 ▲0.5248.45 ▲7.20
Dashboard /wp-admin2,237 ▲554.91 ▲0.01102.11 ▼34.7147.54 ▼2.47
Posts /wp-admin/edit.php2,128 ▲332.09 ▲0.0938.12 ▼1.0739.36 ▲1.70
Add New Post /wp-admin/post-new.php1,555 ▲2223.13 ▼0.11636.38 ▼4.0853.33 ▼23.81
Media Library /wp-admin/upload.php1,430 ▲394.31 ▲0.11106.19 ▼3.7948.86 ▼0.05
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins9772.2131.9032.63
Import Tables /wp-admin/admin.php?page=ibenic_sportspress_import8172.0630.8832.25

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: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ibenic_sportspress_import
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+204
    Undefined offset: 0
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ibenic_sportspress_import
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+205
    Trying to get property 'guid' of non-object
  • 18 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ibenic_sportspress_import
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+221
    Trying to get property 'ID' of non-object
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ibenic_sportspress_import
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+222
    Trying to get property 'post_title' of non-object

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 104× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPExcel_Writer_Excel2007_WriterPart' not found in wp-content/plugins/league-table-importer-for-sportspress/includes/PHPExcel/PHPExcel/Writer/Excel2007/ContentTypes.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'PHPExcel_Writer_OpenDocument_WriterPart' not found in wp-content/plugins/league-table-importer-for-sportspress/includes/PHPExcel/PHPExcel/Writer/OpenDocument/MetaInf.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'PHPExcel_Writer_Excel2007_WriterPart' not found in wp-content/plugins/league-table-importer-for-sportspress/includes/PHPExcel/PHPExcel/Writer/Excel2007/Style.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'PHPExcel_CachedObjectStorage_CacheBase' not found in wp-content/plugins/league-table-importer-for-sportspress/includes/PHPExcel/PHPExcel/CachedObjectStorage/APC.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'PHPExcel_Style_Supervisor' not found in wp-content/plugins/league-table-importer-for-sportspress/includes/PHPExcel/PHPExcel/Style.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'PHPExcel_RichText_TextElement' not found in wp-content/plugins/league-table-importer-for-sportspress/includes/PHPExcel/PHPExcel/RichText/Run.php:26
    • > PHP Fatal error
      require_once(): Failed opening required 'PHPEXCEL_ROOTPHPExcel/Shared/trend/bestFitClass.php' (include_path='.:/usr/share/php') in wp-content/plugins/league-table-importer-for-sportspress/includes/PHPExcel/PHPExcel/Shared/trend/logarithmicBestFitClass.php on line 3
    • > PHP Warning
      Use of undefined constant PHPEXCEL_ROOT - assumed 'PHPEXCEL_ROOT' (this will throw an Error in a future version of PHP) in wp-content/plugins/league-table-importer-for-sportspress/includes/PHPExcel/PHPExcel/Shared/trend/linearBestFitClass.php on line 3
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPExcel_IComparable' not found in wp-content/plugins/league-table-importer-for-sportspress/includes/PHPExcel/PHPExcel/Worksheet/BaseDrawing.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPExcel_Writer_IWriter' not found in wp-content/plugins/league-table-importer-for-sportspress/includes/PHPExcel/PHPExcel/Writer/PDF.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
2 plugin tags: sportspress, import

league-table-importer-for-sportspress/league-table-importer-sportspress.php 92% from 13 tests

The main PHP script in "League Table Importer for SportsPress" version 1.1 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("league-table-importer-for-sportspress.php" instead of "league-table-importer-sportspress.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin60,191 lines of code in 217 files:
LanguageFilesBlank linesComment linesLines of code
PHP21411,64137,41860,138
XML26050
CSS1003

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 1,177)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 387)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity50.85
▷ Minimum class complexity1.00
▷ Maximum class complexity1,177.00
Average method complexity4.64
▷ Minimum method complexity1.00
▷ Maximum method complexity387.00
Code structure
Namespaces0
Interfaces7
Traits0
Classes210
▷ Abstract classes115.24%
▷ Concrete classes19994.76%
▷ Final classes00.00%
Methods2,988
▷ Static methods63221.15%
▷ Public methods2,36879.25%
▷ Protected methods983.28%
▷ Private methods52217.47%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants818
▷ Global constants12114.79%
▷ Class constants69785.21%
▷ Public constants697100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin