83% pepro-bacs-receipt-upload-for-woocommerce

Code Review | PeproDev WooCommerce Receipt Uploader

WordPress plugin PeproDev WooCommerce Receipt Uploader scored83%from 54 tests.

About plugin

  • Plugin page: pepro-bacs-receip...
  • Plugin version: 2.5.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 13, 2020
  • Latest release: Sep 3, 2023
  • Number of updates: 33
  • Update frequency: every 32.0 days
  • Top authors: peprodev (66.67%)blackswanlab (36.36%)

Code review

54 tests

User reviews

11 reviews

Install metrics

2,000+ active /14,211 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

A check of server-side resources used by PeproDev WooCommerce Receipt Uploader
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.93 ▲2.19
Dashboard /wp-admin3.31 ▲0.0060.16 ▲8.03
Posts /wp-admin/edit.php3.36 ▲0.0044.38 ▼3.94
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.14 ▼5.06
Media Library /wp-admin/upload.php3.23 ▲0.0033.93 ▼1.40

Server storage [IO: ▲0.33MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 40 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
wcuploadrcp-clearunistall
wcuploadrcp-cleardbunistall
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for PeproDev WooCommerce Receipt Uploader
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.17 ▼0.071.73 ▲0.1044.78 ▲0.28
Dashboard /wp-admin2,198 ▲245.67 ▲0.0687.85 ▼1.0141.71 ▲0.02
Posts /wp-admin/edit.php2,100 ▲32.00 ▲0.0534.13 ▲0.8733.43 ▼2.94
Add New Post /wp-admin/post-new.php1,526 ▼322.96 ▼0.16598.43 ▼11.3848.62 ▼5.40
Media Library /wp-admin/upload.php1,400 ▲34.17 ▼0.0894.25 ▼4.0641.62 ▼0.28

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • wcuploadrcp-cleardbunistall
    • widget_recent-comments
    • db_upgraded
    • wcuploadrcp-clearunistall

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/pepro-bacs-receipt-upload-for-woocommerce/wc-upload-reciept.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: upload receipt, ecommerce solution, woocommerce

pepro-bacs-receipt-upload-for-woocommerce/wc-upload-reciept.php 77% from 13 tests

The primary PHP file in "PeproDev WooCommerce Receipt Uploader" version 2.5.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("pepro-bacs-receipt-upload-for-woocommerce.php" instead of "wc-upload-reciept.php")
  • Description: The description should be shorter than 140 characters (currently 149 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected2,486 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP19834471,667
PO File1151210379
CSS2349185
JavaScript21011178
SVG14047
Markdown17029
HTML1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity24.43
▷ Minimum class complexity3.00
▷ Maximum class complexity150.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods69
▷ Static methods00.00%
▷ Public methods69100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions00.00%
▷ Anonymous functions5100.00%
Constants1
▷ Global constants1100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/backend/images/NoImageLarge.png1.24KB1.20KB▼ 2.91%