78% cellarweb-server-side-analytics

Code Review | CellarWeb Server Side Analytics

WordPress plugin CellarWeb Server Side Analytics scored78%from 54 tests.

About plugin

  • Plugin page: cellarweb-server-...
  • Plugin version: 1.02
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.6-6.2
  • WordPress version: 6.3.1
  • First release: Mar 24, 2022
  • Latest release: Apr 6, 2023
  • Number of updates: 9
  • Update frequency: every 42.1 days
  • Top authors: rhellewell@gmail.com (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /648 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼1.75ms] Passed 4 tests

An overview of server-side resources used by CellarWeb Server Side Analytics
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0441.77 ▼0.13
Dashboard /wp-admin3.36 ▲0.0652.25 ▲0.53
Posts /wp-admin/edit.php3.47 ▲0.1248.70 ▲3.30
Add New Post /wp-admin/post-new.php5.94 ▲0.0586.75 ▼10.71
Media Library /wp-admin/upload.php3.28 ▲0.0540.62 ▲4.80
Server Side Analytics Settings /wp-admin/options-general.php?page=simple-cwssa3.2336.59

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for CellarWeb Server Side Analytics
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.70 ▲0.171.66 ▼0.5946.72 ▲1.50
Dashboard /wp-admin2,198 ▲215.55 ▼0.1787.23 ▼17.5036.44 ▼9.91
Posts /wp-admin/edit.php2,106 ▲61.99 ▲0.0033.91 ▼3.9634.03 ▼4.63
Add New Post /wp-admin/post-new.php1,531 ▲523.10 ▼0.34633.37 ▼37.7753.91 ▲2.30
Media Library /wp-admin/upload.php1,409 ▲94.28 ▲0.0396.61 ▼17.8241.13 ▼7.28
Server Side Analytics Settings /wp-admin/options-general.php?page=simple-cwssa1,0182.0026.4949.60

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=simple-cwssa
    • > Notice in wp-content/plugins/cellarweb-server-side-analytics/server-side-analytics.php+154
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please 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 get_bloginfo() in wp-content/plugins/cellarweb-server-side-analytics/server-side-analytics.php:331

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: privacy, google analytics, gdpr

cellarweb-server-side-analytics/server-side-analytics.php 85% from 13 tests

The primary PHP file in "CellarWeb Server Side Analytics" version 1.02 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("cellarweb-server-side-analytics.php" instead of "server-side-analytics.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 304 characters long)

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 detected455 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP148101302
CSS2264153

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.14
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 3.03MB with 2.68MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-1000x200.png605.62KB83.25KB▼ 86.25%
assets/banner-772x250.png743.06KB92.55KB▼ 87.54%
assets/icon-256x256.png573.75KB36.02KB▼ 93.72%
assets/icon-128x128.png222.92KB11.54KB▼ 94.82%
assets/cellarweb-logo-2022.png954.49KB191.67KB▼ 79.92%