84% metricool

Code Review | Metricool

WordPress plugin Metricool scored84%from 54 tests.

About plugin

  • Plugin page: metricool
  • Plugin version: 1.19
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.3
  • WordPress version: 6.3.1
  • First release: Apr 20, 2015
  • Latest release: Jul 22, 2023
  • Number of updates: 36
  • Update frequency: every 83.9 days
  • Top authors: juan.pablo.tejela (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

50,000+ active /307,253 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
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Metricool
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.42 ▼2.04
Dashboard /wp-admin3.32 ▲0.0246.05 ▼1.55
Posts /wp-admin/edit.php3.37 ▲0.0149.03 ▼1.41
Add New Post /wp-admin/post-new.php5.90 ▲0.0198.49 ▼2.16
Media Library /wp-admin/upload.php3.24 ▲0.0136.08 ▲2.36
Metricool /wp-admin/options-general.php?page=metricool3.2431.88

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Metricool
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.17 ▼1.111.97 ▲0.0637.37 ▼6.04
Dashboard /wp-admin2,210 ▲224.88 ▼0.98105.24 ▼15.9642.41 ▼1.66
Posts /wp-admin/edit.php2,093 ▲12.06 ▲0.0438.87 ▼5.5435.31 ▼0.83
Add New Post /wp-admin/post-new.php1,541 ▲2718.07 ▲0.60613.44 ▼63.4452.27 ▼0.13
Media Library /wp-admin/upload.php1,386 ▼24.22 ▲0.02131.69 ▲26.6650.70 ▲5.86
Metricool /wp-admin/options-general.php?page=metricool8312.0225.6427.26

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/metricool/metricool.php on line 39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/metricool/metricool.php:39
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/metricool/metricool.php on line 38
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/metricool/views/settings.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Contributors: The plugin contributors field is not present
Please take inspiration from this readme.txt

metricool/metricool.php Passed 13 tests

"Metricool" version 1.19's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
62 characters long description:
Allows you to track your users and readers using metricool.com

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin152 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP23360152

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin