84% limit-login-countries

Code Review | Limit Login Countries

WordPress plugin Limit Login Countries scored84%from 54 tests.

About plugin

  • Plugin page: limit-login-count...
  • Plugin version: 0.6.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.0
  • WordPress version: 6.3.1
  • First release: Oct 20, 2013
  • Latest release: Sep 16, 2014
  • Number of updates: 13
  • Update frequency: every 25.6 days
  • Top authors: wedi (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

50+ active /5,212 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.11MB] [CPU: ▼18.79ms] Passed 4 tests

Analyzing server-side resources used by Limit Login Countries
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▼0.0140.53 ▼19.58
Dashboard /wp-admin3.33 ▲0.0253.17 ▼9.80
Posts /wp-admin/edit.php3.38 ▼0.4749.95 ▼10.04
Add New Post /wp-admin/post-new.php5.91 ▲0.0290.73 ▼35.73
Media Library /wp-admin/upload.php3.25 ▲0.0236.73 ▼6.55
Login Countries /wp-admin/options-general.php?page=limit-login-countries4.5337.24

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Limit Login Countries
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.28 ▼0.723.94 ▲1.5642.75 ▼6.89
Dashboard /wp-admin2,210 ▲285.85 ▼0.05102.36 ▼14.9139.32 ▼8.59
Posts /wp-admin/edit.php2,096 ▲41.99 ▼0.0037.52 ▼0.5536.24 ▲1.20
Add New Post /wp-admin/post-new.php1,536 ▲1523.24 ▲0.32672.81 ▲10.0849.17 ▼9.38
Media Library /wp-admin/upload.php1,395 ▲104.16 ▼0.0399.56 ▼27.8145.67 ▼11.36
Login Countries /wp-admin/options-general.php?page=limit-login-countries9512.4532.1669.27

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% 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)
The smoke test was a success, however most plugin functionality was not tested

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× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/limit-login-countries/limit-login-countries.php:47

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
2 plugin tags: login, security

limit-login-countries/limit-login-countries.php Passed 13 tests

"Limit Login Countries" version 0.6.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
126 characters long description:
This plugin gives you the ability to limit WordPress admin logins based on the country the visitor's IP address is located in.

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
Good job! No executable or dangerous file extensions detected13,239 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP712024510,255
JavaScript114802,9301,543
PO File1287798642
Pascal2621,690380
Markdown1600249
CSS817170

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity7.60
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity2.14
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods30
▷ Static methods2066.67%
▷ Public methods2583.33%
▷ Protected methods310.00%
▷ Private methods26.67%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/TextExt/css/close.png0.40KB0.23KB▼ 41.38%
vendor/TextExt/css/arrow.png0.17KB0.10KB▼ 42.94%