89% ip-address-approval

Code Review | IP Address Approval

WordPress plugin IP Address Approval scored89%from 54 tests.

About plugin

  • Plugin page: ip-address-approval
  • Plugin version: 1.8.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Jan 25, 2020
  • Latest release: Oct 22, 2023
  • Number of updates: 75
  • Update frequency: every 18.2 days
  • Top authors: ipapproval (98.67%)Otto42 (2.67%)

Code review

54 tests

User reviews

3 reviews

Install metrics

90+ active /4,284 total downloads

Benchmarks

Plugin footprint 83% 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.12MB] [CPU: ▼7.65ms] Passed 4 tests

This is a short check of server-side resources used by IP Address Approval
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.85 ▼0.6222.31 ▼14.32
Dashboard /wp-admin3.36 ▲0.0544.46 ▼3.96
Posts /wp-admin/edit.php3.41 ▲0.0542.03 ▼0.52
Add New Post /wp-admin/post-new.php5.94 ▲0.0588.30 ▼11.80
Media Library /wp-admin/upload.php3.28 ▲0.0534.27 ▲2.41

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for IP Address Approval
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.35 ▲0.061.54 ▼0.0236.45 ▼4.01
Dashboard /wp-admin2,228 ▲485.58 ▼0.0282.19 ▼3.7935.68 ▼11.58
Posts /wp-admin/edit.php2,133 ▲332.02 ▲0.0438.13 ▼0.2633.52 ▼5.28
Add New Post /wp-admin/post-new.php1,548 ▲2218.47 ▼5.14615.47 ▼49.6464.15 ▲4.11
Media Library /wp-admin/upload.php1,433 ▲334.22 ▲0.0195.43 ▲1.3941.43 ▼3.35

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tags: Too many tags (25 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

ip-address-approval/ip-approval.php 85% from 13 tests

This is the main PHP file of "IP Address Approval" version 1.8.3, 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:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 145 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("ip-address-approval.php" instead of "ip-approval.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin5,283 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP142751873,449
CSS1128491,369
JavaScript33887437
SVG20128

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity18.42
▷ Minimum class complexity2.00
▷ Maximum class complexity89.00
Average method complexity2.95
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes18.33%
▷ Concrete classes1191.67%
▷ Final classes00.00%
Methods107
▷ Static methods109.35%
▷ Public methods9588.79%
▷ Protected methods10.93%
▷ Private methods1110.28%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/searchicon.png0.84KB0.46KB▼ 45.23%