74% i-plant-a-tree

Code Review | I Plant A Tree

WordPress plugin I Plant A Tree scored74%from 54 tests.

About plugin

  • Plugin page: i-plant-a-tree
  • Plugin version: 1.7.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.2-5.8.2
  • WordPress version: 6.3.1
  • First release: Aug 14, 2015
  • Latest release: Nov 19, 2021
  • Number of updates: 88
  • Update frequency: every 26.0 days
  • Top authors: Hellstrom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,786 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼11.77ms] Passed 4 tests

Analyzing server-side resources used by I Plant A Tree
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1445.58 ▲5.43
Dashboard /wp-admin3.44 ▲0.0948.62 ▼24.87
Posts /wp-admin/edit.php3.55 ▲0.1951.31 ▼2.36
Add New Post /wp-admin/post-new.php6.02 ▲0.1389.47 ▼20.75
Media Library /wp-admin/upload.php3.36 ▲0.1333.99 ▲0.90
I plant a tree /wp-admin/options-general.php?page=i_plant_a_tree3.3332.77

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 40 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
plugin_error
widget_recent-posts
db_upgraded
widget_recent-comments
ipat_widget
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for I Plant A Tree
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲7614.72 ▲0.181.92 ▲0.2838.72 ▼0.35
Dashboard /wp-admin2,204 ▲275.63 ▼0.0783.43 ▼12.3740.22 ▲2.81
Posts /wp-admin/edit.php2,109 ▲61.99 ▼0.0040.79 ▼1.2438.37 ▲2.46
Add New Post /wp-admin/post-new.php1,549 ▲2321.05 ▼2.59649.03 ▲12.5953.57 ▼3.40
Media Library /wp-admin/upload.php1,409 ▲64.19 ▼0.0495.39 ▼7.8841.65 ▼2.50
I plant a tree /wp-admin/options-general.php?page=i_plant_a_tree1,7712.0324.1461.86

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method ipat_widget_class::uninstall() should not be called statically
  • The uninstall procedure has failed, leaving 8 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • ipat_widget
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • plugin_error

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/i-plant-a-tree/iplantatree.php

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

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: ipat, i plant a tree, widget

i-plant-a-tree/iplantatree.php 92% from 13 tests

The main PHP script in "I Plant A Tree" version 1.7.3 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("i-plant-a-tree.php" instead of "iplantatree.php")

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
Good job! No executable or dangerous file extensions detected2,657 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
SVG141401,286
PHP15235606
CSS1460499
PO File3100116266

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity4.67
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods233.33%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
16 PNG files occupy 0.31MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/image/widget-220x90_de.png21.35KB8.92KB▼ 58.25%
assets/image/widget-220x90_it.png21.03KB8.70KB▼ 58.62%
assets/image/widget-120x190_en.png23.84KB9.37KB▼ 60.71%
assets/image/widget-100x150_de.png17.96KB7.13KB▼ 60.29%
assets/image/widget-180x80_it.png17.09KB7.37KB▼ 56.89%