79% reforestum

Code Review | Reforestum - Carbon neutral products at checkout

WordPress plugin Reforestum - Carbon neutral products at checkout scored79%from 54 tests.

About plugin

  • Plugin page: reforestum
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.4
  • WordPress version: 6.3.1
  • First release: Jul 13, 2020
  • Latest release: Mar 9, 2021
  • Number of updates: 6
  • Update frequency: every 40.3 days
  • Top authors: reforestum (66.67%)yongkiagustinus (50%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /472 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▲0.19ms] Passed 4 tests

This is a short check of server-side resources used by Reforestum - Carbon neutral products at checkout
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.99 ▼0.84
Dashboard /wp-admin3.33 ▲0.0344.84 ▼3.05
Posts /wp-admin/edit.php3.38 ▲0.0248.05 ▲1.09
Add New Post /wp-admin/post-new.php5.91 ▲0.0292.57 ▲5.89
Media Library /wp-admin/upload.php3.25 ▲0.0235.07 ▲3.55

Server storage [IO: ▲4.48MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

An overview of browser requirements for Reforestum - Carbon neutral products at checkout
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲11313.71 ▼0.676.07 ▲4.4342.60 ▲4.10
Dashboard /wp-admin2,225 ▲365.87 ▼0.19106.70 ▼4.0043.14 ▼0.18
Posts /wp-admin/edit.php2,107 ▲182.13 ▲0.0939.85 ▲4.7639.85 ▲3.01
Add New Post /wp-admin/post-new.php1,533 ▼017.44 ▼5.73600.29 ▼74.9752.66 ▼4.89
Media Library /wp-admin/upload.php1,404 ▲134.20 ▲0.0096.59 ▼0.6840.17 ▼4.61

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Reforestum::plugin_uninstall() should not be called statically
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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
These attributes need your attention:
  • Donate link: Please fix this invalid URI: ""
Please take inspiration from this readme.txt

reforestum/reforestum.php 85% from 13 tests

The main PHP file in "Reforestum - Carbon neutral products at checkout" ver. 1.2.2 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "3.0")
  • Description: Please don't use more than 140 characters for the plugin description (currently 248 characters long)

Code Analysis Passed 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
No dangerous file extensions were detected2,336 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP103536811,683
PO File189137302
CSS2418229
JavaScript21633121
SVG1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity28.75
▷ Minimum class complexity1.00
▷ Maximum class complexity130.00
Average method complexity4.04
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes112.50%
Methods73
▷ Static methods6791.78%
▷ Public methods7095.89%
▷ Protected methods00.00%
▷ Private methods34.11%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 4.33MB with 0.84MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/reforestum-logo.png3.94KB4.06KB0.00%
public/images/icon-no-offset.png1.14KB1.17KB0.00%
public/images/icon.png0.82KB0.84KB0.00%
public/images/icon-carbon-red.png0.57KB0.44KB▼ 22.55%
public/images/home.png4,423.29KB1,135.84KB▼ 74.32%