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

Code Review | MoceanAPI Order SMS Notification for WooCommerce

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

About plugin

  • Plugin page: moceansms-order-s...
  • Plugin version: 1.3.11
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.9
  • WordPress version: 5.8.1
  • First release: Nov 12, 2015
  • Latest release: Mar 11, 2022
  • Number of updates: 127
  • Update frequency: every 18.2 days
  • Top authors: kelvinsor7 (60.63%)lkloon123 (27.56%)moceanapiplugin (13.39%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active / 9,872 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲2.97MB] [CPU: ▼156.44ms] Passed 4 tests

This is a short check of server-side resources used by MoceanAPI Order SMS Notification for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.78 ▲2.9455.47 ▲27.74
Dashboard /wp-admin6.10 ▲3.041,425.26 ▲1,382.15
Posts /wp-admin/edit.php6.15 ▲3.0460.12 ▲25.65
Add New Post /wp-admin/post-new.php8.37 ▲2.9387.90 ▼693.52
Media Library /wp-admin/upload.php5.96 ▲2.9638.79 ▲14.38
MoceanAPI SMS Settings /wp-admin/options-general.php?page=moceansms-woocoommerce-setting5.9644.58
Scheduled Actions /wp-admin/tools.php?page=action-scheduler6.1559.26
/wp-admin/admin.php?page=moceansms-download-file5.9341.91

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 216 new files
Database: 5 new tables, 4 new options
New tables
moceansms_wc_send_sms_outbox
wp_actionscheduler_logs
wp_actionscheduler_groups
wp_actionscheduler_claims
wp_actionscheduler_actions
New WordPress options
action_scheduler_lock_async-request-runner
schema-ActionScheduler_StoreSchema
action_scheduler_hybrid_store_demarkation
schema-ActionScheduler_LoggerSchema

Browser metrics Passed 4 tests

MoceanAPI Order SMS Notification for WooCommerce: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,965 ▲36417.73 ▲1.785.77 ▲0.5796.38 ▲24.74
Dashboard /wp-admin3,232 ▲3408.44 ▲2.12139.30 ▲5.14175.76 ▲4.30
Posts /wp-admin/edit.php3,017 ▲2805.43 ▲2.2180.82 ▲16.36135.82 ▼3.37
Add New Post /wp-admin/post-new.php1,709 ▼1,99718.59 ▼0.07348.02 ▼105.03158.67 ▼10.28
Media Library /wp-admin/upload.php1,800 ▲485.90 ▲0.43129.34 ▼9.69197.92 ▲11.33
MoceanAPI SMS Settings /wp-admin/options-general.php?page=moceansms-woocoommerce-setting1,3204.8276.6799.32
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,8985.2372.75113.67
/wp-admin/admin.php?page=moceansms-download-file8642.3339.3053.21

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie tables detected upon uninstall: 5 tables
    • moceansms_wc_send_sms_outbox
    • wp_actionscheduler_actions
    • wp_actionscheduler_logs
    • wp_actionscheduler_claims
    • wp_actionscheduler_groups
  • Zombie WordPress options detected upon uninstall: 4 options
    • action_scheduler_hybrid_store_demarkation
    • action_scheduler_lock_async-request-runner
    • schema-ActionScheduler_LoggerSchema
    • schema-ActionScheduler_StoreSchema

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
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
Almost there! Just fix the following items
  • 109× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/lib/action-scheduler/classes/WP_CLI/Migration_Command.php:22
    • > 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/lock/ActionScheduler_OptionLock_Test.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/lib/action-scheduler/lib/cron-expression/CronExpression_DayOfMonthField.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_DBStore' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/lib/action-scheduler/classes/migration/ActionScheduler_DBStoreMigrator.php:10
    • > 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/schedules/ActionScheduler_SimpleSchedule_Test.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Moceansms_Register_Interface' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/includes/class-moceansms-download-log.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_Schedule' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/lib/action-scheduler/classes/abstracts/ActionScheduler_Abstract_RecurringSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'Moceansms_PluginInterface' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/includes/plugins/MoceanBookIt.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Moceansms_PluginInterface' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/includes/plugins/MoceanLatePoint.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Moceansms_PluginInterface' not found in wp-content/plugins/moceansms-order-sms-notification-for-woocommerce/includes/plugins/MoceanWpERP.php:3

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

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed: You can take inspiration from this readme.txt

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

The main file in "MoceanAPI Order SMS Notification for WooCommerce" v. 1.3.11 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("moceansms-order-sms-notification-for-woocommerce.php" instead of "moceansms-woocommerce.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin31,851 lines of code in 196 files:
LanguageFilesBlank linesComment linesLines of code
PHP1653,7875,83217,953
CSS11279,102
JSON4003,401
Markdown113640630
JavaScript35436277
Bourne Shell12311147
YAML4156111
XML38391
HTML28052
Sass110047
SVG10040

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity11.08
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces3
Interfaces7
Traits0
Classes152
▷ Abstract classes1811.84%
▷ Concrete classes13488.16%
▷ Final classes00.00%
Methods1,307
▷ Static methods927.04%
▷ Public methods1,01477.58%
▷ Protected methods17013.01%
▷ Private methods1239.41%
Functions45
▷ Named functions2351.11%
▷ Anonymous functions2248.89%
Constants40
▷ Global constants717.50%
▷ Class constants3382.50%
▷ Public constants33100.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.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/action-scheduler/docs/android-chrome-192x192.png6.77KB2.46KB▼ 63.68%
lib/action-scheduler/docs/android-chrome-256x256.png2.93KB3.03KB0.00%
lib/action-scheduler/docs/apple-touch-icon.png6.77KB2.46KB▼ 63.68%
lib/action-scheduler/docs/mstile-150x150.png4.15KB3.67KB▼ 11.47%
lib/action-scheduler/docs/favicon-16x16.png0.39KB0.38KB▼ 3.02%