67% tryst-invoice

Code Review | Tryst Invoice

WordPress plugin Tryst Invoice scored67%from 54 tests.

About plugin

  • Plugin page: tryst-invoice
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2.9+
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0.0-5.5.1
  • WordPress version: 6.3.1
  • First release: Oct 28, 2020
  • Latest release: Oct 28, 2020
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: mbsdevel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /298 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼11.67ms] Passed 4 tests

Analyzing server-side resources used by Tryst Invoice
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1344.48 ▲0.98
Dashboard /wp-admin3.53 ▲0.2249.37 ▼1.73
Posts /wp-admin/edit.php3.58 ▲0.2251.70 ▼3.15
Add New Post /wp-admin/post-new.php5.35 ▼0.5365.67 ▼42.79
Media Library /wp-admin/upload.php3.39 ▲0.1638.65 ▲2.52
Novo /wp-admin/post-new.php?post_type=invoice3.3136.72
Todos os Boletos /wp-admin/edit.php?post_type=invoice3.4340.82

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 42 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
tryst_option
db_upgraded
widget_theysaidso_widget
widget_recent-posts
recovery_mode_email_last_sent
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Tryst Invoice
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,940 ▲19413.58 ▼0.798.74 ▲6.8445.36 ▲3.25
Dashboard /wp-admin2,237 ▲465.83 ▲0.77118.44 ▲8.2548.83 ▼0.01
Posts /wp-admin/edit.php2,120 ▲341.99 ▼0.0236.66 ▼2.2133.09 ▼2.73
Add New Post /wp-admin/post-new.php45 ▼1,4740.44 ▼22.610.07 ▼695.819.27 ▼42.71
Media Library /wp-admin/upload.php1,416 ▲284.20 ▼0.0496.06 ▼16.6173.85 ▲24.38
Novo /wp-admin/post-new.php?post_type=invoice450.440.1011.46
Todos os Boletos /wp-admin/edit.php?post_type=invoice1,0841.9831.7629.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
  • Zombie WordPress options were found after uninstall: 8 options
    • tryst_option
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/post-new.php?post_type=invoice
    • > Notice in wp-content/plugins/tryst-invoice/admin/class-tryst-invoice-admin-meta.php+143
    Undefined index: invoice_nonce
    • > GET request to /wp-admin/post-new.php?post_type=invoice
    • > Error in wp-content/plugins/tryst-invoice/includes/Tryst/Invoice.php+7
    Uncaught Error: Interface 'Tryst\Contracts\Mail' not found in wp-content/plugins/tryst-invoice/includes/Tryst/Invoice.php:7
    Stack trace:
    #0 wp-content/plugins/tryst-invoice/vendor/composer/ClassLoader.php(440): include()
    #1 wp-content/plugins/tryst-invoice/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile()
    #2 [internal function]: Composer\Autoload\ClassLoader->loadClass()
    #3 wp-content/plugins/tryst-invoice/admin/class-tryst-invoice-admin-meta.php(77): spl_autoload_call()
    #4 wp-includes/class-wp-hook.php(312): Tryst_Invoice_Admin_Meta::add_invoice_request_metaboxes()
    #5 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #6 wp-includes/plugin.php(517): WP_Hook->do_action()
    #7 wp-admin/includes/meta-boxes.php(1715): do_action()
    #8 wp-admin/edit-form-advanced.php(271): register_and_do_post_meta_boxes()
    #9 /var/www/w

SRP 0% 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
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/tryst-invoice/admin/partials/tryst-invoice-admin-display.php
    • > /wp-content/plugins/tryst-invoice/public/partials/tryst-invoice-public-display.php
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_page_link() in wp-content/plugins/tryst-invoice/public/templates/form-invoice-request.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/tryst-invoice/public/templates/Domain/form-invoice-request.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/tryst-invoice/public/class-tryst-invoice-public.php:177
    • > PHP Fatal error
      Uncaught Error: Interface 'Tryst\\Contracts\\Mail' not found in wp-content/plugins/tryst-invoice/includes/Tryst/Invoice.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tryst-invoice/admin/class-tryst-invoice-admin-meta.php:155
    • > PHP Fatal error
      Uncaught Error: Class 'Tryst\\Invoice' not found in wp-content/plugins/tryst-invoice/includes/Tryst/Domain/Invoice.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/post-new.php?post_type=invoice
    • > Network (severe)
    wp-admin/post-new.php?post_type=invoice - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: tryst, member, meeting, calendar, invoice

tryst-invoice/tryst-invoice.php Passed 13 tests

This is the main PHP file of "Tryst Invoice" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
25 characters long description:
Invoice support for Tryst

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected1,415 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP253367781,197
HTML180126
PO File1161847
JavaScript378123
JSON10022
CSS2080

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.64
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods97
▷ Static methods2222.68%
▷ Public methods8991.75%
▷ Protected methods00.00%
▷ Private methods88.25%
Functions7
▷ Named functions457.14%
▷ Anonymous functions342.86%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
public/img/invoice-1.png6.11KB3.58KB▼ 41.32%