84% country-and-continent-blocker

Code Review | Country and Continent Blocker

WordPress plugin Country and Continent Blocker scored84%from 54 tests.

About plugin

  • Plugin page: country-and-conti...
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0.1
  • WordPress version: 6.3.1
  • First release: Jul 30, 2022
  • Latest release: Aug 2, 2022
  • Number of updates: 4
  • Update frequency: every 1.3 days
  • Top authors: jack111111 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /243 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▲0.45ms] Passed 4 tests

Analyzing server-side resources used by Country and Continent Blocker
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0441.06 ▲2.99
Dashboard /wp-admin3.35 ▲0.0553.58 ▲8.00
Posts /wp-admin/edit.php3.41 ▲0.0443.30 ▼1.89
Add New Post /wp-admin/post-new.php5.94 ▲0.0584.43 ▼6.17
Media Library /wp-admin/upload.php3.28 ▲0.0439.58 ▲6.87

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 7 new options
New WordPress options
user_country
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Country and Continent Blocker
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.35 ▼0.072.06 ▲0.5552.23 ▲14.65
Dashboard /wp-admin2,199 ▲215.58 ▼0.0989.08 ▼10.4971.86 ▲32.01
Posts /wp-admin/edit.php2,119 ▲191.99 ▲0.0035.97 ▼0.6331.72 ▼0.79
Add New Post /wp-admin/post-new.php1,694 ▲16822.37 ▼1.35753.71 ▲75.9052.41 ▼3.17
Media Library /wp-admin/upload.php1,410 ▲134.17 ▼0.0696.31 ▼6.5167.28 ▲20.48

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
  • Zombie WordPress options detected upon uninstall: 7 options
    • user_country
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/country-and-continent-blocker/plugin.php:509

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% 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
5 plugin tags: country block, blocker, firewall, block traffic, ip address

country-and-continent-blocker/plugin.php 92% from 13 tests

This is the main PHP file of "Country and Continent Blocker" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("country-and-continent-blocker.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected440 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP15729440

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.50
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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