83% ga-code-visibility

Code Review | GA Code Visibility

WordPress plugin GA Code Visibility scored83%from 54 tests.

About plugin

  • Plugin page: ga-code-visibility
  • Plugin version: 0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7
  • WordPress version: 6.3.1
  • First release: Dec 23, 2015
  • Latest release: Mar 10, 2021
  • Number of updates: 11
  • Update frequency: every 173.2 days
  • Top authors: Off Site Services (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,140 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by GA Code Visibility
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.62 ▼6.07
Dashboard /wp-admin3.31 ▲0.0143.69 ▼4.54
Posts /wp-admin/edit.php3.36 ▲0.0145.78 ▼3.45
Add New Post /wp-admin/post-new.php5.89 ▲0.0194.11 ▼5.82
Media Library /wp-admin/upload.php3.24 ▲0.0132.14 ▼6.53

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by GA Code Visibility
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲4513.32 ▼1.051.69 ▼0.3541.71 ▼9.27
Dashboard /wp-admin2,211 ▲204.87 ▼0.23109.62 ▲0.0736.97 ▼6.97
Posts /wp-admin/edit.php2,094 ▲52.02 ▲0.0247.67 ▲8.9836.53 ▲2.28
Add New Post /wp-admin/post-new.php1,595 ▲5218.25 ▼0.29600.48 ▼22.4045.58 ▼7.26
Media Library /wp-admin/upload.php1,387 ▲24.24 ▼0.0492.42 ▼6.4341.64 ▼3.10

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/ga-code-visibility/ga_add.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Add an image for screenshot #1 (Simply paste Google Analytics code into GA code fields)
  • Tags: Please reduce the number of tags, currently 17 tag instead of maximum 10
You can take inspiration from this readme.txt

ga-code-visibility/ga_add.php 92% from 13 tests

The entry point to "GA Code Visibility" version 0.4 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("ga-code-visibility.php" instead of "ga_add.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected55 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2132131
JavaScript17324

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.07
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
1 PNG file occupies 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png84.75KB32.98KB▼ 61.09%