94% swe-country-code-field-gf-add-on

Code Review | SWE Country Code Field GF Add-On

WordPress plugin SWE Country Code Field GF Add-On scored 94% from 54 tests.

About plugin

  • Plugin page: swe-country-code-...
  • Plugin version: 2.1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.6
  • WordPress version: 5.8.1
  • First release: Feb 28, 2020
  • Latest release: Dec 15, 2020
  • Number of updates: 5
  • Update frequency: every 59.6 days
  • Top authors: sanjaywp (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active / 2,515 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼148.38ms] Passed 4 tests

An overview of server-side resources used by SWE Country Code Field GF Add-On
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1232.44 ▲10.48
Dashboard /wp-admin3.06 ▲0.0142.52 ▼8.75
Posts /wp-admin/edit.php3.12 ▲0.0144.52 ▲0.13
Add New Post /wp-admin/post-new.php5.42 ▼0.0188.29 ▼585.03
Media Library /wp-admin/upload.php3.01 ▲0.0032.83 ▲0.13

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by SWE Country Code Field GF Add-On
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.82 ▲0.308.49 ▼1.3649.05 ▼2.95
Dashboard /wp-admin2,970 ▲375.89 ▼0.08135.61 ▼6.66114.08 ▼3.20
Posts /wp-admin/edit.php2,736 ▼02.69 ▼0.0063.37 ▼1.5191.99 ▼2.75
Add New Post /wp-admin/post-new.php1,872 ▲28119.13 ▲0.38371.28 ▲3.74100.94 ▼16.77
Media Library /wp-admin/upload.php1,807 ▼05.04 ▲0.02160.58 ▲12.97114.11 ▼4.33

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'GFForms' not found in wp-content/plugins/swe-country-code-field-gf-add-on/class-swegfcountycodeaddon.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/swe-country-code-field-gf-add-on/swe-country-code-gfaddon.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: phone code, gf addons for ph with country code, phone code with country flag, phone number with international country code

swe-country-code-field-gf-add-on/swe-country-code-gfaddon.php 85% from 13 tests

The primary PHP file in "SWE Country Code Field GF Add-On" version 2.1.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("swe-country-code-field-gf-add-on.php" instead of "swe-country-code-gfaddon.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin1,805 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript12981,393
CSS111260
PHP35391152

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.33
▷ Minimum class complexity2.00
▷ Maximum class complexity9.00
Average method complexity1.93
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods14
▷ Static methods214.29%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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.06MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
css/flags16.png61.80KB19.90KB▼ 67.79%