94% help-a-charity

Code Review | Help a Charity

WordPress plugin Help a Charity scored 94% from 54 tests.

About plugin

  • Plugin page: help-a-charity
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.6
  • WordPress version: 5.8.1
  • First release: Mar 3, 2021
  • Latest release: Mar 3, 2021
  • Number of updates: 6
  • Update frequency: every 1.3 days
  • Top authors: lv8gr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 103 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼147.10ms] Passed 4 tests

An overview of server-side resources used by Help a Charity
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1235.54 ▲2.61
Dashboard /wp-admin3.06 ▲0.0133.55 ▼11.97
Posts /wp-admin/edit.php3.11 ▲0.0138.39 ▼7.12
Add New Post /wp-admin/post-new.php5.42 ▼0.0187.51 ▼567.79
Media Library /wp-admin/upload.php3.00 ▲0.0033.08 ▼1.52

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Help a Charity
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.95 ▲0.069.05 ▲0.7348.95 ▲1.66
Dashboard /wp-admin2,970 ▲366.00 ▲0.07129.99 ▼8.99109.33 ▲2.58
Posts /wp-admin/edit.php2,736 ▼32.69 ▼0.0163.89 ▼6.0091.41 ▲2.26
Add New Post /wp-admin/post-new.php1,672 ▲17219.02 ▲0.12372.07 ▼3.12108.18 ▼9.18
Media Library /wp-admin/upload.php1,807 ▼05.01 ▼0.00157.18 ▲11.78116.34 ▼7.09

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

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)
Even though everything seems fine, this is not an exhaustive test

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 fix the following items
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant HELPC_PATH - assumed 'HELPC_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/help-a-charity/help-a-charity-settings.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/help-a-charity/includes/helpc-class.php:9
    • > PHP Warning
      require_once(HELPC_PATHhd-wp-settings-api/class-hd-wp-settings-api.php): failed to open stream: No such file or directory in wp-content/plugins/help-a-charity/help-a-charity-settings.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/help-a-charity/help-a-charity.php:12
    • > PHP Fatal error
      require_once(): Failed opening required 'HELPC_PATHhd-wp-settings-api/class-hd-wp-settings-api.php' (include_path='.:/usr/share/php') in wp-content/plugins/help-a-charity/help-a-charity-settings.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: woocommerce, donation from owner, charity, donations, donation per order

help-a-charity/help-a-charity.php 92% from 13 tests

"Help a Charity" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected752 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP5202258671
CSS17857
JavaScript19224

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity31.67
▷ Minimum class complexity18.00
▷ Maximum class complexity50.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods32
▷ Static methods00.00%
▷ Public methods2268.75%
▷ Protected methods00.00%
▷ Private methods1031.25%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin