84% give-receipt-attachments

Code Review | Receipt Attachments for GiveWP

WordPress plugin Receipt Attachments for GiveWP scored84%from 54 tests.

About plugin

  • Plugin page: give-receipt-atta...
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: Jun 8, 2016
  • Latest release: Oct 13, 2021
  • Number of updates: 16
  • Update frequency: every 122.3 days
  • Top authors: webdevmattcrom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /4,266 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
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.71ms] Passed 4 tests

An overview of server-side resources used by Receipt Attachments for GiveWP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0139.87 ▼7.96
Dashboard /wp-admin3.32 ▲0.0247.11 ▼11.53
Posts /wp-admin/edit.php3.37 ▲0.0147.54 ▼0.29
Add New Post /wp-admin/post-new.php5.90 ▲0.0191.36 ▼14.67
Media Library /wp-admin/upload.php3.24 ▲0.0134.60 ▼0.67

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Receipt Attachments for GiveWP
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▲0.091.58 ▼0.1040.32 ▲0.02
Dashboard /wp-admin2,192 ▲125.56 ▲0.0489.07 ▼9.2244.98 ▲4.61
Posts /wp-admin/edit.php2,097 ▼31.97 ▲0.0238.13 ▼0.8536.86 ▲3.60
Add New Post /wp-admin/post-new.php1,531 ▼522.99 ▲4.58610.47 ▼18.3749.19 ▼7.64
Media Library /wp-admin/upload.php1,403 ▲64.17 ▼0.0497.63 ▼9.0841.16 ▼4.30

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/give-receipt-attachments/give-receipt-attachments.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/give-receipt-attachments/inc/admin-notice.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: donations, receipt, givewp, donation, attachment

give-receipt-attachments/give-receipt-attachments.php 92% from 13 tests

The entry point to "Receipt Attachments for GiveWP" version 1.1.3 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Everything looks great! No dangerous files found in this plugin497 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP5127128368
CSS113395
JavaScript14526
Markdown1304
SVG1004

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions1593.75%
▷ Anonymous functions16.25%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin