78% wp-yandex-metrika

Code Review | Yandex.Metrica

WordPress plugin Yandex.Metrica scored78%from 54 tests.

About plugin

  • Plugin page: wp-yandex-metrika
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.9-6.2.2
  • WordPress version: 6.3.1
  • First release: Oct 11, 2021
  • Latest release: Sep 18, 2023
  • Number of updates: 36
  • Update frequency: every 20.5 days
  • Top authors: yandexmetrika (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

30,000+ active /111,333 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 gracefully, with no errors

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

A check of server-side resources used by Yandex.Metrica
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0442.71 ▲1.14
Dashboard /wp-admin3.37 ▲0.0248.83 ▼14.68
Posts /wp-admin/edit.php3.42 ▲0.0646.41 ▲2.45
Add New Post /wp-admin/post-new.php5.97 ▲0.0890.78 ▼21.34
Media Library /wp-admin/upload.php3.29 ▲0.0635.85 ▲0.75
Yandex.Metrica /wp-admin/options-general.php?page=yam_settings3.2931.07

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 111 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_recent-comments
yam_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options
yam_messages

Browser metrics Passed 4 tests

Checking browser requirements for Yandex.Metrica
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6314.67 ▲0.401.60 ▼0.0842.78 ▼0.99
Dashboard /wp-admin2,226 ▲494.91 ▼0.8695.42 ▲11.8240.90 ▲5.99
Posts /wp-admin/edit.php2,138 ▲382.34 ▲0.3540.45 ▲1.2135.11 ▼5.25
Add New Post /wp-admin/post-new.php1,564 ▲2618.43 ▼0.02598.46 ▼30.0348.36 ▼17.62
Media Library /wp-admin/upload.php1,437 ▲404.44 ▲0.2996.44 ▼2.2943.40 ▲2.59
Yandex.Metrica /wp-admin/options-general.php?page=yam_settings1,6152.2940.1250.25

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=yam_settings
    • > Notice in wp-content/plugins/wp-yandex-metrika/includes/class.ya-metrika-backend.php+478
    Undefined index: flex-wrap
    • > GET request to /wp-admin/options-general.php?page=yam_settings
    • > Notice in wp-content/plugins/wp-yandex-metrika/includes/class.ya-metrika-backend.php+503
    Undefined index: brand

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 items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-yandex-metrika/view/index.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tags: There are too many tags (14 tag instead of maximum 10)
The official readme.txt might help

wp-yandex-metrika/wp-yandex-metrika.php 92% from 13 tests

The principal PHP file in "Yandex.Metrica" v. 1.2.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 258 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin3,770 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
PHP21407711,898
JavaScript3219639779
CSS414026717
PO File18496231
SVG1100121
Markdown113022
JSON1102

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity13.83
▷ Minimum class complexity2.00
▷ Maximum class complexity85.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes18
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes00.00%
Methods132
▷ Static methods2921.97%
▷ Public methods11284.85%
▷ Protected methods00.00%
▷ Private methods2015.15%
Functions6
▷ Named functions00.00%
▷ Anonymous functions6100.00%
Constants14
▷ Global constants750.00%
▷ Class constants750.00%
▷ Public constants7100.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/logo.png17.56KB8.69KB▼ 50.53%