84% ga-code

Code Review | GA Code

WordPress plugin GA Code scored84%from 54 tests.

About plugin

  • Plugin page: ga-code
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.9.8
  • WordPress version: 6.3.1
  • First release: May 29, 2016
  • Latest release: Sep 27, 2018
  • Number of updates: 17
  • Update frequency: every 50.1 days
  • Top authors: pedrolaxe (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,268 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.01MB] [CPU: ▼4.22ms] Passed 4 tests

Server-side resources used by GA Code
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0150.49 ▲5.15
Dashboard /wp-admin3.32 ▲0.0143.17 ▼6.28
Posts /wp-admin/edit.php3.37 ▲0.0149.04 ▲1.65
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.30 ▼13.01
Media Library /wp-admin/upload.php3.24 ▲0.0134.17 ▲0.75

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

GA Code: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲7713.49 ▼0.7711.66 ▲9.7143.30 ▼1.28
Dashboard /wp-admin2,225 ▲344.85 ▼0.06100.50 ▼19.3039.33 ▼6.44
Posts /wp-admin/edit.php2,108 ▲191.99 ▼0.0142.23 ▲3.1638.21 ▼0.17
Add New Post /wp-admin/post-new.php1,546 ▲1823.09 ▲4.71630.18 ▼38.4252.12 ▲1.57
Media Library /wp-admin/upload.php1,407 ▲194.20 ▼0.0395.81 ▼9.3441.18 ▼2.29

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ga-code/ga-code.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Screenshots: Please add an image for screenshot #1 (https://phpsec.com.br/includes/gacodee.png)
You can look at the official readme.txt

ga-code/ga-code.php Passed 13 tests

The main PHP script in "GA Code" version 1.0.2 is automatically included on every request by WordPress
66 characters long description:
GA Code is a simple method to use Google Analytics in your website

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 detected65 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2406565

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
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%
Functions5
▷ Named functions5100.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
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png9.54KB4.19KB▼ 56.05%