10% floodwarningsapi

Code Review | FloodWarningsAPI

WordPress plugin FloodWarningsAPI scored10%from 54 tests.

About plugin

  • Plugin page: floodwarningsapi
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Sep 16, 2014
  • Latest release: Sep 16, 2014
  • Number of updates: 4
  • Update frequency: every 1.3 days
  • Top authors: JMTGServices (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /606 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/floodwarningsapi/fw_api.php+342
    Undefined variable: hard

Server metrics [RAM: ▲0.06MB] [CPU: ▼6.77ms] Passed 4 tests

This is a short check of server-side resources used by FloodWarningsAPI
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1037.47 ▼2.71
Dashboard /wp-admin3.38 ▲0.0345.79 ▼17.36
Posts /wp-admin/edit.php3.43 ▲0.0743.68 ▼0.30
Add New Post /wp-admin/post-new.php5.96 ▲0.0784.56 ▼6.69
Media Library /wp-admin/upload.php3.30 ▲0.0739.31 ▲4.80
FloodWarningsAPI /wp-admin/options-general.php?page=fwapi3.2732.20
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=flood_warning3.3039.92
Add New /wp-admin/post-new.php?post_type=flood_warning3.4455.85
FloodWarnings /wp-admin/edit.php?post_type=flood_warning3.3540.78

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 11 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
fw_radius
can_compress_scripts
category_children
theysaidso_admin_options
fw_latitude_fieldname
fw_longitude_fieldname
widget_recent-comments
...

Browser metrics Passed 4 tests

An overview of browser requirements for FloodWarningsAPI
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲4114.23 ▼0.531.70 ▼0.2639.24 ▼4.16
Dashboard /wp-admin2,227 ▲505.66 ▼0.0086.30 ▼4.4935.43 ▼2.18
Posts /wp-admin/edit.php2,132 ▲321.99 ▼0.0436.86 ▼0.7131.00 ▼5.31
Add New Post /wp-admin/post-new.php1,555 ▲2923.27 ▲0.12603.76 ▼15.8867.03 ▲9.97
Media Library /wp-admin/upload.php1,435 ▲384.22 ▲0.0196.38 ▼0.6743.72 ▼0.38
FloodWarningsAPI /wp-admin/options-general.php?page=fwapi8411.9928.3928.43
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=flood_warning1,4902.1332.6136.54
Add New /wp-admin/post-new.php?post_type=flood_warning2,4217.60188.8272.43
FloodWarnings /wp-admin/edit.php?post_type=flood_warning1,1461.9837.1930.13

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/floodwarningsapi/fw_api.php+374
    Trying to access array offset on value of type null
  • This plugin has failed uninstalling correctly, leaving 4 files (0.03MB) in the plugin directory
    • (new file) readme.txt
    • (new file) 1.0/fw_api.php
    • (new file) fw_api.php
    • (new file) 1.0/readme.txt
  • This plugin did not uninstall successfully, leaving 11 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • fw_latitude_fieldname
    • widget_recent-comments
    • fw_radius
    • widget_recent-posts
    • fw_longitude_fieldname
    • can_compress_scripts
    • category_children
    • fw_api_key_shoothill
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_option() in wp-content/plugins/floodwarningsapi/fw_api.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_option() in wp-content/plugins/floodwarningsapi/1.0/fw_api.php:42

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 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from), #2 (This is the second screen shot)
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === floodwarningsapi === )
The official readme.txt is a good inspiration

floodwarningsapi/fw_api.php 92% from 13 tests

The entry point to "FloodWarningsAPI" version 1.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("floodwarningsapi.php" instead of "fw_api.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 plugin257 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP18151257

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants18
▷ Global constants18100.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
There were not PNG files found in your plugin