Template can’t be installed

Updated on January 10, 2020

Jupiter X Templates are actually zip files containing the WordPress data, Widgets and Menu settings and Customizer settings. These are packed into one zip file for each template. The template installer uses this procedure to install the template:

  1. Creating a backup of the previous data.
  2. Downloading the package from Artbees servers.
  3. Installing the required plugins.
  4. Importing the contents.

While installing the templates, you may encounter different issues at each step. In this article, we will give an overview of what can cause template installation failure and suggest workarounds to fix them.

File and Folder permission issue

On all of the steps that require any file import or file creation, wrong permission on folders and files, or even different ownerships can cause template import issues. If you check the Jupiter X -> Control Panel -> System Status and realized any of the folders listed on top are not writable, you may need to reset the folder permissions as below:

[WordPress Root Directory]                                           755
[WordPress Root Directory]/wp-content/                               755
[WordPress Root Directory]/wp-content/uploads/                       755
[WordPress Root Directory]/wp-content/plugins/                       755
[WordPress Root Directory]/wp-content/themes/                        755
[WordPress Root Directory]/wp-content/uploads/jupiterx/              755
[WordPress Root Directory]/wp-content/uploads/jupiterx_backups/      755
[WordPress Root Directory]/wp-content/uploads/jupiterx_templates/    755

If you are a system admin and can use chmod command to reset the folder permissions, that would be easier by executing the following command:

cd "path to your WordPress Directory" 
find . -type d -exec chmod 0755 {} \;
find . -type f -exec chmod 0644 {} \; 

An alternative would be to use FS_METHOD direct. In order to use it, just add the following codes in the wp-config.php file and modify each six FTP details based on your own details.

define('FS_METHOD', 'direct');

In case after adding the line above, a form showed up on your page and asked for FTP credentials, please also add these codes:

 
define( 'FS_CHMOD_DIR', ( 0755 & ~ umask() ) );
define( 'FS_CHMOD_FILE', ( 0644 & ~ umask() ) );
define('FTP_BASE', __DIR__);
define('FTP_CONTENT_DIR', __DIR__ .'/wp-content/');
define('FTP_PLUGIN_DIR', __DIR__ .'/wp-content/plugins/');
define('FTP_HOST', 'hostname');
define('FTP_USER', 'username');
define('FTP_PASS', 'password'); 


Note: 
Please replace “hostname”, “username”, and “password” with your real FTP credentials.

Backup Creation fails

Sometimes the template fails to install at the first step (Creating the backup). It can be either related to the folder permission or database permission. Also, sometimes a corrupted record in the database prevents the backup from being created. So, before everything, make sure the permissions are set correctly like above and if the issue persists, reset the WordPress database using a WordPress reset plugin. Please note that it will remove all of your data, so use this as the last workaround if you don’t know how to fix the database issues. In general, it is recommended to install the templates on fresh WordPress installations to avoid such problems.

Downloading the package or plugin fails

In case you encountered an issue on step 2 and 3, it means that:

  • Your web server can not connect to the Artbees servers and download the files it needs.
  • You don’t have proper permission on the server (check above solution)
  • Your WebHost exceeded the quota

So, the first thing would be to make sure your connection to Artbees Servers can be established. Simply check the Artbees connectivity status on Jupiter X -> Control Panel -> System Status and make sure your web server can access Artbees servers. If it wasn’t possible to connect to Artbees Servers, you should contact your web host support and ask to trace the routs and see what is preventing a secure connection to Artbees. We do not have any limit or blacklist to the connections to our API endpoints so you would need to check it with your web host provider.

In case you couldn’t connect to Artbees Servers, uploading this file to your WordPress rout and executing it may give you additional details on what could be wrong:

<?php 

    $url = 'https://themes.artbees.net/wp-json/templates/v1/list';
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_NOBODY, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_exec($ch);
    $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    if (200==$retcode) {
        echo 'access to artbees servers is OK';
    } else {
        echo 'access to artbees servers is NOT OK Error Code: ' . $retcode . ' <br/> '; 
        $curlHandler = curl_init();

        curl_setopt_array($curlHandler, [
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_VERBOSE => true,
        ]);




        $verbose = fopen('php://temp', 'w+');
        $result = curl_setopt($curlHandler, CURLOPT_STDERR, $verbose);


        $result = curl_exec($curlHandler);


        rewind($verbose);
        $verboseLog = stream_get_contents($verbose);

        echo "Verbose information:\n<pre>", htmlspecialchars($verboseLog), "</pre>\n";

        curl_close($curlHandler);
    }

?>
Did this answer your question?