90% yandex-metrica

Code Review | Yandex Metrica

WordPress plugin Yandex Metrica scored90%from 54 tests.

About plugin

  • Plugin page: yandex-metrica
  • Plugin version: 2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Jan 27, 2013
  • Latest release: Oct 18, 2023
  • Number of updates: 83
  • Update frequency: every 47.2 days
  • Top authors: m_uysl (100%)

Code review

54 tests

User reviews

31 reviews

Install metrics

20,000+ active /343,681 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▲4.07ms] Passed 4 tests

Server-side resources used by Yandex Metrica
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1751.19 ▲12.16
Dashboard /wp-admin3.46 ▲0.1553.14 ▲6.39
Posts /wp-admin/edit.php3.57 ▲0.2153.00 ▲8.19
Add New Post /wp-admin/post-new.php6.04 ▲0.1587.09 ▼10.48
Media Library /wp-admin/upload.php3.38 ▲0.1542.30 ▲12.89
Yandex Metrica /wp-admin/options-general.php?page=yandex-metrica3.4439.58

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
metrica_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Yandex Metrica
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.45 ▲0.101.58 ▲0.0941.67 ▲2.26
Dashboard /wp-admin2,199 ▲225.50 ▼0.1584.43 ▼2.1838.78 ▼2.45
Posts /wp-admin/edit.php2,107 ▲101.99 ▼0.0435.24 ▲0.2333.74 ▼2.73
Add New Post /wp-admin/post-new.php1,538 ▲117.96 ▼0.28618.14 ▼4.2060.95 ▼8.68
Media Library /wp-admin/upload.php1,401 ▲14.21 ▲0.0394.54 ▲0.1944.05 ▲2.04
Yandex Metrica /wp-admin/options-general.php?page=yandex-metrica8092.0022.5327.62

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
8 plugin tags: stats, tools, metrica, yandex, analytics...

yandex-metrica/yandex-metrica.php Passed 13 tests

The primary PHP file in "Yandex Metrica" version 2.0 is used by WordPress to initiate all plugin functionality
45 characters long description:
The best Yandex Metrica plugin for WordPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin1,658 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP143512321,237
PO File2162177419
JavaScript10112

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity17.83
▷ Minimum class complexity3.00
▷ Maximum class complexity31.00
Average method complexity2.98
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes116.67%
Methods51
▷ Static methods00.00%
▷ Public methods4486.27%
▷ Protected methods00.00%
▷ Private methods713.73%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.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
There were not PNG files found in your plugin