84% wpsustainable

Code Review | WPSustainable

WordPress plugin WPSustainable scored84%from 54 tests.

About plugin

  • Plugin page: wpsustainable
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Nov 18, 2022
  • Latest release: Oct 17, 2023
  • Number of updates: 6
  • Update frequency: every 55.5 days
  • Top authors: JavierCasares (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /799 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.63ms] Passed 4 tests

Analyzing server-side resources used by WPSustainable
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.76 ▲2.73
Dashboard /wp-admin3.31 ▼0.0352.15 ▼14.94
Posts /wp-admin/edit.php3.37 ▲0.0150.46 ▼0.95
Add New Post /wp-admin/post-new.php5.90 ▲0.0287.75 ▼18.21
Media Library /wp-admin/upload.php3.24 ▲0.0136.03 ▼0.42

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for WPSustainable
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲2114.24 ▼0.011.97 ▲0.1146.39 ▲2.63
Dashboard /wp-admin2,195 ▲185.59 ▼0.0894.49 ▼3.3445.13 ▲3.98
Posts /wp-admin/edit.php2,097 ▼31.99 ▼0.0238.95 ▼1.1434.49 ▼3.48
Add New Post /wp-admin/post-new.php1,545 ▲1717.90 ▼5.14609.12 ▼9.7874.15 ▲15.80
Media Library /wp-admin/upload.php1,400 ▼04.14 ▼0.09100.68 ▼3.5844.77 ▼2.00

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wpsustainable/includes/class-sustainable-health.php
    • > /wp-content/plugins/wpsustainable/wpsustainable.php
    • > /wp-content/plugins/wpsustainable/badge/class-sustainable-badge.php
    • > /wp-content/plugins/wpsustainable/includes/helper-sustainable-api.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention: You can take inspiration from this readme.txt

wpsustainable/wpsustainable.php Passed 13 tests

This is the main PHP file of "WPSustainable" version 1.1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
92 characters long description:
Check the sustainability from your hosting company and the CO2 generated by your IP address.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected400 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP575166278
PO File1222279
JavaScript121427
JSON10010
CSS1006

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity7.50
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity3.17
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin