Project

General

Profile

Actions

Task #48

open
MF

Start developing a mu plugin

Task #48: Start developing a mu plugin

Added by Maurizio Folini about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Assignee:
-
Start date:
05/07/2026
Due date:
% Done:

0%

Estimated time:

Description

Better approach: develop it directly as one MU plugin, but build and test it one feature at a time.

Do not build many separate WPCode snippets and merge them later, except for very small experiments.

  1. Best workflow

Create one MU plugin like:

```text
wp-content/mu-plugins/
ydb-fluentsupport-tools.php
ydb-fluentsupport-tools/
concurrency.php
ticket-ui.php
logs.php
helpers.php
```

The main file only loads the modules:

```php
/** * Plugin Name: YDB FluentSupport Tools * Description: Custom FluentSupport extensions for ticket handling.
*/

if (!defined('ABSPATH')) {
exit;
}

require_once DIR . '/ydb-fluentsupport-tools/helpers.php';
require_once DIR . '/ydb-fluentsupport-tools/concurrency.php';
require_once DIR . '/ydb-fluentsupport-tools/ticket-ui.php';
require_once DIR . '/ydb-fluentsupport-tools/logs.php';
```

Then we develop things one by one:

1. Concurrency / ticket lock
2. Show who is viewing or replying
3. Assign ticket to current agent
4. Ticket history/audit log
5. Better frontend/agent page, if needed
6. Search/filter helpers

  1. Why this is better than snippets

Snippets are useful for testing simple things, but this project will probably need:

  • database tables or options
  • AJAX or REST endpoints
  • JavaScript loaded only on FluentSupport pages
  • user/ticket state tracking
  • cleanup logic
  • reusable helper functions
  • debugging and logging

That becomes messy very quickly with many snippets.

  1. When to use snippets

Use snippets only to answer questions like:

```text
Does this FluentSupport hook fire?
Can I detect the ticket ID here?
Can I get the current agent ID?
Can I add something to this admin screen?
```

Once confirmed, move the code immediately into the MU plugin.

  1. My recommendation

Start directly with the MU plugin.

For each feature, we make one module file and keep it disabled/enabled with a simple constant if needed:

```php
define('YDB_FS_ENABLE_CONCURRENCY', true);
define('YDB_FS_ENABLE_LOGS', false);
```

For your case, because ticket concurrency is serious, I would not build it as scattered snippets. It should be treated as a proper small plugin from the start.

Actions

Also available in: PDF Atom