10% tree-nation-for-woocommerce

Code Review | Tree-Nation for WooCommerce

WordPress plugin Tree-Nation for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: tree-nation-for-w...
  • Plugin version: 1.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 26, 2020
  • Latest release: Jan 29, 2023
  • Number of updates: 18
  • Update frequency: every 59.3 days
  • Top authors: treenation (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active /1,812 total downloads

Benchmarks

Plugin footprint 58% 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
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Error in wp-content/plugins/tree-nation-for-woocommerce/treenation-for-woocommerce.php+89
    Uncaught Error: Class 'WC_Data_Store' not found in wp-content/plugins/tree-nation-for-woocommerce/treenation-for-woocommerce.php:89
    Stack trace:
    #0 wp-content/plugins/tree-nation-for-woocommerce/treenation-for-woocommerce.php(111): findExistingConfig()
    #1 wp-includes/class-wp-hook.php(310): treenationwoo_activate_webhook()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/includes/plugin.php(693): do_action()

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

Server-side resources used by Tree-Nation for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0035.13 ▼5.07
Dashboard /wp-admin3.31 ▲0.0045.31 ▼3.13
Posts /wp-admin/edit.php3.36 ▲0.0047.25 ▲0.15
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.29 ▼3.04
Media Library /wp-admin/upload.php3.23 ▲0.0032.03 ▼2.00

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Tree-Nation for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.26 ▼0.361.55 ▼0.3437.73 ▼8.74
Dashboard /wp-admin2,198 ▲185.62 ▲0.0288.73 ▲6.3943.25 ▲2.61
Posts /wp-admin/edit.php2,097 ▼32.03 ▲0.0439.04 ▲1.0236.74 ▲2.36
Add New Post /wp-admin/post-new.php1,536 ▲1023.38 ▲0.31587.44 ▼120.9046.94 ▼11.05
Media Library /wp-admin/upload.php1,397 ▼34.20 ▲0.01102.34 ▼2.8747.09 ▲1.21

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • treenationwoo_version
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: tree, product, shop, climate-change, forest...

tree-nation-for-woocommerce/treenation-for-woocommerce.php 77% from 13 tests

This is the main PHP file of "Tree-Nation for WooCommerce" version 1.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.4" instead of "3.0.0")
  • Main file name: Name the main plugin file the same as the plugin slug ("tree-nation-for-woocommerce.php" instead of "treenation-for-woocommerce.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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 detected254 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP34893244
JSON10010

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity10.00
▷ Minimum class complexity4.00
▷ Maximum class complexity22.00
Average method complexity3.08
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods13
▷ Static methods215.38%
▷ Public methods1292.31%
▷ Protected methods00.00%
▷ Private methods17.69%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin