72% crsms-contact-form-7-sms-notification

Code Review | CRSMS Contact Form 7 SMS Notification

WordPress plugin CRSMS Contact Form 7 SMS Notification scored72%from 54 tests.

About plugin

  • Plugin page: crsms-contact-for...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.9.2
  • WordPress version: 6.3.1
  • First release: Mar 29, 2022
  • Latest release: Mar 30, 2022
  • Number of updates: 5
  • Update frequency: every 1.6 days
  • Top authors: cloudrebue (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /636 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼1.00ms] Passed 4 tests

A check of server-side resources used by CRSMS Contact Form 7 SMS Notification
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0841.02 ▲0.20
Dashboard /wp-admin3.45 ▲0.1551.08 ▲2.18
Posts /wp-admin/edit.php3.57 ▲0.2151.37 ▲2.46
Add New Post /wp-admin/post-new.php6.05 ▲0.1785.19 ▼7.27
Media Library /wp-admin/upload.php3.38 ▲0.1536.23 ▲0.90
SMS Integration /wp-admin/admin.php?page=cf7isi-options3.3534.00
/wp-admin/index.php?page=cf7-sms-integration-abs-welcome-page3.3532.12

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for CRSMS Contact Form 7 SMS Notification
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3314.54 ▲0.141.73 ▲0.1447.12 ▲0.26
Dashboard /wp-admin2,200 ▲235.68 ▼0.0996.84 ▲10.6743.01 ▼1.12
Posts /wp-admin/edit.php2,102 ▲22.06 ▲0.0836.95 ▼5.4333.65 ▼2.83
Add New Post /wp-admin/post-new.php1,532 ▲623.38 ▲0.42639.66 ▼67.2760.51 ▲5.83
Media Library /wp-admin/upload.php1,405 ▲25.60 ▲1.39112.03 ▲15.6442.18 ▼3.35
SMS Integration /wp-admin/admin.php?page=cf7isi-options9042.8639.0722.63
/wp-admin/index.php?page=cf7-sms-integration-abs-welcome-page9254.3393.5439.07

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/crsms-contact-form-7-sms-notification/template/cf7-conf-footer.php
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/crsms-contact-form-7-sms-notification/template/cf7-template.php:2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/crsms-contact-form-7-sms-notification/admin/class-table-listing.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/crsms-contact-form-7-sms-notification/admin/class-table-listing.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/crsms-contact-form-7-sms-notification/template/cf7-conf-header.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/crsms-contact-form-7-sms-notification/template/welcome-page.php:2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/crsms-contact-form-7-sms-notification/admin/class-table-listing.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/crsms-contact-form-7-sms-notification/template/cf7-settings.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/index.php?page=cf7-sms-integration-abs-welcome-page
    • > Javascript (severe) in unknown
    /wp-admin/js/common.min.js?ver=6.3.1 1:21 Uncaught TypeError: W is not a function
    • > GET request to /wp-admin/index.php?page=cf7-sms-integration-abs-welcome-page
    • > Javascript (severe) in unknown
    /wp-admin/js/svg-painter.js?ver=6.3.1 14:1 Uncaught TypeError: $ is not a function
    • > GET request to /wp-admin/index.php?page=cf7-sms-integration-abs-welcome-page
    • > Javascript (severe) in unknown
    /wp-includes/js/heartbeat.min.js?ver=6.3.1 1:73 Uncaught TypeError: f is not a function
    • > GET request to /wp-admin/index.php?page=cf7-sms-integration-abs-welcome-page
    • > Javascript (severe) in unknown
    /wp-includes/js/wp-auth-check.min.js?ver=6.3.1 1:331 Uncaught TypeError: i is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 16 tag instead of maximum 10
You can look at the official readme.txt

crsms-contact-form-7-sms-notification/index.php 85% from 13 tests

The primary PHP file in "CRSMS Contact Form 7 SMS Notification" version 1.0.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("crsms-contact-form-7-sms-notification.php" instead of "index.php")
  • 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

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin3,578 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript588862,614
PHP12146100963
CSS1061

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity13.33
▷ Minimum class complexity3.00
▷ Maximum class complexity36.00
Average method complexity2.16
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods65
▷ Static methods23.08%
▷ Public methods5584.62%
▷ Protected methods34.62%
▷ Private methods710.77%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants675.00%
▷ Class constants225.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.33MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icon-256x256.png6.79KB2.49KB▼ 63.30%
screenshot-2.png110.42KB32.77KB▼ 70.33%
logo.png6.79KB2.49KB▼ 63.30%
screenshot-1.png61.59KB18.00KB▼ 70.78%
banner-772x250.png157.32KB57.64KB▼ 63.36%