function wpstg_log_permissions()
{
    global $wpstg_options;
    if (!WPSTG()->logger->checkDir()) {
        return '<br><strong style="color:red;">' . __('Log file directory not writable! Set FTP permission to 755 or 777 for /wp-content/plugins/wp-staging/logs/', 'wpstg') . '</strong> <br> Read here more about <a href="http://codex.wordpress.org/Changing_File_Permissions" target="_blank">file permissions</a> ';
    }
}
Beispiel #2
0
                load_textdomain('wpstg', $mofile_global);
            } elseif (file_exists($mofile_local)) {
                // Look in local /wp-content/plugins/wp-staging/languages/ folder
                load_textdomain('wpstg', $mofile_local);
            } else {
                // Load the default language files
                load_plugin_textdomain('wpstg', false, $wpstg_lang_dir);
            }
        }
    }
}
// End if class_exists check
/**
 * The main function responsible for returning the one true wpstaging
 * Instance to functions everywhere.
 *
 * Use this function like you would a global variable, except without needing
 * to declare the global.
 *
 * Example: <?php $WPSTG = WPSTG(); ?>
 *
 * @since 0.9.0
 * @return object The one true wpstaging Instance
 */
function WPSTG()
{
    return wpstaging::instance();
}
// Get WPSTG Running
WPSTG();
Beispiel #3
0
/** 
 * Create json cloning_details.json after activation of the plugin
 * 
 * @return bool
 */
function wpstg_create_clonedetails_files()
{
    $path = wpstg_get_upload_dir();
    if (wp_is_writable($path)) {
        $file = 'clone_details.json';
        file_put_contents($path . '/' . $file, null);
    } else {
        WPSTG()->logger->info($path . '/' . $file . ' is not writeable! ');
    }
}
/**
 * Write unexpected errors into the log file
 */
function wpstg_error_processing()
{
    $msg = sanitize_text_field($_POST['wpstg_error_msg']);
    if (!empty($msg)) {
        WPSTG()->logger->info($msg);
    }
    wp_die();
}