72% purplepass-ticketing

Code Review | Purplepass plugin for The Event Calendar

WordPress plugin Purplepass plugin for The Event Calendar scored72%from 54 tests.

About plugin

  • Plugin page: purplepass-ticketing
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.4
  • WordPress version: 6.3.1
  • First release: Jul 16, 2020
  • Latest release: Jul 17, 2020
  • Number of updates: 13
  • Update frequency: every 7.2 days
  • Top authors: purplepass (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /511 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
This plugin's installer ran successfully

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

This is a short check of server-side resources used by Purplepass plugin for The Event Calendar
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.05 ▼5.30
Dashboard /wp-admin3.31 ▲0.0051.93 ▼2.38
Posts /wp-admin/edit.php3.36 ▲0.0049.91 ▼2.47
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.61 ▼15.20
Media Library /wp-admin/upload.php3.23 ▲0.0037.16 ▼4.30
Apps & Equipment /wp-admin/admin.php?page=scanning-selling-gear3.0022.97
Help & Feedback /wp-admin/admin.php?page=help-support3.0019.92
Order Custom Tickets /wp-admin/admin.php?page=order-custom-tickets3.0022.17
Purplepass /wp-admin/admin.php?page=purplepass3.0020.74
Stats /wp-admin/admin.php?page=purplepass-stats3.0024.54
Payments /wp-admin/admin.php?page=payments3.0022.19
Log info /wp-admin/admin.php?page=log-info3.0024.12

Server storage [IO: ▲6.33MB] [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: 178 new files
Database: 5 new tables, 7 new options
New tables
wp_pptec_events
wp_pp_logs
wp_pp_stats
wp_pptec_wp_venue_to_pp_venue
wp_pp_sync_events
New WordPress options
widget_recent-comments
widget_recent-posts
pptec_widget_settings
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Purplepass plugin for The Event Calendar
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.421.69 ▼0.1340.27 ▼6.57
Dashboard /wp-admin2,198 ▲185.48 ▼0.1384.46 ▼8.2239.90 ▼7.99
Posts /wp-admin/edit.php2,100 ▼02.00 ▼0.0435.97 ▲1.1032.63 ▼0.86
Add New Post /wp-admin/post-new.php1,535 ▲623.09 ▲0.03637.41 ▼36.8952.88 ▼9.77
Media Library /wp-admin/upload.php1,400 ▲34.20 ▼0.2496.15 ▼12.8744.75 ▼1.10
Apps & Equipment /wp-admin/admin.php?page=scanning-selling-gear280.420.114.03
Help & Feedback /wp-admin/admin.php?page=help-support280.420.084.04
Order Custom Tickets /wp-admin/admin.php?page=order-custom-tickets280.420.073.67
Purplepass /wp-admin/admin.php?page=purplepass280.420.075.00
Stats /wp-admin/admin.php?page=purplepass-stats280.420.094.52
Payments /wp-admin/admin.php?page=payments280.420.084.13
Log info /wp-admin/admin.php?page=log-info280.420.093.80

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please fix the following
  • 18× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/purplepass-ticketing/inc/mb/save-btn.php
    • > /wp-content/plugins/purplepass-ticketing/inc/html/gear.php
    • > /wp-content/plugins/purplepass-ticketing/inc/mb/hidden-status.php
    • > /wp-content/plugins/purplepass-ticketing/inc/mb/coupones.php
    • > /wp-content/plugins/purplepass-ticketing/inc/html/order-custom-tickets.php
    • > /wp-content/plugins/purplepass-ticketing/inc/mb/instructions.php
    • > /wp-content/plugins/purplepass-ticketing/classic-editor.php
    • > /wp-content/plugins/purplepass-ticketing/inc/mb/price-options.php
    • > /wp-content/plugins/purplepass-ticketing/inc/mb/delivery-type.php
    • > /wp-content/plugins/purplepass-ticketing/inc/html/help-support.php
  • 85× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant PPTEC_PLUGIN_PATH - assumed 'PPTEC_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/purplepass-ticketing/inc/Purplepass_ECP.php on line 4
    • > PHP Warning
      Use of undefined constant PPTEC_PLUGIN_DIR - assumed 'PPTEC_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/purplepass-ticketing/inc/html/order-custom-tickets.php on line 41
    • > PHP Warning
      Use of undefined constant PPTEC_PLUGIN_DIR - assumed 'PPTEC_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/purplepass-ticketing/inc/html/payments.php on line 83
    • > PHP Warning
      include_once(): Failed opening 'PPTEC_PLUGIN_PATHinc/Exceptions/EventFormValidationException.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/purplepass-ticketing/inc/Purplepass_ECP.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pptec_get_time_list() in wp-content/plugins/purplepass-ticketing/inc/mb/dates.php:17
    • > PHP Warning
      Use of undefined constant PPTEC_PLUGIN_DIR - assumed 'PPTEC_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/purplepass-ticketing/inc/html/payments.php on line 25
    • > PHP Notice
      Undefined variable: class_closed in wp-content/plugins/purplepass-ticketing/inc/mb/switcher.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/purplepass-ticketing/purple-events.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/purplepass-ticketing/inc/Cron.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/purplepass-ticketing/inc/Cron.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=scanning-selling-gear
    • > Network (severe)
    wp-admin/admin.php?page=scanning-selling-gear - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=help-support
    • > Network (severe)
    wp-admin/admin.php?page=help-support - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=order-custom-tickets
    • > Network (severe)
    wp-admin/admin.php?page=order-custom-tickets - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=purplepass
    • > Network (severe)
    wp-admin/admin.php?page=purplepass - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=purplepass-stats
    • > Network (severe)
    wp-admin/admin.php?page=purplepass-stats - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=payments
    • > Network (severe)
    wp-admin/admin.php?page=payments - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=log-info
    • > Network (severe)
    wp-admin/admin.php?page=log-info - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 90% 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 require attention:
  • Tags: Please delete some tags, you are using 17 tag instead of maximum 10
You can take inspiration from this readme.txt

purplepass-ticketing/purple-events.php 85% from 13 tests

The primary PHP file in "Purplepass plugin for The Event Calendar" version 1.0.4 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("purplepass-ticketing.php" instead of "purple-events.php")
  • Description: The description should be shorter than 140 characters (currently 149 characters long)

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 detected70,458 lines of code in 93 files:
LanguageFilesBlank linesComment linesLines of code
PHP431,5301,09244,014
CSS102,39186115,308
JavaScript101,0131,1684,938
SVG2002,672
Sass1434341,768
LESS1434441,758

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity109.20
▷ Minimum class complexity1.00
▷ Maximum class complexity410.00
Average method complexity9.07
▷ Minimum method complexity1.00
▷ Maximum method complexity92.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods67
▷ Static methods4161.19%
▷ Public methods4871.64%
▷ Protected methods22.99%
▷ Private methods1725.37%
Functions112
▷ Named functions10896.43%
▷ Anonymous functions43.57%
Constants23
▷ Global constants1982.61%
▷ Class constants417.39%
▷ Public constants4100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
21 PNG files occupy 0.83MB with 0.39MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/img_titl_left.png1.73KB1.59KB▼ 8.05%
img/img-bott-2.png90.50KB31.04KB▼ 65.71%
img/success.png0.65KB0.23KB▼ 64.75%
img/img-bott-1.png154.18KB59.22KB▼ 61.59%
img/icon_hover.png2.05KB1.37KB▼ 33.05%