68% gas-injector

Code Review | GAS Injector

WordPress plugin GAS Injector scored68%from 54 tests.

About plugin

  • Plugin page: gas-injector
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.9
  • WordPress version: 6.3.1
  • First release: Dec 2, 2012
  • Latest release: Apr 19, 2014
  • Number of updates: 20
  • Update frequency: every 25.2 days
  • Top authors: hoyce (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /5,689 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▼1.80MB] [CPU: ▼55.36ms] Passed 4 tests

Analyzing server-side resources used by GAS Injector
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.19 ▼1.284.42 ▼34.62
Dashboard /wp-admin2.21 ▼1.105.15 ▼46.09
Posts /wp-admin/edit.php2.21 ▼1.156.47 ▼48.03
Add New Post /wp-admin/post-new.php2.21 ▼3.685.47 ▼91.35
Media Library /wp-admin/upload.php2.21 ▼1.025.92 ▼35.95

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by GAS Injector
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲15214.03 ▼0.339.51 ▲6.8745.24 ▼0.46
Dashboard /wp-admin2,217 ▲324.90 ▲0.04116.77 ▼6.8344.97 ▲0.08
Posts /wp-admin/edit.php2,094 ▲52.03 ▲0.0238.18 ▼0.8032.30 ▼7.27
Add New Post /wp-admin/post-new.php1,520 ▼022.98 ▲0.00680.82 ▲23.8066.17 ▲9.42
Media Library /wp-admin/upload.php1,393 ▲54.15 ▼0.25104.16 ▼6.5744.22 ▼1.87
GAS Injector /wp-admin/gas-injector.php260.440.0812.71

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

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 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
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/gas-injector/gas-injector.php:18

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/gas-injector.php
    • > Network (severe)
    wp-admin/gas-injector.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% 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 require attention:
  • Donate link: Invalid URI found ("")
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === gas-injector === )
  • Screenshots: These screenshots require images: #1 (Add your Google Analytics tracking code and domain name.), #2 (Some additional settings for debugging and adding more GAS hooks for extended tracking.)
You can look at the official readme.txt

gas-injector/gas-injector.php Passed 13 tests

The main file in "GAS Injector" v. 1.3.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
103 characters long description:
GAS Injector for WordPress will help you add Google Analytics on Steroids (GAS) to your WordPress blog.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected383 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP178100316
CSS114354
JavaScript2089
Markdown1204

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
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%
Constants0
▷ Global constants00.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
3 PNG files occupy 0.14MB with 0.05MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png23.54KB10.10KB▼ 57.09%
assets/screenshot-1.png121.49KB50.79KB▼ 58.19%
images/external_link_icon.png0.14KB0.16KB0.00%