10% csrhub-sustainability-rating-widget

Code Review | CSRHub Sustainability Ratings widget

WordPress plugin CSRHub Sustainability Ratings widget scored10%from 54 tests.

About plugin

  • Plugin page: csrhub-sustainabi...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.4
  • WordPress version: 6.3.1
  • First release: Sep 12, 2012
  • Latest release: Sep 18, 2012
  • Number of updates: 11
  • Update frequency: every 1.1 days
  • Top authors: CSRHub team (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,244 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/csrhub-sustainability-rating-widget/csrhubwidget.php+123
    Function create_function() is deprecated

Server metrics [RAM: ▼1.93MB] [CPU: ▼57.71ms] Passed 4 tests

Server-side resources used by CSRHub Sustainability Ratings widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.394.68 ▼38.76
Dashboard /wp-admin2.10 ▼1.255.73 ▼60.47
Posts /wp-admin/edit.php2.10 ▼1.265.86 ▼49.25
Add New Post /wp-admin/post-new.php2.10 ▼3.806.78 ▼82.34
Media Library /wp-admin/upload.php2.10 ▼1.146.00 ▼27.53

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_csrhubwidget
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for CSRHub Sustainability Ratings widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.17 ▼0.392.17 ▲0.5345.18 ▲5.00
Dashboard /wp-admin2,198 ▲215.63 ▲0.0187.12 ▼16.3641.36 ▼3.11
Posts /wp-admin/edit.php2,100 ▼01.98 ▲0.0335.56 ▼5.5635.13 ▼3.71
Add New Post /wp-admin/post-new.php1,404 ▼12217.95 ▼5.19604.53 ▼63.8952.06 ▼13.80
Media Library /wp-admin/upload.php1,397 ▼34.22 ▲0.0599.90 ▼6.5645.26 ▼0.41

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/csrhub-sustainability-rating-widget/csrhubwidget.php+123
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_csrhubwidget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/csrhub-sustainability-rating-widget/csrhubwidget.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Widget in small 170x200 px size.), #2 (Widget in medium 300x400 px and 300x300 px (without teaser) sizes.), #3 (Widget in wide 650x100 px size.)
  • Tags: You are using too many tags: 14 tag instead of maximum 10
You can look at the official readme.txt

csrhub-sustainability-rating-widget/csrhubwidget.php 92% from 13 tests

The main PHP file in "CSRHub Sustainability Ratings widget" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("csrhub-sustainability-rating-widget.php" instead of "csrhubwidget.php")

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
No dangerous file extensions were detected94 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1171694

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods583.33%
▷ Protected methods00.00%
▷ Private methods116.67%
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
No PNG images were found in this plugin