56% bibsonomy-csl

Code Review | BibSonomy/PUMA CSL - Publications & Tag Cloud Widget

WordPress plugin BibSonomy/PUMA CSL - Publications & Tag Cloud Widget scored56%from 54 tests.

About plugin

  • Plugin page: bibsonomy-csl
  • Plugin version: 2.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 6, 2012
  • Latest release: Jan 24, 2023
  • Number of updates: 139
  • Update frequency: every 26.6 days
  • Top authors: academicpuma (61.15%)seboettg (35.25%)mgbckr (4.32%)bibsonomy (1.44%)

Code review

54 tests

User reviews

6 reviews

Install metrics

20+ active /5,511 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼11.61MB] [CPU: ▼2,488,790.88ms] Passed 4 tests

An overview of server-side resources used by BibSonomy/PUMA CSL - Publications & Tag Cloud Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.92 ▼47.6449.64 ▼9,955,150.22
Dashboard /wp-admin3.76 ▲0.3760.64 ▼6.35
Posts /wp-admin/edit.php3.81 ▲0.4156.17 ▲4.36
Add New Post /wp-admin/post-new.php6.37 ▲0.4494.55 ▼11.30
Media Library /wp-admin/upload.php3.69 ▲0.4144.26 ▲7.22
Bibsonomy CSL /wp-admin/options-general.php?page=bibsonomy_csl3.5738.04

Server storage [IO: ▲38.24MB] [DB: ▲0.28MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Please fix the following
  • Filesystem usage must be lower than 25MB (currently using 38.24MB)
Filesystem: 3,860 new files
Database: 1 new table, 7 new options
New tables
wp_bibsonomy_csl_styles
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
jal_db_version
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for BibSonomy/PUMA CSL - Publications & Tag Cloud Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲7314.29 ▲0.142.12 ▲0.2042.88 ▼4.85
Dashboard /wp-admin2,202 ▲255.66 ▲0.0283.78 ▼20.0242.82 ▲0.41
Posts /wp-admin/edit.php2,104 ▲42.00 ▲0.0533.60 ▼2.9535.60 ▼3.27
Add New Post /wp-admin/post-new.php6,708 ▲5,18225.83 ▲2.83948.82 ▲266.4767.42 ▲3.37
Media Library /wp-admin/upload.php1,407 ▲104.24 ▲0.0496.21 ▼19.7641.84 ▼5.46
Bibsonomy CSL /wp-admin/options-general.php?page=bibsonomy_csl8822.0024.7428.00

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'jal_uninstall' not found or invalid function name
  • Zombie tables were found after uninstall: 1 table
    • wp_bibsonomy_csl_styles
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • jal_db_version

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=bibsonomy_csl
    • > Notice in wp-content/plugins/bibsonomy-csl/BibsonomyOptions.php+124
    Trying to access array offset on value of type bool
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=bibsonomy_csl
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=bibsonomy_csl
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(http://www.fillyourtaproom.com/wp-json/wp/v2/posts?per_page=10): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

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
Please fix the following items
  • 291× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Trait 'Seboettg\\CiteProc\\Style\\InheritableNameAttributesTrait' not found in wp-content/plugins/bibsonomy-csl/vendor/seboettg/citeproc-php/src/Root/Root.php on line 19
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/bibsonomy-csl/vendor/academicpuma/restclient-php/tests/Util/SimHashUtilsTest.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/bibsonomy-csl/vendor/guzzlehttp/psr7/src/AppendStream.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Seboettg\\CiteProc\\Rendering\\Rendering' not found in wp-content/plugins/bibsonomy-csl/vendor/seboettg/citeproc-php/src/Rendering/Group.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'AcademicPuma\\RestClient\\Queries\\AbstractQuery' not found in wp-content/plugins/bibsonomy-csl/vendor/academicpuma/restclient-php/src/Queries/Post/CreatePostDocumentQuery.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/bibsonomy-csl/vendor/academicpuma/restclient-php/tests/Queries/Get/GetFriendsQueryTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/bibsonomy-csl/vendor/academicpuma/restclient-php/tests/Queries/Get/GetPostDetailsQueryTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'AcademicPuma\\RestClient\\Queries\\AbstractQuery' not found in wp-content/plugins/bibsonomy-csl/vendor/academicpuma/restclient-php/src/Queries/Delete/DeletePostDocumentQuery.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/bibsonomy-csl/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/bibsonomy-csl/vendor/academicpuma/restclient-php/tests/Queries/Get/GetProjectsQueryTest.php:43

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 86% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Donate link: Invalid URI ("")
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === bibsonomy-csl === )
  • Screenshots: These screenshots require images: #1 (Rendered publication list from BibSonomy of group 'kde' and filtered by tag 'bibsonomy'), #2 ('Add BibSonomy Publications' MetaBox to integrate a publication list in a post), #3 (Decorated tag cloud)
The official readme.txt is a good inspiration

bibsonomy-csl/BibsonomyTagCloudWidget.php 92% from 13 tests

The main PHP script in "BibSonomy/PUMA CSL - Publications & Tag Cloud Widget" version 2.2.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("bibsonomy-csl.php" instead of "BibsonomyTagCloudWidget.php")

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected976,008 lines of code in 3,319 files:
LanguageFilesBlank linesComment linesLines of code
XML2,6451,03910,389868,302
PHP4787,98121,24652,501
HTML1118,469042,749
Markdown371,92405,397
JSON26004,852
JavaScript619476911
CSS511867460
Python15021372
SVG100229
TeX360112
YAML30082
reStructuredText1326018
Ruby13015
Bourne Shell1108

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity9.69
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity2.51
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces71
Interfaces49
Traits18
Classes380
▷ Abstract classes102.63%
▷ Concrete classes37097.37%
▷ Final classes4211.35%
Methods2,637
▷ Static methods38514.60%
▷ Public methods2,30987.56%
▷ Protected methods833.15%
▷ Private methods2459.29%
Functions294
▷ Named functions13345.24%
▷ Anonymous functions16154.76%
Constants537
▷ Global constants8315.46%
▷ Class constants45484.54%
▷ Public constants43495.59%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
21 PNG files occupy 0.70MB with 0.38MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/img/bg_tag_left.png0.97KB0.93KB▼ 3.92%
screenshot-1.png66.30KB32.04KB▼ 51.67%
img/bg_tag_right.png0.40KB0.35KB▼ 12.96%
(invalid) vendor/academicpuma/restclient-php/tests/data/documents/LARGE_Vergleich_Sortierverfahren.pdf.png22.53KB0.00KB▼ 100.00%
(invalid) vendor/academicpuma/restclient-php/tests/data/documents/MIDDLE_Vergleich_Sortierverfahren.pdf.png22.53KB0.00KB▼ 100.00%