10% gna-contact-form-7-sms

Code Review | GNA Contact Form 7 SMS

WordPress plugin GNA Contact Form 7 SMS scored10%from 54 tests.

About plugin

  • Plugin page: gna-contact-form-...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.7
  • WordPress version: 6.3.1
  • First release: Feb 1, 2016
  • Latest release: Sep 5, 2016
  • Number of updates: 32
  • Update frequency: every 9.9 days
  • Top authors: chris_dev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,459 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method GNA_ContactForm7SMS::activate_handler() should not be called statically

Server metrics [RAM: ▲0.02MB] [CPU: ▼1.13ms] Passed 4 tests

A check of server-side resources used by GNA Contact Form 7 SMS
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0240.87 ▲2.53
Dashboard /wp-admin3.33 ▲0.0257.26 ▲1.12
Posts /wp-admin/edit.php3.44 ▲0.0954.70 ▲5.34
Add New Post /wp-admin/post-new.php5.91 ▲0.0293.17 ▼11.88
Media Library /wp-admin/upload.php3.25 ▲0.0241.26 ▲3.72

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

GNA Contact Form 7 SMS: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲6914.64 ▲0.391.91 ▼0.1545.19 ▲3.60
Dashboard /wp-admin2,221 ▲184.90 ▼1.00105.73 ▼4.2281.97 ▲38.75
Posts /wp-admin/edit.php2,121 ▲212.00 ▼0.0435.90 ▼1.9030.69 ▼3.12
Add New Post /wp-admin/post-new.php1,542 ▲523.12 ▼0.02777.47 ▲115.6964.48 ▲1.08
Media Library /wp-admin/upload.php1,403 ▲64.27 ▲0.02115.82 ▲11.77116.14 ▲68.34

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method GNA_ContactForm7SMS::deactivate_handler() should not be called statically
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
Please fix the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/gna-contact-form-7-sms/templates/default.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gna-contact-form-7-sms/inc/gna-contact-form-7-sms-config.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GNA_ContactForm7SMS_Admin_Menu' not found in wp-content/plugins/gna-contact-form-7-sms/admin/gna-contact-form-7-sms-admin-settings-menu.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Donate link: Invalid url: "none"
The official readme.txt is a good inspiration

gna-contact-form-7-sms/gna-contact-form-7-sms.php Passed 13 tests

The principal PHP file in "GNA Contact Form 7 SMS" v. 1.0.5 is loaded by WordPress automatically on each request
67 characters long description:
Send SMS from your existing Contact Form 7 plugin using SMS Global.

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
No dangerous file extensions were detected552 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP78747506
CSS14046

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity8.40
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods55
▷ Static methods47.27%
▷ Public methods55100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
3 PNG files occupy 0.07MB with 0.05MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/gna_20x20.png2.98KB0.33KB▼ 88.89%
assets/images/screenshot-2.png41.92KB18.39KB▼ 56.13%
assets/images/screenshot-1.png27.22KB12.85KB▼ 52.80%