84% redirect-modal-based-on-country

Code Review | Redirect Modal Based On Country

WordPress plugin Redirect Modal Based On Country scored84%from 54 tests.

About plugin

  • Plugin page: redirect-modal-ba...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8.0
  • WordPress version: 6.3.1
  • First release: Aug 21, 2021
  • Latest release: Aug 21, 2021
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: hivid (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

60+ active /720 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.76MB] [CPU: ▲1.63ms] Passed 4 tests

Server-side resources used by Redirect Modal Based On Country
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.41178.03 ▲134.41
Dashboard /wp-admin4.18 ▲0.8850.60 ▼1.30
Posts /wp-admin/edit.php4.27 ▲0.9155.89 ▲6.81
Add New Post /wp-admin/post-new.php6.77 ▲0.8896.16 ▼13.32
Media Library /wp-admin/upload.php4.10 ▲0.8846.62 ▲14.32
Redirect Modal Based On Country /wp-admin/options-general.php?page=rmboc_options6.2258.55

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Redirect Modal Based On Country
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,896 ▲13914.19 ▼0.1215.31 ▲13.0640.70 ▼10.56
Dashboard /wp-admin2,221 ▲334.90 ▼0.92114.27 ▲4.5144.43 ▲3.30
Posts /wp-admin/edit.php2,104 ▲152.11 ▲0.0636.38 ▼0.3934.23 ▲3.44
Add New Post /wp-admin/post-new.php1,524 ▼917.67 ▼5.34678.14 ▲87.3760.97 ▲15.06
Media Library /wp-admin/upload.php1,403 ▲184.31 ▲0.0798.63 ▼6.6039.93 ▼4.08
Redirect Modal Based On Country /wp-admin/options-general.php?page=rmboc_options5,4241.9534.5849.67

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% 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
The following issues need your attention
  • 42× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/redirect-modal-based-on-country/vendor/cmb2/includes/helper-functions.php:131
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller_Boxes' not found in wp-content/plugins/redirect-modal-based-on-country/vendor/cmb2/includes/rest-api/CMB2_REST_Controller_Fields.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/redirect-modal-based-on-country/vendor/cmb2/includes/types/CMB2_Type_Taxonomy_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Select' not found in wp-content/plugins/redirect-modal-based-on-country/vendor/cmb2/includes/types/CMB2_Type_Select_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/redirect-modal-based-on-country/redirect-modal-based-on-country.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/redirect-modal-based-on-country/vendor/cmb2/includes/rest-api/CMB2_REST.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/redirect-modal-based-on-country/vendor/cmb2/includes/types/CMB2_Type_Title.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/redirect-modal-based-on-country/vendor/cmb2/includes/CMB2_Hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Counter_Base' not found in wp-content/plugins/redirect-modal-based-on-country/vendor/cmb2/includes/types/CMB2_Type_Textarea.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/redirect-modal-based-on-country/vendor/cmb2/includes/types/CMB2_Type_Colorpicker.php:13

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 is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: geo, ip, redirect, redirect by country, redirect by ip...

redirect-modal-based-on-country/redirect-modal-based-on-country.php Passed 13 tests

The main file in "Redirect Modal Based On Country" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
76 characters long description:
Let your visitors know that your website is also available for their country

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin52,644 lines of code in 247 files:
LanguageFilesBlank linesComment linesLines of code
PO File13214,37518,64632,599
PHP692,3016,9377,579
CSS142501,1944,555
JSON3004,272
JavaScript93636291,473
Sass17306291,411
Markdown32440755

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity17.42
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity3.23
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes77
▷ Abstract classes911.69%
▷ Concrete classes6888.31%
▷ Final classes00.00%
Methods570
▷ Static methods9115.96%
▷ Public methods47182.63%
▷ Protected methods8915.61%
▷ Private methods101.75%
Functions37
▷ Named functions37100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants545.45%
▷ Class constants654.55%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
vendor/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
vendor/cmb2/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
vendor/cmb2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
vendor/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%