84% rw-elephant-rental-inventory

Code Review | RW Elephant Rental Inventory

WordPress plugin RW Elephant Rental Inventory scored84%from 54 tests.

About plugin

  • Plugin page: rw-elephant-renta...
  • Plugin version: 2.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.4
  • WordPress version: 6.3.1
  • First release: Sep 12, 2018
  • Latest release: Nov 9, 2023
  • Number of updates: 75
  • Update frequency: every 25.1 days
  • Top authors: markheggan (98.67%)rwelephant01 (2.67%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /5,184 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲1.22MB] [CPU: ▲3.47ms] Passed 4 tests

This is a short check of server-side resources used by RW Elephant Rental Inventory
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.69 ▲1.2248.94 ▲10.07
Dashboard /wp-admin4.54 ▲1.2059.29 ▼2.30
Posts /wp-admin/edit.php4.66 ▲1.3053.80 ▲9.77
Add New Post /wp-admin/post-new.php7.12 ▲1.2397.29 ▲0.19
Media Library /wp-admin/upload.php4.44 ▲1.2141.62 ▲6.20
RW Elephant /wp-admin/options-general.php?page=rw-elephant4.4544.19

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 88 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_rwe_wishlist_widget
rw-elephant-rental-inventory
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

RW Elephant Rental Inventory: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,045 ▲28315.42 ▲1.266.07 ▲4.4041.29 ▼2.86
Dashboard /wp-admin2,364 ▲1866.42 ▲0.76107.24 ▼8.3737.55 ▼6.93
Posts /wp-admin/edit.php2,289 ▲1893.58 ▲1.6452.26 ▲12.0931.76 ▼5.75
Add New Post /wp-admin/post-new.php1,552 ▲1723.20 ▼1.89588.61 ▼38.8334.89 ▼26.10
Media Library /wp-admin/upload.php1,432 ▲324.43 ▲0.2384.41 ▼28.0045.27 ▲2.35
RW Elephant /wp-admin/options-general.php?page=rw-elephant1,3043.2443.7790.18

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_rwe_wishlist_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, 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
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wishlist_errors() in wp-content/plugins/rw-elephant-rental-inventory/templates/submit-wishlist.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/rw-elephant-rental-inventory/templates/inventory-item.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function rwe_invoice_details() in wp-content/plugins/rw-elephant-rental-inventory/templates/invoice-terms.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/rw-elephant-rental-inventory/templates/no-products.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/rw-elephant-rental-inventory/templates/single-item-content.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/rw-elephant-rental-inventory/templates/gallery-header.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/rw-elephant-rental-inventory/templates/invoice-pay.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: events, gallery, wishlist, inventory, rental

rw-elephant-rental-inventory/rw-elephant-rental-inventory.php 85% from 13 tests

The main PHP script in "RW Elephant Rental Inventory" version 2.3.3 is automatically included on every request by WordPress
It is important to fix the following:
  • Domain Path: The domain path should use only dashes and lowercase characters ("languages")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin15,327 lines of code in 76 files:
LanguageFilesBlank linesComment linesLines of code
PHP322,9682,2695,602
JavaScript231,6574975,255
CSS163523003,815
PO File1251290583
SVG40172

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity21.38
▷ Minimum class complexity1.00
▷ Maximum class complexity132.00
Average method complexity3.94
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes419.05%
Methods143
▷ Static methods106.99%
▷ Public methods13090.91%
▷ Protected methods00.00%
▷ Private methods139.09%
Functions116
▷ Named functions9481.03%
▷ Anonymous functions2218.97%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.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
9 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/assets/img/no-image-found.png2.60KB2.60KB0.00%
lib/assets/img/icon-right.png0.21KB0.22KB0.00%
lib/assets/img/icon-left.png0.21KB0.21KB0.00%
lib/assets/img/layout-icon-reversed.png1.51KB1.51KB0.00%
lib/assets/img/layout-icon.png1.46KB1.46KB0.00%