72% yaurau-ip-blocker

Code Review | Yaurau-Ip-Blocker

WordPress plugin Yaurau-Ip-Blocker scored72%from 54 tests.

About plugin

  • Plugin page: yaurau-ip-blocker
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3+
  • WordPress version: 6.3.1
  • First release: Mar 12, 2018
  • Latest release: Sep 18, 2018
  • Number of updates: 15
  • Update frequency: every 12.7 days
  • Top authors: yaurau (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /643 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼2.48ms] Passed 4 tests

A check of server-side resources used by Yaurau-Ip-Blocker
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0843.70 ▲3.81
Dashboard /wp-admin3.39 ▲0.0845.71 ▼1.51
Posts /wp-admin/edit.php3.50 ▲0.1450.06 ▲3.67
Add New Post /wp-admin/post-new.php5.97 ▲0.0882.29 ▼14.11
Media Library /wp-admin/upload.php3.31 ▲0.0839.85 ▲2.02
Yaurau IP Blocker /wp-admin/options-general.php?page=yaurau_ip_blocker3.2832.55

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

A short overview of filesystem and database impact
Just a few items left to fix
  • You have illegally modified 1 file (0.53KB) outside of "wp-content/plugins/yaurau-ip-blocker/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 24 new files
Database: 3 new tables, 6 new options
New tables
wp_yaurau_ip_blocker
wp_yaurau_ip_blocked
wp_yaurau_ip_repository
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Yaurau-Ip-Blocker
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7114.84 ▲0.431.92 ▲0.1040.36 ▼4.49
Dashboard /wp-admin2,212 ▲244.84 ▼1.01111.85 ▼4.5744.86 ▼1.46
Posts /wp-admin/edit.php2,095 ▲62.00 ▼0.0141.68 ▲1.3835.17 ▼4.20
Add New Post /wp-admin/post-new.php1,533 ▼923.25 ▲4.80591.25 ▼71.5554.22 ▼11.24
Media Library /wp-admin/upload.php1,391 ▼04.22 ▼0.0396.99 ▼17.4443.19 ▼5.11
Yaurau IP Blocker /wp-admin/options-general.php?page=yaurau_ip_blocker8542.0221.9326.70

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=yaurau_ip_blocker
    • > Warning in wp-content/plugins/yaurau-ip-blocker/public/add_IPv4.php+9
    Use of undefined constant delete_plugins - assumed 'delete_plugins' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=yaurau_ip_blocker
    • > Notice in wp-content/plugins/yaurau-ip-blocker/public/add_IPv4.php+13
    Undefined index: firstblockIPv4
    • > GET request to /wp-admin/options-general.php?page=yaurau_ip_blocker
    • > Notice in wp-content/plugins/yaurau-ip-blocker/public/add_IPv4.php+14
    Undefined index: secondblockIPv4
    • > GET request to /wp-admin/options-general.php?page=yaurau_ip_blocker
    • > Notice in wp-content/plugins/yaurau-ip-blocker/public/add_IPv4.php+25
    Undefined index: submitIPv4

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/yaurau-ip-blocker/public/add_IPv6.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/yaurau-ip-blocker/public/add_IPv4.php:9
    • > PHP Warning
      Use of undefined constant Yaurau_IP_Blocker_PAGE - assumed 'Yaurau_IP_Blocker_PAGE' (this will throw an Error in a future version of PHP) in wp-content/plugins/yaurau-ip-blocker/public/add_IPv4.php on line 1
    • > PHP Warning
      Use of undefined constant Yaurau_IP_Blocker_PAGE - assumed 'Yaurau_IP_Blocker_PAGE' (this will throw an Error in a future version of PHP) in wp-content/plugins/yaurau-ip-blocker/public/add_IPv6.php on line 1

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 93% from 29 tests

readme.txt Passed 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
10 plugin tags: ip, permission, bots, ban, spam...

yaurau-ip-blocker/yaurau_ip_blocker.php 85% from 13 tests

The primary PHP file in "Yaurau-Ip-Blocker" version 1.2.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("yaurau-ip-blocker.php" instead of "yaurau_ip_blocker.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 175 characters long)

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
No dangerous file extensions were detected735 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP1986296681
CSS11042
HTML10012

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity2.67
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.28
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods53
▷ Static methods4788.68%
▷ Public methods53100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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