83% metorik-helper

Code Review | Metorik - Reports & Email Automation for WooCommerce

WordPress plugin Metorik - Reports & Email Automation for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: metorik-helper
  • Plugin version: 1.7.1
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.3.0
  • WordPress version: 6.3.1
  • First release: Oct 10, 2016
  • Latest release: Oct 1, 2023
  • Number of updates: 103
  • Update frequency: every 24.7 days
  • Top authors: bryceadams (55.34%)metorik (45.63%)

Code review

54 tests

User reviews

19 reviews

Install metrics

10,000+ active /116,337 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.12ms] Passed 4 tests

Server-side resources used by Metorik - Reports & Email Automation for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.45 ▼4.41
Dashboard /wp-admin3.31 ▲0.0146.90 ▼9.73
Posts /wp-admin/edit.php3.36 ▲0.0151.34 ▼0.86
Add New Post /wp-admin/post-new.php5.89 ▲0.01105.92 ▼9.19
Media Library /wp-admin/upload.php3.23 ▲0.0137.77 ▼1.13

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Metorik - Reports & Email Automation for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲6013.62 ▼0.692.10 ▲0.1045.35 ▲3.26
Dashboard /wp-admin2,227 ▲275.85 ▼0.03110.91 ▼4.0644.75 ▲2.48
Posts /wp-admin/edit.php2,106 ▲62.06 ▲0.0140.57 ▲0.7341.75 ▲3.68
Add New Post /wp-admin/post-new.php1,551 ▼323.21 ▲5.07656.88 ▼4.9754.96 ▲1.58
Media Library /wp-admin/upload.php1,406 ▲34.17 ▼0.08110.70 ▼10.7548.53 ▼0.47

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • metorik_show_activation_notice
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means 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
Almost there! Just fix the following items
  • 13× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WC_REST_Posts_Controller' not found in wp-content/plugins/metorik-helper/inc/api/coupons.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WC_REST_Posts_Controller' not found in wp-content/plugins/metorik-helper/inc/api/refunds.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/metorik-helper/inc/ui.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WC_REST_Posts_Controller' not found in wp-content/plugins/metorik-helper/inc/api/customers.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/metorik-helper/metorik-helper.php:122
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/metorik-helper/inc/import.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/metorik-helper/inc/api.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WC_REST_Posts_Controller' not found in wp-content/plugins/metorik-helper/inc/api/products.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/metorik-helper/inc/custom.php:44
    • > PHP Fatal error
      Uncaught Error: Class 'WC_REST_Posts_Controller' not found in wp-content/plugins/metorik-helper/inc/api/metorik.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: You are using too many tags: 19 tag instead of maximum 10
The official readme.txt is a good inspiration

metorik-helper/metorik-helper.php 85% from 13 tests

The entry point to "Metorik - Reports & Email Automation for WooCommerce" version 1.7.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.4.0" instead of "4.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected3,386 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP154921,0182,168
JavaScript5157931,156
CSS19241
Markdown19014
JSON1007

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity20.46
▷ Minimum class complexity1.00
▷ Maximum class complexity128.00
Average method complexity3.07
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods122
▷ Static methods32.46%
▷ Public methods11997.54%
▷ Protected methods10.82%
▷ Private methods21.64%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/metorik.png4.51KB2.60KB▼ 42.40%