78% webrtc-softphone

Code Review | WebRTC Softphone

WordPress plugin WebRTC Softphone scored78%from 54 tests.

About plugin

  • Plugin page: webrtc-softphone
  • Plugin version: 0.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-4.9
  • WordPress version: 6.3.1
  • First release: Nov 8, 2017
  • Latest release: Nov 15, 2017
  • Number of updates: 7
  • Update frequency: every 1.0 days
  • Top authors: nabeelee (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,052 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.26ms] Passed 4 tests

Server-side resources used by WebRTC Softphone
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.37 ▼3.46
Dashboard /wp-admin3.31 ▲0.0145.21 ▼1.26
Posts /wp-admin/edit.php3.36 ▲0.0149.42 ▼3.64
Add New Post /wp-admin/post-new.php5.91 ▲0.0386.35 ▼4.68
Media Library /wp-admin/upload.php3.23 ▲0.0134.29 ▲1.45
WebRTC Softphone /wp-admin/options-general.php?page=WebRTC-Softphone3.1832.44

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
websp
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for WebRTC Softphone
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,944 ▲20914.38 ▲0.0111.47 ▲9.6239.08 ▼8.90
Dashboard /wp-admin2,226 ▲385.02 ▼0.88107.08 ▼7.5740.39 ▼1.91
Posts /wp-admin/edit.php2,117 ▲252.30 ▲0.3342.14 ▼1.4434.67 ▼1.81
Add New Post /wp-admin/post-new.php1,531 ▼223.17 ▼0.13647.66 ▼34.0837.85 ▼23.55
Media Library /wp-admin/upload.php1,408 ▲204.41 ▲0.2298.10 ▼6.8043.94 ▼0.29
WebRTC Softphone /wp-admin/options-general.php?page=WebRTC-Softphone1,1612.3548.5726.73

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • websp
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=WebRTC-Softphone
    • > Notice in wp-content/plugins/webrtc-softphone/WebRTC-Softphone.php+86
    Undefined index: sipdomain
    • > GET request to /wp-admin/options-general.php?page=WebRTC-Softphone
    • > Notice in wp-content/plugins/webrtc-softphone/WebRTC-Softphone.php+89
    Undefined index: wss
    • > GET request to /wp-admin/options-general.php?page=WebRTC-Softphone
    • > Notice in wp-content/plugins/webrtc-softphone/WebRTC-Softphone.php+92
    Undefined index: authusername
    • > GET request to /wp-admin/options-general.php?page=WebRTC-Softphone
    • > Notice in wp-content/plugins/webrtc-softphone/WebRTC-Softphone.php+95
    Undefined index: sipusername
    • > GET request to /wp-admin/options-general.php?page=WebRTC-Softphone
    • > Notice in wp-content/plugins/webrtc-softphone/WebRTC-Softphone.php+98
    Undefined index: sippassword

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/webrtc-softphone/WebRTC-Softphone.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

webrtc-softphone/WebRTC-Softphone.php 92% from 13 tests

"WebRTC Softphone" version 0.1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("webrtc-softphone.php" instead of "WebRTC-Softphone.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin10,415 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript51,8591,6509,396
CSS18113757
PHP15926262

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin