62% whats-going-on

Code Review | What's going on

WordPress plugin What's going on scored 62% from 54 tests.

About plugin

  • Plugin page: whats-going-on
  • Plugin version: 1.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Aug 26, 2020
  • Latest release: Jun 23, 2022
  • Number of updates: 20
  • Update frequency: every 33.7 days
  • Top authors: jaimenj (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 722 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.40MB] [CPU: ▼2.68ms] Passed 4 tests

Analyzing server-side resources used by What's going on
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4343.29 ▲4.08
Dashboard /wp-admin3.73 ▲0.4348.51 ▼1.16
Posts /wp-admin/edit.php3.78 ▲0.4349.60 ▼1.69
Add New Post /wp-admin/post-new.php6.25 ▲0.3685.18 ▼10.12
Media Library /wp-admin/upload.php3.59 ▲0.3635.83 ▲2.25
What's going on /wp-admin/tools.php?page=whats-going-on3.6936.54

Server storage [IO: ▲7.97MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Please try to fix the following items
  • You have illegally modified 1 file (19.09KB) outside of "wp-content/plugins/whats-going-on/" and "wp-content/uploads/"
    • (new file) waf-going-on.php
Filesystem: 72 new files
Database: 3 new tables, 21 new options
New tables
wp_whats_going_on_bans
wp_whats_going_on
wp_whats_going_on_block
New WordPress options
wgo_days_to_store
can_compress_scripts
wgo_notify_requests_more_than_3sd
theysaidso_admin_options
wgo_notify_requests_more_than_sd
wgo_limit_requests_per_minute
wgo_notify_requests_more_than_2sd
wgo_autoreload_datatables
wgo_db_version
wgo_notification_email
...

Browser metrics Passed 4 tests

Checking browser requirements for What's going on
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲10114.74 ▲0.362.18 ▲0.5543.12 ▲2.62
Dashboard /wp-admin2,219 ▲285.80 ▼0.0694.20 ▼14.1543.06 ▲0.62
Posts /wp-admin/edit.php2,105 ▲162.06 ▲0.0738.98 ▲2.6036.11 ▲3.92
Add New Post /wp-admin/post-new.php1,540 ▼223.32 ▲5.03676.98 ▲58.0349.91 ▼1.70
Media Library /wp-admin/upload.php1,401 ▲164.32 ▲0.0896.62 ▼2.3240.64 ▼3.27
What's going on /wp-admin/tools.php?page=whats-going-on5,0668.05298.6065.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/whats-going-on/whats-going-on.php+268
    file_get_contents(.user.ini): failed to open stream: No such file or directory
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_recent-comments
    • wgo_waf_installed
    • theysaidso_admin_options
    • wgo_autoreload_datatables
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • wgo_notify_requests_less_than_x_percent

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/tools.php?page=whats-going-on
    • > Warning in wp-content/plugins/whats-going-on/view/sub-main-chart.php+13
    Use of undefined constant WGO_WP_UPLOAD_DIR - assumed 'WGO_WP_UPLOAD_DIR' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/tools.php?page=whats-going-on
    • > Warning in wp-content/plugins/whats-going-on/view/sub-main-chart.php+243
    Division by zero
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=whats-going-on
    • > Notice in wp-content/plugins/whats-going-on/view/sub-suspicious-behaviors.php+78
    Undefined offset: 0
  • 20 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=whats-going-on
    • > Notice in wp-content/plugins/whats-going-on/view/sub-suspicious-behaviors.php+82
    Trying to get property 'times' of non-object
  • 20 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=whats-going-on
    • > Notice in wp-content/plugins/whats-going-on/view/sub-suspicious-behaviors.php+84
    Trying to get property 'remote_ip' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=whats-going-on
    • > Notice in wp-content/plugins/whats-going-on/view/sub-suspicious-behaviors.php+78
    Undefined offset: 1
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=whats-going-on
    • > Notice in wp-content/plugins/whats-going-on/view/sub-suspicious-behaviors.php+78
    Undefined offset: 2
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=whats-going-on
    • > Notice in wp-content/plugins/whats-going-on/view/sub-suspicious-behaviors.php+78
    Undefined offset: 3
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=whats-going-on
    • > Notice in wp-content/plugins/whats-going-on/view/sub-suspicious-behaviors.php+78
    Undefined offset: 4
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=whats-going-on
    • > Notice in wp-content/plugins/whats-going-on/view/sub-suspicious-behaviors.php+78
    Undefined offset: 5
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=whats-going-on
    • > Notice in wp-content/plugins/whats-going-on/view/sub-suspicious-behaviors.php+78
    Undefined offset: 6
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=whats-going-on
    • > Notice in wp-content/plugins/whats-going-on/view/sub-suspicious-behaviors.php+78
    Undefined offset: 7
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=whats-going-on
    • > Notice in wp-content/plugins/whats-going-on/view/sub-suspicious-behaviors.php+78
    Undefined offset: 8
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=whats-going-on
    • > Notice in wp-content/plugins/whats-going-on/view/sub-suspicious-behaviors.php+78
    Undefined offset: 9

SRP 0% 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
  • 27× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/whats-going-on/view/sub-popup-info.php
    • > /wp-content/plugins/whats-going-on/view/sub-banned-ips.php
    • > /wp-content/plugins/whats-going-on/view/ajax-last-urls-doing-404s.php
    • > /wp-content/plugins/whats-going-on/view/sub-unique-ips.php
    • > /wp-content/plugins/whats-going-on/view/whats-going-on-view.php
    • > /wp-content/plugins/whats-going-on/whats-going-on-messages.php
    • > /wp-content/plugins/whats-going-on/whats-going-on-ajax-controller.php
    • > /wp-content/plugins/whats-going-on/uninstall.php
    • > /wp-content/plugins/whats-going-on/view/ajax-last-blocks.php
    • > /wp-content/plugins/whats-going-on/view/ajax-last-ips-doing-404s.php
  • 16× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant WGO_WP_UPLOAD_DIR - assumed 'WGO_WP_UPLOAD_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/whats-going-on/waf-going-on.php on line 66
    • > PHP Warning
      Use of undefined constant WGO_WP_UPLOAD_DIR - assumed 'WGO_WP_UPLOAD_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/whats-going-on/waf-going-on.php on line 65
    • > PHP Warning
      Use of undefined constant WGO_WP_UPLOAD_DIR - assumed 'WGO_WP_UPLOAD_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/whats-going-on/waf-going-on.php on line 61
    • > PHP Warning
      Use of undefined constant WGO_DB_PASSWORD - assumed 'WGO_DB_PASSWORD' (this will throw an Error in a future version of PHP) in wp-content/plugins/whats-going-on/waf-going-on.php on line 83
    • > PHP Warning
      include_once(): Failed opening 'WGO_PLUGIN_DIR_PATHlib/geoip2.phar' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/whats-going-on/waf-going-on.php on line 12
    • > PHP Warning
      Use of undefined constant WGO_DB_HOST - assumed 'WGO_DB_HOST' (this will throw an Error in a future version of PHP) in wp-content/plugins/whats-going-on/waf-going-on.php on line 83
    • > PHP Warning
      Use of undefined constant WGO_TABLE_PREFIX - assumed 'WGO_TABLE_PREFIX' (this will throw an Error in a future version of PHP) in wp-content/plugins/whats-going-on/waf-going-on.php on line 84
    • > PHP Warning
      Use of undefined constant WGO_DB_NAME - assumed 'WGO_DB_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/whats-going-on/waf-going-on.php on line 84
    • > PHP Warning
      mysqli::__construct(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in wp-content/plugins/whats-going-on/waf-going-on.php on line 83
    • > PHP Warning
      Use of undefined constant WGO_WP_UPLOAD_DIR - assumed 'WGO_WP_UPLOAD_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/whats-going-on/waf-going-on.php on line 63

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: firewall, waf, wordpress, security

whats-going-on/whats-going-on.php Passed 13 tests

The primary PHP file in "What's going on" version 1.3 is used by WordPress to initiate all plugin functionality
98 characters long description:
A tiny WAF, a tool for control and showing what kind of requests are being made to your WordPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected13,300 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
JSON2008,975
PHP284731823,263
JavaScript876120660
Markdown31060237
Sass1251134
CSS3121231

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity37.50
▷ Minimum class complexity2.00
▷ Maximum class complexity88.00
Average method complexity4.04
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods96
▷ Static methods88.33%
▷ Public methods4546.88%
▷ Protected methods00.00%
▷ Private methods5153.12%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
17 PNG files occupy 0.71MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png108.99KB37.00KB▼ 66.05%
assets/screenshot-8.png33.68KB33.65KB0.11%
assets/icon-128x128.png12.19KB2.79KB▼ 77.12%
assets/screenshot-7.png57.64KB57.65KB0.00%
images/sort_both.png0.20KB0.29KB0.00%