88% access-watch

Code Review | Access Watch: Security and Traffic Insights

WordPress plugin Access Watch: Security and Traffic Insights scored 88% from 54 tests.

About plugin

  • Plugin page: access-watch
  • Plugin version: 2.0.0-end-of-life...
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.1
  • WordPress version: 5.9.2
  • First release: Feb 8, 2016
  • Latest release: Nov 26, 2018
  • Number of updates: 273
  • Update frequency: every 3.7 days
  • Top authors: znarfor (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

100+ active / 11,272 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼292.29ms] Passed 4 tests

A check of server-side resources used by Access Watch: Security and Traffic Insights
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2253.10 ▲2.52
Dashboard /wp-admin3.57 ▲0.1636.58 ▲2.34
Posts /wp-admin/edit.php3.80 ▲0.1643.35 ▲4.51
Add New Post /wp-admin/post-new.php7.10 ▲0.1394.81 ▼1,173.53
Media Library /wp-admin/upload.php3.51 ▲0.2223.70 ▼0.50
About /wp-admin/admin.php?page=access-watch-about3.4224.07
Access Watch /wp-admin/admin.php?page=access-watch-dashboard3.4223.64

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 400 new files
Database: no new tables, 1 new option
New WordPress options
access_watch_api_key_registered

Browser metrics Passed 4 tests

Checking browser requirements for Access Watch: Security and Traffic Insights
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,797 ▲4416.01 ▲0.305.88 ▼0.232.39 ▼0.07
Dashboard /wp-admin2,923 ▲656.09 ▼0.12120.81 ▼20.62158.53 ▼4.34
Posts /wp-admin/edit.php2,725 ▲403.36 ▲0.0165.01 ▲2.53141.33 ▼2.23
Add New Post /wp-admin/post-new.php1,683 ▲2222.30 ▲6.39416.41 ▼0.52154.65 ▼3.52
Media Library /wp-admin/upload.php1,732 ▲345.53 ▼0.03133.55 ▼8.60180.58 ▼7.12
About /wp-admin/admin.php?page=access-watch-about1,0132.5354.14103.12
Access Watch /wp-admin/admin.php?page=access-watch-dashboard1,0272.5353.70111.93

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/access-watch/feedback.php
    • > /wp-content/plugins/access-watch/index.php
  • 262× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractSyslogHandler' not found in wp-content/plugins/access-watch/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/access-watch/vendor/monolog/monolog/tests/Monolog/Formatter/MongoDBFormatterTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/access-watch/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Processor\\MemoryProcessor' not found in wp-content/plugins/access-watch/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/access-watch/vendor/bouncer/bouncer/tests/AddrTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/access-watch/vendor/monolog/monolog/tests/Monolog/Handler/BufferHandlerTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/access-watch/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/access-watch/vendor/symfony/http-foundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Bouncer\\Cache\\CacheInterface' not found in wp-content/plugins/access-watch/vendor/bouncer/bouncer/src/Cache/AbstractCache.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpFoundation\\Tests\\ResponseTestCase' not found in wp-content/plugins/access-watch/vendor/symfony/http-foundation/Tests/ResponseTest.php:20

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)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed: The official readme.txt might help

access-watch/index.php 85% from 13 tests

This is the main PHP file of "Access Watch: Security and Traffic Insights" version 2.0.0-end-of-life..., providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Version: Plugin version number should only contain digits separated by dots (ex. "1.0.3" instead of "2.0.0-end-of-life...")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("access-watch.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected29,510 lines of code in 365 files:
LanguageFilesBlank linesComment linesLines of code
PHP3346,81413,35327,186
Markdown122970951
SVG300551
JSON700470
CSS1375230
XML48064
JavaScript10133
YAML30025

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity6.32
▷ Minimum class complexity1.00
▷ Maximum class complexity190.00
Average method complexity1.77
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces42
Interfaces16
Traits2
Classes328
▷ Abstract classes113.35%
▷ Concrete classes31796.65%
▷ Final classes00.00%
Methods2,479
▷ Static methods732.94%
▷ Public methods2,15386.85%
▷ Protected methods2339.40%
▷ Private methods933.75%
Functions125
▷ Named functions4132.80%
▷ Anonymous functions8467.20%
Constants148
▷ Global constants53.38%
▷ Class constants14396.62%
▷ Public constants143100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 compressed PNG files occupy 0.12MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/flags3x-5b66f2.png78.85KB78.96KB0.00%
assets/flags1x-0c1db6.png14.47KB14.65KB0.00%
assets/flags2x-1defcd.png31.95KB32.11KB0.00%