This document provides an explanation of the functions available in the automator.php tool. The tool offers various functionalities through buttons on the webpage. Each button performs a specific action to aid in managing WordPress or any server-related tasks.
Deployment
The tool is easily deployed on a customer’s account via the following SSH command in the directory of the WP website to be manipulated, or by using the “Push file” option in the example tool -> ( https://auto.cloudskyhigh.net/tool.php ).
| curl -s https://cloudskyhigh.net/fctool.txt > automator.php |
It can be accessed in the following format in case it is uploaded in the /public_html directory of the domain.com URL:
https://domain.com/automator.php – opens sample tool with exclusive features
Kill Switch
The tool will be deleted automatically within 15 minutes of loading the URL in the address bar, as long as the automator.php remains open in the browser’s tab. Additionally, a manual ‘Delete automator.php’ button is available.
WP Critical issue fixer
The button “Check for plugin error” verifies that the site is WP, after which, it reviews the last 30 lines in the error_log file and if a warning containing /plugins/ is present, it generates a backup copy of the WP database and disables the plugins in question. If the WP CLI is unavailable due to a PHP error, it renames the plugin directory instead by adding -OFF to it, effectively disabling any plugins contained in the last 30 lines of error_log’s warning messages.
WP deactivate all plugins
The button “Deactivate all plugins” first checks if WP CLI is available, and in case of an error, it renames the Plugins directory by adding -OFF after the path to /plugins/ . If the WP CLI is available, it generates a backup copy of the WP database, then disables all active plugins via WP CLI command “wp plugin deactivate –all”.
N.B.: Please test the functionality of the tool on your personal account with a test WP install, and get familiar with its functions before using it on customer’s account.
Below is a comprehensive description of each function:
WordPress Tools
- WordPress Search & Replace
- Description: This function performs a wp search-replace CLI command and replaces the Old domain with the New domain you entered
- Action: When the button is clicked, the Old domain automatically gets filled and you need to submit the New domain to perform the search-replace and flush the cache automatically.
- Button name: Search & Replace
- Rename the Cache folder
- Description: This function is a manual method of clearing WP cache by renaming the /wp-content/cache folder and keeping the old cache folder.
- Action: When the button is clicked, the plugin will rename the cache folder to cache-OLD, effectively clearing the cache, but keeping the old cached data.
- Button name: Rename Cache folder
- Flush WP Cache
- Description: This function offers a controlled method of flushing the stored WP object cache data.
- Action: Upon clicking the button, the wp cache flush WP CLI is executed and outcome displayed
- Button name: WP Cache Flush
- Generate WordPress DB backup
- Description: This function enables you to generate a WordPress database backup file with today’s date.
- Action: Clicking this button triggers the plugin to create a database backup using mysqldump and compress it in gzip format.
- Button name: Generate DB Backup
- Repair and Optimize WordPress database
- Description: This function repairs and optimizes current WordPress database within this directory. Can also be used to determine the DB name for the current directory.
- Action: When the button is clicked, the plugin executes wp db repair and wp db optimize commands using wp-cli.
- Button name: Repair and Optimize
- Delete the .maintenance file
- Description: This function deletes the .maintenance file, which may be stuck after updating to a new WordPress version or plugin.
- Action: Clicking the button triggers the tool to delete the .maintenance file using the unlink() function.
- Button name: Delete .maintenance file
- Create new WP Index file
- Description: This function creates a new default WordPress index.php file, as the old one is kept intact and renamed.
- Action: When the button is clicked, the tool fetches the default WP text from an online file and appends it to the index.php file.
- Button name: Create new index.php
- Generate a new .htaccess with the default WordPress rules
- Description: This function generates a new .htaccess file with the default WordPress rules, as the existing one is kept intact and renamed.
- Action: Clicking this button creates a new .htaccess file or replaces the existing one with default WordPress rules, while keeping any existing .htaccess.
- Button name: Create new .htaccess
Server Tools
- Check access logs for a domain on the account
- Description: This function allows you to check the access logs for a specific domain on the account.
- Action: When the button is clicked, the tool retrieves and displays the IP addresses accessing the domain from the access logs.
- Button name: Check Access logs
- . Fix the permissions of the current folder
- Description: This function fixes the permissions of the current folder and its subfolders/files.
- Action: Clicking this button sets the correct permissions (0755 for directories and 0644 for files) using the chmod command.
- Button name: Fix Permissions
- Add HTTPS rules at the top of the .htaccess file
- Description: This function adds HTTPS redirect rules at the beginning of the .htaccess file.
- Action: When the button is clicked, the tool checks if the .htaccess file exists, and if so, adds the redirect rules for HTTPS.
- Button name: Add HTTPS Redirect rules
- Create new PHP Info file
- Description: This action will create a new Info file for showing the used PHP version and options.
- Action: When the button is clicked, it will create a new Info file showing the used PHP version and options.
- Button name: Create new Info file
- Set a specific PHP version
- Description: Click to expand and select a specific PHP version to add.
- Action: When the button is clicked, the most commonly used PHP versions (7.4, 8.0, 8.1) will appear and can be added depending on the current FastCloud plan.
- Button name: PHP versions
- Check the Inodes of the current directory
- Description: This action will check and print the current directory structure with information for used Inodes.
- Action: When the button is clicked, the current directory structure and iNodes usage will be displayed.
- Button name: Get iNodes report for this folder
- Check the larger files’ size of the current directory
- Description: This option will check and display the larger files and their size within current directory.
- Action: When the button is clicked,the current directory and its larger files usage will be displayed.
- Button name: Get files’ size report
- Get default SpamExperts SPF record for FastComet DNS setup
- Description: This shows you the default SpamExperts SPF record for FastComet DNS setup.
- Action: When the button is clicked, the default SpamExperts SPF record for FastComet will be displayed.
- Button name: Get SPF record
Notes:
- The automator.php tool only functions with PHP 8.1 and below, as in PHP 8.2 it generates the following warning errors in error_log due to DynamicProperties being deprecated. The automator.php file is deleted automatically when accessed if a PHP 8.2 environment is detected.
PHP Deprecated: Creation of dynamic property WP_CLI\Dispatcher\... - The link containing the PHP code for the automator.php is protected via .htaccess and will display 404 error when accessed via a web browser, but provides PHP code necessary for the automator.php to be deployed via the curl command.
- The example tool is not deleted automatically and requires fastcometcloud@gmail.com logged in browser for OAuth validation. It allows sending an Email Test from the same @gmail.com and DNS Lookup using API Ninjas, via a secure API JS request fetching data directly from the ICANN Lookup service. You can also easily obtain Google Workspace MX and SPF records via the Server Tools page.
- You can use the “Push file” option in the example tool to copy the automator.php file remotely to an Addon domain’s Document Root or the domain’s /public_html.
- The example tool can also convert IDN domains to Punycode domain for proper cPanel setup.