Posts: 16
Threads: 2
Joined: Apr 2013
2015-05-05, 05:40:53
(This post was last modified: 2015-05-05, 21:59:14 by ambo.)
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
Posts: 1,928
Threads: 88
Joined: Apr 2010
2015-05-05, 06:13:50
(This post was last modified: 2015-05-05, 06:15:28 by Oleg06.)
(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
Code: Parse error: syntax error, unexpected T_USE, expecting T_FUNCTION in /home/cp459243/public_html/demo/plugins/cleanUpload/PageAnalize.php on line 11
Posts: 6,266
Threads: 181
Joined: Sep 2011
Posts: 1,928
Threads: 88
Joined: Apr 2010
2015-05-05, 08:10:25
(This post was last modified: 2015-05-05, 08:15:38 by Oleg06.)
(2015-05-05, 07:36:07)shawn_a Wrote: php 5.3 probably
possible php 5.4, he uses is his
Posts: 1,928
Threads: 88
Joined: Apr 2010
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
Posts: 6,266
Threads: 181
Joined: Sep 2011
Posts: 16
Threads: 2
Joined: Apr 2013
2015-05-05, 15:25:07
(This post was last modified: 2015-05-05, 16:05:32 by ambo.)
I am sorry. I doing this plugin for acquaintance how homework for scool 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
Posts: 1,928
Threads: 88
Joined: Apr 2010
(2015-05-05, 15:25:07)ambo Wrote: I am sorry. I doing this plugin for acquaintance how homework for scool 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
вам грозит 2 в школе
Posts: 16
Threads: 2
Joined: Apr 2013
(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 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
вам грозит 2 в школе
В школе то всё нормально - там необходимо использовать именно trait и php 5.4 (здесь всё работает)
не хотелось копипастить в коде, но придётся.
Posts: 16
Threads: 2
Joined: Apr 2013
Posts: 6,266
Threads: 181
Joined: Sep 2011
That's fine just note on the plugin that it requires a higher version of php that gs minimum which is 5.2
Posts: 16
Threads: 2
Joined: Apr 2013
(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
Posts: 10
Threads: 1
Joined: Mar 2015
ambo, plugin 0.9.2 identifies as not used index.php file and offers to remove it)))
Posts: 6,266
Threads: 181
Joined: Sep 2011
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.
Posts: 16
Threads: 2
Joined: Apr 2013
(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.
Posts: 305
Threads: 15
Joined: Mar 2014
2015-05-07, 07:20:30
(This post was last modified: 2015-05-07, 07:20:59 by Tyblitz.)
(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...
Posts: 6,266
Threads: 181
Joined: Sep 2011
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"){
Posts: 16
Threads: 2
Joined: Apr 2013
2015-05-07, 15:19:08
(This post was last modified: 2015-05-07, 17:21:20 by ambo.)
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
Posts: 16
Threads: 2
Joined: Apr 2013
(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
Posts: 10
Threads: 1
Joined: Mar 2015
(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
Posts: 1,928
Threads: 88
Joined: Apr 2010
2015-05-11, 15:17:36
(This post was last modified: 2015-05-11, 15:52:24 by Oleg06.)
only for me when I enabled the plugin debug these warnings appear?
Posts: 16
Threads: 2
Joined: Apr 2013
(2015-05-11, 15:17:36)Oleg06 Wrote:
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.
Posts: 16
Threads: 2
Joined: Apr 2013
(2015-05-11, 15:17:36)Oleg06 Wrote:
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:
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 - ошибок не наблюдал.
Сделал исправления - по умолчания результат возвращает не ноль а нулевой массив.
В новой версии добавил подсчёт размера удаляемых файлов.
Posts: 6
Threads: 1
Joined: Jun 2017
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.
|