78% ip-blacklist-cloudflare

Code Review | IP Blacklist for Cloudflare

WordPress plugin IP Blacklist for Cloudflare scored78%from 54 tests.

About plugin

  • Plugin page: ip-blacklist-clou...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.8
  • WordPress version: 6.3.1
  • First release: Feb 21, 2020
  • Latest release: Sep 11, 2021
  • Number of updates: 10
  • Update frequency: every 56.8 days
  • Top authors: MillerMediaNow (90%)millermediadev (20%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /728 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼6.80ms] Passed 4 tests

Server-side resources used by IP Blacklist for Cloudflare
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.1545.12 ▼3.09
Dashboard /wp-admin3.73 ▲0.1053.95 ▼14.48
Posts /wp-admin/edit.php3.78 ▲0.1052.11 ▲3.10
Add New Post /wp-admin/post-new.php6.25 ▲0.1090.70 ▼12.73
Media Library /wp-admin/upload.php3.59 ▲0.1045.90 ▲8.98

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for IP Blacklist for Cloudflare
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.28 ▼0.091.88 ▲0.0647.27 ▲1.98
Dashboard /wp-admin2,210 ▲395.71 ▲0.0285.43 ▼10.1176.91 ▲33.49
Posts /wp-admin/edit.php2,118 ▲181.99 ▼0.0739.19 ▲4.1034.98 ▼6.44
Add New Post /wp-admin/post-new.php1,692 ▲16122.50 ▼0.74707.83 ▲62.4464.11 ▲11.93
Media Library /wp-admin/upload.php1,418 ▲214.16 ▼0.06107.96 ▲6.1046.36 ▲3.89

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ip-blacklist-cloudflare/classes/CloudflareAPIController.php
    • > /wp-content/plugins/ip-blacklist-cloudflare/classes/SiteSettings.php
    • > /wp-content/plugins/ip-blacklist-cloudflare/classes/Plugin.php
    • > /wp-content/plugins/ip-blacklist-cloudflare/classes/Helpers.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/ip-blacklist-cloudflare/ip-blacklist-for-cloudflare.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CFIP_SiteSettings' not found in wp-content/plugins/ip-blacklist-cloudflare/views/SiteSettingsView.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
10 plugin tags: passwords, brute force, username, profile, security...

ip-blacklist-cloudflare/ip-blacklist-for-cloudflare.php 92% from 13 tests

The entry point to "IP Blacklist for Cloudflare" version 1.0.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ip-blacklist-cloudflare.php" instead of "ip-blacklist-for-cloudflare.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin866 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP6133309691
JavaScript12311113
CSS15162

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity24.25
▷ Minimum class complexity6.00
▷ Maximum class complexity39.00
Average method complexity3.58
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods36
▷ Static methods00.00%
▷ Public methods3597.22%
▷ Protected methods00.00%
▷ Private methods12.78%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
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
assets/media/cf-facebook-card.png1.30KB0.44KB▼ 65.84%