83% lightag-lightweight-google-tag-manager

Code Review | LighTag - Lightweight Google Tag Manager

WordPress plugin LighTag - Lightweight Google Tag Manager scored83%from 54 tests.

About plugin

  • Plugin page: lightag-lightweig...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.1
  • WordPress version: 6.3.1
  • First release: Apr 8, 2023
  • Latest release: Apr 8, 2023
  • Number of updates: 6
  • Update frequency: every 2.8 days
  • Top authors: omriregev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /134 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.48ms] Passed 4 tests

This is a short check of server-side resources used by LighTag - Lightweight Google Tag Manager
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.22 ▼5.03
Dashboard /wp-admin3.32 ▲0.0248.99 ▼11.36
Posts /wp-admin/edit.php3.37 ▲0.0147.66 ▲0.57
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.14 ▼18.11
Media Library /wp-admin/upload.php3.24 ▲0.0140.90 ▲4.23
LighTag /wp-admin/options-general.php?page=lightag3.2433.25

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for LighTag - Lightweight Google Tag Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3714.38 ▲0.031.90 ▼0.3440.82 ▼3.42
Dashboard /wp-admin2,204 ▲275.58 ▼0.0286.15 ▼12.5743.28 ▼4.81
Posts /wp-admin/edit.php2,109 ▲122.03 ▲0.0535.88 ▲0.6333.65 ▼2.74
Add New Post /wp-admin/post-new.php1,539 ▲1122.67 ▼0.46686.42 ▲11.9560.39 ▲6.26
Media Library /wp-admin/upload.php1,409 ▲184.13 ▼0.07100.69 ▲5.1545.78 ▼0.15
LighTag /wp-admin/options-general.php?page=lightag8222.0023.3632.43

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/lightag-lightweight-google-tag-manager/inc/options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lightag-lightweight-google-tag-manager/default.php:51
    • > PHP Notice
      Undefined index: wp_version in wp-content/plugins/lightag-lightweight-google-tag-manager/default.php on line 50

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Requires php: The plugin version is formatted incorrectly
The official readme.txt is a good inspiration

lightag-lightweight-google-tag-manager/default.php 85% from 13 tests

This is the main PHP file of "LighTag - Lightweight Google Tag Manager" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("lightag-lightweight-google-tag-manager.php" instead of "default.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
Everything looks great! No dangerous files found in this plugin127 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP346114127

PHP code Passed 2 tests

This is a very shot review 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 complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity1.89
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin