84% swal-alert-for-contact-form-7

Code Review | Swal Alert for Contact Form 7

WordPress plugin Swal Alert for Contact Form 7 scored84%from 54 tests.

About plugin

  • Plugin page: swal-alert-for-co...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.5-5.2.3
  • WordPress version: 6.3.1
  • First release: Sep 29, 2019
  • Latest release: Sep 30, 2019
  • Number of updates: 12
  • Update frequency: N/A
  • Top authors: kektz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /624 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 successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Swal Alert for Contact Form 7
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0138.30 ▼1.51
Dashboard /wp-admin3.31 ▲0.0045.80 ▼14.74
Posts /wp-admin/edit.php3.36 ▲0.0046.06 ▼6.20
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.67 ▼6.89
Media Library /wp-admin/upload.php3.23 ▲0.0034.04 ▼0.88

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Swal Alert for Contact Form 7
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.31 ▼1.066.51 ▲4.6939.83 ▼8.73
Dashboard /wp-admin2,209 ▲274.83 ▼1.05106.58 ▲3.9739.95 ▼2.22
Posts /wp-admin/edit.php2,092 ▼02.05 ▲0.0139.33 ▼2.5734.21 ▼4.27
Add New Post /wp-admin/post-new.php1,520 ▼1423.04 ▼0.32614.99 ▼43.9747.55 ▼5.82
Media Library /wp-admin/upload.php1,388 ▼04.18 ▲0.0194.87 ▼2.1239.84 ▼6.99

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/swal-alert-for-contact-form-7/swalforcf7.php:17

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: response message, contact form 7, popup message

swal-alert-for-contact-form-7/swalforcf7.php 92% from 13 tests

The main PHP file in "Swal Alert for Contact Form 7" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("swal-alert-for-contact-form-7.php" instead of "swalforcf7.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin15 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2008
PHP1497

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.00
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
No PNG files were detected