83% analytics-head

Code Review | Analytics Head

WordPress plugin Analytics Head scored83%from 54 tests.

About plugin

  • Plugin page: analytics-head
  • Plugin version: 1.6.7
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 6.3.1
  • First release: Jun 18, 2011
  • Latest release: Jan 20, 2022
  • Number of updates: 68
  • Update frequency: every 56.9 days
  • Top authors: lukasznowicki (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /22,411 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
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼5.38ms] Passed 4 tests

Analyzing server-side resources used by Analytics Head
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0639.81 ▼2.73
Dashboard /wp-admin3.43 ▲0.1251.05 ▼0.49
Posts /wp-admin/edit.php3.54 ▲0.1844.90 ▼1.18
Add New Post /wp-admin/post-new.php6.01 ▲0.12101.65 ▼17.11
Media Library /wp-admin/upload.php3.35 ▲0.1233.97 ▲1.63
Google Analytics Head /wp-admin/options-general.php?page=phylax_plugin_analytics_head3.3230.58

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
phylax_plugin-analytics_head
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Analytics Head: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲6513.18 ▼1.461.69 ▼0.1744.64 ▼0.77
Dashboard /wp-admin2,217 ▲295.77 ▼0.1296.20 ▼21.0339.86 ▼8.97
Posts /wp-admin/edit.php2,081 ▼112.05 ▲0.0435.43 ▼0.2832.87 ▼0.51
Add New Post /wp-admin/post-new.php1,552 ▲2318.34 ▲0.03591.48 ▼64.1648.69 ▲1.69
Media Library /wp-admin/upload.php1,393 ▲84.23 ▼0.0898.06 ▼7.3342.74 ▼10.63
Google Analytics Head /wp-admin/options-general.php?page=phylax_plugin_analytics_head8622.3021.9527.33

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_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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 take a closer look at the following
  • 6× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/analytics-head/inc/admin.php
    • > /wp-content/plugins/analytics-head/inc/plugin.php
    • > /wp-content/plugins/analytics-head/inc/install.php
    • > /wp-content/plugins/analytics-head/inc/options.php
    • > /wp-content/plugins/analytics-head/analytics_head.php
    • > /wp-content/plugins/analytics-head/inc/remove.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

analytics-head/analytics_head.php 85% from 13 tests

The primary PHP file in "Analytics Head" version 1.6.7 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 299 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("analytics-head.php" instead of "analytics_head.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
Good job! No executable or dangerous file extensions detected547 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP680325450
PO File1305297

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity18.20
▷ Minimum class complexity1.00
▷ Maximum class complexity36.00
Average method complexity3.46
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods35
▷ Static methods12.86%
▷ Public methods2674.29%
▷ Protected methods00.00%
▷ Private methods925.71%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin