73% visitors-traffic-real-time-statistics

Code Review | Visitor Traffic Real Time Statistics

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

About plugin

  • Plugin page: visitors-traffic-...
  • Plugin version: 7.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3.1
  • WordPress version: 6.3.1
  • First release: Jan 18, 2015
  • Latest release: Sep 30, 2023
  • Number of updates: 348
  • Update frequency: every 9.1 days
  • Top authors: wp-buy (54.6%)osamaesh (45.69%)

Code review

54 tests

User reviews

227 reviews

Install metrics

50,000+ active /1,511,812 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.04MB] [CPU: ▲35.64ms] 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 /3.53 ▲0.0681.00 ▲43.98
Dashboard /wp-admin3.35 ▲0.0583.64 ▲34.35
Posts /wp-admin/edit.php3.40 ▲0.0487.77 ▲39.96
Add New Post /wp-admin/post-new.php5.93 ▲0.04119.35 ▲25.28
Media Library /wp-admin/upload.php3.27 ▲0.0481.18 ▲42.96
Visitor Traffic /wp-admin/admin.php?page=ahc_hits_counter_menu_free3.4786.79
Help /wp-admin/admin.php?page=ahc_hits_counter_help3.2772.03
Settings /wp-admin/admin.php?page=ahc_hits_counter_settings3.3275.20

Server storage [IO: ▲4.34MB] [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, 10 new options
New tables
ahc_settings
ahc_search_engine_crawlers
ahc_daily_visitors_stats
ahc_visitors
ahc_keywords
ahc_refering_sites
ahc_online_users
ahc_search_engines
ahc_title_traffic
ahc_visits_time
...
New WordPress options
ahcfree_wp_hits_counter_options
can_compress_scripts
widget_recent-posts
ahcfree_new_updates
db_upgraded
widget_recent-comments
ahcfree_custom_timezone
theysaidso_admin_options
widget_ahcfree_vtrts_widget
widget_theysaidso_widget

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 /2,891 ▲13014.36 ▼0.372.31 ▲0.7947.66 ▲9.91
Dashboard /wp-admin2,256 ▲845.73 ▲0.0881.53 ▼17.8679.09 ▲34.55
Posts /wp-admin/edit.php2,158 ▲581.99 ▲0.0535.38 ▼1.7034.70 ▲0.76
Add New Post /wp-admin/post-new.php1,589 ▲6122.86 ▼0.31678.79 ▼4.2963.83 ▲0.03
Media Library /wp-admin/upload.php1,458 ▲584.16 ▼0.0597.64 ▼7.3772.99 ▲27.34
Visitor Traffic /wp-admin/admin.php?page=ahc_hits_counter_menu_free3,0277.68188.56195.55
Help /wp-admin/admin.php?page=ahc_hits_counter_help9531.9924.0327.78
Settings /wp-admin/admin.php?page=ahc_hits_counter_settings3,4102.0828.1135.54

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_visits_time
    • ahc_visitors
    • ahc_settings
    • ahc_browsers
    • ahc_keywords
    • ahc_hits
    • ahc_online_users
    • ahc_search_engine_crawlers
    • ahc_recent_visitors
    • ahc_countries
    • ...
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • ahcfree_new_updates
    • ahcfree_custom_timezone
    • widget_ahcfree_vtrts_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
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 add_shortcode() in wp-content/plugins/visitors-traffic-real-time-statistics/functions.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/visitors-traffic-real-time-statistics/init.php:18
    • > 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 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 plugins_url() in wp-content/plugins/visitors-traffic-real-time-statistics/ahc_about.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/visitors-traffic-real-time-statistics/functions.php:2
    • > 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

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 7.2 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Domain Path: The domain path folder was not found ("/languages")
  • 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")

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,961 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
CSS152,04411812,941
PHP131,5689284,623
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.36
Average class complexity37.67
▷ Minimum class complexity1.00
▷ Maximum class complexity87.00
Average method complexity4.93
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods28
▷ Static methods00.00%
▷ Public methods725.00%
▷ Protected methods2175.00%
▷ Private methods00.00%
Functions100
▷ Named functions100100.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.39MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/online.png8.55KB3.20KB▼ 62.62%
images/flags/pt.png0.39KB0.48KB0.00%
images/flags/gq.png0.32KB0.33KB0.00%
images/flags/ar.png0.14KB0.14KB0.00%
images/plugin-6.png38.48KB17.06KB▼ 55.67%