10% transmit-sms-two-factor-authentication

Code Review | Transmit SMS Two Factor Authentication

WordPress plugin Transmit SMS Two Factor Authentication scored10%from 54 tests.

About plugin

  • Plugin page: transmit-sms-two-...
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.9.1
  • WordPress version: 6.3.1
  • First release: Dec 22, 2014
  • Latest release: Nov 11, 2015
  • Number of updates: 25
  • Update frequency: every 15.4 days
  • Top authors: adykidd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /792 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/transmit-sms-two-factor-authentication/transmitsms.php+321
    Undefined variable: pagenow

Server metrics [RAM: ▼0.83MB] [CPU: ▼34.78ms] Passed 4 tests

An overview of server-side resources used by Transmit SMS Two Factor Authentication
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1038.99 ▲0.98
Dashboard /wp-admin3.12 ▼0.2223.33 ▼40.74
Posts /wp-admin/edit.php3.13 ▼0.2324.21 ▼17.92
Add New Post /wp-admin/post-new.php3.12 ▼2.7623.15 ▼75.37
Media Library /wp-admin/upload.php3.13 ▼0.1026.87 ▼5.07
Transmit SMS /wp-admin/admin.php?page=transmit-sms3.1324.53
2FA Transmit SMS /wp-admin/admin.php?page=2FA-Transmit-SMS3.1324.31

Server storage [IO: ▲1.01MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 53 new files
Database: 1 new table, 6 new options
New tables
wp_T2FAtransmit_country
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Transmit SMS Two Factor Authentication
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲10213.37 ▼1.421.78 ▼0.0334.08 ▼8.94
Dashboard /wp-admin2,242 ▲544.95 ▼0.90115.38 ▲10.1574.21 ▲30.04
Posts /wp-admin/edit.php2,153 ▲612.23 ▲0.2635.60 ▼6.5437.65 ▼0.47
Add New Post /wp-admin/post-new.php1,707 ▲19322.70 ▲4.87705.63 ▲82.6079.91 ▲28.24
Media Library /wp-admin/upload.php1,431 ▲404.43 ▲0.18100.63 ▼1.4375.69 ▲31.78
Transmit SMS /wp-admin/admin.php?page=transmit-sms280.440.103.82
2FA Transmit SMS /wp-admin/admin.php?page=2FA-Transmit-SMS1,0251.8128.5637.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/transmit-sms-two-factor-authentication/admin/admin-functions.php+19
    Use of undefined constant TSC_PLUGIN_URL - assumed 'TSC_PLUGIN_URL' (this will throw an Error in a future version of PHP)
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=2FA-Transmit-SMS
    • > Warning in wp-content/plugins/transmit-sms-two-factor-authentication/admin/admin-functions.php+19
    Use of undefined constant TSC_PLUGIN_URL - assumed 'TSC_PLUGIN_URL' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=2FA-Transmit-SMS
    • > Notice in wp-content/plugins/transmit-sms-two-factor-authentication/admin/admin-functions.php+52
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/admin.php?page=2FA-Transmit-SMS
    • > Notice in wp-content/plugins/transmit-sms-two-factor-authentication/admin/admin-functions.php+178
    Undefined variable: T2FAOptionThankyouPage

SRP 50% 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
Please take a closer look at the following
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      require_once(T2FA_PLUGIN_DIR/classTransmitAuth.php): failed to open stream: No such file or directory in wp-content/plugins/transmit-sms-two-factor-authentication/settings.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/transmit-sms-two-factor-authentication/transmitsms.php:13
    • > PHP Warning
      Use of undefined constant T2FA_PLUGIN_DIR - assumed 'T2FA_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/transmit-sms-two-factor-authentication/settings.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/transmit-sms-two-factor-authentication/admin/admin-functions.php:2
    • > PHP Warning
      Use of undefined constant T2FA_PLUGIN_DIR - assumed 'T2FA_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/transmit-sms-two-factor-authentication/admin/admin.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'T2FA_PLUGIN_DIR/classTransmitAuth.php' (include_path='.:/usr/share/php') in wp-content/plugins/transmit-sms-two-factor-authentication/settings.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'T2FA_PLUGIN_DIR/admin/admin-functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/transmit-sms-two-factor-authentication/admin/admin.php on line 3
    • > PHP Warning
      require_once(T2FA_PLUGIN_DIR/admin/admin-functions.php): failed to open stream: No such file or directory in wp-content/plugins/transmit-sms-two-factor-authentication/admin/admin.php on line 3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=transmit-sms
    • > Network (severe)
    wp-admin/admin.php?page=transmit-sms - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=2FA-Transmit-SMS
    • > Network (severe)
    http://tsc_plugin_url/assets/images/sms-wp-favicon.png - Failed to load resource: net::ERR_NAME_NOT_RESOLVED

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (http://burst360.com.au/wp-content/uploads/T2faScreenshot/backend.jpg), #2 (http://burst360.com.au/wp-content/uploads/T2faScreenshot/frontend.jpg)
  • Donate link: Please fix this invalid url: ""
The official readme.txt might help

transmit-sms-two-factor-authentication/transmitsms.php 92% from 13 tests

The main PHP file in "Transmit SMS Two Factor Authentication" ver. 1.5 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: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("transmit-sms-two-factor-authentication.php" instead of "transmitsms.php")

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
Everything looks great! No dangerous files found in this plugin12,314 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
CSS471,2636,794
JavaScript35081881,312
Sass1323241,256
LESS1323331,247
PHP71172901,185
SVG100520

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity14.50
▷ Minimum class complexity11.00
▷ Maximum class complexity18.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods45
▷ Static methods00.00%
▷ Public methods3986.67%
▷ Protected methods613.33%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants22
▷ Global constants22100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/info.png4.34KB1.72KB▼ 60.43%
assets/images/success.png1.71KB1.62KB▼ 5.19%
assets/images/sms-wp-favicon.png3.16KB0.79KB▼ 75.05%
assets/images/trash.png0.49KB0.58KB0.00%
assets/images/error.png1.44KB1.43KB0.27%