78% virtue-for-woocommerce

Code Review | Virtue - Charity Donations UK

WordPress plugin Virtue - Charity Donations UK scored78%from 54 tests.

About plugin

  • Plugin page: virtue-for-woocom...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2
  • WordPress version: 6.3.1
  • First release: May 10, 2023
  • Latest release: Jun 6, 2023
  • Number of updates: 10
  • Update frequency: every 12.9 days
  • Top authors: virtueimpact (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /128 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼9.00ms] Passed 4 tests

An overview of server-side resources used by Virtue - Charity Donations UK
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.42 ▼0.0325.50 ▼13.71
Dashboard /wp-admin3.35 ▲0.0543.93 ▼4.49
Posts /wp-admin/edit.php3.40 ▲0.0444.24 ▼2.49
Add New Post /wp-admin/post-new.php5.93 ▲0.0479.57 ▼15.30
Media Library /wp-admin/upload.php3.27 ▲0.0435.25 ▼1.24
Virtue /wp-admin/options-general.php?page=virtue-for-woocommerce3.2630.42

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Virtue - Charity Donations UK
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,471 ▼26413.20 ▼1.160.44 ▼1.5916.21 ▼30.43
Dashboard /wp-admin2,212 ▲235.86 ▲0.91102.79 ▼23.0738.97 ▼6.28
Posts /wp-admin/edit.php2,098 ▲92.04 ▲0.0540.05 ▼0.3533.93 ▼1.17
Add New Post /wp-admin/post-new.php1,533 ▲1423.14 ▼0.01605.63 ▼59.4454.98 ▲3.09
Media Library /wp-admin/upload.php1,394 ▲64.30 ▲0.0797.79 ▼0.1045.56 ▲1.22
Virtue /wp-admin/options-general.php?page=virtue-for-woocommerce7892.0528.1425.75

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% 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 0% 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 fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/virtue-for-woocommerce/public/partials/post-purchase-widget.php
    • > /wp-content/plugins/virtue-for-woocommerce/public/partials/product-page-widget.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/virtue-for-woocommerce/admin/partials/virtue-woocommerce-admin-notice.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/virtue-for-woocommerce/admin/partials/virtue-woocommerce-admin-settings.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/virtue-for-woocommerce/public/partials/cart-page-widget.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: donations, donate button, tree-planting, charity, checkout donations

virtue-for-woocommerce/virtue-woocommerce.php 85% from 13 tests

"Virtue - Charity Donations UK" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("virtue-for-woocommerce.php" instead of "virtue-woocommerce.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 158 characters long)

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
Everything looks great! No dangerous files found in this plugin620 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP17236722599
CSS20615
JavaScript2466

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.24
Average class complexity6.89
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity2.02
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods52
▷ Static methods23.85%
▷ Public methods4586.54%
▷ Protected methods00.00%
▷ Private methods713.46%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.57MB with 0.39MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/img/virtue-hero.png586.94KB184.97KB▼ 68.49%