10% wp-real-ip-based-access-control

Code Review | WP Real IP-based Access Control

WordPress plugin WP Real IP-based Access Control scored10%from 54 tests.

About plugin

  • Plugin page: wp-real-ip-based-...
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Apr 13, 2014
  • Latest release: Sep 4, 2014
  • Number of updates: 15
  • Update frequency: every 10.3 days
  • Top authors: hitoy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,191 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > User deprecated in wp-includes/functions.php+5747
    Function add_option was called with an argument that is deprecated since version 2.3.0 with no alternative available.

Server metrics [RAM: ▲0.02MB] [CPU: ▼10.65ms] Passed 4 tests

A check of server-side resources used by WP Real IP-based Access Control
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0136.69 ▼0.43
Dashboard /wp-admin3.34 ▼0.0148.47 ▼15.81
Posts /wp-admin/edit.php3.39 ▲0.0348.99 ▲1.83
Add New Post /wp-admin/post-new.php5.92 ▲0.0382.73 ▼26.39
Media Library /wp-admin/upload.php3.26 ▲0.0335.38 ▲0.03

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
acl_ctrl_addr
widget_recent-posts
widget_recent-comments
acl_ctrl_mode
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Real IP-based Access Control
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.30 ▼1.061.80 ▲0.1542.88 ▲3.21
Dashboard /wp-admin2,207 ▲195.97 ▲1.0898.17 ▼10.8539.81 ▼4.51
Posts /wp-admin/edit.php2,093 ▲42.00 ▲0.0041.46 ▲6.8338.23 ▲5.87
Add New Post /wp-admin/post-new.php1,536 ▼023.09 ▲0.00644.10 ▼12.8056.10 ▲3.25
Media Library /wp-admin/upload.php1,392 ▲74.21 ▲0.0295.04 ▼1.1343.57 ▲0.77
WP Real IP-based ACL /wp-admin/get-real-ip-admin.php260.440.1313.88

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/wp-real-ip-based-access-control/get-real-ip-admin.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-real-ip-based-access-control/get-real-ip.php:101

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/get-real-ip-admin.php
    • > Network (severe)
    wp-admin/get-real-ip-admin.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (Admin Panel) image not found
The official readme.txt is a good inspiration

wp-real-ip-based-access-control/get-real-ip.php 85% from 13 tests

The entry point to "WP Real IP-based Access Control" version 1.3.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 157 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-real-ip-based-access-control.php" instead of "get-real-ip.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
Success! There were no dangerous files found in this plugin173 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP21530126
PO File1131347

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
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%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png27.42KB14.78KB▼ 46.11%
screenshot-1.png51.06KB23.01KB▼ 54.93%