79% rc-geo-access

Code Review | RC Geo Access Plugin

WordPress plugin RC Geo Access Plugin scored79%from 54 tests.

About plugin

  • Plugin page: rc-geo-access
  • Plugin version: 1.48
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.1
  • WordPress version: 6.3.1
  • First release: Oct 8, 2018
  • Latest release: Jan 5, 2023
  • Number of updates: 20
  • Update frequency: every 77.8 days
  • Top authors: rickcurran (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /928 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
Install script ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼6.30ms] Passed 4 tests

A check of server-side resources used by RC Geo Access Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1242.68 ▲2.50
Dashboard /wp-admin3.43 ▲0.1351.24 ▼2.92
Posts /wp-admin/edit.php3.54 ▲0.1946.65 ▼8.94
Add New Post /wp-admin/post-new.php6.01 ▲0.1289.11 ▼10.82
Media Library /wp-admin/upload.php3.35 ▲0.1236.59 ▼2.51
RC GEO Access /wp-admin/options-general.php?page=rc_geo_access3.3033.09

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

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

Browser metrics Passed 4 tests

A check of browser resources used by RC Geo Access Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲3814.35 ▼0.421.65 ▼0.0346.16 ▲0.55
Dashboard /wp-admin2,205 ▲315.61 ▼0.0295.21 ▼9.0541.86 ▼5.36
Posts /wp-admin/edit.php2,104 ▲42.16 ▲0.1535.42 ▼4.4634.52 ▼3.11
Add New Post /wp-admin/post-new.php1,538 ▲1218.14 ▼5.05725.71 ▲74.3573.51 ▲19.72
Media Library /wp-admin/upload.php1,395 ▼54.17 ▲0.0197.47 ▼9.0842.76 ▼3.24
RC GEO Access /wp-admin/options-general.php?page=rc_geo_access2,4972.0233.6759.93

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

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 29 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=rc_geo_access
    • > Notice in wp-content/plugins/rc-geo-access/rc-geo-access.php+121
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=rc_geo_access
    • > Notice in wp-content/plugins/rc-geo-access/rc-geo-access.php+285
    Undefined variable: rc_geo_access_api_key
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=rc_geo_access
    • > Notice in wp-content/plugins/rc-geo-access/rc-geo-access.php+614
    Undefined variable: ch
    • > GET request to /wp-admin/options-general.php?page=rc_geo_access
    • > Warning in wp-content/plugins/rc-geo-access/rc-geo-access.php+613
    curl_exec() expects parameter 1 to be resource, null given
    • > GET request to /wp-admin/options-general.php?page=rc_geo_access
    • > Warning in wp-content/plugins/rc-geo-access/rc-geo-access.php+614
    curl_close() expects parameter 1 to be resource, null given
    • > GET request to /wp-admin/options-general.php?page=rc_geo_access
    • > Notice in wp-content/plugins/rc-geo-access/rc-geo-access.php+295
    Undefined variable: rc_geo_access_country_code

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 add_action() in wp-content/plugins/rc-geo-access/rc-geo-access.php:13

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: login, geolocation, security

rc-geo-access/rc-geo-access.php Passed 13 tests

"RC Geo Access Plugin" version 1.48's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
125 characters long description:
This plugin restricts access to the login page of your WordPress Admin based on the location of the user trying to access it.

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
There were no executable files found in this plugin622 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP120393622

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.44
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%
Functions21
▷ Named functions21100.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
There are no PNG files in this plugin