Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cleanUpload
#1
Plugin Description:

This is cleaning your "Upload" from garbage (not used files in content or gallery albums).
This plugin scaning page source xml files and albums created in I18N Gallery (xml files). It search there all used files in content from "Upload".
Next, this plugin analizing to directory "Upload" and print in console all files that not used in content or gallery albums.
You can delete files from "Upload" just press button "Delete".


Install Instructions:

Requirements: PHP 5.3 or greater! Uncompress file in /plugins directory and activate it in control panel. Use clenUpload from Files panel
Reply
#2
(2015-05-05, 05:40:53)ambo Wrote: This plugin scaning page source xml files and alboms created in I18N Gallery (xml files).

It search there all used files in content from "Upload". 

Next, this plugin analizing to directory "Upload" and print in console all files that not used in content or gallery alboms.

You can delete files from "Upload" just press button "Delete".
This is cleaning your "Upload" from garbage (not used files).

plugin useful, but does not work
[Image: prLDKHC.png]

[Image: PwNsziB.png]
[Image: VHpkftL.png]

Code:
Parse error: syntax error, unexpected T_USE, expecting T_FUNCTION in /home/cp459243/public_html/demo/plugins/cleanUpload/PageAnalize.php on line 11
Reply
#3
php 5.3 probably
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#4
(2015-05-05, 07:36:07)shawn_a Wrote: php 5.3 probably

[Image: dt61wGF.png]
possible php 5.4, he uses is his
[Image: aU2Mkvg.png]
Reply
#5
with php5.4
Code:
Notice: Undefined variable: result in /home/cp459243/public_html/demo/plugins/cleanUpload/PageAnalize.php on line 48

Warning: array_unique() expects parameter 1 to be array, null given in /home/cp459243/public_html/demo/plugins/cleanUpload/PageAnalize.php on line 48

Warning: array_diff(): Argument #2 is not an array in /home/cp459243/public_html/demo/plugins/cleanUpload.php on line 87
Reply
#6
I meant 5.4, oops
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#7
I am sorry. I doing this plugin for acquaintance how homework for scool Smile and there was a requirement used "trait". Now i adapted a new plugin version (0.9.1) for php 5.3

Presentation: https://plus.google.com/u/0/111232801311...BBpCj7yKYh
Reply
#8
(2015-05-05, 15:25:07)ambo Wrote: I am sorry. I doing this plugin for acquaintance how homework for scool Smile and there was a requirement used "trait". Now i adapted a new plugin version (0.9.1) for php 5.3

Presentation: https://plus.google.com/u/0/111232801311...BBpCj7yKYh

try using the debug
[Image: r3kVB0f.png]

вам грозит 2 в школе Smile
Reply
#9
(2015-05-05, 17:13:04)Oleg06 Wrote:
(2015-05-05, 15:25:07)ambo Wrote: I am sorry. I doing this plugin for acquaintance how homework for scool Smile and there was a requirement used "trait". Now i adapted a new plugin version (0.9.1) for php 5.3

Presentation: https://plus.google.com/u/0/111232801311...BBpCj7yKYh

try using the debug
[Image: r3kVB0f.png]

вам грозит 2 в школе Smile

В школе то всё нормально - там необходимо использовать именно trait и php 5.4 (здесь всё работает)
не хотелось копипастить в коде, но придётся.
Reply
#10
(2015-05-05, 18:12:01)ambo Wrote:
(2015-05-05, 17:13:04)Oleg06 Wrote:
(2015-05-05, 15:25:07)ambo Wrote: I am sorry. I doing this plugin for acquaintance how homework for scool Smile and there was a requirement used "trait". Now i adapted a new plugin version (0.9.1) for php 5.3

Presentation: https://plus.google.com/u/0/111232801311...BBpCj7yKYh

try using the debug
[Image: r3kVB0f.png]

вам грозит 2 в школе Smile

В школе то всё нормально - там необходимо использовать именно trait и php 5.4 (здесь всё работает)
не хотелось копипастить в коде, но придётся.
Всё поправил, протестировал на php 5.3.28
Reply
#11
That's fine just note on the plugin that it requires a higher version of php that gs minimum which is 5.2
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#12
(2015-05-05, 22:06:40)shawn_a Wrote: That's fine just note on the plugin that it requires a higher version of php that gs minimum which is 5.2


I reload plugin and now it work on php 5.3 (early it was 5.4 version)
sorry for my not competence 
Reply
#13
ambo, plugin 0.9.2 identifies as not used index.php file and offers to remove it)))
Reply
#14
It would be kind of nice to have similar functionality in core where it keeps track of asset references, and shows a flag in filebrowsers, like a little dot to hint at its usage.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#15
(2015-05-06, 12:13:00)kuguar Wrote: ambo, plugin 0.9.2 identifies as not used index.php file and offers to remove it)))

Plugin scan only directory "upload". If file not exists in this directory that plugin ignore it.
Reply
#16
(2015-05-06, 15:24:48)ambo Wrote:
(2015-05-06, 12:13:00)kuguar Wrote: ambo, plugin 0.9.2 identifies as not used index.php file and offers to remove it)))

Plugin scan only directory "upload". If file not exists in this directory that plugin ignore it.

That's why it's called cleanUpload...
Reply
#17
It is IN uploads
GS includes an empty index.php file in uploads as a last resort protection to prevent dir listing in case htaccess fails.

it is ignored in upload.php
if ($file == "." || $file == ".." || $file == ".htaccess" || $file == "index.php"){
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#18
plugin ignored '.htaccess'

if($file != '.htaccess'){
$result[] = trim (substr($dirname, 3)."/".$file," \t\n\r\0\x0B");
}

you can add any file in "if" construction

example (very simple example):

class UploadAnalize{
.......
if($file != '.htaccess' && $file != 'index.html'){
$result[] = trim (substr($dirname, 3)."/".$file," \t\n\r\0\x0B");
}
....


i do it change in next version
Reply
#19
(2015-05-06, 12:13:00)kuguar Wrote: ambo, plugin 0.9.2 identifies as not used index.php file and offers to remove it)))

1.0.0 - add files by name index.* in exclude
Reply
#20
(2015-05-07, 17:29:40)ambo Wrote:
(2015-05-06, 12:13:00)kuguar Wrote: ambo, plugin 0.9.2 identifies as not used index.php file and offers to remove it)))

1.0.0 - add files by name index.* in exclude

It works great! Only for some reason in cleanUpload.php Version: 0.9.2 remains Wink
Reply
#21
[Image: 9afhtOY.png]
only for me when I enabled the plugin debug these warnings appear?
Reply
#22
(2015-05-11, 15:17:36)Oleg06 Wrote: [Image: 9afhtOY.png]
only for me when I enabled the plugin debug these warnings appear?

Second argument not array... (because not exist links files in your content)
I will make changes.
Do you use i18n_Gallery? This is main requirement.
Reply
#23
(2015-05-11, 15:17:36)Oleg06 Wrote: [Image: 9afhtOY.png]
only for me when I enabled the plugin debug these warnings appear?

(2015-05-12, 01:26:54)ambo Wrote:
(2015-05-11, 15:17:36)Oleg06 Wrote: [Image: 9afhtOY.png]
only for me when I enabled the plugin debug these warnings appear?

Second argument not array... (because not exist links files in your content)
I will make changes.
Do you use i18n_Gallery? This is main requirement.
В принципе ничего страшного. варнинг нас предупреждает что в массив сравнения попадёт нулевое значение после анализа ссылок на страницах.
Далее не может открыть директорию с галлереей - вероятно не создано ни одной галереи, либо как то ограничен доступ, либо не установлен плагин i18n_gallery , что вернёт пустой массив в сравнение.

Чесно говоря, нужно также посмотреть настройки денвера и апача. Я использую OpenServer  - ошибок не наблюдал.

Сделал исправления - по умолчания результат возвращает не ноль а нулевой массив.
В новой версии добавил подсчёт размера удаляемых файлов.
Reply
#24
Hi,

I just installed the plugin, (with GS 3.3.13 on debian 9 with php 7.0.2) and it just keep telling me "No files to clean", even when there are several files and also subdirectories with unused files...

Any hint?

BR,
Andreas.
Reply




Users browsing this thread: 3 Guest(s)