10% aa-counter

Code Review | AA Visitor Counter Widget

WordPress plugin AA Visitor Counter Widget scored10%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: 6.3.1
  • 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

60+ active /7,557 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
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: ▼1.84MB] [CPU: ▼47.58ms] Passed 4 tests

An overview of server-side resources used by AA Visitor Counter Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.378.66 ▼30.95
Dashboard /wp-admin2.19 ▼1.1210.80 ▼38.36
Posts /wp-admin/edit.php2.19 ▼1.1610.64 ▼38.20
Add New Post /wp-admin/post-new.php2.19 ▼3.7010.32 ▼82.82
Media Library /wp-admin/upload.php2.19 ▼1.048.70 ▼24.56
Counter Settings /wp-admin/options-general.php?page=my-setting-admin2.199.92

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 2 new files
Database: 1 new table, 7 new options
New tables
counter
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_aa_counter
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

AA Visitor Counter Widget: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲4914.10 ▼0.491.72 ▲0.1437.50 ▼7.40
Dashboard /wp-admin2,211 ▲375.61 ▼0.0191.42 ▲6.9444.43 ▲6.61
Posts /wp-admin/edit.php2,119 ▲222.02 ▲0.0535.33 ▼1.1839.35 ▲7.80
Add New Post /wp-admin/post-new.php1,387 ▼14121.75 ▼1.36556.11 ▼127.4953.38 ▼4.40
Media Library /wp-admin/upload.php1,410 ▲134.18 ▼0.1296.94 ▼18.5041.37 ▼2.47
Counter Settings /wp-admin/options-general.php?page=my-setting-admin7672.1624.3428.68

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/aa-counter/aacounter.php+54
    Undefined index: HTTP_CLIENT_IP
  • The uninstall procedure failed, leaving 1 table in the database
    • counter
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_aa_counter
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

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+5463
    Function 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+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > 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
      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 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 | A shallow check that no browser errors were triggered
No browser issues were found

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: aaextention, counter, aaextension, visitor, visitor counter

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

"AA Visitor Counter Widget" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • 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 a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin141 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP15687141

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
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

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin