/** * Return an instance of this class. * * @since 1.0.0 * * @return object A single instance of this class. */ public static function get_instance() { // If the single instance hasn't been set, set it now. if (null == self::$instance) { self::$instance = new self(); } return self::$instance; }
<?php /** * Plugin Name: OptimizePress WPengine fix headers * Plugin URI: www.optimizepress.com * Description: Fixes corrupt headers settings after pushing site fomr live to stage in WP Engine and vice versa * Version: 1.0.0 * Author: Zvonko Biškup * Author URI: www.optimizepress.com */ // If this file is called directly, abort. if (!defined('WPINC')) { die; } require_once plugin_dir_path(__FILE__) . 'class-op2_wpengine_fix_headers.php'; Op_Wpengine_Fix_Headers::get_instance();
<div class="wrap"> <h3 class="title"><?php _e('Fix WPEngine headers', Op_Wpengine_Fix_Headers::slug()); ?> </h3> <p class="install-help"><?php _e('This will fix header settings after moving the site from stage to live or live to stage in WPEngine.', Op_Wpengine_Fix_Headers::slug()); ?> </p> <form method="POST"> <input type="hidden" name="opfix" value="" /> <?php wp_nonce_field('op_fix', 'op_fix_nonce', true, true); ?> <input type="submit" name="submit" value="Fix headers" /> </form> <?php if (isset($_POST['opfix'])) { ?> <p class="install-help"> Headers are now fixed. </p> <?php } ?> </div>