67% wps-visitor-counter

Code Review | WPS Visitor Counter Plugin

WordPress plugin WPS Visitor Counter Plugin scored 67% from 54 tests.

About plugin

  • Plugin page: wps-visitor-counter
  • Plugin version: 1.4.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7.2
  • WordPress version: 5.8.1
  • First release: May 25, 2019
  • Latest release: Jul 3, 2021
  • Number of updates: 68
  • Update frequency: every 11.3 days
  • Top authors: techmix (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

10,000+ active / 46,382 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼144.03ms] Passed 4 tests

Server-side resources used by WPS Visitor Counter Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.93 ▲0.2143.13 ▲19.76
Dashboard /wp-admin3.14 ▲0.0947.05 ▼10.06
Posts /wp-admin/edit.php3.20 ▲0.0955.63 ▲0.43
Add New Post /wp-admin/post-new.php5.50 ▲0.07107.33 ▼556.10
Media Library /wp-admin/upload.php3.09 ▲0.0835.50 ▼10.39
WPS Visitor Counter /wp-admin/options-general.php?page=wps_options_general3.1237.48

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 296 new files
Database: 2 new tables, 1 new option
New tables
wp_wps_statistic
wp_wps_st_options
New WordPress options
widget_wps_visitor_counter

Browser metrics Passed 4 tests

An overview of browser requirements for WPS Visitor Counter Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,799 ▲22816.72 ▲1.1250.90 ▲42.6147.30 ▼8.82
Dashboard /wp-admin2,974 ▲415.87 ▼0.33180.28 ▲9.06112.68 ▼12.09
Posts /wp-admin/edit.php2,746 ▲102.83 ▲0.1275.84 ▲10.5286.90 ▼4.55
Add New Post /wp-admin/post-new.php1,626 ▲4521.49 ▲5.15311.61 ▼201.58128.95 ▼22.24
Media Library /wp-admin/upload.php1,814 ▲75.04 ▲0.01190.38 ▲8.94117.30 ▼18.69
WPS Visitor Counter /wp-admin/options-general.php?page=wps_options_general2,2302.8282.24142.14

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Zombie tables were found after uninstall: 2 tables
    • wp_wps_statistic
    • wp_wps_st_options
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_wps_visitor_counter

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wps-visitor-counter/wps-visitor-counter.php on line 30
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-includes/pluggable.php' (include_path='.:/usr/share/php') in wp-content/plugins/wps-visitor-counter/wps-visitor-counter.php on line 31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wps-visitor-counter/wps-visitor-counter-count.php:18
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wps-visitor-counter/wps-visitor-counter.php on line 31
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wps-visitor-counter/wps-visitor-counter.php on line 29
    • > PHP Warning
      require_once(ABSPATHwp-includes/pluggable.php): failed to open stream: No such file or directory in wp-content/plugins/wps-visitor-counter/wps-visitor-counter.php on line 31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/wps-visitor-counter/wps-visitor-counter-options-general.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wps-visitor-counter/wps-visitor-counter-widgets.php:2

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/options-general.php?page=wps_options_general
    • > Network (severe)
    https://affiliates.a2hosting.com/scripts/imp.php?aid=5bf7c623aa2a9&bid=d6664600 - Failed to load resource: the server responded with a status of 403 ()
    • > GET request to /wp-admin/options-general.php?page=wps_options_general
    • > Network (severe)
    http://affiliates.a2hosting.com/accounts/default1/banners/d6664600.jpg - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Please describe screenshot #4 in wps-visitor-counter/assets to your readme.txt
You can look at the official readme.txt

wps-visitor-counter/wps-visitor-counter.php 85% from 13 tests

This is the main PHP file of "WPS Visitor Counter Plugin" version 1.4.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 145 characters long)
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

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 plugin892 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP623124658
CSS1141194
JavaScript239040
HTML1080

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions1493.33%
▷ Anonymous functions16.67%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
17 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
counter/views_month.png0.42KB0.35KB▼ 16.51%
counter/user_year.png0.84KB0.59KB▼ 29.29%
counter/twitter.png16.67KB2.02KB▼ 87.87%
counter/user_today.png0.63KB0.57KB▼ 10.63%
counter/7days_views.png0.69KB0.63KB▼ 8.35%