84% foxmetrics

Code Review | FoxMetrics

WordPress plugin FoxMetrics scored84%from 54 tests.

About plugin

  • Plugin page: foxmetrics
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.8
  • WordPress version: 6.3.1
  • First release: Oct 7, 2021
  • Latest release: Oct 21, 2021
  • Number of updates: 8
  • Update frequency: every 1.9 days
  • Top authors: foxmetricsteam (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /357 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
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼8.96ms] Passed 4 tests

An overview of server-side resources used by FoxMetrics
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1148.77 ▲10.53
Dashboard /wp-admin3.42 ▲0.0846.78 ▼35.05
Posts /wp-admin/edit.php3.53 ▲0.1849.74 ▼1.47
Add New Post /wp-admin/post-new.php6.02 ▲0.1398.98 ▼1.57
Media Library /wp-admin/upload.php3.34 ▲0.1238.88 ▲2.24

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

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

Browser metrics Passed 4 tests

Checking browser requirements for FoxMetrics
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,892 ▲12113.35 ▼1.018.41 ▲6.7439.81 ▲0.09
Dashboard /wp-admin2,218 ▲435.65 ▲0.0492.98 ▼7.0038.24 ▼2.44
Posts /wp-admin/edit.php2,120 ▲171.97 ▲0.0240.24 ▼2.7435.96 ▼2.34
Add New Post /wp-admin/post-new.php1,552 ▲2418.19 ▼4.75617.22 ▼74.9260.83 ▲11.29
Media Library /wp-admin/upload.php1,417 ▲204.18 ▼0.0294.84 ▼7.2440.18 ▼6.78

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • 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
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/foxmetrics/public/partials/foxmetrics-analytics-public-display.php
    • > /wp-content/plugins/foxmetrics/admin/partials/foxmetrics-analytics-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

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
6 plugin tags: statistics, analytics, stats, ecommerce, tracking...

foxmetrics/foxmetrics-analytics.php 85% from 13 tests

"FoxMetrics" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 213 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("foxmetrics.php" instead of "foxmetrics-analytics.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected753 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP13207717643
JavaScript32874110
CSS2080

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity13.50
▷ Minimum class complexity1.00
▷ Maximum class complexity56.00
Average method complexity3.08
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods48
▷ Static methods24.17%
▷ Public methods4287.50%
▷ Protected methods00.00%
▷ Private methods612.50%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.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
There were not PNG files found in your plugin