84% web-vitals

Code Review | Web Vitals

WordPress plugin Web Vitals scored84%from 54 tests.

About plugin

  • Plugin page: web-vitals
  • Plugin version: 0.1.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.4
  • WordPress version: 6.3.1
  • First release: May 29, 2020
  • Latest release: Jun 19, 2020
  • Number of updates: 5
  • Update frequency: every 4.4 days
  • Top authors: saltagency (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /893 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.04MB] [CPU: ▼4.68ms] Passed 4 tests

This is a short check of server-side resources used by Web Vitals
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.09 ▼2.52
Dashboard /wp-admin3.35 ▲0.0546.01 ▼4.65
Posts /wp-admin/edit.php3.46 ▲0.1147.30 ▲2.12
Add New Post /wp-admin/post-new.php5.93 ▲0.0479.82 ▼9.34
Media Library /wp-admin/upload.php3.27 ▲0.0432.18 ▼2.21
Web Vitals /wp-admin/options-general.php?page=sa-webvitals3.2428.53

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Web Vitals
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.31 ▼1.082.62 ▲0.6841.16 ▼1.09
Dashboard /wp-admin2,213 ▲225.85 ▼0.03106.74 ▲5.6138.60 ▼3.59
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0039.79 ▲4.3135.33 ▲1.83
Add New Post /wp-admin/post-new.php1,538 ▲2423.10 ▲5.52691.58 ▲56.7755.14 ▼3.28
Media Library /wp-admin/upload.php1,386 ▼24.24 ▲0.0497.68 ▲1.7640.95 ▼1.84
Web Vitals /wp-admin/options-general.php?page=sa-webvitals8402.0624.4224.86

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, 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
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/web-vitals/includes/class-sa-webvitals.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: performance, analytics, ga, webvitals, tagmanager...

web-vitals/web-vitals.php 92% from 13 tests

"Web Vitals" version 0.1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin329 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP33522265
JavaScript122164

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.33
Average class complexity13.00
▷ Minimum class complexity10.00
▷ Maximum class complexity16.00
Average method complexity2.13
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods16100.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.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