62% otp-easy-login-with-mocean

Code Review | SMS OTP Easy Login with Mocean

WordPress plugin SMS OTP Easy Login with Mocean scored62%from 54 tests.

About plugin

  • Plugin page: otp-easy-login-wi...
  • Plugin version: 1.1.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Jun 18, 2020
  • Latest release: Dec 1, 2023
  • Number of updates: 25
  • Update frequency: every 50.5 days
  • Top authors: moceanapiplugin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /753 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲4.77MB] [CPU: ▲670.88ms] 50% from 4 tests

This is a short check of server-side resources used by SMS OTP Easy Login with Mocean
Please fix the following
  • CPU: The total CPU usage must kept under 500.00ms (currently 966.89ms on /wp-admin/admin.php?page=freemius)
  • Extra CPU: The extra CPU usage should be kept under 200.00ms (currently 670.88ms on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.77 ▲5.3174.82 ▲30.53
Dashboard /wp-admin8.79 ▲5.44886.87 ▲826.09
Posts /wp-admin/edit.php8.79 ▲5.43902.97 ▲858.36
Add New Post /wp-admin/post-new.php8.79 ▲2.901,387.85 ▲1,298.70
Media Library /wp-admin/upload.php8.79 ▲5.561,003.46 ▲968.52
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.79966.89

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 198 new files
Database: no new tables, 15 new options
New WordPress options
oelm_last_cleanup
can_compress_scripts
fs_accounts
widget_recent-posts
oelm-version
fs_debug_mode
widget_theysaidso_widget
db_upgraded
widget_recent-comments
fs_gdpr
...

Browser metrics Passed 4 tests

An overview of browser requirements for SMS OTP Easy Login with Mocean
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,969 ▲23313.79 ▼0.618.77 ▲7.0932.80 ▼11.21
Dashboard /wp-admin2,228 ▲505.74 ▲0.1091.94 ▼18.5544.60 ▼0.50
Posts /wp-admin/edit.php2,137 ▲371.93 ▼0.0634.60 ▼3.1335.60 ▲4.40
Add New Post /wp-admin/post-new.php1,547 ▲1123.01 ▼0.31695.53 ▲7.5352.29 ▲7.80
Media Library /wp-admin/upload.php1,433 ▲364.11 ▼0.10108.68 ▲4.7448.47 ▲5.38
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,0731.6527.0932.12

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-admin/includes/class-wp-filesystem-direct.php+558
    mkdir(): File exists
  • The uninstall procedure has failed, leaving 15 options in the database
    • widget_theysaidso_widget
    • oelm_last_cleanup
    • fs_debug_mode
    • widget_recent-posts
    • fs_gdpr
    • oelm-version
    • can_compress_scripts
    • oelm-phone-options
    • db_upgraded
    • oelm_otp_users
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 62 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=freemius
    • > Warning in wp-admin/includes/class-wp-filesystem-direct.php+558
    mkdir(): File exists

SRP 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/otp-easy-login-with-mocean/admin/templates/sidebar.php
  • 17× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/otp-easy-login-with-mocean/templates/oelm-phone-input.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mo_el() in wp-content/plugins/otp-easy-login-with-mocean/admin/includes/class-oelm-el-fields.php:10
    • > PHP Notice
      Undefined variable: phone_input in wp-content/plugins/otp-easy-login-with-mocean/templates/oelm-phone-input-form.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/otp-easy-login-with-mocean/templates/oelm-form-otp.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_upload_dir() in wp-content/plugins/otp-easy-login-with-mocean/admin/templates/oelm-balance-info.php:4
    • > PHP Warning
      Use of undefined constant oelm_PATH - assumed 'oelm_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/otp-easy-login-with-mocean/admin/templates/oelm-balance-info.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/otp-easy-login-with-mocean/includes/class-oelm-easy-login-functions.php:124
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/otp-easy-login-with-mocean/templates/oelm-otp-login-button.php:1
    • > PHP Warning
      include(oelm_PATH/includes/servicesScripts/class-oelm-mocean.php): failed to open stream: No such file or directory in wp-content/plugins/otp-easy-login-with-mocean/admin/templates/oelm-balance-info.php on line 2
    • > PHP Warning
      include(oelm_PATH/admin/includes/options/services-options.php): failed to open stream: No such file or directory in wp-content/plugins/otp-easy-login-with-mocean/admin/templates/oelm-balance-info.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: otp, login, signup, 2fa, woocommerce

otp-easy-login-with-mocean/oelm-main.php 92% from 13 tests

The primary PHP file in "SMS OTP Easy Login with Mocean" version 1.1.2 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("otp-easy-login-with-mocean.php" instead of "oelm-main.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected34,022 lines of code in 153 files:
LanguageFilesBlank linesComment linesLines of code
PHP1328,04216,33032,751
JavaScript5212113672
CSS13475357
Markdown2680215
JSON10027

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity75.37
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.52
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes57
▷ Abstract classes23.51%
▷ Concrete classes5596.49%
▷ Final classes00.00%
Methods1,237
▷ Static methods20316.41%
▷ Public methods89372.19%
▷ Protected methods161.29%
▷ Private methods32826.52%
Functions115
▷ Named functions11398.26%
▷ Anonymous functions21.74%
Constants128
▷ Global constants10380.47%
▷ Class constants2519.53%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
lib/freemius/assets/img/moceansms-order-sms-notification-for-woocommerce.png1.78KB1.19KB▼ 33.33%
lib/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%