83% ourpass-payment-gateway

Code Review | OurPass One-Click Checkout

WordPress plugin OurPass One-Click Checkout scored83%from 54 tests.

About plugin

  • Plugin page: ourpass-payment-g...
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.8.1
  • WordPress version: 6.3.1
  • First release: Oct 20, 2021
  • Latest release: Jun 12, 2022
  • Number of updates: 18
  • Update frequency: every 13.3 days
  • Top authors: ourpass0824 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /733 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
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by OurPass One-Click Checkout
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.87 ▼4.67
Dashboard /wp-admin3.31 ▲0.0146.10 ▲1.00
Posts /wp-admin/edit.php3.36 ▲0.0041.26 ▼7.87
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.58 ▼9.02
Media Library /wp-admin/upload.php3.23 ▲0.0035.40 ▲0.62

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 72 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

OurPass One-Click Checkout: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲5114.45 ▲0.081.70 ▼0.2439.26 ▼5.82
Dashboard /wp-admin2,214 ▲254.96 ▲0.04111.91 ▼4.5542.29 ▲0.05
Posts /wp-admin/edit.php2,096 ▲72.01 ▼0.0034.88 ▼5.9433.11 ▼1.82
Add New Post /wp-admin/post-new.php1,553 ▲2023.53 ▲0.32629.24 ▼47.7648.58 ▼8.84
Media Library /wp-admin/upload.php1,399 ▲114.30 ▲0.0593.78 ▼20.3341.47 ▼6.94

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

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
The following issues need your attention
  • 38× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      require_once(OURPASSWC_PATHincludes/routes/class-route.php): failed to open stream: No such file or directory in wp-content/plugins/ourpass-payment-gateway/includes/routes.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'OurPass_Form_Field' not found in wp-content/plugins/ourpass-payment-gateway/includes/admin/fields/class-textarea.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/ourpass-payment-gateway/templates/admin/ourpass-settings-footer.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ourpass-payment-gateway/includes/admin/notices.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ourpasswc_load_template() in wp-content/plugins/ourpass-payment-gateway/templates/admin/tabs/ourpass-options.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ourpasswc_load_template() in wp-content/plugins/ourpass-payment-gateway/templates/admin/tabs/ourpass-app-info.php:8
    • > PHP Warning
      Use of undefined constant OURPASSWC_ONBOARDING_URL - assumed 'OURPASSWC_ONBOARDING_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/ourpass-payment-gateway/templates/admin/ourpass-settings-footer.php on line 9
    • > PHP Fatal error
      require_once(): Failed opening required 'OURPASSWC_PATHincludes/routes/class-route.php' (include_path='.:/usr/share/php') in wp-content/plugins/ourpass-payment-gateway/includes/routes.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ourpasswc_load_template() in wp-content/plugins/ourpass-payment-gateway/templates/ourpass-mini-cart.php:11
    • > PHP Warning
      require_once(OURPASSWC_PATHincludes/admin/fields/class-field.php): failed to open stream: No such file or directory in wp-content/plugins/ourpass-payment-gateway/includes/admin/fields.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
  • Screenshots: These screenshots do not have images: #1 ([Settings](assets/screenshot-1 "OurPass Section")), #2 ([Cart](assets/screenshot-2 "Product")), #7 ([OurPass Payment](assets/screenshot-7 "Checkout Successful"))
The official readme.txt might help

ourpass-payment-gateway/woo-ourpass.php 92% from 13 tests

The main file in "OurPass One-Click Checkout" v. 1.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("ourpass-payment-gateway.php" instead of "woo-ourpass.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin2,105 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
PHP385041,0262,078
SVG20018
JavaScript4014
CSS3003
Markdown1002

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity7.00
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes218.18%
▷ Concrete classes981.82%
▷ Final classes00.00%
Methods35
▷ Static methods00.00%
▷ Public methods617.14%
▷ Protected methods2982.86%
▷ Private methods00.00%
Functions99
▷ Named functions9898.99%
▷ Anonymous functions11.01%
Constants39
▷ Global constants39100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 8.06MB with 5.52MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png1,746.58KB682.01KB▼ 60.95%
assets/screenshot-5.png1,047.35KB272.63KB▼ 73.97%
assets/screenshot-7.png1,005.50KB259.72KB▼ 74.17%
assets/screenshot-4.png1,568.26KB652.76KB▼ 58.38%
assets/screenshot-1.png341.32KB85.70KB▼ 74.89%