Permalink
Browse files

Updated to version 3.0

  • Loading branch information...
1 parent 12f8312 commit 87ef852d361ab5291d5342db5d3fd572bdca5094 @mvied committed Apr 10, 2012
View
@@ -0,0 +1 @@
+Options -Indexes
View
@@ -0,0 +1,19 @@
+#adminmenu .menu-top.toplevel_page_wordpress-https.current .wp-menu-image,
+#adminmenu .menu-top.toplevel_page_wordpress-https.wp-has-current-submenu .wp-menu-image,
+#adminmenu .menu-top.toplevel_page_wordpress-https:hover .wp-menu-image,
+#adminmenu .menu-top.toplevel_page_wordpress-https.focused .wp-menu-image {
+ /* background-position: -360px -1px; */
+ background-position: 0% 0%;
+}
+#adminmenu .menu-top.toplevel_page_wordpress-https .wp-menu-image img {
+ display: none;
+}
+
+#adminmenu .menu-top.toplevel_page_wordpress-https div.wp-menu-image {
+ /* background: url('../../../../../wp-admin/images/menu.png') no-repeat scroll -360px -33px; */
+ background: url('images/admin-icon.png') no-repeat 0% 100%;;
+}
+#side-sortables #wordpress-https .inside {
+ padding: 0;
+ margin: 0;
+}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -0,0 +1,90 @@
+#icon-options-https {
+ background: url(images/admin-icon32.png) no-repeat;
+}
+
+.meta-box-sortables {
+ margin: 0 8px;
+}
+
+#poststuff .column-primary {
+ width: 60%;
+}
+#poststuff .column-secondary {
+ width: 40%;
+ float: right;
+}
+
+.wphttps-message-wrap {
+ position: fixed;
+ bottom: 50%;
+ left: 50%;
+ margin-left: -25%;
+ width: 50%;
+ z-index: 10;
+ text-align: center;
+}
+
+#message {
+ margin: 15px 0 0 0;
+}
+#message p {
+ line-height: 100%;
+}
+
+img.loading {
+ display: block;
+ position: absolute;
+ top: 7px;
+ right: 7px;
+}
+
+img.waiting {
+ display: none;
+}
+img#submit-waiting {
+ vertical-align: middle;
+ margin-left: 5px;
+}
+
+#wphttps-donate-link img {
+ display: block;
+ margin: 5px auto 13px auto;
+}
+
+#wordpress-https_settings input[type="text"] {
+ margin: -5px 0 0 0;
+}
+#wordpress-https_settings input[type="checkbox"] {
+ margin: 7px 0 0 0;
+ vertical-align: bottom;
+}
+#wordpress-https_settings table tr td,
+#wordpress-https_settings table tr th {
+ line-height: 1em;
+ padding: 10px;
+}
+#wordpress-https_settings table tr td {
+ padding: 2px 0 0 0;
+}
+#wordpress-https_settings table tr td:first-child {
+ padding-top: 0;
+}
+#wordpress-https_settings table th {
+ width: 140px;
+ line-height: 32px;
+ padding: 0;
+}
+#wordpress-https_settings #settings-reset {
+ float: left;
+ margin-right: 10px;
+}
+#wordpress-https_settings #ssl_port_label {
+ display: inline-block;
+ padding-top: 10px;
+}
+#wordpress-https_settings #ssl_host {
+ width: 70%;
+}
+#exclusive_https_row label {
+ padding-top: 5px;
+}
View
@@ -0,0 +1,33 @@
+<?php
+
+$include_paths = array(
+ realpath(dirname(__FILE__) . '/../../../../..'),
+ realpath(dirname(__FILE__) . '/../../lib'),
+ get_include_path()
+);
+set_include_path(implode(PATH_SEPARATOR, $include_paths));
+require_once('wp-load.php');
+require_once('WordPressHTTPS.php');
+
+// Disable errors
+error_reporting(0);
+
+// Set headers
+header("Status: 200");
+header("HTTP/1.1 200 OK");
+header('Content-Type: text/html');
+header('Cache-Control: no-store, no-cache, must-revalidate');
+header('Cache-Control: post-check=0, pre-check=0', FALSE);
+header('Pragma: no-cache');
+header("Vary: Accept-Encoding");
+
+if ( ! wp_verify_nonce($_POST['nonce'], $_POST['id']) ) {
+ exit;
+}
+
+$content = WordPressHTTPS::factory('Url')->fromString( $_POST['url'] )->getContent();
+
+if ( $content ) {
+ echo $content;
+}
+?>
@@ -1,6 +1,10 @@
<?php
-
-require_once('../wordpress-https.php');
+$include_paths = array(
+ realpath(dirname(__FILE__) . '/../../lib'),
+ get_include_path()
+);
+set_include_path(implode(PATH_SEPARATOR, $include_paths));
+require_once('WordPressHTTPS.php');
// Disable errors
error_reporting(0);
@@ -14,11 +18,9 @@
header('Pragma: no-cache');
header("Vary: Accept-Encoding");
-$url = 'http://mvied.com/wphttps-updates.html';
-
-$content = WordPressHTTPS::get_file_contents($url);
+$content = WordPressHTTPS::factory('Url')->fromString('http://mvied.com/wphttps-updates.html')->getContent();
-if ($content) {
+if ( $content ) {
echo $content;
} else {
echo "<p class=\"error\">Unable to retrieve updates.</p>";
@@ -0,0 +1,23 @@
+<?php
+ $nonce = wp_create_nonce($metabox['id']);
+?><script type="text/javascript">
+jQuery(document).ready(function($) {
+ var loading = $('<img alt="Loading..." src="<?php echo admin_url('/images/wpspin_light.gif'); ?>" class="loading" />');
+
+ $('#<?php echo $metabox['id']; ?> .handlediv').append( loading );
+ $('#<?php echo $metabox['id']; ?> .handlediv .loading').fadeIn('fast');
+ $.ajax({
+ type: 'post',
+ url: '<?php echo parse_url((( $this->is_ssl() ) ? $this->replace_http_url($this->get('plugin_url')) : $this->get('plugin_url')), PHP_URL_PATH); ?>/admin/js/metabox.php',
+ data: {
+ id : '<?php echo $metabox['id']; ?>',
+ url : '<?php echo $metabox['args']['url']; ?>',
+ nonce : '<?php echo $nonce; ?>'
+ },
+ success: function(response) {
+ $('#<?php echo $metabox['id']; ?> .inside').html(response);
+ $('#<?php echo $metabox['id']; ?> .handlediv .loading').fadeIn(0).fadeOut('fast');
+ }
+ });
+});
+</script>
@@ -0,0 +1,16 @@
+<?php
+global $post;
+
+if ( $post->ID ) {
+ $force_ssl = get_post_meta($post->ID, 'force_ssl', true);
+ $force_ssl_children = get_post_meta($post->ID, 'force_ssl_children', true);
+}
+
+wp_nonce_field($this->get('slug'), $this->get('slug'));
+?>
+<div class="misc-pub-section">
+ <label><input type="checkbox" value="1" name="force_ssl" id="force_ssl"<?php echo ( $force_ssl ? ' checked="checked"' : '' ); ?> /> Secure post</label>
+</div>
+<div class="misc-pub-section misc-pub-section-last">
+ <label><input type="checkbox" value="1" name="force_ssl_children" id="force_ssl_children"<?php echo ( $force_ssl_children ? ' checked="checked"' : '' ); ?> /> Secure child posts</label>
+</div>
@@ -0,0 +1,108 @@
+<?php
+ $count = 1; // Used to restrict str_replace count
+ $ssl_host = clone $this->get('https_url');
+ $ssl_host = $ssl_host->set('port', '')->set('scheme', '')->toString();
+ $ssl_host = str_replace($this->get('http_url')->get('path'), '', $ssl_host, $count);
+ $ssl_host = rtrim($ssl_host, '/');
+?>
+<form name="form" id="<?php echo $this->get('slug'); ?>" method="post">
+<?php settings_fields($this->get('slug')); ?>
+
+<table class="form-table">
+ <tr valign="top" id="ssl_host_row">
+ <th scope="row">SSL Host</th>
+ <td>
+ <fieldset>
+ <label for="ssl_host" id="ssl_host_label">
+ <input name="ssl_host" type="text" id="ssl_host" class="regular-text code" value="<?php echo $ssl_host; ?>" />
+ </label>
+ <label for="ssl_port" id="ssl_port_label">Port
+ <input name="ssl_port" type="text" id="ssl_port" class="small-text" value="<?php echo $this->getSetting('ssl_port'); ?>" />
+ </label>
+ </fieldset>
+ </td>
+ </tr>
+ <tr valign="top" id="exclusive_https_row">
+ <th scope="row">Force SSL Exclusively</th>
+ <td>
+ <fieldset>
+ <label for="exclusive_https">
+ <input type="hidden" name="exclusive_https" value="0" />
+ <input name="exclusive_https" type="checkbox" id="exclusive_https" value="1"<?php echo (($this->getSetting('exclusive_https')) ? ' checked="checked"' : ''); ?> />
+ Posts and pages without <a href="<?php echo parse_url($this->get('plugin_url'), PHP_URL_PATH); ?>/screenshot-2.png" class="thickbox">Force SSL</a> enabled will be redirected to HTTP.
+ </label>
+ </fieldset>
+ </td>
+ </tr>
+ <tr valign="top" id="ssl_admin_row">
+ <th scope="row">Force SSL Administration</th>
+ <td>
+ <fieldset>
+ <label for="ssl_admin">
+ <input type="hidden" name="ssl_admin" value="0" />
+ <input name="ssl_admin" type="checkbox" id="ssl_admin" value="1"<?php echo (($this->getSetting('ssl_admin')) ? ' checked="checked"' : ''); ?><?php echo ((force_ssl_admin()) ? ' disabled="disabled" title="FORCE_SSL_ADMIN is true in wp-config.php"' : ''); ?> />
+ </label>
+ </fieldset>
+ </td>
+ </tr>
+
+<?php if ( get_option('show_on_front') == 'posts' ) { ?>
+ <tr valign="top" id="frontpage_row">
+ <th scope="row">HTTPS Front Page</th>
+ <td>
+ <fieldset>
+ <label for="frontpage">
+ <input type="hidden" name="frontpage" value="0" />
+ <input name="frontpage" type="checkbox" id="frontpage" value="1"<?php echo (($this->getSetting('frontpage')) ? ' checked="checked"' : ''); ?> />
+ </label>
+ </fieldset>
+ </td>
+ </tr>
+
+<?php } ?>
+ <tr valign="top" id="debug_row">
+ <th scope="row">Debug Mode</th>
+ <td>
+ <fieldset>
+ <label for="debug">
+ <input type="hidden" name="debug" value="0" />
+ <input name="debug" type="checkbox" id="debug" value="1"<?php echo (($this->getSetting('debug')) ? ' checked="checked"' : ''); ?> />
+ Outputs debug information to the browser's console.
+ </label>
+ </fieldset>
+ </td>
+ </tr>
+</table>
+
+<input type="hidden" name="action" value="save" />
+<input type="hidden" name="ssl_host_subdomain" value="<?php echo (($this->getSetting('ssl_host_subdomain') != 1) ? 0 : 1); ?>" />
+<input type="hidden" name="ssl_host_diff" value="<?php echo (($this->getSetting('ssl_host_diff') != 1) ? 0 : 1); ?>" />
+
+<p class="button-controls">
+ <input type="submit" name="Submit" value="Save Changes" class="button-primary" id="settings-save" />
+ <input type="submit" name="Reset" value="Reset" class="button-secondary" id="settings-reset" />
+ <img alt="Waiting..." src="<?php echo admin_url('/images/wpspin_light.gif'); ?>" class="waiting" id="submit-waiting" />
+</p>
+</form>
+<script type="text/javascript">
+jQuery(document).ready(function($) {
+ $('#<?php echo $this->get('slug'); ?>').submit(function() {
+ $('#submit-waiting').show();
+ }).ajaxForm({
+ data: { ajax: '1'},
+ success: function(responseText, textStatus, XMLHttpRequest) {
+ $('#submit-waiting').hide();
+ $('#message-body').html(responseText).fadeOut(0).fadeIn().delay(5000).fadeOut();
+ }
+ });
+
+ $('#settings-reset').click(function(e, el) {
+ if ( confirm('Are you sure you want to reset all WordPress HTTPS settings?') ) {
+ $(this).parents('form').submit();
+ } else {
+ e.preventDefault();
+ return false;
+ }
+ });
+});
+</script>
@@ -0,0 +1,23 @@
+<?php
+require_once('includes/template.php'); // WordPress Dashboard Functions
+?>
+
+<div class="wphttps-message-wrap" id="message-wrap"><div id="message-body"></div></div>
+
+<div class="wrap" id="wphttps-main">
+ <div id="icon-options-https" class="icon32"><br /></div>
+ <h2>HTTPS</h2>
+
+<?php
+ wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false );
+ wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false );
+?>
+ <div id="poststuff" class="columns metabox-holder">
+ <div class="postbox-container column-primary">
+<?php do_meta_boxes('toplevel_page_' . $this->get('slug'), 'main', $this); ?>
+ </div>
+ <div class="postbox-container column-secondary">
+<?php do_meta_boxes('toplevel_page_' . $this->get('slug'), 'side', $this); ?>
+ </div>
+ </div>
+</div>
Oops, something went wrong.

0 comments on commit 87ef852

Please sign in to comment.