84% fast-google-analytics

Code Review | Fast Google Analytics

WordPress plugin Fast Google Analytics scored 84% from 54 tests.

About plugin

  • Plugin page: fast-google-analy...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5
  • WordPress version: 6.3.1
  • First release: Mar 5, 2019
  • Latest release: Oct 11, 2020
  • Number of updates: 10
  • Update frequency: every 58.6 days
  • Top authors: crucialinnovations (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 962 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.98ms] Passed 4 tests

An overview of server-side resources used by Fast Google Analytics
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0538.69 ▲0.01
Dashboard /wp-admin3.36 ▲0.0646.33 ▼14.31
Posts /wp-admin/edit.php3.48 ▲0.1248.83 ▼3.54
Add New Post /wp-admin/post-new.php5.94 ▲0.0695.84 ▼4.15
Media Library /wp-admin/upload.php3.29 ▲0.0631.97 ▼1.91
Google Analytics /wp-admin/options-general.php?page=fast-google-analytics-settings3.2629.46

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 10 new options
New WordPress options
cruinnv_fast_google_analytics_enable_disable
widget_recent-posts
widget_theysaidso_widget
cruinnv_fast_google_analytics_version
can_compress_scripts
theysaidso_admin_options
cruinnv_fast_google_analytics_tracker_id
widget_recent-comments
db_upgraded
cruinnv_fast_google_analytics_tracking_location

Browser metrics Passed 4 tests

Fast Google Analytics: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲7214.79 ▲0.421.67 ▼0.0443.33 ▲3.51
Dashboard /wp-admin2,216 ▲315.83 ▲0.7296.96 ▼20.1979.99 ▲34.58
Posts /wp-admin/edit.php2,093 ▲42.00 ▲0.0138.41 ▼2.3136.12 ▲4.89
Add New Post /wp-admin/post-new.php1,529 ▲1023.21 ▼0.37670.44 ▲13.4258.61 ▲6.21
Media Library /wp-admin/upload.php1,398 ▲104.22 ▼0.05114.27 ▲13.7847.33 ▲1.96
Google Analytics /wp-admin/options-general.php?page=fast-google-analytics-settings9781.8727.3333.46

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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 fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fast-google-analytics/include/settings.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fast-google-analytics/include/settings.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/fast-google-analytics/include/admin-help.php:2

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: stats, google analytics widget, google analytics, analytics, google analytics dashboard...

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

Analyzing the main PHP file in "Fast Google Analytics" version 1.0.1
119 characters long description:
Fast Google Analytics allows you to add the standard Google Analytics tracking code to your website's header or footer.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected679 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP5937397
CSS106228
JavaScript451954

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
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%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
6 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
include/images/cruinnv-fast-google-analytics-admin-pop-up.png0.73KB1.12KB0.00%
screenshot-3.png26.65KB12.82KB▼ 51.91%
screenshot-2.png30.81KB14.82KB▼ 51.90%
screenshot-1.png25.29KB13.21KB▼ 47.78%
include/images/cruinnv-fast-google-analytics.png0.34KB0.49KB0.00%