77% click-to-call-for-twilio

Code Review | Click-to-Call for Twilio

WordPress plugin Click-to-Call for Twilio scored77%from 54 tests.

About plugin

  • Plugin page: click-to-call-for...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8.1
  • WordPress version: 6.3.1
  • First release: Jul 15, 2019
  • Latest release: Oct 29, 2021
  • Number of updates: 5
  • Update frequency: every 168.0 days
  • Top authors: daswebagency (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

90+ active /2,006 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼6.77ms] Passed 4 tests

An overview of server-side resources used by Click-to-Call for Twilio
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0735.48 ▼4.70
Dashboard /wp-admin3.37 ▲0.0745.66 ▼0.30
Posts /wp-admin/edit.php3.48 ▲0.1346.00 ▼4.16
Add New Post /wp-admin/post-new.php5.97 ▲0.0881.22 ▼17.90
Media Library /wp-admin/upload.php3.29 ▲0.0737.38 ▲2.27

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 2,680 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Click-to-Call for Twilio
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,937 ▲19114.73 ▲0.3610.49 ▲8.6239.85 ▼3.39
Dashboard /wp-admin2,226 ▲354.85 ▼0.07110.54 ▲7.4338.87 ▼5.97
Posts /wp-admin/edit.php2,109 ▲172.04 ▼0.0239.19 ▼2.2533.79 ▼4.05
Add New Post /wp-admin/post-new.php1,531 ▲1223.36 ▲0.25675.10 ▲22.5757.92 ▲2.99
Media Library /wp-admin/upload.php1,408 ▲204.19 ▼0.05112.41 ▲1.4547.53 ▲0.96

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/click-to-call-for-twilio/lib/screen_for_machine.php
    • > /wp-content/plugins/click-to-call-for-twilio/lib/outbound.php
  • 2595× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\InstanceResource' not found in wp-content/plugins/click-to-call-for-twilio/lib/Twilio/Rest/Api/V2010/AccountInstance.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\ListResource' not found in wp-content/plugins/click-to-call-for-twilio/lib/Twilio/TwilioFull/Rest/Preview/Wireless/CommandList.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Options' not found in wp-content/plugins/click-to-call-for-twilio/lib/Twilio/TwilioFull/Rest/Video/V1/RoomOptions.php:50
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\ListResource' not found in wp-content/plugins/click-to-call-for-twilio/lib/Twilio/TwilioFull/Rest/Preview/Sync/ServiceList.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Page' not found in wp-content/plugins/click-to-call-for-twilio/lib/Twilio/TwilioFull/Rest/Api/V2010/Account/OutgoingCallerIdPage.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\InstanceResource' not found in wp-content/plugins/click-to-call-for-twilio/lib/Twilio/Rest/IpMessaging/V1/Service/ChannelInstance.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\ListResource' not found in wp-content/plugins/click-to-call-for-twilio/lib/Twilio/Rest/Api/V2010/Account/ShortCodeList.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Options' not found in wp-content/plugins/click-to-call-for-twilio/lib/Twilio/TwilioFull/Rest/Preview/Marketplace/InstalledAddOnOptions.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\ListResource' not found in wp-content/plugins/click-to-call-for-twilio/lib/Twilio/TwilioFull/Rest/Wireless/V1/RatePlanList.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Options' not found in wp-content/plugins/click-to-call-for-twilio/lib/Twilio/TwilioFull/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsOptions.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: These screenshots need descriptions #1, #2, #3, #4, #5, #6, #7 in click-to-call-for-twilio/assets to your readme.txt
  • Donate link: Invalid url: ""
  • Tags: There are too many tags (12 tag instead of maximum 10)
You can look at the official readme.txt

click-to-call-for-twilio/click-to-call-twilio.php 92% from 13 tests

"Click-to-Call for Twilio" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
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 ("click-to-call-for-twilio.php" instead of "click-to-call-twilio.php")

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
Everything looks great! No dangerous files found in this plugin71,833 lines of code in 1,388 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,38018,84077,67869,909
SVG1311,373
JavaScript42266464
CSS33687

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity2.71
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity1.32
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces139
Interfaces4
Traits0
Classes3,337
▷ Abstract classes38811.63%
▷ Concrete classes2,94988.37%
▷ Final classes00.00%
Methods18,152
▷ Static methods7213.97%
▷ Public methods16,34090.02%
▷ Protected methods1,8009.92%
▷ Private methods120.07%
Functions175
▷ Named functions10.57%
▷ Anonymous functions17499.43%
Constants19
▷ Global constants210.53%
▷ Class constants1789.47%
▷ Public constants17100.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
1 PNG file occupies 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/flags.png69.15KB23.62KB▼ 65.85%