90% page-metrics

Code Review | Page Metrics

WordPress plugin Page Metrics scored90%from 54 tests.

About plugin

  • Plugin page: page-metrics
  • Plugin version: 1.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 6.3.1
  • First release: Jun 8, 2016
  • Latest release: Mar 2, 2017
  • Number of updates: 52
  • Update frequency: every 6.3 days
  • Top authors: webstartup (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,124 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

An overview of server-side resources used by Page Metrics
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.57 ▼3.77
Dashboard /wp-admin3.34 ▲0.0444.59 ▼3.86
Posts /wp-admin/edit.php3.39 ▲0.0446.50 ▲1.45
Add New Post /wp-admin/post-new.php5.92 ▲0.0481.14 ▼11.77
Media Library /wp-admin/upload.php3.26 ▲0.0433.30 ▲1.20

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 17 new options
New WordPress options
widget_recent-posts
slwsu_page_metrics_activation
can_compress_scripts
slwsu_page_metrics_firstPaint
theysaidso_admin_options
slwsu_page_metrics_domInteractive
widget_theysaidso_widget
slwsu_page_metrics_fps
db_upgraded
slwsu_page_metrics_warnThreshold
...

Browser metrics Passed 4 tests

Page Metrics: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲7213.55 ▼0.801.68 ▼0.1238.83 ▼4.75
Dashboard /wp-admin2,224 ▲365.88 ▲0.00102.75 ▼10.1537.90 ▼8.80
Posts /wp-admin/edit.php2,110 ▲241.99 ▲0.0037.54 ▲2.9332.84 ▼5.70
Add New Post /wp-admin/post-new.php1,529 ▲617.65 ▼5.60654.84 ▼12.5054.99 ▲0.40
Media Library /wp-admin/upload.php1,406 ▲184.22 ▲0.0196.40 ▼12.4542.21 ▼3.83

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
No output text or server-side errors detected on direct access of PHP files

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, but this is not an exhaustive test

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
7 plugin tags: justice js, analysis page web, metrics js, performance metrics, analysis metrics...

page-metrics/page-metrics.php 92% from 13 tests

"Page Metrics" version 1.5.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Everything looks great! No dangerous files found in this plugin988 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP8113187600
JavaScript2290238
PO File15152150

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity5.29
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity1.62
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods48
▷ Static methods1225.00%
▷ Public methods4593.75%
▷ Protected methods00.00%
▷ Private methods36.25%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.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
There are no PNG files in this plugin