84% ys-simple-google-analytics

Code Review | Ys Simple Google Analytics

WordPress plugin Ys Simple Google Analytics scored84%from 54 tests.

About plugin

  • Plugin page: ys-simple-google-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.8
  • WordPress version: 6.3.1
  • First release: Jul 18, 2017
  • Latest release: Sep 3, 2017
  • Number of updates: 8
  • Update frequency: every 5.9 days
  • Top authors: yosiakatsuki (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /591 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

A check of server-side resources used by Ys Simple Google Analytics
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.99 ▼4.76
Dashboard /wp-admin3.31 ▲0.0157.34 ▲1.22
Posts /wp-admin/edit.php3.36 ▲0.0153.96 ▲6.25
Add New Post /wp-admin/post-new.php5.89 ▲0.0189.87 ▼22.91
Media Library /wp-admin/upload.php3.24 ▲0.0138.56 ▲0.64
YS Simple Google Analytics /wp-admin/options-general.php?page=ys-simple-google-analytics3.2038.21

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Ys Simple Google Analytics
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.24 ▼0.332.08 ▼0.3147.81 ▲3.67
Dashboard /wp-admin2,199 ▲195.65 ▼0.01104.56 ▲2.7343.50 ▲0.88
Posts /wp-admin/edit.php2,111 ▲112.00 ▲0.0543.96 ▲1.1535.82 ▼0.46
Add New Post /wp-admin/post-new.php1,531 ▼423.25 ▲5.00652.41 ▲25.4651.10 ▼17.57
Media Library /wp-admin/upload.php1,407 ▲74.25 ▲0.0498.78 ▼17.8745.35 ▲0.98
YS Simple Google Analytics /wp-admin/options-general.php?page=ys-simple-google-analytics8241.9929.9329.50

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not 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
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ys-simple-google-analytics/ys-simple-google-analytics.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
1 plugin tags: google analytics

ys-simple-google-analytics/ys-simple-google-analytics.php Passed 13 tests

The main PHP script in "Ys Simple Google Analytics" version 1.0.0 is automatically included on every request by WordPress
61 characters long description:
This plugin enables Google Analytics for your WordPress site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin113 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1174571
PO File191242

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.08
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%
Functions6
▷ Named functions6100.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
No PNG images were found in this plugin