84% woocommerce-pay-to-upload-modification

Code Review | WooCommerce Pay to Upload

WordPress plugin WooCommerce Pay to Upload scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-pay-t...
  • Plugin version: 2.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.1-5.3.2
  • WordPress version: 6.3.1
  • First release: Mar 16, 2013
  • Latest release: Feb 19, 2020
  • Number of updates: 50
  • Update frequency: every 50.6 days
  • Top authors: wpashokg (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

30+ active /8,238 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

Analyzing server-side resources used by WooCommerce Pay to Upload
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0343.56 ▼1.84
Dashboard /wp-admin3.32 ▲0.0249.30 ▼2.27
Posts /wp-admin/edit.php3.37 ▲0.0251.26 ▲2.21
Add New Post /wp-admin/post-new.php5.91 ▲0.0286.06 ▼5.09
Media Library /wp-admin/upload.php3.24 ▲0.0238.93 ▲3.28

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Pay to Upload
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.73 ▲0.521.62 ▼0.3142.24 ▼2.43
Dashboard /wp-admin2,195 ▲185.64 ▲0.1190.11 ▲0.4440.47 ▼5.85
Posts /wp-admin/edit.php2,103 ▲31.96 ▲0.0040.75 ▲2.7235.55 ▲3.86
Add New Post /wp-admin/post-new.php1,526 ▼1123.02 ▲4.92659.80 ▲21.1453.46 ▼13.54
Media Library /wp-admin/upload.php1,400 ▼34.20 ▼0.05112.26 ▲11.5947.77 ▲3.81

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • 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
Good news, no errors were detected

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 take a closer look at the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woocommerce-pay-to-upload-modification/classes/class-wc-pay-to-upload.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Airy_Framework' not found in wp-content/plugins/woocommerce-pay-to-upload-modification/classes/class-wc-pay-to-upload.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% 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
2 plugin tags: woocommerce, file upload

woocommerce-pay-to-upload-modification/wc-pay-to-upload.php 92% from 13 tests

"WooCommerce Pay to Upload" version 2.1.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woocommerce-pay-to-upload-modification.php" instead of "wc-pay-to-upload.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin535 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3101220535

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity51.00
▷ Minimum class complexity42.00
▷ Maximum class complexity60.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.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
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icons/excel.png1.93KB1.61KB▼ 16.91%
icons/csv.png2.19KB1.55KB▼ 29.33%
icons/word.png2.10KB1.80KB▼ 14.54%
icons/text.png0.84KB0.43KB▼ 49.12%
icons/pdf.png2.26KB1.74KB▼ 23.22%