64% moceanapi-sendsms

Code Review | MoceanAPI SendSMS

WordPress plugin MoceanAPI SendSMS scored64%from 54 tests.

About plugin

  • Plugin page: moceanapi-sendsms
  • Plugin version: 1.4.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.0
  • WordPress version: 6.3.1
  • First release: Mar 19, 2019
  • Latest release: Sep 12, 2023
  • Number of updates: 39
  • Update frequency: every 42.0 days
  • Top authors: moceanapiplugin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,342 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲1.01MB] [CPU: ▲15.14ms] Passed 4 tests

This is a short check of server-side resources used by MoceanAPI SendSMS
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.41 ▲0.9453.10 ▲14.73
Dashboard /wp-admin4.37 ▲1.071,368.14 ▲1,318.23
Posts /wp-admin/edit.php4.41 ▲1.0675.48 ▲24.14
Add New Post /wp-admin/post-new.php6.88 ▲0.9999.79 ▲4.36
Media Library /wp-admin/upload.php4.28 ▲1.0552.78 ▲17.33
Scheduled Actions /wp-admin/tools.php?page=action-scheduler4.4468.70
/wp-admin/admin.php?page=moceansms-download-file4.2545.39
MoceanAPI SMS Settings /wp-admin/options-general.php?page=moceansms-woocoommerce-setting4.6553.16
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius4.6150.53

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 402 new files
Database: 5 new tables, 25 new options
New tables
wp_actionscheduler_logs
wp_actionscheduler_claims
wp_actionscheduler_actions
wp_actionscheduler_groups
moceansms_wc_send_sms_outbox
New WordPress options
moceansms_admin_setting
moceansms_smsoutbox_setting
schema-ActionScheduler_LoggerSchema
widget_theysaidso_widget
widget_recent-comments
moceansms_multivendor_setting
fs_accounts
action_scheduler_hybrid_store_demarkation
widget_recent-posts
db_upgraded
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for MoceanAPI SendSMS
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,022 ▲26114.63 ▲0.251.74 ▼0.0131.17 ▼11.56
Dashboard /wp-admin2,425 ▲2516.42 ▲0.79113.61 ▲24.1542.45 ▼4.40
Posts /wp-admin/edit.php2,318 ▲2183.57 ▲1.5652.38 ▲13.1836.35 ▼1.25
Add New Post /wp-admin/post-new.php1,573 ▲4718.36 ▼4.73640.29 ▲7.5944.72 ▼21.98
Media Library /wp-admin/upload.php1,457 ▲604.37 ▲0.2081.92 ▼25.3948.14 ▲2.04
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,5573.5440.5733.11
/wp-admin/admin.php?page=moceansms-download-file6971.689.7722.91
MoceanAPI SMS Settings /wp-admin/options-general.php?page=moceansms-woocoommerce-setting1,1993.2942.5685.07
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,2683.2843.7725.64

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/moceanapi-sendsms/lib/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • The uninstall procedure failed, leaving 5 tables in the database
    • wp_actionscheduler_claims
    • moceansms_wc_send_sms_outbox
    • wp_actionscheduler_actions
    • wp_actionscheduler_groups
    • wp_actionscheduler_logs
  • Zombie WordPress options were found after uninstall: 23 options
    • db_upgraded
    • moceansms_admin_setting
    • can_compress_scripts
    • fs_debug_mode
    • moceansms_help_setting
    • schema-ActionScheduler_LoggerSchema
    • fs_gdpr
    • fs_active_plugins
    • widget_theysaidso_widget
    • widget_recent-comments
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following items
  • 114× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Abstract_Moceansms_Multivendor' not found in wp-content/plugins/moceanapi-sendsms/includes/multivendor/managers/class-moceanapi-multivendor-wc-marketplace-manager.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Action' not found in wp-content/plugins/moceanapi-sendsms/lib/action-scheduler/classes/actions/ActionScheduler_NullAction.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'Moceansms_PluginInterface' not found in wp-content/plugins/moceanapi-sendsms/includes/plugins/MoceanARMemberLite.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/moceanapi-sendsms/lib/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_UnitTestCase' not found in wp-content/plugins/moceanapi-sendsms/lib/action-scheduler/tests/phpunit/helpers/ActionScheduler_Compatibility_Test.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Moceansms_Register_Interface' not found in wp-content/plugins/moceanapi-sendsms/includes/class-moceansms-woocommerce-widget.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Store' not found in wp-content/plugins/moceanapi-sendsms/lib/action-scheduler/classes/data-stores/ActionScheduler_HybridStore.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_UnitTestCase' not found in wp-content/plugins/moceanapi-sendsms/lib/action-scheduler/tests/phpunit/migration/BatchFetcher_Test.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Moceansms_PluginInterface' not found in wp-content/plugins/moceanapi-sendsms/includes/plugins/MoceanFATService.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Moceansms_PluginInterface' not found in wp-content/plugins/moceanapi-sendsms/includes/plugins/MoceanGroundhoggCRM.php:3

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: sms, moceanapi, mocean, send sms, messaging...

moceanapi-sendsms/moceansms-woocommerce.php 92% from 13 tests

The main file in "MoceanAPI SendSMS" v. 1.4.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("moceanapi-sendsms.php" instead of "moceansms-woocommerce.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected64,306 lines of code in 338 files:
LanguageFilesBlank linesComment linesLines of code
PHP28811,33222,40349,921
CSS131279,119
JSON7003,450
Markdown124320844
JavaScript68995484
Bourne Shell12311147
YAML4156111
XML38391
HTML28052
Sass110047
SVG10040

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity28.14
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity3.39
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces9
Interfaces7
Traits0
Classes207
▷ Abstract classes209.66%
▷ Concrete classes18790.34%
▷ Final classes00.00%
Methods2,517
▷ Static methods28811.44%
▷ Public methods1,87374.41%
▷ Protected methods1867.39%
▷ Private methods45818.20%
Functions142
▷ Named functions11983.80%
▷ Anonymous functions2316.20%
Constants164
▷ Global constants10664.63%
▷ Class constants5835.37%
▷ Public constants58100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
9 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/action-scheduler/docs/favicon-16x16.png0.39KB0.38KB▼ 3.02%
lib/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
lib/freemius/assets/img/moceansms-order-sms-notification-for-woocommerce.png1.78KB1.19KB▼ 33.33%
lib/action-scheduler/docs/favicon-32x32.png1.16KB0.71KB▼ 39.02%
lib/action-scheduler/docs/android-chrome-192x192.png6.77KB2.46KB▼ 63.68%