83% a-gateway-for-pasargad-bank-on-woocommerce

Code Review | a Gateway for Pasargad Bank on WooCommerce

WordPress plugin a Gateway for Pasargad Bank on WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: a-gateway-for-pas...
  • Plugin version: 2.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.8
  • WordPress version: 6.3.1
  • First release: Nov 13, 2016
  • Latest release: Mar 31, 2017
  • Number of updates: 10
  • Update frequency: every 25.6 days
  • Top authors: AlaFalaki (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active /4,000 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.06ms] Passed 4 tests

This is a short check of server-side resources used by a Gateway for Pasargad Bank on WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0433.99 ▼2.25
Dashboard /wp-admin3.34 ▲0.0444.73 ▼4.17
Posts /wp-admin/edit.php3.39 ▲0.0447.43 ▲1.90
Add New Post /wp-admin/post-new.php5.92 ▲0.0491.40 ▼7.71
Media Library /wp-admin/upload.php3.27 ▲0.0436.28 ▲3.20

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

a Gateway for Pasargad Bank on WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.26 ▼1.321.67 ▲0.2042.11 ▼1.20
Dashboard /wp-admin2,206 ▲184.85 ▼0.04110.46 ▼9.5641.54 ▼3.86
Posts /wp-admin/edit.php2,086 ▼32.00 ▼0.0539.38 ▲4.8236.44 ▼1.65
Add New Post /wp-admin/post-new.php1,522 ▼1323.37 ▲0.12640.40 ▼50.7949.88 ▼6.30
Media Library /wp-admin/upload.php1,391 ▼04.22 ▲0.0494.68 ▼6.8042.51 ▼2.25

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions 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/a-gateway-for-pasargad-bank-on-woocommerce/index.php:12

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)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed: You can take inspiration from this readme.txt

a-gateway-for-pasargad-bank-on-woocommerce/index.php 92% from 13 tests

The entry point to "a Gateway for Pasargad Bank on WooCommerce" version 2.5.2 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("a-gateway-for-pasargad-bank-on-woocommerce.php" instead of "index.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 plugin515 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP57573515

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity9.40
▷ Minimum class complexity1.00
▷ Maximum class complexity18.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods30
▷ Static methods00.00%
▷ Public methods30100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.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
images/logo.png1.51KB1.73KB0.00%