84% paystack-sprout-invoices

Code Review | Paystack Gateway for Sprout Invoices

WordPress plugin Paystack Gateway for Sprout Invoices scored 84% from 54 tests.

About plugin

  • Plugin page: paystack-sprout-i...
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.9
  • WordPress version: 6.3.1
  • First release: May 11, 2018
  • Latest release: Jan 27, 2022
  • Number of updates: 9
  • Update frequency: every 194.8 days
  • Top authors: paystack (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 1,950 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: ▼2.04ms] Passed 4 tests

An overview of server-side resources used by Paystack Gateway for Sprout Invoices
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.99 ▼1.65
Dashboard /wp-admin3.31 ▲0.0051.56 ▼1.38
Posts /wp-admin/edit.php3.36 ▲0.0052.20 ▼2.94
Add New Post /wp-admin/post-new.php5.89 ▲0.0095.87 ▼2.17
Media Library /wp-admin/upload.php3.24 ▲0.0038.09 ▲2.36

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Paystack Gateway for Sprout Invoices
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲2513.26 ▼0.062.04 ▲0.3842.27 ▲1.64
Dashboard /wp-admin2,206 ▼04.89 ▲0.05109.03 ▲10.3843.37 ▲3.81
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0340.38 ▲4.3236.48 ▲2.66
Add New Post /wp-admin/post-new.php1,533 ▼123.39 ▲0.34599.15 ▼112.6150.72 ▼13.78
Media Library /wp-admin/upload.php1,391 ▲34.25 ▲0.0095.94 ▼4.4247.03 ▲3.11

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'SI_Credit_Card_Processors' not found in wp-content/plugins/paystack-sprout-invoices/SI_Paystack.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'SI_Updates' not found in wp-content/plugins/paystack-sprout-invoices/SI_Updates.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/paystack-sprout-invoices/sprout-invoices-paystack-payments.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

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
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (The slick Paystack settings panel.) image required
You can look at the official readme.txt

paystack-sprout-invoices/sprout-invoices-paystack-payments.php 92% from 13 tests

"Paystack Gateway for Sprout Invoices" version 3.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("paystack-sprout-invoices.php" instead of "sprout-invoices-paystack-payments.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected416 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP39883416

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity11.00
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods24
▷ Static methods1458.33%
▷ Public methods1875.00%
▷ Protected methods14.17%
▷ Private methods520.83%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants22
▷ Global constants522.73%
▷ Class constants1777.27%
▷ Public constants17100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin