10% aa-counter

Code Review | AA Visitor Counter Widget

WordPress plugin AA Visitor Counter Widget scored 10% from 54 tests.

About plugin

  • Plugin page: aa-counter
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.0
  • WordPress version: 5.9.2
  • First release: Oct 7, 2014
  • Latest release: Nov 17, 2014
  • Number of updates: 14
  • Update frequency: every 3.1 days
  • Top authors: aaextention (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

90+ active / 7,303 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/aa-counter/aacounter.php+54
    Undefined index: HTTP_CLIENT_IP

Server metrics [RAM: ▼2.36MB] [CPU: ▼345.17ms] Passed 4 tests

An overview of server-side resources used by AA Visitor Counter Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /1.95 ▼1.5617.07 ▼40.95
Dashboard /wp-admin2.04 ▼1.3618.01 ▼36.37
Posts /wp-admin/edit.php2.04 ▼1.6015.75 ▼35.67
Add New Post /wp-admin/post-new.php2.04 ▼4.9316.14 ▼1,267.70
Media Library /wp-admin/upload.php2.04 ▼1.2523.61 ▼7.23
Counter Settings /wp-admin/options-general.php?page=my-setting-admin2.0414.11

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: 1 new table, 1 new option
New tables
counter
New WordPress options
widget_aa_counter

Browser metrics Passed 4 tests

A check of browser resources used by AA Visitor Counter Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,903 ▲18115.85 ▼0.187.26 ▲0.6939.44 ▲37.22
Dashboard /wp-admin2,924 ▲706.00 ▼0.16146.12 ▲15.85193.82 ▲27.40
Posts /wp-admin/edit.php2,719 ▲313.24 ▼0.1283.84 ▼2.16211.03 ▲73.45
Add New Post /wp-admin/post-new.php1,740 ▲2921.50 ▲0.74411.91 ▼46.41213.73 ▲30.43
Media Library /wp-admin/upload.php1,731 ▲335.52 ▼0.02120.61 ▼17.54185.68 ▼0.87
Counter Settings /wp-admin/options-general.php?page=my-setting-admin1,0112.4152.08123.08

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/aa-counter/aacounter.php+54
    Undefined index: HTTP_CLIENT_IP
  • Zombie tables detected upon uninstall: 1 table
    • counter
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_aa_counter

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=my-setting-admin
    • > Notice in wp-content/plugins/aa-counter/aacounter.php+54
    Undefined index: HTTP_CLIENT_IP
    • > GET request to /wp-admin/options-general.php?page=my-setting-admin
    • > Notice in wp-content/plugins/aa-counter/aacounter.php+55
    Undefined index: HTTP_X_FORWARDED_FOR
    • > GET request to /wp-admin/options-general.php?page=my-setting-admin
    • > Notice in wp-content/plugins/aa-counter/aacounter.php+81
    Undefined property: stdClass::$countryCode
    • > GET request to /wp-admin/options-general.php?page=my-setting-admin
    • > User deprecated in wp-includes/functions.php+5326
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=my-setting-admin
    • > User deprecated in wp-includes/functions.php+5326
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/aa-counter/aacounter.php on line 46
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/aa-counter/aacounter.php on line 46
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/aa-counter/aacounter.php on line 46

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: visitor counter, aaextention, counter, visitor, aaextension

aa-counter/aacounter.php 92% from 13 tests

Analyzing the main PHP file in "AA Visitor Counter Widget" version 1.0
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("aa-counter.php" instead of "aacounter.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected141 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP15687141

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity4.50
▷ Minimum class complexity2.00
▷ Maximum class complexity7.00
Average method complexity1.88
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin