78% analytics-cat

Code Review | Analytics Cat - Google Analytics Made Easy

WordPress plugin Analytics Cat - Google Analytics Made Easy scored78%from 54 tests.

About plugin

  • Plugin page: analytics-cat
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Dec 16, 2016
  • Latest release: May 16, 2023
  • Number of updates: 36
  • Update frequency: every 64.9 days
  • Top authors: davidhme (41.67%)flippy101 (33.33%)RyanNovotny (30.56%)

Code review

54 tests

User reviews

14 reviews

Install metrics

10,000+ active /197,363 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
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼9.20ms] Passed 4 tests

This is a short check of server-side resources used by Analytics Cat - Google Analytics Made Easy
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.17 ▲0.81
Dashboard /wp-admin3.32 ▼0.0350.42 ▼15.40
Posts /wp-admin/edit.php3.37 ▲0.0145.35 ▼5.59
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.68 ▼15.29
Media Library /wp-admin/upload.php3.24 ▲0.0137.32 ▼0.50
Google Analytics Manager /wp-admin/options-general.php?page=fca_ga_settings_page3.2131.70

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
fca_ga_show_ga4_notice
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Analytics Cat - Google Analytics Made Easy
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲9114.26 ▼0.101.84 ▲0.1039.78 ▼1.53
Dashboard /wp-admin2,248 ▲685.68 ▲0.0783.14 ▼4.9273.63 ▲32.73
Posts /wp-admin/edit.php2,150 ▲502.18 ▲0.1735.65 ▼4.4234.62 ▲2.40
Add New Post /wp-admin/post-new.php1,595 ▲5718.17 ▼4.99670.00 ▼0.6355.20 ▲1.68
Media Library /wp-admin/upload.php1,450 ▲504.20 ▲0.03109.95 ▲0.1466.32 ▲19.19
Google Analytics Manager /wp-admin/options-general.php?page=fca_ga_settings_page9642.1837.3128.88

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • fca_ga_show_ga4_notice
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/analytics-cat/languages/index.php
    • > /wp-content/plugins/analytics-cat/fca-ga.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/analytics-cat/includes/editor/editor.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/analytics-cat/includes/api.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/analytics-cat/includes/notices/notices.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (Analytics Cat - Google Analytics for WordPress settings screen)
You can take inspiration from this readme.txt

analytics-cat/fca-ga.php 85% from 13 tests

The main PHP script in "Analytics Cat - Google Analytics Made Easy" version 1.1.2 is automatically included on every request by WordPress
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("analytics-cat.php" instead of "fca-ga.php")

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
Good job! No executable or dangerous file extensions detected482 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP613133345
CSS67189
JavaScript68246
Markdown1002

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
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%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
5 PNG files occupy 0.15MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/googlecat_icon128_128_360.png24.66KB6.88KB▼ 72.09%
assets/icon.png0.73KB0.60KB▼ 17.38%
assets/googlecat_icon256_256_360.png73.46KB18.88KB▼ 74.30%
screenshot-1.png40.18KB40.33KB0.00%
assets/fatcatapps-logo-text.png16.24KB4.88KB▼ 69.97%