83% nk-google-analytics

Code Review | NK Google Analytics

WordPress plugin NK Google Analytics scored83%from 54 tests.

About plugin

  • Plugin page: nk-google-analytics
  • Plugin version: 1.6.2
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 23, 2013
  • Latest release: Nov 27, 2020
  • Number of updates: 108
  • Update frequency: every 25.4 days
  • Top authors: marodok (98.15%)quantumdev (2.78%)

Code review

54 tests

User reviews

24 reviews

Install metrics

10,000+ active /465,621 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.08MB] [CPU: ▼1.18ms] Passed 4 tests

A check of server-side resources used by NK Google Analytics
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1039.53 ▼4.73
Dashboard /wp-admin3.39 ▲0.0848.01 ▼4.97
Posts /wp-admin/edit.php3.44 ▲0.0852.79 ▲3.85
Add New Post /wp-admin/post-new.php5.98 ▲0.0995.95 ▲1.18
Media Library /wp-admin/upload.php3.31 ▲0.0841.07 ▲3.82
NK Google Analytics /wp-admin/options-general.php?page=NKgoogleanalytics3.3437.57

Server storage [IO: ▲0.21MB] [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: 23 new files
Database: no new tables, 22 new options
New WordPress options
nkweb_Custom_js
widget_recent-comments
nkweb_Custom_Values
nkweb_id
nkweb_fingerprintjs
widget_theysaidso_widget
widget_recent-posts
nkweb_analytics_type
nkweb_Use_Custom
nkweb_track_login_and_register
...

Browser metrics Passed 4 tests

NK Google Analytics: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6314.75 ▲0.401.85 ▲0.0941.75 ▼2.69
Dashboard /wp-admin2,197 ▲205.59 ▲0.0682.97 ▼16.5036.04 ▼9.16
Posts /wp-admin/edit.php2,108 ▲82.04 ▲0.0941.31 ▲4.8138.06 ▲3.23
Add New Post /wp-admin/post-new.php6,367 ▲4,83926.08 ▲2.93893.12 ▲199.6056.01 ▲3.88
Media Library /wp-admin/upload.php1,405 ▲24.42 ▲0.17104.91 ▼0.1948.59 ▲3.74
NK Google Analytics /wp-admin/options-general.php?page=NKgoogleanalytics1,1741.6830.5326.69

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following items
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/nk-google-analytics/admin/options.php
    • > /wp-content/plugins/nk-google-analytics/admin/save_metabox.php
    • > /wp-content/plugins/nk-google-analytics/options.php
    • > /wp-content/plugins/nk-google-analytics/NKgoogleanalytics.php
    • > /wp-content/plugins/nk-google-analytics/admin/metabox.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
  • Requires at least: Version format is invalid
  • Donate link: Invalid URI found ("#")
You can take inspiration from this readme.txt

nk-google-analytics/NKgoogleanalytics.php 92% from 13 tests

The entry point to "NK Google Analytics" version 1.6.2 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("nk-google-analytics.php" instead of "NKgoogleanalytics.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin1,223 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP522959893
PO File36266207
CSS111087
JavaScript20035
HTML1011

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.13MB with 0.08MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png80.64KB24.64KB▼ 69.45%
screenshot-1.png16.42KB6.32KB▼ 61.49%
screenshot-2.png12.49KB5.35KB▼ 57.11%
screenshot-3.png24.18KB9.22KB▼ 61.85%