42% statistico

Code Review | Statistico

WordPress plugin Statistico scored42%from 54 tests.

About plugin

  • Plugin page: statistico
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Nov 14, 2012
  • Latest release: Nov 14, 2012
  • Number of updates: 11
  • Update frequency: N/A
  • Top authors: miljushm (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /917 total downloads

Benchmarks

Plugin footprint 30% 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.03MB] [CPU: ▼3.77ms] Passed 4 tests

This is a short check of server-side resources used by Statistico
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.96 ▼2.25
Dashboard /wp-admin3.34 ▲0.0348.19 ▼5.28
Posts /wp-admin/edit.php3.39 ▲0.0345.54 ▲2.50
Add New Post /wp-admin/post-new.php5.92 ▲0.0384.43 ▼8.23
Media Library /wp-admin/upload.php3.26 ▲0.0334.84 ▲0.69
Screen Resolutions /wp-admin/admin.php?page=ws_statistico_resolutions3.2332.59
Visual Stats /wp-admin/admin.php?page=ws_statistico_visual3.3232.98
Browser Info /wp-admin/admin.php?page=ws_statistico_info3.2330.25

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: 2 new tables, 7 new options
New tables
wp_ws_statistico_agent
wp_ws_statistico
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
recovery_mode_email_last_sent
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Statistico
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲10213.18 ▼1.203.31 ▲1.0148.84 ▼0.19
Dashboard /wp-admin2,233 ▲485.84 ▲0.97101.13 ▼12.6283.34 ▲44.29
Posts /wp-admin/edit.php2,119 ▲301.99 ▼0.0137.19 ▼0.0933.20 ▼1.25
Add New Post /wp-admin/post-new.php1,539 ▼323.00 ▲4.34772.64 ▲162.2154.88 ▲2.93
Media Library /wp-admin/upload.php1,412 ▲214.23 ▲0.01108.82 ▲6.3345.88 ▲0.23
Screen Resolutions /wp-admin/admin.php?page=ws_statistico_resolutions7041.536.6016.12
Visual Stats /wp-admin/admin.php?page=ws_statistico_visual8192.1523.1827.20
Browser Info /wp-admin/admin.php?page=ws_statistico_info7041.146.5220.09

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Error in wp-content/plugins/statistico/index.php+113
    Uncaught Error: Call to undefined function query() in wp-content/plugins/statistico/index.php:113
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): ws_statistico_uninstall()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(1269): do_action()
    #4 wp-admin/includes/plugin.php(960): uninstall_plugin()
  • Incomplete uninstall procedure, leaving 10 files (0.08MB) in the plugin directory
    • (new file) index.php
    • (new file) php/ws_statistico_visual.php
    • (new file) images/stat-big.png
    • (new file) images/ws_browser_icons.png
    • (new file) readme.txt
    • (new file) php/ws_statistico_info.php
    • (new file) images/stat.png
    • (new file) css/style.css
    • (new file) php/ws_statistico_resolutions.php
    • (new file) js/ws-browser.js
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_ws_statistico_agent
    • wp_ws_statistico
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ws_statistico_info
    • > Parse error in wp-content/plugins/statistico/php/ws_statistico_info.php+105
    syntax error, unexpected end of file
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ws_statistico_visual
    • > Warning in wp-content/plugins/statistico/php/ws_statistico_visual.php+112
    Division by zero
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ws_statistico_visual
    • > Notice in wp-content/plugins/statistico/php/ws_statistico_visual.php+174
    Undefined variable: ws_result
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ws_statistico_visual
    • > Notice in wp-content/plugins/statistico/php/ws_statistico_visual.php+174
    Trying to get property 'cnt' of non-object
    • > GET request to /wp-admin/admin.php?page=ws_statistico_visual
    • > Notice in wp-content/plugins/statistico/php/ws_statistico_visual.php+173
    Undefined variable: safari_values
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ws_statistico_visual
    • > Notice in wp-content/plugins/statistico/php/ws_statistico_visual.php+231
    Undefined variable: safari_string_percent

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
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/statistico/php/ws_statistico_info.php on line 105
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/statistico/php/ws_statistico_visual.php on line 19
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/statistico/php/ws_statistico_resolutions.php on line 92
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/statistico/index.php:15
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/statistico/php/ws_statistico_visual.php:20

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=ws_statistico_visual
    • > Network (severe)
    https://2.chart.apis.google.com/chart?chs=350x200&cht=p3&chco=3399CC|FC5B07|FED710|A9A9A9&chd=t:NAN,NAN,NAN,NAN&chdl=Windows+%28NAN%25%29|Linux+%28NAN%25%29|Mac+%28NAN%25%29|Other+%28NAN%25%29&chtt=OS+Usage - Failed to load resource: net::ERR_CERT_COMMON_NAME_INVALID
    • > GET request to /wp-admin/admin.php?page=ws_statistico_visual
    • > Network (severe)
    https://1.chart.apis.google.com/chart?chs=350x200&cht=p3&chco=015083|FC5B07|FED710|3BADD9|E21515|A9A9A9&chd=t:NAN,NAN,NAN,NAN,NAN,NAN&chdl=Explorer+%28NAN%25%29|Firefox+%28NAN%25%29|Chrome+%28NAN%25%29|Safari+%28NAN%25%29|Opera+%28NAN%25%29|Other+%28NAN%25%29&chtt=Browser+Usage - Failed to load resource: net::ERR_CERT_COMMON_NAME_INVALID

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Plugin Name: Please specify the plugin name on the first line ( === statistico === )
Please take inspiration from this readme.txt

statistico/index.php 92% from 13 tests

Analyzing the main PHP file in "Statistico" version 1.1
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("statistico.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin626 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP410529432
JavaScript163143
CSS11051

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/stat-big.png13.85KB6.39KB▼ 53.91%
images/stat.png1.55KB0.85KB▼ 45.29%
images/ws_browser_icons.png39.91KB10.18KB▼ 74.49%