73% pay4fun-for-woocommerce

Code Review | Pay4Fun for WooCommerce

WordPress plugin Pay4Fun for WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: pay4fun-for-wooco...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.5
  • WordPress version: 6.3.1
  • First release: Nov 13, 2020
  • Latest release: Nov 14, 2020
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: pay4fun (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /355 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼2.23ms] Passed 4 tests

A check of server-side resources used by Pay4Fun for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.73 ▲2.17
Dashboard /wp-admin3.36 ▲0.0645.89 ▼1.90
Posts /wp-admin/edit.php3.47 ▲0.1249.79 ▲2.17
Add New Post /wp-admin/post-new.php5.95 ▲0.0790.44 ▼9.19
Media Library /wp-admin/upload.php3.28 ▲0.0634.46 ▼0.01
Pay4Fun Donations /wp-admin/options-general.php?page=p4f-donations-page3.2532.96
Pay4Fun /wp-admin/options-general.php?page=p4f-settings-page3.2732.60

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 39 new files
Database: 1 new table, 8 new options
New tables
wp_p4f_donations
New WordPress options
p4f_db_version
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_wp_p4fdonationswidget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pay4Fun for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲11313.60 ▼1.021.96 ▲0.3442.84 ▲3.00
Dashboard /wp-admin2,226 ▲385.81 ▼0.12101.20 ▼9.2340.07 ▼2.36
Posts /wp-admin/edit.php2,111 ▲222.04 ▼0.1235.42 ▼4.5333.74 ▼2.22
Add New Post /wp-admin/post-new.php1,555 ▲1322.93 ▲4.79674.19 ▲65.8756.02 ▼2.00
Media Library /wp-admin/upload.php1,411 ▲204.32 ▲0.0999.05 ▼2.2142.57 ▼1.88
Pay4Fun Donations /wp-admin/options-general.php?page=p4f-donations-page8372.0322.6527.96
Pay4Fun /wp-admin/options-general.php?page=p4f-settings-page1,0012.2123.3031.67

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_p4f_donations
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% 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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/pay4fun-for-woocommerce/includes/class-wp-p4f-donations-widget.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed: The official readme.txt is a good inspiration

pay4fun-for-woocommerce/woocommerce-pay4fun.php 77% from 13 tests

This is the main PHP file of "Pay4Fun for WooCommerce" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.7" instead of "4.0.0")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("pay4fun-for-woocommerce.php" instead of "woocommerce-pay4fun.php")

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 plugin2,770 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP223833751,927
PO File2266317733
Markdown127059
JavaScript28451

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.42
Average class complexity30.89
▷ Minimum class complexity2.00
▷ Maximum class complexity95.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods102
▷ Static methods109.80%
▷ Public methods8886.27%
▷ Protected methods32.94%
▷ Private methods1110.78%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants18
▷ Global constants844.44%
▷ Class constants1055.56%
▷ Public constants440.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 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/pay4fun.png7.29KB3.30KB▼ 54.70%