84% wp-visitors-widget

Code Review | Live Visitor Counter

WordPress plugin Live Visitor Counter scored84%from 54 tests.

About plugin

  • Plugin page: wp-visitors-widget
  • Plugin version: 2.2
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Feb 26, 2019
  • Latest release: Jun 20, 2023
  • Number of updates: 15
  • Update frequency: every 105.2 days
  • Top authors: liveplugins (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

5,000+ active /44,438 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.04MB] [CPU: ▼7.46ms] Passed 4 tests

Analyzing server-side resources used by Live Visitor Counter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0437.60 ▼5.57
Dashboard /wp-admin3.35 ▲0.0451.58 ▼3.18
Posts /wp-admin/edit.php3.47 ▲0.1157.05 ▲7.35
Add New Post /wp-admin/post-new.php5.93 ▲0.0484.61 ▼22.82
Media Library /wp-admin/upload.php3.25 ▲0.0234.96 ▲1.73

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 26 new files
Database: 1 new table, 7 new options
New tables
wp_visitors_stat
New WordPress options
theysaidso_admin_options
widget_visitors_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Live Visitor Counter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,070 ▲31315.52 ▲0.895.31 ▲3.1442.12 ▲2.75
Dashboard /wp-admin2,357 ▲1726.50 ▲0.62123.02 ▲17.5941.21 ▼4.08
Posts /wp-admin/edit.php2,257 ▲1683.33 ▲1.2947.55 ▲7.2230.79 ▼6.81
Add New Post /wp-admin/post-new.php1,534 ▼123.10 ▲0.05665.60 ▲16.5636.06 ▼18.25
Media Library /wp-admin/upload.php1,468 ▲804.19 ▲0.0186.69 ▼17.7443.82 ▲3.39

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_visitors_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant DAY_IN_SECONDS - assumed 'DAY_IN_SECONDS' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-visitors-widget/modules/hooks.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_uninstall_hook() in wp-content/plugins/wp-visitors-widget/wp-visitors-widget.php:72
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-visitors-widget/modules/widgets.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-visitors-widget/modules/hooks.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-visitors-widget/modules/scripts.php:73
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-visitors-widget/modules/shortcodes.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: click counter, marketing, wordpress visitor counter

wp-visitors-widget/wp-visitors-widget.php Passed 13 tests

The main file in "Live Visitor Counter" v. 2.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
72 characters long description:
Adds a widget showing the visitor how many live visitors is on the page.

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
There were no executable files found in this plugin17,269 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
CSS61,08713614,675
JavaScript45363371,350
PHP6183241,237
SVG1007

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity13.67
▷ Minimum class complexity2.00
▷ Maximum class complexity24.00
Average method complexity5.22
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions466.67%
▷ Anonymous functions233.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 compressed PNG files occupy 0.04MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
modules/inc/assets/css/glyphicons-halflings-white.png8.57KB9.20KB0.00%
modules/inc/assets/css/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%
modules/images/logo-dark-copy-2.png2.47KB2.57KB0.00%
modules/inc/assets/img/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%
modules/inc/assets/img/glyphicons-halflings-white.png8.57KB9.20KB0.00%