84% buy-me-a-tree

Code Review | Buy me a Tree

WordPress plugin Buy me a Tree scored 84% from 54 tests.

About plugin

  • Plugin page: buy-me-a-tree
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7
  • WordPress version: 6.3.1
  • First release: Apr 2, 2021
  • Latest release: Apr 23, 2021
  • Number of updates: 19
  • Update frequency: every 1.1 days
  • Top authors: buyatree (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 485 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.02MB] [CPU: ▼2.94ms] Passed 4 tests

A check of server-side resources used by Buy me a Tree
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.24 ▼4.15
Dashboard /wp-admin3.33 ▲0.0345.34 ▼4.19
Posts /wp-admin/edit.php3.38 ▲0.0345.01 ▲0.81
Add New Post /wp-admin/post-new.php5.91 ▲0.0384.66 ▼4.22
Media Library /wp-admin/upload.php3.25 ▲0.0333.59 ▲0.80

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Buy me a Tree
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲8313.24 ▼1.051.72 ▼0.1543.77 ▼3.55
Dashboard /wp-admin2,222 ▲346.02 ▲0.16109.40 ▼6.6739.33 ▼6.90
Posts /wp-admin/edit.php2,105 ▲192.00 ▼0.0133.76 ▼2.6735.07 ▼0.41
Add New Post /wp-admin/post-new.php1,559 ▲2623.18 ▼0.11654.63 ▼22.4156.38 ▼2.68
Media Library /wp-admin/upload.php1,404 ▲164.20 ▼0.0393.66 ▼11.0543.24 ▼2.06

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/buy-me-a-tree/by_me_a_tree.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
2 plugin tags: tree, donate

buy-me-a-tree/by_me_a_tree.php 85% from 13 tests

The entry point to "Buy me a Tree" version 1.0.4 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("buy-me-a-tree.php" instead of "by_me_a_tree.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 164 characters long)

Code Analysis Passed 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
There were no executable files found in this plugin157 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP23421108
CSS1131649

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.08MB with 0.06MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/screenshot.png84.81KB20.88KB▼ 75.38%