84% wp-google-analytics

Code Review | WP Google Analytics

WordPress plugin WP Google Analytics scored84%from 54 tests.

About plugin

  • Plugin page: wp-google-analytics
  • Plugin version: 1.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.0
  • WordPress version: 6.3.1
  • First release: Apr 17, 2008
  • Latest release: Jun 9, 2014
  • Number of updates: 27
  • Update frequency: every 86.6 days
  • Top authors: aaroncampbell (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

10,000+ active /267,976 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.09MB] [CPU: ▼5.83ms] Passed 4 tests

An overview of server-side resources used by WP Google Analytics
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1042.53 ▼3.72
Dashboard /wp-admin3.41 ▲0.0751.21 ▼13.54
Posts /wp-admin/edit.php3.53 ▲0.1749.91 ▼2.75
Add New Post /wp-admin/post-new.php5.99 ▲0.1187.81 ▼3.30
Media Library /wp-admin/upload.php3.34 ▲0.1137.03 ▲0.80
Google Analytics /wp-admin/options-general.php?page=wp-google-analytics3.3036.82

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by WP Google Analytics
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲8513.16 ▼1.222.09 ▲0.3744.89 ▲5.74
Dashboard /wp-admin2,225 ▲225.82 ▼0.0499.73 ▼9.6637.31 ▼4.12
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0034.28 ▼6.7537.29 ▲2.21
Add New Post /wp-admin/post-new.php1,534 ▼1123.23 ▲0.12662.92 ▼32.6869.24 ▲10.61
Media Library /wp-admin/upload.php1,404 ▲104.23 ▼0.1997.57 ▼35.6941.18 ▼13.10
Google Analytics /wp-admin/options-general.php?page=wp-google-analytics1,1112.0226.1330.09

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-google-analytics/wp-google-analytics.php:53

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
3 plugin tags: google analytics, analytics, google

wp-google-analytics/wp-google-analytics.php Passed 13 tests

The main PHP file in "WP Google Analytics" ver. 1.4.1 adds more information about the plugin and also serves as the entry point for this plugin
69 characters long description:
Lets you use Google Analytics to track your WordPress site statistics

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
No dangerous file extensions were detected421 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP167110405
JavaScript131016

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity84.00
▷ Minimum class complexity84.00
▷ Maximum class complexity84.00
Average method complexity5.15
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods20
▷ Static methods15.00%
▷ Public methods1680.00%
▷ Protected methods00.00%
▷ Private methods420.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin