84% fahipay-payment-gateway-for-wc

Code Review | FahiPay Payment Gateway for WooCommerce

WordPress plugin FahiPay Payment Gateway for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: fahipay-payment-g...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.5
  • WordPress version: 6.3.1
  • First release: Nov 28, 2020
  • Latest release: Nov 28, 2020
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: fahipay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /354 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

This is a short check of server-side resources used by FahiPay Payment Gateway for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0033.35 ▼6.11
Dashboard /wp-admin3.31 ▲0.0144.25 ▼2.02
Posts /wp-admin/edit.php3.36 ▲0.0059.05 ▲15.33
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.85 ▼11.85
Media Library /wp-admin/upload.php3.23 ▲0.0034.07 ▲4.19

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

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

Browser metrics Passed 4 tests

A check of browser resources used by FahiPay Payment Gateway for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.36 ▼1.231.73 ▲0.1239.87 ▼1.27
Dashboard /wp-admin2,209 ▲204.86 ▼0.06106.49 ▲0.0637.91 ▼4.82
Posts /wp-admin/edit.php2,092 ▲32.02 ▲0.0341.68 ▲5.9639.93 ▲7.00
Add New Post /wp-admin/post-new.php1,533 ▲1923.30 ▲5.59667.40 ▲4.7661.61 ▲0.42
Media Library /wp-admin/upload.php1,385 ▼34.25 ▲0.03105.65 ▲6.2448.26 ▲6.71

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

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

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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fahipay-payment-gateway-for-wc/index.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Contributors: The plugin contributors field is missing
The official readme.txt might help

fahipay-payment-gateway-for-wc/index.php 92% from 13 tests

Analyzing the main PHP file in "FahiPay Payment Gateway for WooCommerce" version 1.0.0
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("fahipay-payment-gateway-for-wc.php" instead of "index.php")

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 detected182 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1358182

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin