78% elegant-visitor-counter

Code Review | Elegant Visitor Counter

WordPress plugin Elegant Visitor Counter scored78%from 54 tests.

About plugin

  • Plugin page: elegant-visitor-c...
  • Plugin version: 3.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 23, 2018
  • Latest release: May 24, 2020
  • Number of updates: 42
  • Update frequency: every 46.4 days
  • Top authors: regolithsjk (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

900+ active /6,179 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

A check of server-side resources used by Elegant Visitor Counter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0542.83 ▼3.90
Dashboard /wp-admin3.35 ▲0.0150.13 ▼20.32
Posts /wp-admin/edit.php3.46 ▲0.1150.83 ▼1.75
Add New Post /wp-admin/post-new.php5.95 ▲0.0685.83 ▼18.22
Media Library /wp-admin/upload.php3.27 ▲0.0539.75 ▲4.31
Elegant Visitor Counter /wp-admin/options-general.php?page=evc_settings3.2938.46

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 26 new files
Database: 1 new table, 8 new options
New tables
wp_evc_log
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_elegant_visitor_counter_plugin_widget
widget_theysaidso_widget
db_upgraded
evc_db_version

Browser metrics Passed 4 tests

A check of browser resources used by Elegant Visitor Counter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,922 ▲17613.67 ▼0.788.64 ▲6.8246.84 ▼2.28
Dashboard /wp-admin2,214 ▲295.94 ▲0.13106.95 ▲1.3838.16 ▼3.66
Posts /wp-admin/edit.php2,116 ▲272.08 ▲0.0939.35 ▼1.0634.80 ▲0.01
Add New Post /wp-admin/post-new.php1,545 ▲1623.48 ▲0.35683.65 ▲43.1155.66 ▼11.23
Media Library /wp-admin/upload.php1,405 ▲174.35 ▲0.1897.17 ▼12.9041.79 ▼5.15
Elegant Visitor Counter /wp-admin/options-general.php?page=evc_settings8821.8828.5536.05

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_elegant_visitor_counter_plugin_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% 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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/elegant-visitor-counter/public/partials/elegant-visitor-counter-public-display.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/elegant-visitor-counter/admin/partials/elegant-visitor-counter-admin-display.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/elegant-visitor-counter/public/class-elegant-visitor-counter-public.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Contributors: Plugin contributors field is missing
  • Screenshots: No descriptions were found for these screenshots #3, #4, #5 in elegant-visitor-counter/assets to your readme.txt
You can look at the official readme.txt

elegant-visitor-counter/elegant-visitor-counter.php 92% from 13 tests

The main file in "Elegant Visitor Counter" v. 3.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 157 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin2,316 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript33332151,374
PHP15164747649
CSS23712257
Markdown114036

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.70
▷ Minimum class complexity1.00
▷ Maximum class complexity34.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods51
▷ Static methods23.92%
▷ Public methods4690.20%
▷ Protected methods00.00%
▷ Private methods59.80%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin