89% cs-google-analytics-code

Code Review | CS Google Analytics

WordPress plugin CS Google Analytics scored 89% from 54 tests.

About plugin

  • Plugin page: cs-google-analyti...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.2
  • WordPress version: 6.3.1
  • First release: Jul 20, 2017
  • Latest release: Sep 26, 2019
  • Number of updates: 10
  • Update frequency: every 79.8 days
  • Top authors: catchsquare (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 895 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

Server-side resources used by CS Google Analytics
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.39 ▼0.0727.25 ▼14.94
Dashboard /wp-admin3.32 ▲0.0247.63 ▼2.03
Posts /wp-admin/edit.php3.37 ▲0.0146.63 ▲1.24
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.82 ▼8.38
Media Library /wp-admin/upload.php3.24 ▲0.0135.07 ▼4.52

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for CS Google Analytics
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲7613.23 ▼1.124.76 ▲2.9343.47 ▼7.81
Dashboard /wp-admin2,220 ▲294.91 ▲0.0397.56 ▼2.9876.84 ▲33.63
Posts /wp-admin/edit.php2,100 ▲141.99 ▼0.0035.96 ▼2.1733.51 ▼0.50
Add New Post /wp-admin/post-new.php1,533 ▲523.08 ▲4.76724.15 ▲126.1859.35 ▼3.44
Media Library /wp-admin/upload.php1,402 ▲114.25 ▲0.07107.92 ▲7.0246.59 ▲3.59

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests Passed 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)
Good news, no errors were detected

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention: The official readme.txt is a good inspiration

cs-google-analytics-code/cs-google-analytics.php 85% from 13 tests

The main PHP script in "CS Google Analytics" version 1.0.2 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cs-google-analytics-code.php" instead of "cs-google-analytics.php")

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
No dangerous file extensions were detected105 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11444105

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.62
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/ga-icon.png1.04KB0.28KB▼ 73.16%