84% paystack-for-events-calendar

Code Review | Paystack for The Events Calendar

WordPress plugin Paystack for The Events Calendar scored84%from 54 tests.

About plugin

  • Plugin page: paystack-for-even...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8.6-6.2.2
  • WordPress version: 6.3.1
  • First release: Jan 11, 2023
  • Latest release: Oct 4, 2023
  • Number of updates: 7
  • Update frequency: every 40.7 days
  • Top authors: paystack (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /623 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

This is a short check of server-side resources used by Paystack for The Events Calendar
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0042.60 ▼0.07
Dashboard /wp-admin3.31 ▲0.0049.81 ▲1.64
Posts /wp-admin/edit.php3.36 ▲0.0045.75 ▼4.84
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.16 ▼12.31
Media Library /wp-admin/upload.php3.23 ▲0.0036.94 ▲0.55

Server storage [IO: ▲0.72MB] [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: 52 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Paystack for The Events Calendar
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.57 ▼0.814.49 ▲2.3747.77 ▲2.89
Dashboard /wp-admin2,221 ▲515.86 ▲0.17101.51 ▲6.0839.43 ▼5.27
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0240.92 ▲0.4040.55 ▲6.44
Add New Post /wp-admin/post-new.php1,556 ▲3023.43 ▲5.88608.16 ▼86.6653.88 ▼7.62
Media Library /wp-admin/upload.php1,400 ▼04.22 ▼0.0294.74 ▼21.5641.93 ▼5.00

Uninstaller [IO: ▲0.00MB] [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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • 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 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 36× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/paystack-for-events-calendar/paystack/checkout/fields/email.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/paystack-for-events-calendar/paystack/admin-views/fields/mode-select.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/paystack-for-events-calendar/paystack/admin-views/fields/checkout-mode.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/paystack-for-events-calendar/paystack/checkout/container.php:31
    • > PHP Notice
      Undefined variable: value in wp-content/plugins/paystack-for-events-calendar/paystack/admin-views/fields/input.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'tad_DI52_ServiceProvider' not found in wp-content/plugins/paystack-for-events-calendar/classes/class-provider.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'TEC\\Tickets\\Commerce\\Gateways\\Contracts\\Abstract_Settings' not found in wp-content/plugins/paystack-for-events-calendar/classes/class-settings.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'TEC\\Tickets\\Commerce\\Gateways\\Contracts\\Abstract_Gateway' not found in wp-content/plugins/paystack-for-events-calendar/classes/class-gateway.php:16
    • > PHP Notice
      Undefined variable: has_sub_account in wp-content/plugins/paystack-for-events-calendar/paystack/checkout/fields/hidden.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/paystack-for-events-calendar/paystack/admin-views/connect/inactive.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Requires php: Version format is invalid
Please take inspiration from this readme.txt

paystack-for-events-calendar/paystack-tec.php 92% from 13 tests

The main PHP file in "Paystack for The Events Calendar" ver. 1.0.3 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("paystack-for-events-calendar.php" instead of "paystack-tec.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
There were no executable files found in this plugin14,177 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
JSON20011,945
PHP333488141,762
JavaScript12519224
PO File17177155
Markdown145050
CSS18041

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity10.54
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods66
▷ Static methods710.61%
▷ Public methods5887.88%
▷ Protected methods710.61%
▷ Private methods11.52%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.16MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
.wordpress.org/icon-256x256.png2.67KB2.11KB▼ 21.04%
assets/images/icon.png13.06KB7.82KB▼ 40.15%
.wordpress.org/icon-128x128.png1.21KB1.04KB▼ 14.22%
.wordpress.org/banner-1544x500.png76.09KB33.20KB▼ 56.37%
.wordpress.org/banner-772x250.png25.23KB11.09KB▼ 56.05%