84% relative-metrics

Code Review | Relative Metrics

WordPress plugin Relative Metrics scored 84% from 54 tests.

About plugin

  • Plugin page: relative-metrics
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-3.5
  • WordPress version: 6.3.1
  • First release: Feb 1, 2013
  • Latest release: May 27, 2013
  • Number of updates: 23
  • Update frequency: every 5.0 days
  • Top authors: eddpeterson (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 830 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

Server-side resources used by Relative Metrics
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0144.37 ▲2.38
Dashboard /wp-admin3.31 ▲0.0145.73 ▼4.12
Posts /wp-admin/edit.php3.36 ▲0.0147.38 ▼0.11
Add New Post /wp-admin/post-new.php5.89 ▲0.0183.66 ▼10.37
Media Library /wp-admin/upload.php3.23 ▲0.0135.26 ▲1.78
Relative Metrics /wp-admin/options-general.php?page=relativemetrics3.2329.66

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
relativemetrics_api_key
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Relative Metrics: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲7313.32 ▼0.862.21 ▼0.1141.07 ▼5.62
Dashboard /wp-admin2,207 ▲225.79 ▲0.89108.05 ▲2.3639.53 ▼6.04
Posts /wp-admin/edit.php2,096 ▲72.03 ▲0.0440.14 ▲4.9735.06 ▼0.79
Add New Post /wp-admin/post-new.php1,545 ▲118.36 ▲0.31653.01 ▲16.4755.42 ▼8.08
Media Library /wp-admin/upload.php1,395 ▲74.23 ▲0.0296.75 ▼7.6541.38 ▼2.45
Relative Metrics /wp-admin/options-general.php?page=relativemetrics7852.0324.9125.87

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/relative-metrics/options.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/relative-metrics/relativemetrics.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% 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
5 plugin tags: analytics, statistics, metrics, relative metrics, relativemetrics

relative-metrics/relativemetrics.php 92% from 13 tests

The main PHP file in "Relative Metrics" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("relative-metrics.php" instead of "relativemetrics.php")

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
There were no executable files found in this plugin74 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP225874

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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