10% sovratec-return-exchange

Code Review | Plugin Name: Sovratec Return & Exchange management

WordPress plugin Plugin Name: Sovratec Return & Exchange managementscored 10% from 54 tests.

About plugin

  • Plugin page: sovratec-return-e...
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8.2
  • WordPress version: 6.3.1
  • First release: Jan 26, 2022
  • Latest release: Jan 27, 2022
  • Number of updates: 35
  • Update frequency: every 0.0 days
  • Top authors: sovratecdev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 231 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin did not install without errors
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.14ms] Passed 4 tests

A check of server-side resources used by Plugin Name: Sovratec Return & Exchange management
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.62 ▼1.11
Dashboard /wp-admin3.33 ▲0.0246.08 ▼0.67
Posts /wp-admin/edit.php3.38 ▲0.0246.48 ▲0.57
Add New Post /wp-admin/post-new.php5.93 ▲0.0482.25 ▼15.35
Media Library /wp-admin/upload.php3.25 ▲0.0235.81 ▲2.07
Edit Order /wp-admin/admin.php?page=edit-order3.1929.66

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 155 new files
Database: 3 new tables, 7 new options
New tables
wp_wp_return_exchange_reason
wp_wp_return_exchange
wp_wp_return_exchange_configuration
New WordPress options
widget_recent-posts
recovery_mode_email_last_sent
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Plugin Name: Sovratec Return & Exchange management
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,928 ▲19313.91 ▼0.8412.85 ▲11.0344.08 ▼5.40
Dashboard /wp-admin2,221 ▲335.87 ▲0.9997.02 ▼2.5585.99 ▲47.87
Posts /wp-admin/edit.php2,107 ▲182.03 ▼0.0035.98 ▼5.0932.75 ▼3.56
Add New Post /wp-admin/post-new.php1,535 ▼023.05 ▼0.05732.75 ▲81.6559.63 ▲6.81
Media Library /wp-admin/upload.php1,397 ▲124.21 ▲0.0396.31 ▼6.9586.80 ▲40.83
Edit Order /wp-admin/admin.php?page=edit-order6881.557.6121.28

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie tables were found after uninstall: 3 tables
    • wp_wp_return_exchange_reason
    • wp_wp_return_exchange_configuration
    • wp_wp_return_exchange
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=edit-order
    • > Warning in wp-content/plugins/sovratec-return-exchange/public/class-woo-return-exchange-public.php+109
    require_once(wp-content/plugins/sovratec-return-exchange/public/partials/woo-return-exchange-edit-display.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/admin.php?page=edit-order
    • > Compile error in wp-content/plugins/sovratec-return-exchange/public/class-woo-return-exchange-public.php+109
    require_once(): Failed opening required 'wp-content/plugins/sovratec-return-exchange/public/partials/woo-return-exchange-edit-display.php' (include_path='.:/usr/share/php')

SRP 0% 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 items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/sovratec-return-exchange/admin/partials/woo-return-exchange-admin-display.php
  • 15× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sovratec-return-exchange/includes/return-exchange-admin-tabs/class-woo-return-exchange-pending.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sovratec-return-exchange/public/class-woo-return-exchange-public.php:57
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/sovratec-return-exchange/includes/return-exchange-admin-tabs/class-woo-return-exchange-request.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/sovratec-return-exchange/includes/return-exchange-admin-tabs/class-woo-return-exchange-tabs.php:34
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_row() on null in wp-content/plugins/sovratec-return-exchange/includes/return-exchange-admin-tabs/class-woo-return-exchange-configurations.php:40
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/sovratec-return-exchange/includes/return-exchange-admin-tabs/class-woo-return-exchange-pending.php on line 24
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/sovratec-return-exchange/includes/return-exchange-admin-tabs/class-woo-return-exchange-completed.php on line 24
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/sovratec-return-exchange/includes/return-exchange-admin-tabs/class-woo-return-exchange-completed.php on line 24
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sovratec-return-exchange/includes/return-exchange-admin-tabs/class-woo-return-exchange-completed.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/sovratec-return-exchange/includes/class-woo-return-exchange-dashboard.php:27

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 user-side errors
    • > GET request to /wp-admin/admin.php?page=edit-order
    • > 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: tinymce is not defined" "ReferenceError: tinymce is not defined\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/sovratec-return-exchange/admin/js/woo-return-exchange-admin.js?ver=1.1.0:35:4)\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/admin.php?page=edit-order
    • > 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 ReferenceError: tinymce is not defined

Optimizations

Plugin configuration 93% 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 your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === Plugin Name: Sovratec Return & Exchange management=== )
The official readme.txt is a good inspiration

sovratec-return-exchange/woo-return-exchange.php 92% from 13 tests

The primary PHP file in "Plugin Name: Sovratec Return & Exchange management" version 1.1.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sovratec-return-exchange.php" instead of "woo-return-exchange.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin72,447 lines of code in 117 files:
LanguageFilesBlank linesComment linesLines of code
CSS318,14523335,258
JavaScript623,4892,15431,784
TypeScript1003,036
PHP213117792,365
Markdown2104

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity10.85
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods82
▷ Static methods33.66%
▷ Public methods7490.24%
▷ Protected methods00.00%
▷ Private methods89.76%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/wre-logo.png1.17KB0.46KB▼ 60.76%