62% moceansms-order-sms-notification-for-woocommerce

Code Review | MoceanAPI Order SMS Notification for WooCommerce

WordPress plugin MoceanAPI Order SMS Notification for WooCommerce scored 62% from 54 tests.

About plugin

  • Plugin page: moceansms-order-s...
  • Plugin version: 1.4.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.2
  • WordPress version: 6.3.1
  • First release: Nov 12, 2015
  • Latest release: Oct 1, 2023
  • Number of updates: 159
  • Update frequency: every 18.1 days
  • Top authors: kelvinsor7 (50.31%)moceanapiplugin (28.93%)lkloon123 (22.01%)

Code review

54 tests

User reviews

6 reviews

Install metrics

60+ active / 12,742 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲6.92MB] [CPU: ▲50.39ms] 50% from 4 tests

Analyzing server-side resources used by MoceanAPI Order SMS Notification for WooCommerce
It is recommended to improve the following
  • RAM: You should keep total memory usage under 10MB (currently 10.39MB on /wp-admin/tools.php?page=action-scheduler)
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 6.92MB on /wp-admin/tools.php?page=action-scheduler)
PageMemory (MB)CPU Time (ms)
Home /10.30 ▲6.8484.51 ▲40.30
Dashboard /wp-admin10.26 ▲6.961,494.88 ▲1,443.91
Posts /wp-admin/edit.php10.31 ▲6.95106.60 ▲57.46
Add New Post /wp-admin/post-new.php12.83 ▲6.95146.17 ▲47.13
Media Library /wp-admin/upload.php10.18 ▲6.9594.57 ▲56.66
/wp-admin/admin.php?page=moceansms-download-file10.1784.05
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius10.4286.25
MoceanAPI SMS Settings /wp-admin/options-general.php?page=moceansms-woocoommerce-setting10.4580.08
Scheduled Actions /wp-admin/tools.php?page=action-scheduler10.3995.76

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 402 new files
Database: 5 new tables, 25 new options
New tables
wp_actionscheduler_groups
wp_actionscheduler_logs
wp_actionscheduler_actions
moceansms_wc_send_sms_outbox
wp_actionscheduler_claims
New WordPress options
moceansms_plugin_version
widget_recent-posts
fs_active_plugins
moceansms_smsoutbox_setting
widget_recent-comments
moceansms_sendsms_setting
widget_theysaidso_widget
moceansms_customer_setting
theysaidso_admin_options
action_scheduler_hybrid_store_demarkation
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for MoceanAPI Order SMS Notification for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,059 ▲32415.28 ▲0.532.08 ▲0.4027.06 ▼14.88
Dashboard /wp-admin2,443 ▲2586.67 ▲1.81144.77 ▲27.9642.37 ▼4.73
Posts /wp-admin/edit.php2,310 ▲2213.57 ▲1.5249.42 ▲11.8034.45 ▼1.22
Add New Post /wp-admin/post-new.php1,551 ▲1822.16 ▼1.07592.63 ▼65.9331.44 ▼19.09
Media Library /wp-admin/upload.php1,446 ▲584.42 ▲0.2183.20 ▼33.5442.07 ▼6.20
/wp-admin/admin.php?page=moceansms-download-file6901.709.8220.68
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,2703.4342.5327.13
MoceanAPI SMS Settings /wp-admin/options-general.php?page=moceansms-woocoommerce-setting1,2333.2743.3485.89
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,5433.4240.9830.38

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 25% 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 cannot be uninstalled
    • > Notice in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/lib/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • The plugin did not uninstall successfully, leaving 5 tables in the database
    • wp_actionscheduler_logs
    • wp_actionscheduler_actions
    • wp_actionscheduler_groups
    • wp_actionscheduler_claims
    • moceansms_wc_send_sms_outbox
  • Zombie WordPress options detected upon uninstall: 23 options
    • can_compress_scripts
    • fs_active_plugins
    • moceansms_help_setting
    • moceansms_automation_setting
    • fs_debug_mode
    • fs_gdpr
    • db_upgraded
    • widget_recent-comments
    • fs_accounts
    • moceansms_logs_setting
    • ...

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 114× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Moceansms_Register_Interface' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/includes/class-moceansms-woocommerce-hook.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_UnitTestCase' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/lib/action-scheduler/tests/phpunit/runner/ActionScheduler_QueueCleaner_Test.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'Moceansms_Register_Interface' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/includes/multivendor/admin/class-moceansms-multivendor-setting.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Action_Scheduler\\Migration\\ActionMigrator' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/lib/action-scheduler/classes/migration/DryRun_ActionMigrator.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Moceansms_PluginInterface' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/includes/plugins/MoceanSimpleMembership.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'CronExpression_FieldInterface' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/lib/action-scheduler/lib/cron-expression/CronExpression_AbstractField.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_UnitTestCase' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/lib/action-scheduler/tests/phpunit/procedural_api/wc_get_scheduled_actions_Test.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Lock' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/lib/action-scheduler/classes/ActionScheduler_OptionLock.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Moceansms_Register_Interface' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/admin/class-moceansms-woocommerce-setting.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'Moceansms_PluginInterface' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/includes/plugins/MoceanGroundhoggCRM.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
These attributes need your attention: Please take inspiration from this readme.txt

moceansms-order-sms-notification-for-woocommerce/moceansms-woocommerce.php 85% from 13 tests

The primary PHP file in "MoceanAPI Order SMS Notification for WooCommerce" version 1.4.9 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("moceansms-order-sms-notification-for-woocommerce.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
Success! There were no dangerous files found in this plugin64,307 lines of code in 338 files:
LanguageFilesBlank linesComment linesLines of code
PHP28811,33422,40349,922
CSS131279,119
JSON7003,450
Markdown124320844
JavaScript68995484
Bourne Shell12311147
YAML4156111
XML38391
HTML28052
Sass110047
SVG10040

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Class cyclomatic complexity has to be reduced 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

Using a strong compression for your PNG files is a great way to speed-up your plugin
9 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
lib/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
lib/action-scheduler/docs/favicon-16x16.png0.39KB0.38KB▼ 3.02%
lib/action-scheduler/docs/mstile-150x150.png4.15KB3.67KB▼ 11.47%
lib/action-scheduler/docs/apple-touch-icon.png6.77KB2.46KB▼ 63.68%