62% caret-country-access-limit

Code Review | Caret Country Access Limit

WordPress plugin Caret Country Access Limit scored62%from 54 tests.

About plugin

  • Plugin page: caret-country-acc...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.9.8
  • WordPress version: 6.3.1
  • First release: Apr 16, 2015
  • Latest release: Aug 6, 2018
  • Number of updates: 5
  • Update frequency: every 241.6 days
  • Top authors: caret (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,238 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.89MB] [CPU: ▼37.72ms] Passed 4 tests

Server-side resources used by Caret Country Access Limit
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0748.29 ▲5.68
Dashboard /wp-admin3.06 ▼0.2524.03 ▼22.66
Posts /wp-admin/edit.php3.06 ▼0.3025.89 ▼25.75
Add New Post /wp-admin/post-new.php3.06 ▼2.8323.22 ▼91.04
Media Library /wp-admin/upload.php3.06 ▼0.1725.71 ▼11.43
CaretCountryAccessLimitの設定 /wp-admin/options-general.php?page=CaretCountryAccessLimit3.0626.43

Server storage [IO: ▲0.10MB] [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
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Caret Country Access Limit
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲7213.12 ▼1.174.68 ▲2.7347.68 ▼4.45
Dashboard /wp-admin2,210 ▲244.85 ▼0.09113.56 ▼7.7143.64 ▲3.99
Posts /wp-admin/edit.php2,096 ▲72.01 ▲0.0043.27 ▲4.7840.03 ▲3.77
Add New Post /wp-admin/post-new.php1,536 ▲1623.12 ▲0.19672.98 ▼1.4463.13 ▼6.83
Media Library /wp-admin/upload.php1,395 ▲44.32 ▲0.12108.14 ▼2.5447.72 ▼0.06
CaretCountryAccessLimitの設定 /wp-admin/options-general.php?page=CaretCountryAccessLimit1,0442.0428.13109.18

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=CaretCountryAccessLimit
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=CaretCountryAccessLimit
    • > Notice in wp-content/plugins/caret-country-access-limit/setup.php+94
    Undefined index: error
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=CaretCountryAccessLimit
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+204
    Undefined offset: 0
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=CaretCountryAccessLimit
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+205
    Trying to get property 'guid' of non-object
  • 20 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=CaretCountryAccessLimit
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+221
    Trying to get property 'ID' of non-object
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=CaretCountryAccessLimit
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+222
    Trying to get property 'post_title' of non-object

SRP 0% from 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
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/caret-country-access-limit/batch.php
    • > /wp-content/plugins/caret-country-access-limit/setup.php
  • 47× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined index: COUNTRY_LIMIT_STATUS in wp-content/plugins/caret-country-access-limit/setup.php on line 41
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/caret-country-access-limit/setup.php on line 47
    • > PHP Notice
      Undefined index: COUNTRY_LIMIT_LIST in wp-content/plugins/caret-country-access-limit/setup.php on line 61
    • > PHP Notice
      Undefined variable: argv in wp-content/plugins/caret-country-access-limit/batch.php on line 11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/caret-country-access-limit/setup.php on line 54
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/caret-country-access-limit/setup.php on line 49
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/caret-country-access-limit/setup.php on line 73
    • > PHP Notice
      Undefined index: COUNTRY_LIMIT_EXTRA in wp-content/plugins/caret-country-access-limit/setup.php on line 80
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/caret-country-access-limit/setup.php on line 88
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/caret-country-access-limit/setup.php on line 86

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Screenshot #1 (設定画面) image required
  • Plugin Name: You should set the name of your plugin on the first line ( === caret-country-access-limit === )
You can look at the official readme.txt

caret-country-access-limit/CaretCountryAccessLimit.php 85% from 13 tests

The principal PHP file in "Caret Country Access Limit" v. 1.0.2 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 154 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("caret-country-access-limit.php" instead of "CaretCountryAccessLimit.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected541 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP711639516
JavaScript14025

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity18.67
▷ Minimum class complexity7.00
▷ Maximum class complexity41.00
Average method complexity3.65
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants23
▷ Global constants23100.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.07MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png67.67KB29.24KB▼ 56.80%