72% shop-metrics-report

Code Review | Shop Metrics Report for WP

WordPress plugin Shop Metrics Report for WP scored72%from 54 tests.

About plugin

  • Plugin page: shop-metrics-report
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.0
  • WordPress version: 6.3.1
  • First release: Nov 6, 2014
  • Latest release: Nov 6, 2014
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: martinvw (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /872 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.62ms] Passed 4 tests

A check of server-side resources used by Shop Metrics Report for WP
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0234.78 ▼2.09
Dashboard /wp-admin3.36 ▲0.0152.34 ▼5.49
Posts /wp-admin/edit.php3.47 ▲0.1148.16 ▲3.51
Add New Post /wp-admin/post-new.php5.94 ▲0.0584.18 ▼12.97
Media Library /wp-admin/upload.php3.28 ▲0.0537.24 ▲2.06
Test API connection /wp-admin/admin.php?page=smr_for_wp_test3.23419.33
Settings /wp-admin/admin.php?page=smr_for_wp_settings3.2532.86

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
shopmetrics_for_woocommerce
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Shop Metrics Report for WP
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲7214.34 ▼0.241.58 ▲0.0636.95 ▼3.72
Dashboard /wp-admin2,218 ▲465.50 ▼0.1082.82 ▼17.7938.63 ▼7.56
Posts /wp-admin/edit.php2,132 ▲322.03 ▲0.0538.98 ▲0.3635.18 ▼2.71
Add New Post /wp-admin/post-new.php1,551 ▲2523.79 ▲0.26663.97 ▼7.1252.97 ▼3.78
Media Library /wp-admin/upload.php1,432 ▲384.16 ▼0.0897.83 ▲0.0642.72 ▼1.55
Test API connection /wp-admin/admin.php?page=smr_for_wp_test8322.0322.7026.53
Settings /wp-admin/admin.php?page=smr_for_wp_settings8791.6822.9629.00

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
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • can_compress_scripts
    • shopmetrics_for_woocommerce
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=smr_for_wp_settings
    • > Notice in wp-content/plugins/shop-metrics-report/templates/settings.php+33
    Trying to access array offset on value of type bool

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
Almost there! Just fix the following items
  • 7× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/shop-metrics-report/templates/test.php
    • > /wp-content/plugins/shop-metrics-report/images/index.php
    • > /wp-content/plugins/shop-metrics-report/translations/index.php
    • > /wp-content/plugins/shop-metrics-report/lib/index.php
    • > /wp-content/plugins/shop-metrics-report/templates/settings.php
    • > /wp-content/plugins/shop-metrics-report/lib/plugins/index.php
    • > /wp-content/plugins/shop-metrics-report/templates/index.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/shop-metrics-report/lib/plugins/class-edd.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/shop-metrics-report/lib/plugins/class-woocommerce.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/shop-metrics-report/shopmetrics-for-wp.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/shop-metrics-report/lib/class-admin.php:8

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: shop metrics, ecommerce dashboard, woocommerce, charts

shop-metrics-report/shopmetrics-for-wp.php 85% from 13 tests

The primary PHP file in "Shop Metrics Report for WP" version 1.0.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 232 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("shop-metrics-report.php" instead of "shopmetrics-for-wp.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
There were no executable files found in this plugin631 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP1010376475
PO File14548156

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods16
▷ Static methods16.25%
▷ Public methods1275.00%
▷ Protected methods00.00%
▷ Private methods425.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
images/favicon.png2.20KB1.15KB▼ 47.60%