Ejemplo n.º 1
0
/**
 * Add rating links to the admin dashboard
 *
 * @since	0.9.0
 * @global	string $typenow
 * @param       string $footer_text The existing footer text
 * @return      string
 */
function wpstg_admin_rate_us($footer_text)
{
    global $typenow;
    if (wpstg_is_admin_page()) {
        /*$rate_text = sprintf( __( 'Thank you for using <a href="%1$s" target="_blank">WP Staging</a>! Please <a href="%2$s" target="_blank">rate WP Staging</a> on <a href="%2$s" target="_blank">WordPress.org</a> and help to support this project.<br>Something not working as expected with WP Staging? Read the <a href="https://www.wp-staging.net/faq/" target="blank">FAQ</a> and visit the WP-Staging <a href="https://wp-staging.net/support" target="blank">Support Forum</a>', 'wpstg' ),
        			'https://www.wp-staging.net',
        			'http://wordpress.org/support/view/plugin-reviews/wp-staging?filter=5#postform'
        		);*/
        $rate_text = sprintf(__('Please <a href="%1$s" target="_blank">rate WP Staging</a> and help to support this project.<br>Something not working as expected? Visit the WP Staging <a href="https://wordpress.org/support/plugin/wp-staging" target="blank">Support Forum</a>', 'wpstg'), 'http://wordpress.org/support/view/plugin-reviews/wp-staging?filter=5#postform');
        return str_replace('</span>', '', '') . $rate_text . '</span>';
    } else {
        return $footer_text;
    }
}
Ejemplo n.º 2
0
/**
 * Load Admin Scripts
 *
 * Enqueues the required admin scripts.
 *
 * @since 1.0
 * @global $post
 * @param string $hook Page hook
 * @return void
 */
function wpstg_load_admin_scripts($hook)
{
    if (!apply_filters('wpstg_load_admin_scripts', wpstg_is_admin_page(), $hook)) {
        return;
    }
    global $wp_version, $wpstg_options;
    $js_dir = WPSTG_PLUGIN_URL . 'assets/js/';
    $css_dir = WPSTG_PLUGIN_URL . 'assets/css/';
    // Use minified libraries if DEBUG is turned off
    $suffix = isset($wpstg_options['debug_mode']) ? '.min' : '';
    // These have to be global
    wp_enqueue_script('wpstg-admin-script', $js_dir . 'wpstg-admin' . $suffix . '.js', array('jquery'), WPSTG_VERSION, false);
    wp_enqueue_style('wpstg-admin', $css_dir . 'wpstg-admin' . $suffix . '.css', WPSTG_VERSION);
    wp_localize_script('wpstg-admin-script', 'wpstg', array('nonce' => wp_create_nonce('wpstg_ajax_nonce'), 'mu_plugin_confirmation' => __("If confirmed we will install an additional WordPress 'Must Use' plugin. This plugin will allow us to control which plugins are loaded during WP Staging specific operations. Do you wish to continue?", 'wpstg'), 'plugin_compatibility_settings_problem' => __('A problem occurred when trying to change the plugin compatibility setting.', 'wpstg'), 'saved' => __('Saved', 'The settings were saved successfully', 'wpstg'), 'status' => __('Status', 'Current request status', 'wpstg'), 'response' => __('Response', 'The message the server responded with', 'wpstg'), 'blacklist_problem' => __('A problem occurred when trying to add plugins to backlist.', 'wpstg'), 'cpu_load' => wpstg_get_cpu_load_sett()));
}
Ejemplo n.º 3
0
/**
 * Show a admin notice that this software is beta 
 */
function wpstg_show_beta_message()
{
    $notice = '<div class="wpstg_beta_notice error" style="box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);">
    	<p>This software is beta and work in progress! <br>WP Staging is well tested and we did our best to catch every possible error we can forecast but we can not handle all possible combinations of different server, plugins and themes. <br><strong>BEFORE</strong> you create your first staging site it´s highly recommended <strong>to make a full backup of your website</strong> first!
        <p><strong>This is no joke! </strong>WP Staging is using crucial database and system close functions which have the power to break your website or even to delete your entire database! WP-Staging has neever caused any errors like data loose on any of the sites we are using for testing, so in most cases everything will be running fine, but we have 
        to give out this warning until WP Staging is not in beta status any longer.
      <p>
        One of the best free plugins for an entire wordpress backup is the free one <a href="https://wordpress.org/plugins/backwpup/" target="_blank">BackWPup</a> 
        <p>To be more clear: <p>We are not responsible for any damages this plugin will cause to your site. <br>Do a full backup first!</p>
        <ul>
            <li><a href="javascript:void(0);" class="wpstg_hide_beta" title="I understand" style="font-weight:bold;color:#00a0d2;">I understand! (Do not show this again)</a></li>
        </ul>
    </div>
    <script>
    jQuery( document ).ready(function( $ ) {
        jQuery(\'.wpstg_hide_beta\').click(function(){
                 var data={\'action\':\'wpstg_hide_beta\'}
                jQuery.ajax({
                    url: "' . admin_url('admin-ajax.php') . '",
                    type: "post",
                    data: data,
                    dataType: "json",
                    async: !0,
                    success: function(e) {
                        if (e=="success") {
                           jQuery(\'.wpstg_beta_notice\').slideUp(\'slow\');
                        }
                    }
                });
        })
    });
    </script>
    ';
    if (get_option('wpstg_hide_beta') === "no" && wpstg_is_admin_page()) {
        return $notice;
    }
}