52% willing2buy

Code Review | Willing2Buy Price Suggestion

WordPress plugin Willing2Buy Price Suggestion scored52%from 54 tests.

About plugin

  • Plugin page: willing2buy
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.7.4
  • WordPress version: 6.3.1
  • First release: Apr 28, 2017
  • Latest release: Apr 28, 2017
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: medmatech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /557 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▼1.96MB] [CPU: ▼52.27ms] Passed 4 tests

Server-side resources used by Willing2Buy Price Suggestion
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.45 ▼32.65
Dashboard /wp-admin2.05 ▼1.266.32 ▼43.27
Posts /wp-admin/edit.php2.05 ▼1.317.68 ▼41.49
Add New Post /wp-admin/post-new.php2.05 ▼3.845.43 ▼91.66
Media Library /wp-admin/upload.php2.05 ▼1.185.32 ▼29.35
Home Page /wp-admin/admin.php?page=willingtobuy_home2.056.12
Wiiling2Buy Settings /wp-admin/admin.php?page=Wiiling2Buy_Settings2.056.39

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 43 new files
Database: 2 new tables, 8 new options
New tables
wp_cron_email
wp_suggested_pice
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
suggest_subject
sp_suggest_message
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Willing2Buy Price Suggestion
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,910 ▲14913.23 ▼1.132.18 ▲0.6141.19 ▲0.75
Dashboard /wp-admin2,236 ▲614.83 ▼0.9292.86 ▼5.2839.85 ▼5.01
Posts /wp-admin/edit.php2,146 ▲462.26 ▲0.2740.29 ▲3.1136.01 ▲2.40
Add New Post /wp-admin/post-new.php1,560 ▲2523.32 ▲4.87677.45 ▲19.8146.04 ▼27.15
Media Library /wp-admin/upload.php1,447 ▲534.52 ▲0.3196.93 ▼0.4843.04 ▼1.80
Home Page /wp-admin/admin.php?page=willingtobuy_home1,2542.1736.4483.71
Wiiling2Buy Settings /wp-admin/admin.php?page=Wiiling2Buy_Settings1,6567.10132.0256.81

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the admin-mycss-suggest-price handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_cron_email
    • wp_suggested_pice
  • Zombie WordPress options were found after uninstall: 8 options
    • sp_suggest_message
    • suggest_subject
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Wiiling2Buy_Settings
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the admin-mycss-suggest-price handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Wiiling2Buy_Settings
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the custom-css-suggest-price handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Wiiling2Buy_Settings
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the font-awesome-css-suggest handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Wiiling2Buy_Settings
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp-color-picker handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Wiiling2Buy_Settings
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the my-style-css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Wiiling2Buy_Settings
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the view-price-detail-script handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Wiiling2Buy_Settings
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/willing2buy/index.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Wiiling2Buy_Settings
    • > Network (severe)
    wp-content/plugins/willing2buy/css/suggest_mycss.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Wiiling2Buy_Settings
    • > Network (severe)
    wp-content/plugins/willing2buy/css/my-style.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=willingtobuy_home
    • > Network (severe)
    https://www.medma.in/apps/public/extension - Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: suggest your price for product, suggest product price, woocommerce price suggestion, price suggestion, product price suggestion

willing2buy/index.php 92% from 13 tests

The main PHP file in "Willing2Buy Price Suggestion" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("willing2buy.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected5,710 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
CSS336221,706
Sass1319221,158
LESS1319311,149
PHP4191147992
SVG100504
JavaScript23610201

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity10.67
▷ Minimum class complexity4.00
▷ Maximum class complexity18.00
Average method complexity2.93
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods15
▷ Static methods320.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.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.07MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png72.57KB26.16KB▼ 63.95%