83% pravel-rent-sell-addon-for-woocommerce

Code Review | Pravel Rent & Sell Addon for WooCommerce

WordPress plugin Pravel Rent & Sell Addon for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: pravel-rent-sell-...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.3.2
  • WordPress version: 6.3.1
  • First release: Dec 24, 2019
  • Latest release: Jul 24, 2020
  • Number of updates: 30
  • Update frequency: every 7.4 days
  • Top authors: pravel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,076 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.14ms] Passed 4 tests

This is a short check of server-side resources used by Pravel Rent & Sell Addon for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0137.49 ▼1.04
Dashboard /wp-admin3.32 ▼0.0345.77 ▼14.67
Posts /wp-admin/edit.php3.37 ▲0.0141.94 ▼5.34
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.04 ▼11.52
Media Library /wp-admin/upload.php3.25 ▲0.0135.02 ▲4.03

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Pravel Rent & Sell Addon for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3714.51 ▲0.221.76 ▲0.2044.47 ▲3.13
Dashboard /wp-admin2,204 ▲245.55 ▼0.0895.03 ▲9.0143.90 ▼0.94
Posts /wp-admin/edit.php2,110 ▲132.11 ▲0.1136.13 ▼0.8636.25 ▼1.71
Add New Post /wp-admin/post-new.php1,535 ▼223.14 ▲4.75683.22 ▲28.4857.06 ▼9.50
Media Library /wp-admin/upload.php1,406 ▲94.17 ▼0.03108.88 ▲8.9650.90 ▲5.33

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/pravel-rent-sell-addon-for-woocommerce/templates/unsubscribe.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pravel-rent-sell-addon-for-woocommerce/includes/add_to_checkout_functions.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pravel-rent-sell-addon-for-woocommerce/admin/notification_settings.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pravel-rent-sell-addon-for-woocommerce/templates/booking_template.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/pravel-rent-sell-addon-for-woocommerce/admin/core_function.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/pravel-rent-sell-addon-for-woocommerce/admin/add_payment_method.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/pravel-rent-sell-addon-for-woocommerce/index.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/pravel-rent-sell-addon-for-woocommerce/includes/add_to_cart_function.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/pravel-rent-sell-addon-for-woocommerce/admin/pravel_settings_tab.php:7

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 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention: The official readme.txt is a good inspiration

pravel-rent-sell-addon-for-woocommerce/index.php 92% from 13 tests

"Pravel Rent & Sell Addon for WooCommerce" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("pravel-rent-sell-addon-for-woocommerce.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin11,745 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript42,1997,0027,629
PHP10461952,156
CSS471801,960

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity44.40
▷ Minimum class complexity6.00
▷ Maximum class complexity84.00
Average method complexity6.86
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods37
▷ Static methods616.22%
▷ Public methods37100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
9 PNG files occupy 0.06MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/sort_desc.png0.15KB0.25KB0.00%
assets/css/images/ui-icons_454545_256x240.png3.69KB4.18KB0.00%
images/buy-now-button.png19.00KB10.23KB▼ 46.18%
images/Doneplugin02_round.png14.64KB7.26KB▼ 50.40%
assets/images/sort_both.png0.20KB0.29KB0.00%