63% count-unique-visitors-widget

Code Review | Plugin Name: Count Unique Visitors Widget

WordPress plugin Plugin Name: Count Unique Visitors Widgetscored63%from 54 tests.

About plugin

  • Plugin page: count-unique-visi...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8.0-3.8
  • WordPress version: 6.3.1
  • First release: Jan 29, 2014
  • Latest release: Jan 29, 2014
  • Number of updates: 3
  • Update frequency: every 2.0 days
  • Top authors: dynamologic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,957 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.84MB] [CPU: ▼52.04ms] Passed 4 tests

An overview of server-side resources used by Plugin Name: Count Unique Visitors Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.3013.74 ▼26.66
Dashboard /wp-admin2.18 ▼1.1611.49 ▼50.39
Posts /wp-admin/edit.php2.18 ▼1.1713.00 ▼36.43
Add New Post /wp-admin/post-new.php2.18 ▼3.7112.41 ▼94.67
Media Library /wp-admin/upload.php2.18 ▼1.0510.93 ▼23.21

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 8 new files
Database: 1 new table, 6 new options
New tables
wp_cuv_log
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Plugin Name: Count Unique Visitors Widget: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,878 ▲13213.21 ▼1.331.93 ▼0.2636.03 ▼6.71
Dashboard /wp-admin2,232 ▲265.81 ▼0.13106.92 ▲5.2743.29 ▼7.85
Posts /wp-admin/edit.php2,114 ▲142.00 ▼0.0335.51 ▼2.5041.24 ▲6.99
Add New Post /wp-admin/post-new.php1,386 ▼15920.65 ▼2.53570.29 ▼71.4936.95 ▼12.39
Media Library /wp-admin/upload.php1,411 ▲144.29 ▲0.1195.83 ▼8.1444.13 ▼1.53

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/count-unique-visitors-widget/wp-count-unique-visitors-widget.php+331
    Undefined index: HTTP_X_FORWARD_FOR
  • Zombie tables detected upon uninstall: 1 table
    • wp_cuv_log
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

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
Even though everything seems fine, this is not an exhaustive test

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 take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/count-unique-visitors-widget/wp-count-unique-visitors-widget.php:369

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === Plugin Name: Count Unique Visitors Widget=== )
The official readme.txt might help

count-unique-visitors-widget/wp-count-unique-visitors-widget.php 85% from 13 tests

Analyzing the main PHP file in "Plugin Name: Count Unique Visitors Widget" version 1.0.0
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 168 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("count-unique-visitors-widget.php" instead of "wp-count-unique-visitors-widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected324 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP16920288
JavaScript15021
CSS12015

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
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%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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.10MB with 0.06MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
count_unique_visitors_plugin_screen_shot.png104.70KB39.92KB▼ 61.87%