68% cf7-sms-extension

Code Review | SMS Extension for Contact Form 7

WordPress plugin SMS Extension for Contact Form 7 scored68%from 54 tests.

About plugin

  • Plugin page: cf7-sms-extension
  • Plugin version: 1.3.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4
  • WordPress version: 6.3.1
  • First release: Dec 25, 2020
  • Latest release: Nov 10, 2023
  • Number of updates: 20
  • Update frequency: every 52.6 days
  • Top authors: kofimokome (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

400+ active /6,584 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: ▲5.49MB] [CPU: ▲25.29ms] 75% from 4 tests

An overview of server-side resources used by SMS Extension for Contact Form 7
Please fix the following
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.49MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.22 ▲5.7664.58 ▲31.03
Dashboard /wp-admin9.24 ▲5.9474.29 ▲28.52
Posts /wp-admin/edit.php9.24 ▲5.8875.59 ▲21.91
Add New Post /wp-admin/post-new.php10.25 ▲4.37111.54 ▲19.71
Media Library /wp-admin/upload.php9.24 ▲6.0170.18 ▲38.24
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius9.2458.39

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 245 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
fs_active_plugins
fs_accounts
widget_theysaidso_widget
db_upgraded
fs_debug_mode
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for SMS Extension for Contact Form 7
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲8614.13 ▼0.141.61 ▲0.0629.38 ▼10.42
Dashboard /wp-admin2,228 ▲515.55 ▼0.0598.79 ▼1.6246.71 ▲7.47
Posts /wp-admin/edit.php2,134 ▲312.02 ▲0.0536.46 ▼8.2836.33 ▼2.68
Add New Post /wp-admin/post-new.php1,544 ▲823.04 ▼0.27624.81 ▼49.3049.48 ▼0.23
Media Library /wp-admin/upload.php1,433 ▲304.19 ▼0.03100.63 ▼6.7345.15 ▼2.04
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,1011.6527.8728.54

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/cf7-sms-extension/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 9 options in the database
    • fs_debug_mode
    • widget_recent-posts
    • fs_accounts
    • fs_active_plugins
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/cf7-sms-extension/cf7-sms-extension.php
    • > /wp-content/plugins/cf7-sms-extension/views/plugins.php
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/cf7-sms-extension/core/requires.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function kmcf7_sms_extension\\_e() in wp-content/plugins/cf7-sms-extension/views/whatsapp.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/cf7-sms-extension/lib/requires.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Plural' not found in wp-content/plugins/cf7-sms-extension/lib/wordpress_tools/lib/plural/rules/en.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function kmcf7_sms_extension\\get_option() in wp-content/plugins/cf7-sms-extension/views/settings.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressTools' not found in wp-content/plugins/cf7-sms-extension/views/upgrade.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function kmcf7_sms_extension\\_e() in wp-content/plugins/cf7-sms-extension/views/test.php:5

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 Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: contact form 7, contact form, nexmo, sms, twilio...

cf7-sms-extension/cf7-sms-extension.php Passed 13 tests

The main PHP script in "SMS Extension for Contact Form 7" version 1.3.2 is automatically included on every request by WordPress
60 characters long description:
Receive text message notifications when a form is submitted.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected87,586 lines of code in 182 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1210,77614,37349,563
PHP1488,63918,17636,256
CSS1864311,149
Markdown31700590
PO File191128

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity70.62
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces1
Interfaces1
Traits0
Classes67
▷ Abstract classes34.48%
▷ Concrete classes6495.52%
▷ Final classes00.00%
Methods1,438
▷ Static methods21314.81%
▷ Public methods1,02871.49%
▷ Protected methods171.18%
▷ Private methods39327.33%
Functions122
▷ Named functions10989.34%
▷ Anonymous functions1310.66%
Constants148
▷ Global constants10067.57%
▷ Class constants4832.43%
▷ Public constants48100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
16 PNG files occupy 3.99MB with 2.63MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/upgrade4.png192.85KB56.48KB▼ 70.71%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/screenshot-1.png588.56KB150.17KB▼ 74.48%
assets/images/messages.png485.72KB149.33KB▼ 69.26%
assets/images/upgrade3.png174.58KB47.68KB▼ 72.69%