68% rental

Code Review | RENTAL

WordPress plugin RENTAL scored68%from 54 tests.

About plugin

  • Plugin page: rental
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.7
  • WordPress version: 6.3.1
  • First release: Jun 28, 2021
  • Latest release: Sep 2, 2021
  • Number of updates: 5
  • Update frequency: every 13.8 days
  • Top authors: teamdream (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /699 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.94MB] [CPU: ▼38.58ms] Passed 4 tests

An overview of server-side resources used by RENTAL
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0624.41 ▼16.34
Dashboard /wp-admin3.01 ▼0.3329.16 ▼28.88
Posts /wp-admin/edit.php3.01 ▼0.3422.09 ▼30.45
Add New Post /wp-admin/post-new.php3.01 ▼2.8722.69 ▼78.48
Media Library /wp-admin/upload.php3.01 ▼0.2221.98 ▼16.50
My Clients /wp-admin/admin.php?page=my-client3.0122.07
All Rental /wp-admin/admin.php?page=all-rental3.0121.27
Create rental /wp-admin/admin.php?page=custom-plugin23.0122.83
RENTAL /wp-admin/admin.php?page=rental3.0122.12

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 15 new files
Database: 2 new tables, 6 new options
New tables
wp_rentaldata
wp_checkavailabity
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for RENTAL
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,085 ▲32415.03 ▲0.7012.56 ▲11.0147.98 ▲5.48
Dashboard /wp-admin2,374 ▲1946.17 ▲0.51104.75 ▲17.4739.78 ▼0.95
Posts /wp-admin/edit.php2,302 ▲2023.39 ▲1.3949.36 ▲11.2432.54 ▼0.82
Add New Post /wp-admin/post-new.php1,714 ▲18822.23 ▼0.87636.44 ▼14.3237.88 ▼24.18
Media Library /wp-admin/upload.php1,433 ▲334.15 ▼0.0481.34 ▼17.8447.37 ▲5.44
My Clients /wp-admin/admin.php?page=my-client1,0143.0240.3226.61
All Rental /wp-admin/admin.php?page=all-rental1,1183.2241.0326.38
Create rental /wp-admin/admin.php?page=custom-plugin21,2773.1639.5029.83
RENTAL /wp-admin/admin.php?page=rental1,1243.0739.8929.75

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function add_menu_page was called incorrectly. The seventh parameter passed to add_menu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 6.0.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rental
    • > User notice in wp-includes/functions.php+5905
    Function add_menu_page was called incorrectly. The seventh parameter passed to add_menu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 6.0.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rental
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rental
    • > Notice in wp-content/plugins/rental/views/all-pages.php+82
    Undefined index: editid
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rental
    • > Notice in wp-content/plugins/rental/views/all-pages.php+209
    Undefined variable: features2
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rental
    • > Notice in wp-content/plugins/rental/views/all-pages.php+213
    Undefined variable: featureArr
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rental
    • > Warning in wp-content/plugins/rental/views/all-pages.php+213
    sizeof(): Parameter must be an array or an object that implements Countable
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rental
    • > Notice in wp-content/plugins/rental/views/all-pages.php+225
    Undefined variable: descriptions2
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rental
    • > Notice in wp-content/plugins/rental/views/all-pages.php+236
    Undefined variable: id

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 7× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/rental/views/imageslider.php
    • > /wp-content/plugins/rental/rental.php
    • > /wp-content/plugins/rental/views/popup.php
    • > /wp-content/plugins/rental/views/Myclient.php
    • > /wp-content/plugins/rental/index.php
    • > /wp-content/plugins/rental/views/all-pages.php
    • > /wp-content/plugins/rental/views/datasubmit.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
These attributes need to be fixed:
  • Contributors: The plugin contributors field is not present
  • Screenshots: Add images for these screenshots: #1 (This is the screenshot of admin section of Rental plugin (Screenshot-1.png).), #2 (This is the screenshot of admin section when we select images for slider and features ( Screenshot-2.png).), #3 (This is the screenshot of filling the information in rental plugin (Screenshot-3.png).), #4 (This is the screenshot of Adding multiple featues (Screenshot-4.png).), #5 (This is the screenshot of decription section of rental plugin (Screenshot-5.png).), #6 (This is the screenshot of post type view of rental plugin (Screenshot-6.png).), #7 (This is the screenshot of main page of rental plugin here you will see your rental products (Screenshot-7.png).), #8 (This is the screenshot of here you will see the Slider of rental plugin-8.png).)
The official readme.txt is a good inspiration

rental/rental.php 92% from 13 tests

"RENTAL" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.6" instead of "5.2")

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
No dangerous file extensions were detected2,164 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP7218391,232
CSS3164116774
JavaScript35021158

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions1487.50%
▷ Anonymous functions212.50%
Constants1
▷ Global constants1100.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
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/featuredimg.png26.95KB9.36KB▼ 65.26%