84% onehalf-google-analytics

Code Review | OneHalf Google Analytics

WordPress plugin OneHalf Google Analytics scored84%from 54 tests.

About plugin

  • Plugin page: onehalf-google-an...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4.1
  • WordPress version: 6.3.1
  • First release: Aug 11, 2015
  • Latest release: Jan 10, 2016
  • Number of updates: 5
  • Update frequency: every 31.0 days
  • Top authors: itivanov (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /603 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼9.35ms] Passed 4 tests

Analyzing server-side resources used by OneHalf Google Analytics
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0135.59 ▼13.98
Dashboard /wp-admin3.33 ▼0.0243.04 ▼17.36
Posts /wp-admin/edit.php3.38 ▲0.0249.10 ▲1.56
Add New Post /wp-admin/post-new.php5.91 ▲0.0288.12 ▼7.61
Media Library /wp-admin/upload.php3.25 ▲0.0235.02 ▲1.83

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
can_compress_scripts
OHGoogleAnalytics_Enabled
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
OHGoogleAnalytics_Version

Browser metrics Passed 4 tests

A check of browser resources used by OneHalf Google Analytics
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲6914.23 ▼0.121.95 ▼0.1941.97 ▼5.66
Dashboard /wp-admin2,211 ▲315.57 ▼0.0883.38 ▼11.2038.93 ▼0.86
Posts /wp-admin/edit.php2,113 ▲132.03 ▲0.0734.52 ▼5.1434.42 ▲3.47
Add New Post /wp-admin/post-new.php1,539 ▲1323.08 ▼0.45595.32 ▼6.1163.65 ▲6.13
Media Library /wp-admin/upload.php1,416 ▲194.17 ▼0.0395.33 ▼8.5542.19 ▼4.51

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

Smoke tests 75% from 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/onehalf-google-analytics/admin-main.php
    • > /wp-content/plugins/onehalf-google-analytics/wpgoogleanalytics.php
    • > /wp-content/plugins/onehalf-google-analytics/class.admin.php

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 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: tracking, google analytics, google, analytics

onehalf-google-analytics/wpgoogleanalytics.php 92% from 13 tests

The main PHP script in "OneHalf Google Analytics" version 1.3 is automatically included on every request by WordPress
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 ("onehalf-google-analytics.php" instead of "wpgoogleanalytics.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin134 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP33253134

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity4.50
▷ Minimum class complexity3.00
▷ Maximum class complexity6.00
Average method complexity1.64
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods1090.91%
▷ Public methods872.73%
▷ Protected methods00.00%
▷ Private methods327.27%
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

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin