78% wc-gateway-greeninvoice

Code Review | Morning for WooCommerce

WordPress plugin Morning for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: wc-gateway-greeni...
  • Plugin version: 1.2.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.3
  • WordPress version: 6.3.1
  • First release: Aug 6, 2020
  • Latest release: Oct 25, 2023
  • Number of updates: 26
  • Update frequency: every 45.2 days
  • Top authors: DorZki (53.85%)greeninvoice (50%)

Code review

54 tests

User reviews

1 review

Install metrics

900+ active /5,661 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

Server-side resources used by Morning for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0140.08 ▼1.89
Dashboard /wp-admin3.33 ▲0.0244.51 ▼3.68
Posts /wp-admin/edit.php3.38 ▲0.0245.53 ▼0.51
Add New Post /wp-admin/post-new.php5.91 ▲0.0287.28 ▼2.99
Media Library /wp-admin/upload.php3.25 ▲0.0234.70 ▲1.39

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 45 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Morning for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.45 ▼0.141.86 ▼0.0139.08 ▼1.29
Dashboard /wp-admin2,190 ▲105.48 ▼0.1981.39 ▼7.2140.28 ▼0.73
Posts /wp-admin/edit.php2,104 ▲42.03 ▲0.0234.67 ▼2.2733.07 ▼2.08
Add New Post /wp-admin/post-new.php1,530 ▲423.06 ▼0.65639.84 ▼56.9154.94 ▲6.30
Media Library /wp-admin/upload.php1,398 ▼24.29 ▲0.0496.79 ▲0.5543.09 ▼4.35

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wc-gateway-greeninvoice/templates/admin/order-metabox.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: order_meta_labels in wp-content/plugins/wc-gateway-greeninvoice/templates/admin/order-metabox.php on line 15
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wc-gateway-greeninvoice/templates/admin/order-metabox.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wc-gateway-greeninvoice/templates/frontend/installments-form.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/wc-gateway-greeninvoice/templates/admin/settings-page.php:14

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention: You can look at the official readme.txt

wc-gateway-greeninvoice/wc-gateway-greeninvoice.php Passed 13 tests

The main PHP file in "Morning for WooCommerce" ver. 1.2.1 adds more information about the plugin and also serves as the entry point for this plugin
64 characters long description:
Accept payments from clients, with automated invoice production.

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
Good job! No executable or dangerous file extensions detected1,560 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP365741,6891,520
SVG10136
CSS2042
JavaScript2022

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 complexity4.93
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.22
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes30
▷ Abstract classes13.33%
▷ Concrete classes2996.67%
▷ Final classes620.69%
Methods97
▷ Static methods1616.49%
▷ Public methods7072.16%
▷ Protected methods1313.40%
▷ Private methods1414.43%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants83
▷ Global constants89.64%
▷ Class constants7590.36%
▷ Public constants75100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/dropdown-arrow.png0.27KB0.25KB▼ 7.50%