73% wp-twilio-core

Code Review | WP SMS Plugin Notification for WordPress

WordPress plugin WP SMS Plugin Notification for WordPress scored73%from 54 tests.

About plugin

  • Plugin page: wp-twilio-core
  • Plugin version: 1.5.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.3.0
  • WordPress version: 6.3.1
  • First release: Jun 23, 2015
  • Latest release: Nov 2, 2023
  • Number of updates: 91
  • Update frequency: every 33.6 days
  • Top authors: spartac (82.42%)mohsinoffline (18.68%)

Code review

54 tests

User reviews

15 reviews

Install metrics

5,000+ active /170,446 total downloads

Benchmarks

Plugin footprint 65% 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: ▲5.10MB] [CPU: ▲26.19ms] 75% from 4 tests

A check of server-side resources used by WP SMS Plugin Notification for WordPress
Please have a look at the following items
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.10MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.97 ▲5.5065.11 ▲25.74
Dashboard /wp-admin8.99 ▲5.6874.07 ▲24.97
Posts /wp-admin/edit.php8.99 ▲5.6380.28 ▲35.18
Add New Post /wp-admin/post-new.php9.48 ▲3.59106.78 ▲18.86
Media Library /wp-admin/upload.php8.99 ▲5.7677.62 ▲44.36
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius8.9964.28

Server storage [IO: ▲16.56MB] [DB: ▲0.32MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 2,880 new files
Database: no new tables, 12 new options
New WordPress options
fs_active_plugins
widget_recent-posts
db_upgraded
theysaidso_admin_options
fs_accounts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
twl_notification_option
twl_logs
...

Browser metrics Passed 4 tests

A check of browser resources used by WP SMS Plugin Notification for WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,878 ▲11714.72 ▲0.351.85 ▲0.1628.35 ▼11.19
Dashboard /wp-admin2,262 ▲825.61 ▼0.0489.62 ▲3.0746.26 ▲9.06
Posts /wp-admin/edit.php2,165 ▲652.10 ▲0.1040.56 ▲3.2438.22 ▲2.55
Add New Post /wp-admin/post-new.php1,575 ▲4923.02 ▼0.08672.61 ▼19.1355.82 ▲8.51
Media Library /wp-admin/upload.php1,464 ▲674.23 ▼0.04105.00 ▲10.7348.35 ▲5.11
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,0861.6626.0128.52

Uninstaller [IO: ▲0.00MB] [DB: ▲0.31MB] 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
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/wp-twilio-core/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 9 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • fs_debug_mode
    • fs_accounts
    • db_upgraded
    • widget_recent-posts
    • fs_active_plugins
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 2600× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\InstanceContext' not found in wp-content/plugins/wp-twilio-core/twilio-php/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryContext.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Tests\\HolodeckTestCase' not found in wp-content/plugins/wp-twilio-core/twilio-php/tests/Twilio/Integration/Studio/V1/FlowTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Page' not found in wp-content/plugins/wp-twilio-core/twilio-php/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextPage.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\ListResource' not found in wp-content/plugins/wp-twilio-core/twilio-php/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionList.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\ListResource' not found in wp-content/plugins/wp-twilio-core/twilio-php/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeList.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Page' not found in wp-content/plugins/wp-twilio-core/twilio-php/src/Twilio/Rest/Chat/V2/Service/BindingPage.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Page' not found in wp-content/plugins/wp-twilio-core/twilio-php/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayPage.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\InstanceResource' not found in wp-content/plugins/wp-twilio-core/twilio-php/src/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldInstance.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Tests\\HolodeckTestCase' not found in wp-content/plugins/wp-twilio-core/twilio-php/tests/Twilio/Integration/Video/V1/RecordingSettingsTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Tests\\HolodeckTestCase' not found in wp-content/plugins/wp-twilio-core/twilio-php/tests/Twilio/Integration/Preview/Understand/Assistant/Task/FieldTest.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (11 tag instead of maximum 10)
The official readme.txt is a good inspiration

wp-twilio-core/core.php 85% from 13 tests

The entry point to "WP SMS Plugin Notification for WordPress" version 1.5.5 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-twilio-core.php" instead of "core.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin217,541 lines of code in 2,805 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,75248,773149,362198,712
PO File147,1168,61715,647
Markdown1297602,551
CSS144810238
JavaScript33459194
JSON20062
YAML20147
XML33141
make114240
Dockerfile1308
SVG1001

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity4.19
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity1.53
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces357
Interfaces3
Traits0
Classes3,230
▷ Abstract classes33110.25%
▷ Concrete classes2,89989.75%
▷ Final classes20.07%
Methods19,421
▷ Static methods7844.04%
▷ Public methods17,46489.92%
▷ Protected methods1,5668.06%
▷ Private methods3912.01%
Functions274
▷ Named functions13448.91%
▷ Anonymous functions14051.09%
Constants171
▷ Global constants10963.74%
▷ Class constants6236.26%
▷ Public constants62100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
22 PNG files occupy 0.30MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/wpsms-edd.png14.98KB14.21KB▼ 5.13%
freemius/assets/img/bulksms.png5.96KB4.30KB▼ 27.81%
assets/images/aicontentlylogo.png3.51KB1.61KB▼ 54.24%
assets/images/wpsms-bookings.png14.60KB13.79KB▼ 5.57%
assets/images/wpsms-givewp.png13.38KB14.18KB0.00%