84% goolytics-simple-google-analytics

Code Review | Goolytics - Simple Google Analytics

WordPress plugin Goolytics - Simple Google Analytics scored84%from 54 tests.

About plugin

  • Plugin page: goolytics-simple-...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3.99
  • WordPress version: 6.3.1
  • First release: Feb 6, 2013
  • Latest release: Jul 25, 2023
  • Number of updates: 58
  • Update frequency: every 65.9 days
  • Top authors: Alphawolf (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

6,000+ active /38,189 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
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.58ms] Passed 4 tests

Server-side resources used by Goolytics - Simple Google Analytics
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.63 ▲1.34
Dashboard /wp-admin3.34 ▲0.0447.23 ▼5.28
Posts /wp-admin/edit.php3.40 ▲0.0346.57 ▼3.02
Add New Post /wp-admin/post-new.php5.93 ▲0.0387.63 ▼12.26
Media Library /wp-admin/upload.php3.27 ▲0.0335.26 ▼1.74
Goolytics /wp-admin/options-general.php?page=goolytics3.2535.08

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Goolytics - Simple Google Analytics: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6314.28 ▼0.091.91 ▲0.3141.81 ▼4.90
Dashboard /wp-admin2,208 ▲285.62 ▼0.0585.41 ▼2.1639.69 ▼3.70
Posts /wp-admin/edit.php2,110 ▲101.99 ▼0.0034.76 ▼2.5434.44 ▼1.53
Add New Post /wp-admin/post-new.php1,535 ▲723.56 ▲0.34678.84 ▼18.3276.36 ▲20.49
Media Library /wp-admin/upload.php1,410 ▲104.21 ▼0.0198.29 ▼16.8645.98 ▲0.77
Goolytics /wp-admin/options-general.php?page=goolytics9691.8225.6935.27

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not 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 fix the following
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined index: wp_version in wp-content/plugins/goolytics-simple-google-analytics/goolytics.php on line 44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/goolytics-simple-google-analytics/inc/options.php:5
    • > PHP Notice
      Undefined variable: pagenow in wp-content/plugins/goolytics-simple-google-analytics/inc/authorplugins.inc.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/goolytics-simple-google-analytics/goolytics.php:81

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
You can look at the official readme.txt

goolytics-simple-google-analytics/goolytics.php 92% from 13 tests

The principal PHP file in "Goolytics - Simple Google Analytics" v. 1.1.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("goolytics-simple-google-analytics.php" instead of "goolytics.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected516 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PO File25454228
PHP358137198
CSS113075
JavaScript10015

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity2.27
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.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
No PNG files were detected