10% tracking-code-manager-google-analytics

Code Review | Wordpress Google Analytics Tracking Code Manager by Wpbdcoders

WordPress plugin Wordpress Google Analytics Tracking Code Manager by Wpbdcoders scored10%from 54 tests.

About plugin

  • Plugin page: tracking-code-man...
  • Plugin version: 0.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.4.2
  • WordPress version: 6.3.1
  • First release: Apr 6, 2017
  • Latest release: Jun 23, 2020
  • Number of updates: 5
  • Update frequency: every 234.8 days
  • Top authors: ruhul105 (100%)Otto42 (40%)

Code review

54 tests

User reviews

5 reviews

Install metrics

60+ active /935 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/tracking-code-manager-google-analytics/includes/class-google-analytics-tracking-code-manager.php+48
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.93MB] [CPU: ▼52.80ms] Passed 4 tests

A check of server-side resources used by Wordpress Google Analytics Tracking Code Manager by Wpbdcoders
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.405.26 ▼36.32
Dashboard /wp-admin2.08 ▼1.226.04 ▼46.64
Posts /wp-admin/edit.php2.08 ▼1.286.46 ▼39.80
Add New Post /wp-admin/post-new.php2.08 ▼3.817.04 ▼88.45
Media Library /wp-admin/upload.php2.08 ▼1.157.08 ▼29.87
Google Analytics Settings /wp-admin/options-general.php?page=gac-setting-admin2.087.33

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Wordpress Google Analytics Tracking Code Manager by Wpbdcoders
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6014.77 ▲0.421.74 ▼0.1446.30 ▲3.91
Dashboard /wp-admin2,212 ▲245.90 ▲1.00103.34 ▼2.3539.18 ▼7.79
Posts /wp-admin/edit.php2,095 ▲32.04 ▼0.0135.78 ▼1.4636.15 ▲1.33
Add New Post /wp-admin/post-new.php1,533 ▼023.18 ▼0.09582.10 ▼21.7857.07 ▼0.58
Media Library /wp-admin/upload.php1,394 ▲64.18 ▼0.1298.10 ▼11.8541.84 ▼2.38
Google Analytics Settings /wp-admin/options-general.php?page=gac-setting-admin7972.1126.3628.36

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/tracking-code-manager-google-analytics/includes/class-google-analytics-tracking-code-manager.php+48
    Trying to access array offset on value of type bool
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=gac-setting-admin
    • > Notice in wp-content/plugins/tracking-code-manager-google-analytics/includes/class-google-analytics-tracking-code-manager.php+48
    Trying to access array offset on value of type bool

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 items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/tracking-code-manager-google-analytics/admin/partials/google-analytics-tracking-code-manager.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
The official readme.txt is a good inspiration

tracking-code-manager-google-analytics/google-analytics-tracking-code-manager.php 92% from 13 tests

The main PHP script in "Wordpress Google Analytics Tracking Code Manager by Wpbdcoders" version 0.1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("tracking-code-manager-google-analytics.php" instead of "google-analytics-tracking-code-manager.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin261 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP57963249
Markdown1107
CSS1005

PHP code Passed 2 tests

An overview of 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.26
Average class complexity7.00
▷ Minimum class complexity3.00
▷ Maximum class complexity14.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods2083.33%
▷ Protected methods00.00%
▷ Private methods416.67%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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