84% wc-call-for-price

Code Review | WC Call For Price

WordPress plugin WC Call For Price scored84%from 54 tests.

About plugin

  • Plugin page: wc-call-for-price
  • Plugin version: 1.4.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.2-6.3
  • WordPress version: 6.3.1
  • First release: Jul 3, 2015
  • Latest release: Aug 12, 2023
  • Number of updates: 36
  • Update frequency: every 82.3 days
  • Top authors: aihimel (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

800+ active /7,953 total downloads

Benchmarks

Plugin footprint 83% 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.14MB] [CPU: ▼6.71ms] Passed 4 tests

Server-side resources used by WC Call For Price
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1340.65 ▼5.39
Dashboard /wp-admin3.43 ▲0.1348.53 ▼1.99
Posts /wp-admin/edit.php3.55 ▲0.1948.90 ▼2.89
Add New Post /wp-admin/post-new.php6.03 ▲0.1587.17 ▼16.58
Media Library /wp-admin/upload.php3.36 ▲0.1336.24 ▲2.14
Call For Price /wp-admin/admin.php?page=wc-call-for-price3.3637.90

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 54 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

WC Call For Price: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.19 ▼1.161.61 ▼0.2441.74 ▼0.34
Dashboard /wp-admin2,203 ▲185.83 ▲0.8899.52 ▼17.5638.71 ▼7.16
Posts /wp-admin/edit.php2,089 ▼01.98 ▼0.0533.88 ▼3.1631.95 ▼2.46
Add New Post /wp-admin/post-new.php1,533 ▲1923.34 ▲5.80623.98 ▼3.6155.74 ▼0.54
Media Library /wp-admin/upload.php1,382 ▼34.21 ▼0.0496.09 ▼3.5743.12 ▲0.71
Call For Price /wp-admin/admin.php?page=wc-call-for-price1,0553.1242.6941.23

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wc-call-for-price/templates/admin/pages/404.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed: You can take inspiration from this readme.txt

wc-call-for-price/wc-call-for-price.php Passed 13 tests

"WC Call For Price" version 1.4.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
103 characters long description:
This plugin shows "call for price" text/HTML or image on empty price fields. It depends on woocommerce.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected1,527 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP293028051,343
CSS11091
JavaScript1165888
JSON1005

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity11.83
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.87
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes18.33%
Methods71
▷ Static methods2028.17%
▷ Public methods6185.92%
▷ Protected methods68.45%
▷ Private methods45.63%
Functions9
▷ Named functions777.78%
▷ Anonymous functions222.22%
Constants33
▷ Global constants412.12%
▷ Class constants2987.88%
▷ Public constants29100.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
18 PNG files occupy 0.11MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/preset-buttons/cfp_1.png4.50KB1.58KB▼ 64.90%
assets/images/preset-buttons/cfp_7.png7.71KB3.32KB▼ 56.97%
assets/images/preset-buttons/unselected.png3.27KB0.49KB▼ 85.02%
assets/images/preset-buttons/cfp_15.png6.16KB2.46KB▼ 60.02%
assets/images/preset-buttons/close.png0.22KB0.20KB▼ 9.13%