10% oneapi-sms-for-woocommerce

Code Review | OneAPI SMS For Woo

WordPress plugin OneAPI SMS For Woo scored10%from 54 tests.

About plugin

  • Plugin page: oneapi-sms-for-wo...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.4.2
  • WordPress version: 6.3.1
  • First release: Apr 4, 2016
  • Latest release: Mar 31, 2016
  • Number of updates: 2
  • Update frequency: every 1.5 days
  • Top authors: lexok (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /635 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/oneapi-sms-for-woocommerce/includes/class-oneapi-activator.php+19
    Non-static method Oneapi_Activator::create_files() should not be called statically

Server metrics [RAM: ▲0.21MB] [CPU: ▼2.28ms] Passed 4 tests

This is a short check of server-side resources used by OneAPI SMS For Woo
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2240.92 ▲3.44
Dashboard /wp-admin3.52 ▲0.1753.85 ▼10.93
Posts /wp-admin/edit.php3.63 ▲0.2753.23 ▼0.76
Add New Post /wp-admin/post-new.php6.12 ▲0.23106.70 ▲2.81
Media Library /wp-admin/upload.php3.44 ▲0.2140.71 ▼0.24
Oneapi SMS For Woo /wp-admin/options-general.php?page=oneapi-sms-for-woo-option3.4142.84

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for OneAPI SMS For Woo
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲4013.40 ▼0.621.80 ▼0.0646.95 ▲3.51
Dashboard /wp-admin2,232 ▲295.04 ▼0.83105.58 ▼0.9338.75 ▼5.20
Posts /wp-admin/edit.php2,114 ▲142.02 ▼0.0339.68 ▼3.6535.52 ▼3.92
Add New Post /wp-admin/post-new.php1,536 ▲517.41 ▼5.87669.59 ▼27.6964.12 ▲8.64
Media Library /wp-admin/upload.php1,408 ▲54.32 ▲0.00119.10 ▲9.0148.44 ▲2.14
Oneapi SMS For Woo /wp-admin/options-general.php?page=oneapi-sms-for-woo-option1,2081.7031.0832.69

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% 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)
Even though no errors were found, 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 take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/oneapi-sms-for-woocommerce/admin/partials/class-oneapi-setting.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/oneapi-sms-for-woocommerce/admin/partials/oneapi-admin-display.php:21

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=oneapi-sms-for-woo-option
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/oneapi-sms-for-woocommerce/admin/js/oneapi-admin.js?ver=1.0.0:2:38)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=oneapi-sms-for-woo-option
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #1 (Admin Notifications Setting.)
Please take inspiration from this readme.txt

oneapi-sms-for-woocommerce/oneapi.php 85% from 13 tests

The main PHP script in "OneAPI SMS For Woo" version 1.0.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("oneapi-sms-for-woocommerce.php" instead of "oneapi.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected1,019 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP14192452979
JavaScript20040

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity11.73
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity60.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods54
▷ Static methods2444.44%
▷ Public methods4787.04%
▷ Protected methods00.00%
▷ Private methods712.96%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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
PNG images were not found in this plugin