73% visitors-traffic-real-time-statistics

Code Review | Visitor Traffic Real Time Statistics

WordPress plugin Visitor Traffic Real Time Statistics scored 73% from 54 tests.

About plugin

  • Plugin page: visitors-traffic-...
  • Plugin version: 5.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9.1
  • WordPress version: 5.9.2
  • First release: Jan 18, 2015
  • Latest release: Mar 23, 2022
  • Number of updates: 313
  • Update frequency: every 8.4 days
  • Top authors: wp-buy (60.7%)osamaesh (39.62%)

Code review

54 tests

User reviews

213 reviews

Install metrics

50,000+ active / 1,177,982 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.59MB] [CPU: ▼289.25ms] Passed 4 tests

This is a short check of server-side resources used by Visitor Traffic Real Time Statistics
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.16 ▲0.6460.40 ▲9.79
Dashboard /wp-admin4.00 ▲0.5940.76 ▲6.27
Posts /wp-admin/edit.php4.22 ▲0.5843.16 ▲6.15
Add New Post /wp-admin/post-new.php7.52 ▲0.5595.59 ▼1,174.97
Media Library /wp-admin/upload.php3.94 ▲0.6529.53 ▲5.56
Help /wp-admin/admin.php?page=ahc_hits_counter_help3.8530.29
Visitor Traffic /wp-admin/admin.php?page=ahc_hits_counter_menu_free4.0435.35
Settings /wp-admin/admin.php?page=ahc_hits_counter_settings3.9131.89

Server storage [IO: ▲4.32MB] [DB: ▲0.03MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 406 new files
Database: 15 new tables, 5 new options
New tables
ahc_visitors
ahc_settings
ahc_recent_visitors
ahc_online_users
ahc_title_traffic
ahc_browsers
ahc_keywords
ahc_visits_time
ahc_daily_visitors_stats
ahc_search_engine_crawlers
...
New WordPress options
ahcfree_new_updates
ahcfree_wp_hits_counter_options
visitors-traffic-real-time-statistics-pro-version
widget_ahcfree_vtrts_widget
ahcfree_custom_timezone

Browser metrics Passed 4 tests

This is an overview of browser requirements for Visitor Traffic Real Time Statistics
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,856 ▲13415.62 ▼0.105.93 ▲0.352.41 ▼0.32
Dashboard /wp-admin2,967 ▲1136.13 ▼0.07119.38 ▼16.25175.15 ▲13.24
Posts /wp-admin/edit.php2,763 ▲723.37 ▲0.1460.47 ▼3.81140.52 ▼3.28
Add New Post /wp-admin/post-new.php1,715 ▼3716.29 ▼4.78389.49 ▼82.47204.93 ▲47.08
Media Library /wp-admin/upload.php1,772 ▲775.55 ▲0.09124.69 ▼20.12203.54 ▲19.24
Help /wp-admin/admin.php?page=ahc_hits_counter_help1,1242.4055.00112.02
Visitor Traffic /wp-admin/admin.php?page=ahc_hits_counter_menu_free3,4858.85205.79251.47
Settings /wp-admin/admin.php?page=ahc_hits_counter_settings3,6622.9359.4292.46

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure failed, leaving 15 tables in the database
    • ahc_refering_sites
    • ahc_hits
    • ahc_visitors
    • ahc_search_engines
    • ahc_visits_time
    • ahc_daily_visitors_stats
    • ahc_browsers
    • ahc_keywords
    • ahc_searching_visits
    • ahc_title_traffic
    • ...
  • This plugin did not uninstall successfully, leaving 4 options in the database
    • widget_ahcfree_vtrts_widget
    • ahcfree_new_updates
    • visitors-traffic-real-time-statistics-pro-version
    • ahcfree_custom_timezone

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
Everything seems fine, however this is by no means 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 take a closer look at the following
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/visitors-traffic-real-time-statistics/ahc_help.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ahcfree_get_current_timezone_offset() in wp-content/plugins/visitors-traffic-real-time-statistics/overview.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/visitors-traffic-real-time-statistics/functions.php:104
    • > PHP Warning
      Use of undefined constant AHCFREE_VISITORS_VISITS_LIMIT - assumed 'AHCFREE_VISITORS_VISITS_LIMIT' (this will throw an Error in a future version of PHP) in wp-content/plugins/visitors-traffic-real-time-statistics/lang/en_lang.php on line 34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/visitors-traffic-real-time-statistics/ahc_about.php:4
    • > PHP Warning
      Use of undefined constant AHCFREE_VISITORS_VISITS_LIMIT - assumed 'AHCFREE_VISITORS_VISITS_LIMIT' (this will throw an Error in a future version of PHP) in wp-content/plugins/visitors-traffic-real-time-statistics/lang/ar_lang.php on line 33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/visitors-traffic-real-time-statistics/functions.php:104
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/visitors-traffic-real-time-statistics/init.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 87% 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 to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Visits & Visitors Statistics), #2 (Traffic by country), #3 (Google map), #4 (Summary statistics), #5 (Browsers), #6 (Search engines), #7 (Traffic by IP), #8 (Traffic by country), #9 (Visits times), #10 (Latest search words), #11 (Traffic by title), #12 (Visits & Visitors Statistics)
  • Tags: Too many tags (38 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

visitors-traffic-real-time-statistics/Visitors-Traffic-Real-Time-Statistics.php 85% from 13 tests

The main PHP script in "Visitor Traffic Real Time Statistics" version 5.4 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("visitors-traffic-real-time-statistics.php" instead of "Visitors-Traffic-Real-Time-Statistics.php")
  • Domain Path: The domain path folder was not found ("/languages")

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 detected19,668 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
CSS152,04311812,940
PHP131,4879114,331
JavaScript173301562,114
SVG200278
INI2005

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity37.00
▷ Minimum class complexity1.00
▷ Maximum class complexity85.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods27
▷ Static methods00.00%
▷ Public methods622.22%
▷ Protected methods2177.78%
▷ Private methods00.00%
Functions90
▷ Named functions90100.00%
▷ Anonymous functions00.00%
Constants82
▷ Global constants82100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
331 PNG files occupy 1.65MB with 0.41MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/flags/ni.png0.27KB0.27KB0.00%
images/plugin-2.png35.39KB12.35KB▼ 65.11%
images/vtrtspro.png4.29KB1.73KB▼ 59.74%
images/flags/kz.png0.53KB0.61KB0.00%
images/flags/pe.png0.09KB0.09KB0.00%