78% wt-yandex-metrika

Code Review | WT Yandex Metrika

WordPress plugin WT Yandex Metrika scored 78% from 54 tests.

About plugin

  • Plugin page: wt-yandex-metrika
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.4
  • WordPress version: 6.3.1
  • First release: Feb 16, 2016
  • Latest release: May 25, 2020
  • Number of updates: 16
  • Update frequency: every 97.5 days
  • Top authors: kustyrt (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

9,000+ active / 40,997 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▲0.94ms] Passed 4 tests

A check of server-side resources used by WT Yandex Metrika
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0451.00 ▲3.80
Dashboard /wp-admin3.36 ▲0.0647.19 ▼6.21
Posts /wp-admin/edit.php3.47 ▲0.1251.35 ▲2.31
Add New Post /wp-admin/post-new.php5.94 ▲0.0598.63 ▲4.66
Media Library /wp-admin/upload.php3.28 ▲0.0540.01 ▲3.85
WT Яндекс Метрика /wp-admin/options-general.php?page=wt_yandex_metrika/setting.php3.2228.93

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

WT Yandex Metrika: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.19 ▼1.164.78 ▲2.1741.87 ▼1.42
Dashboard /wp-admin2,210 ▲255.89 ▲0.04115.23 ▲14.5741.59 ▼0.85
Posts /wp-admin/edit.php2,096 ▲42.06 ▲0.0438.22 ▼2.3236.22 ▼1.40
Add New Post /wp-admin/post-new.php1,536 ▲2223.19 ▲5.64670.54 ▲42.4661.30 ▲2.91
Media Library /wp-admin/upload.php1,395 ▲44.32 ▲0.11107.70 ▲7.0447.62 ▲4.77
WT Яндекс Метрика /wp-admin/options-general.php?page=wt_yandex_metrika/setting.php8442.0223.2830.02

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wt_yandex_metrika/setting.php
    • > Notice in wp-content/plugins/wt-yandex-metrika/admin_panel.php+162
    Trying to access array offset on value of type bool

SRP 50% 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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wt-yandex-metrika/wt_yandex_metrika.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
1 plugin tags: yandexmetrika

wt-yandex-metrika/wt_yandex_metrika.php 92% from 13 tests

The principal PHP file in "WT Yandex Metrika" v. 1.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wt-yandex-metrika.php" instead of "wt_yandex_metrika.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 plugin193 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP24336193

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity20.00
▷ Minimum class complexity14.00
▷ Maximum class complexity26.00
Average method complexity3.71
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods214.29%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
There are no PNG files in this plugin