84% wp-smart-analytics

Code Review | WP Smart Analytics

WordPress plugin WP Smart Analytics scored84%from 54 tests.

About plugin

  • Plugin page: wp-smart-analytics
  • Plugin version: 1.2.1
  • PHP compatiblity: 5.3.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.0-5.9
  • WordPress version: 6.3.1
  • First release: Mar 19, 2018
  • Latest release: Aug 7, 2022
  • Number of updates: 212
  • Update frequency: every 7.6 days
  • Top authors: vinodsebastian (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,551 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.49MB] [CPU: ▼3.00ms] Passed 4 tests

This is a short check of server-side resources used by WP Smart Analytics
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.17 ▲0.7049.45 ▲13.32
Dashboard /wp-admin3.83 ▲0.4947.01 ▼12.28
Posts /wp-admin/edit.php3.88 ▲0.5350.93 ▲4.76
Add New Post /wp-admin/post-new.php6.35 ▲0.4784.21 ▼9.66
Media Library /wp-admin/upload.php3.69 ▲0.4639.52 ▲5.17

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 27 new files
Database: 1 new table, 13 new options
New tables
wp_smart_analytics_visitor_log
New WordPress options
MAX_DATABASE_RECORDS
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
SHA_SECRET_IV
SHA_SECRET_KEY
MAX_CACHE_RECORDS
SESSION_DURATION
widget_theysaidso_widget
VISITOR_COUNT
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Smart Analytics
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲4014.40 ▼0.151.72 ▲0.0636.50 ▼2.38
Dashboard /wp-admin2,204 ▲245.58 ▼0.0280.47 ▼8.4236.04 ▼2.63
Posts /wp-admin/edit.php2,112 ▲152.01 ▼0.0338.65 ▲2.0435.90 ▼1.25
Add New Post /wp-admin/post-new.php1,536 ▲1022.18 ▼1.36668.73 ▲1.0863.50 ▲4.19
Media Library /wp-admin/upload.php1,415 ▲184.21 ▼0.02104.12 ▲6.2443.75 ▼0.64

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wp-smart-analytics/uninstall.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
10 plugin tags: security, ban, logs, statistics, behavior...

wp-smart-analytics/class-wpsa.php 85% from 13 tests

"WP Smart Analytics" version 1.2.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 311 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-smart-analytics.php" instead of "class-wpsa.php")

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
Good job! No executable or dangerous file extensions detected3,978 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP24254832,287
CSS6126601,346
JavaScript1394345

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity357.00
▷ Minimum class complexity357.00
▷ Maximum class complexity357.00
Average method complexity6.65
▷ Minimum method complexity1.00
▷ Maximum method complexity49.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods63
▷ Static methods11.59%
▷ Public methods6298.41%
▷ Protected methods00.00%
▷ Private methods11.59%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants24
▷ Global constants00.00%
▷ Class constants24100.00%
▷ Public constants24100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
14 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon.png6.08KB2.68KB▼ 55.93%
assets/css/images/ui-icons_469bdd_256x240.png4.51KB4.18KB▼ 7.28%
assets/css/images/ui-bg_inset-hard_100_f5f8f9_1x100.png0.38KB0.13KB▼ 66.24%
assets/css/images/ui-bg_glass_75_d0e5f5_1x400.png0.38KB0.16KB▼ 59.39%
assets/css/images/ui-icons_d8e7f3_256x240.png4.51KB4.18KB▼ 7.28%