83% newsletter-sms-smsapi

Code Review | Newsletter SMS - SMSAPI

WordPress plugin Newsletter SMS - SMSAPI scored83%from 54 tests.

About plugin

  • Plugin page: newsletter-sms-sm...
  • Plugin version: 2.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.3-5.8.1
  • WordPress version: 6.3.1
  • First release: Aug 25, 2015
  • Latest release: Apr 13, 2022
  • Number of updates: 66
  • Update frequency: every 36.7 days
  • Top authors: smsapi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,345 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.55MB] [CPU: ▼5.92ms] Passed 4 tests

A check of server-side resources used by Newsletter SMS - SMSAPI
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.21 ▲0.7445.72 ▲4.15
Dashboard /wp-admin3.91 ▲0.5655.78 ▼12.90
Posts /wp-admin/edit.php3.96 ▲0.6052.71 ▲1.44
Add New Post /wp-admin/post-new.php6.43 ▲0.5392.06 ▼10.10
Media Library /wp-admin/upload.php3.77 ▲0.5337.38 ▼2.12
Subscribers /wp-admin/admin.php?page=smsapi-subscribers3.7740.98
Send SMS /wp-admin/admin.php?page=smsapi-send-sms3.7838.76
Settings /wp-admin/admin.php?page=smsapi-settings3.7334.12

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 519 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_smsapi_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Newsletter SMS - SMSAPI
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,902 ▲15213.78 ▼0.448.62 ▲6.8243.11 ▼5.44
Dashboard /wp-admin2,212 ▲325.56 ▼0.1093.30 ▼2.1983.52 ▲41.89
Posts /wp-admin/edit.php2,135 ▲322.01 ▼0.0634.85 ▼6.0833.60 ▼2.36
Add New Post /wp-admin/post-new.php1,706 ▲18022.10 ▼0.85707.39 ▲8.6057.97 ▼11.07
Media Library /wp-admin/upload.php1,429 ▲294.14 ▼0.03107.95 ▼3.7361.90 ▲16.21
Subscribers /wp-admin/admin.php?page=smsapi-subscribers7351.517.5916.92
Send SMS /wp-admin/admin.php?page=smsapi-send-sms8322.1927.3925.57
Settings /wp-admin/admin.php?page=smsapi-settings8462.0024.6925.14

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_smsapi_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 265× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Smsapi\\Client\\Version3\\Feature\\Mms\\MmsFeature' not found in wp-content/plugins/newsletter-sms-smsapi/vendor/smsapi/php-client/src/Feature/Mms/MmsHttpFeature.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'SMSApi\\Api\\ActionFactory' not found in wp-content/plugins/newsletter-sms-smsapi/vendor/smsapi/php-client/smsapi/Api/MmsFactory.php:9
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/newsletter-sms-smsapi/install.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'SMSApi\\Api\\Action\\Contacts\\ContactsAction' not found in wp-content/plugins/newsletter-sms-smsapi/vendor/smsapi/php-client/smsapi/Api/Action/Contacts/ContactEdit.php:13
    • > PHP Warning
      require_once(SMSAPI_PLUGIN_PATH/classes/SmsapiPsrClient.php): failed to open stream: No such file or directory in wp-content/plugins/newsletter-sms-smsapi/classes/SmsapiClient.php on line 20
    • > PHP Warning
      require_once(wp-content/plugins/newsletter-sms-smsapi/vendor/smsapi/php-client/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/newsletter-sms-smsapi/vendor/smsapi/php-client/tests/bootstrap.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'SMSApi\\Api\\Action\\AbstractAction' not found in wp-content/plugins/newsletter-sms-smsapi/vendor/smsapi/php-client/smsapi/Api/Action/Mms/Get.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'SMSApi\\Exception\\SmsapiException' not found in wp-content/plugins/newsletter-sms-smsapi/vendor/smsapi/php-client/smsapi/Exception/ClientException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/newsletter-sms-smsapi/vendor/smsapi/php-client/tests/Unit/Feature/Sms/Bag/BagWithSingleParamsTestCase.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Smsapi\\Client\\Version3\\Feature\\Subusers\\SubusersFeature' not found in wp-content/plugins/newsletter-sms-smsapi/vendor/smsapi/php-client/src/Feature/Subusers/SubusersHttpFeature.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: Screenshot #6 (In 'Subscribers' subtab you can view, edit or remove current subscribers.) image required
You can take inspiration from this readme.txt

newsletter-sms-smsapi/smsapi.php 85% from 13 tests

"Newsletter SMS - SMSAPI" version 2.0.4'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: Name the main plugin file the same as the plugin slug ("newsletter-sms-smsapi.php" instead of "smsapi.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 225 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin20,237 lines of code in 494 files:
LanguageFilesBlank linesComment linesLines of code
PHP4545,3287,24617,646
Markdown1361401,134
JSON1300685
PO File2192237456
CSS2210116
XML26087
YAML59075
Dockerfile14013
make18013
JavaScript121612

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity3.08
▷ Minimum class complexity1.00
▷ Maximum class complexity65.00
Average method complexity1.55
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces110
Interfaces43
Traits8
Classes390
▷ Abstract classes153.85%
▷ Concrete classes37596.15%
▷ Final classes4512.00%
Methods1,810
▷ Static methods1186.52%
▷ Public methods1,58887.73%
▷ Protected methods1085.97%
▷ Private methods1146.30%
Functions102
▷ Named functions8684.31%
▷ Anonymous functions1615.69%
Constants106
▷ Global constants109.43%
▷ Class constants9690.57%
▷ Public constants96100.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
6 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/apl-logo-60x60.png2.68KB2.38KB▼ 11.20%
assets/banner-1544x500.png27.12KB9.91KB▼ 63.45%
assets/icon-128x128.png2.56KB1.56KB▼ 39.07%
assets/icon-256x256.png4.78KB2.34KB▼ 50.98%
assets/images/apl-logo-18x18.png0.71KB0.91KB0.00%