62% core-vitals-monitor

Code Review | Core Vitals Monitor

WordPress plugin Core Vitals Monitor scored62%from 54 tests.

About plugin

  • Plugin page: core-vitals-monitor
  • Plugin version: 1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Oct 24, 2022
  • Latest release: Jan 27, 2023
  • Number of updates: 5
  • Update frequency: every 19.6 days
  • Top authors: speedplussecurity (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /434 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.95MB] [CPU: ▼39.85ms] Passed 4 tests

This is a short check of server-side resources used by Core Vitals Monitor
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.34 ▼4.79
Dashboard /wp-admin3.00 ▼0.3427.43 ▼38.90
Posts /wp-admin/edit.php3.01 ▼0.3528.23 ▼20.70
Add New Post /wp-admin/post-new.php3.01 ▼2.8823.86 ▼86.78
Media Library /wp-admin/upload.php3.01 ▼0.2224.72 ▼13.01
Key Metrics /wp-admin/tools.php?page=key_metrics3.0126.75

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Core Vitals Monitor
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7313.21 ▼0.794.92 ▲3.1143.21 ▼1.84
Dashboard /wp-admin2,225 ▲254.87 ▼1.10113.97 ▲14.2741.86 ▼1.73
Posts /wp-admin/edit.php2,104 ▲41.99 ▼0.1841.16 ▲0.3637.85 ▼0.57
Add New Post /wp-admin/post-new.php1,547 ▲2122.09 ▲4.58691.81 ▲73.8898.04 ▲50.33
Media Library /wp-admin/upload.php1,404 ▲74.25 ▼0.0496.30 ▼11.9144.49 ▼2.98
Key Metrics /wp-admin/tools.php?page=key_metrics2,1952.1639.6443.31

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • 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
These server-side errors were triggered
    • > GET request to /wp-admin/tools.php?page=key_metrics
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
    • > GET request to /wp-admin/tools.php?page=key_metrics
    • > Notice in wp-content/plugins/core-vitals-monitor/includes/class-key-metrics.php+150
    Undefined index: message
    • > GET request to /wp-admin/tools.php?page=key_metrics
    • > Notice in wp-content/plugins/core-vitals-monitor/includes/class-key-metrics.php+151
    Undefined index: type
    • > GET request to /wp-admin/tools.php?page=key_metrics
    • > Notice in wp-content/plugins/core-vitals-monitor/includes/display.php+76
    Undefined variable: path

SRP 0% 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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/core-vitals-monitor/includes/header.php
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/core-vitals-monitor/includes/display.php:75
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/core-vitals-monitor/includes/config.php:110
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/core-vitals-monitor/includes/config.php on line 85
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/core-vitals-monitor/includes/config.php on line 31
    • > PHP Notice
      Undefined variable: sites in wp-content/plugins/core-vitals-monitor/includes/display.php on line 34
    • > PHP Notice
      Undefined variable: sites in wp-content/plugins/core-vitals-monitor/includes/config.php on line 31
    • > PHP Notice
      Undefined variable: sel_dsk in wp-content/plugins/core-vitals-monitor/includes/config.php on line 107
    • > PHP Warning
      array_pop() expects parameter 1 to be array, null given in wp-content/plugins/core-vitals-monitor/includes/display.php on line 33
    • > PHP Notice
      Undefined variable: sec_grade in wp-content/plugins/core-vitals-monitor/includes/config.php on line 85
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/core-vitals-monitor/key-metrics.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: wp, speed, security, performance, php...

core-vitals-monitor/key-metrics.php 77% from 13 tests

The main PHP file in "Core Vitals Monitor" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("core-vitals-monitor.php" instead of "key-metrics.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 plugin1,147 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP718145735
CSS1593248
JavaScript12911154
JSON21010

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity42.00
▷ Minimum class complexity42.00
▷ Maximum class complexity42.00
Average method complexity3.29
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
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