74% project-donations-wc

Code Review | Project Donations for WooCommerce

WordPress plugin Project Donations for WooCommerce scored74%from 54 tests.

About plugin

  • Plugin page: project-donations-wc
  • Plugin version: 1.5.5
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2.2
  • WordPress version: 6.3.1
  • First release: Aug 5, 2022
  • Latest release: Jun 10, 2023
  • Number of updates: 4
  • Update frequency: every 77.0 days
  • Top authors: magicoli69 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /226 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: ▼1.80MB] [CPU: ▼58.84ms] Passed 4 tests

An overview of server-side resources used by Project Donations for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.20 ▼1.266.32 ▼34.72
Dashboard /wp-admin2.22 ▼1.136.44 ▼59.16
Posts /wp-admin/edit.php2.22 ▼1.146.18 ▼43.02
Add New Post /wp-admin/post-new.php2.22 ▼3.676.57 ▼98.46
Media Library /wp-admin/upload.php2.22 ▼1.016.69 ▼27.08

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Project Donations for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.21 ▼1.184.71 ▲2.7742.61 ▲3.39
Dashboard /wp-admin2,210 ▲194.86 ▼0.07117.89 ▲2.5842.54 ▼0.80
Posts /wp-admin/edit.php2,093 ▲42.08 ▲0.0437.88 ▼2.3032.39 ▼4.15
Add New Post /wp-admin/post-new.php1,518 ▼117.53 ▼5.57677.07 ▼11.0460.20 ▼4.56
Media Library /wp-admin/upload.php1,395 ▲74.23 ▼0.05101.62 ▼5.3244.94 ▼0.56

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function is_single was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/project-donations-wc/includes/class-woocommerce.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_single() in wp-content/plugins/project-donations-wc/includes/class-project.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/project-donations-wc/admin/wc-admin-classes.php:13

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: projects, donation, woocommerce, product

project-donations-wc/project-donations-wc.php Passed 13 tests

Analyzing the main PHP file in "Project Donations for WooCommerce" version 1.5.5
92 characters long description:
Add project field to WooCommerce products, allow clients to link their purchase to a project

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
There were no executable files found in this plugin1,766 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP81942021,142
PO File3253274568
Markdown220049
CSS2105
JavaScript2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity39.50
▷ Minimum class complexity3.00
▷ Maximum class complexity79.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods50
▷ Static methods3162.00%
▷ Public methods50100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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
PNG images were not found in this plugin