Support

Admin Tools for WordPress

#29833 File scanner link incorrect in doc?

Posted in ‘Admin Tools for WordPress’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

WordPress version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by on Wednesday, 18 July 2018 17:17 CDT

hkymre
I've set up a cron as per the doc & it's failing with could not open input file

The doc says to use
/path/to/php /xxxxx/public/wp-content/plugins/admintoolswp/cli/admintools-filescanner.php

But there is no cli folder
admintools-filescanner.php is installed in wp-content/plugins/admintoolswp/

I'm using 1.0.0.b1

tampe125
Akeeba Staff
Hello,

thank you very much for the report.
There is indeed a typo in the documentation, the correct path is wp-content/plugins/admintoolswp/app/cli/admintools-filescanner.php
I'm going to fix it right now.

Davide Tampellini

Developer and Support Staff

๐Ÿ‡ฎ๐Ÿ‡นItalian: native ๐Ÿ‡ฌ๐Ÿ‡งEnglish: good โ€ข ๐Ÿ• My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

hkymre
Thanks.
It also appears on the Automatic Scanning page in Malware Detection

tampe125
Akeeba Staff
Thank you!

Davide Tampellini

Developer and Support Staff

๐Ÿ‡ฎ๐Ÿ‡นItalian: native ๐Ÿ‡ฌ๐Ÿ‡งEnglish: good โ€ข ๐Ÿ• My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

hkymre
Just to clarify the correct link is wp-content/plugins/admintoolswp/filescanner.php

I got the php filename wrong above.

My cron is now running but it's throwing the below error

403 COM_ADMINTOOLS_ERROR_NOT_ENABLED

I've now set Frontend to Yes in the scanner options. Think the word Run is missing below the button

When enabled it allows you to the PHP File Change Scanner without logging in to the backend.
When enabled it allows you to run the PHP File Change Scanner without logging in to the backend.

It now fails with
403 COM_ADMINTOOLS_ERROR_INVALID_KEY

I assume that's because my cron doesn't have the key added but I wouldn't expect the cron to need the key & front end enabling.

Ran the Cron with
/path/to/php srv/etc/etc/wp-content/plugins/admintoolswp/filescanner.php?key=secret_bit

And that failed with Could not open input file

nicholas
Akeeba Staff
Manager
There are two different ways to schedule the malware scanner.

1. Using CRON (command line). The correct path for that file is wp-content/plugins/admintoolswp/app/cli/admintools-filescanner.php as Davide said.

2. Using fake CRON (access a file over the web, e.g. using wget or cURL). In this case the URL you need to access is wp-content/plugins/admintoolswp/filescanner.php as you said.

From your ticket it's evident that you are trying to use the first method (command line). Therefore you must use the path that Davide gave you. The path you are trying to use is for the web-accessible version of the malware scanner which won't run correctly using a command-line CRON.

Also note that you can not pass command line parameters in URL query format (using question mark and key=value pairs separated by ampersands). This has a completely different meaning in the command line and your server rightfully complains about it.

So, the correct CRON command line for your case is
/path/to/php srv/etc/etc/wp-content/plugins/admintoolswp/app/cli/admintools-filescanner.php
You should also disable the front-end access to the file scanner at this point and remove the secret key. This is only required in servers which do not support real, command-line, CRON jobs. You don't need that and it's safer if you disable it.

I hope this further helps clarify what's going on.

Nicholas K. Dionysopoulos

Lead Developer and Director

๐Ÿ‡ฌ๐Ÿ‡ทGreek: native ๐Ÿ‡ฌ๐Ÿ‡งEnglish: excellent ๐Ÿ‡ซ๐Ÿ‡ทFrench: basic โ€ข ๐Ÿ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

hkymre
Thanks Nicholas

I'm missed Davide adding the /app/ to the url

The cron is running but now failing with

The script is meant to be run from a CLI version of PHP. You are currently using the cli version of PHP 5.6.36.

And when I tried php 7 CLI

The script is meant to be run from a CLI version of PHP. You are currently using the cli version of PHP 7.0.30.

********** ERROR! **********

Call to a member function get() on null

Technical information:

Code: 0
File: /srv/users/serverpilot/xxxxxx/public/wp-content/plugins/admintoolswp/app/cli/admintools-filescanner.php
Line: 37

Stack Trace:

#0 /srv/users/serverpilot/xxxxxx/public/wp-content/plugins/admintoolswp/app/cli/admintools-filescanner.php(307): AdminToolsFAM->execute()
#1 {main}

tampe125
Akeeba Staff
Thank you very much for the report, there was indeed a bug in the scanner file, I just fixed it.
We're going to publish a new release soon, in the meanwhile you can still trigger the scans manually or setup the Frontend mode.

Sorry for the trouble and thanks again.

Davide Tampellini

Developer and Support Staff

๐Ÿ‡ฎ๐Ÿ‡นItalian: native ๐Ÿ‡ฌ๐Ÿ‡งEnglish: good โ€ข ๐Ÿ• My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.