Child pages
  • UAPI Functions - WordPressInstanceManager::start_scan
Skip to end of metadata
Go to start of metadata

Description

This function scans for WordPress® instances installed on a cPanel account. The system will populate cPanel's WordPress Manager interface with any newly discovered instances.

Note:

You must install the WordPress Manager cPanel plugin to access this API function.

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/WordPressInstanceManager/start_scan


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Scan for the account's WordPress instances.
 $instances = $cpanel->uapi(
    'WordPressInstanceManager', 'start_scan',
);


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Scan for the account's WordPress instances.
my $instances = $cpliveapi->uapi(
    'WordPressInstanceManager', 'start_scan',
);


Note:

For more information, read our Guide to the LiveAPI System.

 cPanel Template Toolkit
<!-- Scan for the account's WordPress instances. -->
[% data = execute( 'WordPressInstanceManager', 'start_scan' ); %]


Note:

For more information, read our Guide to Template Toolkit documentation. 

 Command Line
uapi --user=username WordPressInstanceManager start_scan


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{
	"status": 1,
	"messages": null,
	"warnings": null,
	"data": {
		"log": "/home/example/.cpanel/plugins/wordpress/scans/B3A27B96-51F7-11E8-92E3-CC90C4F823F0",
		"sse_url": "/sse/WordPressScan/B3A27B96-51F7-11E8-92E3-CC90C4F823F0",
		"guid": "B3A27B96-51F7-11E8-92E3-CC90C4F823F0"
	},
	"errors": null,
	"metadata": {}
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
guidstringThe unique identifier for the scan.A valid string.B3A27B96-51F7-11E8-92E3-CC90C4F823F0
logstringThe scan's log file.An absolute file path.
 Click here to view...

/home/example/.cpanel/plugins/wordpress/scans/B3A27B96-51F7-11E8-92E3-CC90C4F823F0



sse_urlstring

The SSE interface that other applications can use to track the progress of the scan.

Note:

For more information about the SSE interface, read the Server Sent Events section below.


 Click here to view...

/sse/WordPressScan/B3A27B96-51F7-11E8-92E3-CC90C4F823F0

Server Sent Events

Note:

For more information about server sent events, read Mozilla's Using server-sent events documentation.


EventDescriptionData
registerThe scan operation discovered a WordPress instance and registered it.A JSON-encoded object that contains the attributes of the instance, with the same format used in the get_instances and get_instance_by_id functions.
found

The scan operation found a WordPress instance.

Note:

If the WordPress instance is newly discovered, the system will also generate a register event for the instance.

A JSON-encoded object that contains:

path — The absolute file path to the instance.

doneThe scan is finished.

A JSON-encoded object that contains:

  • found — An array of strings that represents the absolute path to the discovered instances and any instances that the system already registered.
  • converted — An array of converted instances that the system returns in the same format we provide in the get_instances and get_instance_by_id functions.
terminatedThe system or user terminated the scan.None.
timedoutThe scan timed out before it completed.None.
register-failedThe system failed to build the instance registry.A JSON-encoded string that contains the error message.
register-load-failedThe system could not load the registry after building the instance registry.A JSON-encoded string that contains the error message.