93% wcc-google-analytics

Code Review | WCC Google Analytics

WordPress plugin WCC Google Analytics scored 93% from 54 tests.

About plugin

  • Plugin page: wcc-google-analytics
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-5.7
  • WordPress version: 5.9.2
  • First release: Jun 11, 2021
  • Latest release: Jun 11, 2021
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: weconnectcode (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 111 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼297.01ms] 75% from 4 tests

This is a short check of server-side resources used by WCC Google Analytics
It is recommended to improve the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 634.15ms on /wp-admin/admin.php?page=wcc-google-analytics-setting)
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0554.47 ▲4.61
Dashboard /wp-admin3.46 ▲0.0633.50 ▼2.24
Posts /wp-admin/edit.php3.69 ▲0.0536.80 ▼1.56
Add New Post /wp-admin/post-new.php6.93 ▼0.0492.09 ▼1,183.41
Media Library /wp-admin/upload.php3.34 ▲0.0524.36 ▼0.83
WCC Google Analytics /wp-admin/admin.php?page=wcc-google-analytics3.33601.32
Setting /wp-admin/admin.php?page=wcc-google-analytics-setting3.33634.15

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 51 new files
Database: no new tables, 1 new option
New WordPress options
google_analytics_db_version

Browser metrics Passed 4 tests

WCC Google Analytics: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,817 ▲7515.98 ▲0.445.78 ▼0.382.15 ▼0.33
Dashboard /wp-admin2,926 ▲656.12 ▼0.01116.54 ▼14.43156.89 ▼6.35
Posts /wp-admin/edit.php2,719 ▲253.23 ▼0.0169.14 ▲4.87149.58 ▲2.24
Add New Post /wp-admin/post-new.php1,690 ▲2919.49 ▲3.41405.23 ▼21.78157.05 ▼0.31
Media Library /wp-admin/upload.php1,732 ▲375.46 ▼0.04142.46 ▼3.32187.59 ▼2.72
WCC Google Analytics /wp-admin/admin.php?page=wcc-google-analytics1,0922.7556.52153.09
Setting /wp-admin/admin.php?page=wcc-google-analytics-setting1,1272.7660.39152.89

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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 take a closer look at the following
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wcc-google-analytics/includes/dashboard.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wcc-google-analytics/includes/analytics.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wcc-google-analytics/includes/getApiKey.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wcc-google-analytics/includes/api_key_success.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wcc-google-analytics/includes/setting.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wcc-google-analytics/wcc_google_analytics.php:10

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
1 plugin tags: wcc google analytics

wcc-google-analytics/wcc_google_analytics.php 92% from 13 tests

The main PHP file in "WCC Google Analytics" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wcc-google-analytics.php" instead of "wcc_google_analytics.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected4,320 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript23091411,210
SVG333121,108
PHP683461,079
CSS27319923

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.52
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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.25MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/logo.png73.47KB24.51KB▼ 66.64%
(invalid) img/placeholder-2.png37.42KB0.00KB▼ 100.00%
img/placeholder-1.png131.37KB131.60KB0.00%
img/star.png0.50KB0.41KB▼ 17.58%
img/placeholder-3.png3.68KB1.60KB▼ 56.48%