10% ecomatcher-for-woocommerce

Code Review | EcoMatcher

WordPress plugin EcoMatcher scored10%from 54 tests.

About plugin

  • Plugin page: ecomatcher-for-wo...
  • Plugin version: 1.3.11
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.1
  • WordPress version: 6.3.1
  • First release: Aug 2, 2019
  • Latest release: Apr 18, 2023
  • Number of updates: 142
  • Update frequency: every 9.6 days
  • Top authors: jovianch (87.32%)alvinlan (13.38%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /1,622 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • The plugin cannot be installed
    • > Error in wp-content/plugins/ecomatcher-for-woocommerce/inc/Base/EcoMatcher-Activate.php+78
    Uncaught Error: Call to undefined function wc_update_product_stock() in wp-content/plugins/ecomatcher-for-woocommerce/inc/Base/EcoMatcher-Activate.php:78
    Stack trace:
    #0 wp-content/plugins/ecomatcher-for-woocommerce/ecomatcher.php(45): EcoMatcher_Activate->activate()
    #1 wp-includes/class-wp-hook.php(310): activate_ecomatcher_plugin()
    #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.01MB] [CPU: ▼9.79ms] Passed 4 tests

Analyzing server-side resources used by EcoMatcher
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.73 ▲1.04
Dashboard /wp-admin3.31 ▼0.0449.67 ▼15.81
Posts /wp-admin/edit.php3.36 ▲0.0047.16 ▼4.18
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.23 ▼20.20
Media Library /wp-admin/upload.php3.23 ▲0.0036.61 ▲2.61

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for EcoMatcher
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲9413.18 ▼1.196.05 ▲4.1244.31 ▲0.75
Dashboard /wp-admin2,218 ▲125.86 ▼0.03111.71 ▲5.5246.44 ▲5.11
Posts /wp-admin/edit.php2,100 ▼32.01 ▲0.0036.55 ▼1.1835.58 ▼1.18
Add New Post /wp-admin/post-new.php1,545 ▼021.00 ▼2.39628.39 ▼82.0545.86 ▼21.06
Media Library /wp-admin/upload.php1,403 ▲64.34 ▲0.18104.53 ▼2.0545.42 ▼1.22

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 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 0% 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 fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/ecomatcher-for-woocommerce/uninstall.php
    • > /wp-content/plugins/ecomatcher-for-woocommerce/ecomatcher.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ecomatcher-for-woocommerce/inc/EcoMatcher-Init.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/ecomatcher-for-woocommerce/templates/admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ecomatcher-for-woocommerce/inc/Pages/EcoMatcher-Admin.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
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
5 plugin tags: sustainability, ecomatcher, tree, forest, ecommerce

ecomatcher-for-woocommerce/ecomatcher.php 85% from 13 tests

The main file in "EcoMatcher" v. 1.3.11 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ecomatcher-for-woocommerce.php" instead of "ecomatcher.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 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin972 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP1346030863
JavaScript27158
CSS27051

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity4.22
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity1.57
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes111.11%
Methods49
▷ Static methods48.16%
▷ Public methods4795.92%
▷ Protected methods00.00%
▷ Private methods24.08%
Functions14
▷ Named functions1285.71%
▷ Anonymous functions214.29%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
image/EcoMatcher-button-v2.png2.55KB0.99KB▼ 61.19%
image/EcoMatcher-button.png22.21KB1.53KB▼ 93.12%