Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions mclogcleaner/config/mclogcleaner.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
'mclogcleaner_text_enabled' => filter_var(env('MCLOGCLEANER_TEXT_ENABLED', true), FILTER_VALIDATE_BOOL),
];
4 changes: 2 additions & 2 deletions mclogcleaner/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"id": "mclogcleaner",
"name": "McLogCleaner",
"author": "JuggleGaming",
"version": "1.1.1",
"version": "1.1.2",
"description": "Clean your Minecraft-logs with ease",
"category": "plugin",
"url": "https://github.com/pelican-dev/plugins/tree/main/mclogcleaner",
"update_url": null,
"update_url": "https://raw.githubusercontent.com/JuggleGaming/mclogcleaner/refs/heads/main/updater.json",
Comment on lines +5 to +9
Copy link
Contributor

@coderabbitai coderabbitai bot Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check all update_url entries across plugin.json files
fd plugin.json | xargs rg '"update_url"' -B1 -A1

Repository: pelican-dev/plugins

Length of output: 5829


Update URL points to a personal repository, inconsistent with repository pattern.

All other plugins in pelican-dev/plugins have update_url set to null. This plugin alone points to JuggleGaming/mclogcleaner for updates, allowing changes to be deployed without going through the pelican-dev review process. Either align with the repository pattern by setting update_url to null, or confirm this exception is intentional.

🤖 Prompt for AI Agents
In `@mclogcleaner/plugin.json` around lines 5 - 9, The plugin's update_url
currently points to a personal repo; change the "update_url" key in the
plugin.json to null to match the repository pattern (i.e., set "update_url":
null) and ensure the JSON remains valid (remove any trailing comma after the
last property if present); the field to edit is "update_url" in the plugin.json
containing the existing
"https://raw.githubusercontent.com/JuggleGaming/mclogcleaner/..." value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change that. Because the download must lead to my personal repo as well for the download i set the update_url to my repo as well. @Boy132 do you want me to change this or could this stay as it is? Before you ask. The moment this PR gets merged i will update my repo to be identical with this McLogCleaner-Release and create a new release there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise i can remove the update-system for my plugin in this repo - but in my oppinion it should keep existing.

"namespace": "JuggleGaming\\McLogCleaner",
"class": "McLogCleanerPlugin",
"panels": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ protected function setUp(): void
return !in_array('mclogcleaner', $features, true);
});

$this->label('Delete logs');
$this->label(function () {
return config('mclogcleaner.mclogcleaner_text_enabled') ? 'Delete logs' : '';
});
$this->icon('tabler-trash');
$this->color('danger');
$this->size(Size::ExtraLarge);
Expand Down Expand Up @@ -104,7 +106,7 @@ protected function setUp(): void
return $logDate->lessThan($threshold);
})
->pluck('name')
->map(fn ($name) => 'logs/' . $name)
->map(fn ($name) => 'logs/'.$name)
->values()
->all();
if (empty($logsToDelete)) {
Expand All @@ -124,7 +126,7 @@ protected function setUp(): void
->throw();
Notification::make()
->title('Logfolder cleaned')
->body(count($logsToDelete) . ' files were deleted.')
->body(count($logsToDelete).' files were deleted.')
->success()
->send();
} catch (\Throwable $e) {
Expand Down
30 changes: 29 additions & 1 deletion mclogcleaner/src/McLogCleanerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@

namespace JuggleGaming\McLogCleaner;

use App\Contracts\Plugins\HasPluginSettings;
use App\Traits\EnvironmentWriterTrait;
use Filament\Contracts\Plugin;
use Filament\Forms\Components\Toggle;
use Filament\Notifications\Notification;
use Filament\Panel;

class McLogCleanerPlugin implements Plugin
class McLogCleanerPlugin implements HasPluginSettings, Plugin
{
use EnvironmentWriterTrait;

public function getId(): string
{
return 'mclogcleaner';
Expand All @@ -21,4 +27,26 @@ public function boot(Panel $panel): void
{
//
}

public function getSettingsForm(): array
{
return [
Toggle::make('mclogcleaner_text_enabled')
->label('Enable button text')
->default(fn () => (bool) config('mclogcleaner.mclogcleaner_text_enabled', true)),
];
}

public function saveSettings(array $data): void
{
$this->writeToEnvironment([
'MCLOGCLEANER_TEXT_ENABLED' => $data['mclogcleaner_text_enabled'] ? 'true' : 'false',
]);

Notification::make()
->title('McLogCleaner')
->body('Settings successfully saved!')
->success()
->send();
}
}
6 changes: 6 additions & 0 deletions mclogcleaner/updater.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"*": {
"version": "1.1.2",
"download_url": "https://github.com/JuggleGaming/mclogcleaner/releases/latest/download/mclogcleaner.zip"
}
}