10% key4ce-osticket-bridge

Code Review | Key4ce osTicket Bridge

WordPress plugin Key4ce osTicket Bridge scored10%from 54 tests.

About plugin

  • Plugin page: key4ce-osticket-b...
  • Plugin version: 1.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.7
  • WordPress version: 6.3.1
  • First release: Jun 1, 2014
  • Latest release: Jan 30, 2018
  • Number of updates: 107
  • Update frequency: every 12.5 days
  • Top authors: m.tiggelaar (95.33%)mbnoimi (4.67%)Otto42 (1.87%)

Code review

54 tests

User reviews

14 reviews

Install metrics

100+ active /15,411 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/key4ce-osticket-bridge/ost-bridge.php+174
    extract() expects parameter 1 to be array, bool given

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

A check of server-side resources used by Key4ce osTicket Bridge
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.30 ▼2.37
Dashboard /wp-admin3.31 ▲0.0050.46 ▼1.01
Posts /wp-admin/edit.php3.36 ▲0.0053.20 ▲0.78
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.22 ▼6.65
Media Library /wp-admin/upload.php3.23 ▲0.0038.08 ▼1.05

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 148 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Key4ce osTicket Bridge
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▲0.221.73 ▲0.0244.05 ▲2.39
Dashboard /wp-admin2,198 ▲215.57 ▼0.0983.82 ▼4.8440.52 ▼0.60
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0341.54 ▲4.6637.71 ▼1.67
Add New Post /wp-admin/post-new.php1,526 ▼022.89 ▼0.20644.73 ▼57.9952.90 ▼2.28
Media Library /wp-admin/upload.php1,400 ▼04.21 ▲0.0696.25 ▼12.0944.99 ▲0.03

Uninstaller [IO: ▲3.50MB] [DB: ▲0.00MB] 25% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/key4ce-osticket-bridge/ost-bridge.php+174
    extract() expects parameter 1 to be array, bool given
  • This plugin has failed uninstalling correctly, leaving 148 files (3.50MB) in the plugin directory
    • (new file) admin/ost-config.php
    • (new file) admin/ost-departments.php
    • (new file) admin/ost-kb.php
    • (new file) admin/adminticketmail.php
    • (new file) admin/admin_create_ticket.php
    • (new file) admin/ost-emailtemp.php
    • (new file) admin/index.php
    • (new file) admin/header_nav.php
    • (new file) admin/header_nav_ticket.php
    • (new file) admin/db-settings.php
    • ...
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% 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)
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 take a closer look at the following
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/key4ce-osticket-bridge/includes/udscript.php
    • > /wp-content/plugins/key4ce-osticket-bridge/templates/pagination.php
    • > /wp-content/plugins/key4ce-osticket-bridge/includes/pagination.php
    • > /wp-content/plugins/key4ce-osticket-bridge/lib/attachment/download.php
  • 91× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: currentpage in wp-content/plugins/key4ce-osticket-bridge/templates/pagination.php on line 16
    • > PHP Notice
      Undefined variable: currentpage in wp-content/plugins/key4ce-osticket-bridge/templates/pagination.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/key4ce-osticket-bridge/templates/message.php:6
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/key4ce-osticket-bridge/admin/ost-emailtemp.php on line 7
    • > PHP Notice
      Undefined variable: keyost_usercloseticket in wp-content/plugins/key4ce-osticket-bridge/templates/list_tickets.php on line 126
    • > PHP Notice
      Undefined variable: currentpage in wp-content/plugins/key4ce-osticket-bridge/includes/pagination.php on line 18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/key4ce-osticket-bridge/templates/contact_nav_bar.php:2
    • > PHP Fatal error
      require_once(): Failed opening required 'WP_PLUGIN_DIR/key4ce-osticket-bridge/templates/kb_nav_bar.php' (include_path='.:/usr/share/php') in wp-content/plugins/key4ce-osticket-bridge/templates/knowledgebase.php on line 4
    • > PHP Warning
      require_once(WP_PLUGIN_DIR/key4ce-osticket-bridge/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/key4ce-osticket-bridge/admin/ost-ticketview.php on line 2
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/key4ce-osticket-bridge/admin/ost-licensekey.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (Shows the Client ticket list.), #2 (Shows how the client views the ticket.), #3 (Shows how the Wordpress admin views the ticket list.), #4 (Shows how the Wordpress admin views the), #5 (Shows the [addoscontact] shortcode forms), #6 (HTML Email template example (with signature).)
Please take inspiration from this readme.txt

key4ce-osticket-bridge/ost-bridge.php 92% from 13 tests

Analyzing the main PHP file in "Key4ce osTicket Bridge" version 1.4.0
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("key4ce-osticket-bridge.php" instead of "ost-bridge.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected37,280 lines of code in 99 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript275,99810,34926,470
PHP431451474,681
CSS23941754,247
PO File51,0078041,594
SVG100288

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity2.00
▷ Minimum method complexity2.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions64
▷ Named functions6398.44%
▷ Anonymous functions11.56%
Constants3
▷ Global constants3100.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
28 PNG files occupy 0.57MB with 0.27MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png67.99KB33.01KB▼ 51.44%
images/status.png1.58KB0.97KB▼ 38.58%
icons/search.png0.38KB0.40KB0.00%
icons/down.png2.94KB0.23KB▼ 92.16%
screenshot-2.png128.21KB54.17KB▼ 57.75%