Skip to content
Permalink
Browse files

First pass on making the UI a little bit better.

  • Loading branch information
daniloercoli committed Mar 18, 2015
1 parent 17aca0b commit 1b3b996e07475d471edb51a8b231ef4192760400
Showing with 64 additions and 28 deletions.
  1. +10 −1 README.markdown
  2. +6 −7 footer.php
  3. +27 −15 page.php
  4. +9 −4 xml-rpc-validator.css
  5. +12 −1 xml-rpc-validator.js
@@ -2,7 +2,16 @@

WordPress plugin that checks the validity of the XML-RPC Endpoint of WordPress sites.

This plugin is deployed on the following test site: http://www.eritreo.it/wp31es/
If you're having throubles login into your site by using one of the WordPress mobile apps, this plugin can help you to find the real cause of the issue. A live version of the plugin is deployed on the following site: http://xmlrpc.eritreo.it
Just insert your address there, and a check will be stared against your site. (No data will be collected on our side. I completely delete the logs on the server without even taking a look at them).

**Advanced usage**
It's possible to launch the validator by passing parameters to it:
Available parameter are _site_url_ and _user_agent_.
EX: http://xmlrpc.eritreo.it?user_agent=my-user-agent-here&site_url=daniloercoli.com

**Note:** Plugins and incompatible themes can also cause issues when using your site on a mobile app . There’s a list of known plugin conflicts here: http://ios.forums.wordpress.org/topic/app-blocking-plugin-list?replies=1#post-5985. If deactivating all the plugins doesn’t help then suggest they try a default theme. Also check what user role they’re signing in with. Sometimes signing in as an unusual user (something other than administrator) can cause strange things with the app.


## Details ##

@@ -1,11 +1,4 @@
</div><!-- closing "content" -->
<div class="intro">
<p>
This validator checks the validity of the XML-RPC Endpoint of WordPress Sites.
<br>
Source code available <a href="https://github.com/daniloercoli/WordPress-XML-RPC-Validator">here</a>.
</p>
</div>
<?php if ( 'home' != $action ) : ?>
<a href="" id="xmlrpc_validator_log_view_switcher" onclick="xml_rpc_validator.toggle_log( ); return false;">Show Log</a>
<?php endif; ?>
@@ -15,6 +8,12 @@
</div>

<footer>
<?php if ( 'home' == $action ) : ?>
<p>
Source code available <a href="https://github.com/daniloercoli/WordPress-XML-RPC-Validator">here</a>.
</p>

<?php endif; ?>
<?php wp_footer(); ?>
</footer>
</body>
@@ -15,7 +15,7 @@
else
$nonce_content = '';

$site_url = isset( $_REQUEST['site_url'] ) ? esc_url ( $_REQUEST['site_url'] ) : 'http://';
$site_url = isset( $_REQUEST['site_url'] ) ? esc_url( $_REQUEST['site_url'] ) : 'http://';
?>
<form name="loginform" id="loginform" action="#" method="post" onSubmit="return xml_rpc_validator.check_url();">
<?php echo $nonce_content; ?>
@@ -26,29 +26,40 @@
<input type='text' name='site_url' id='site_url' class='input' value='<?php echo $site_url; ?>' size='30' tabindex='10'/>
</p>
<br/>
<a href="" id="xmlrpc_validator_advanced_settings_switcher" onclick="xml_rpc_validator.toggle_advanced_settings( ); return false;">More Options</a>
<fieldset id="xmlrpc_validator_advanced_settings" style="display:none; margin-top:10px;">
<!-- a href="" id="xmlrpc_validator_advanced_settings_switcher" onclick="xml_rpc_validator.toggle_advanced_settings( ); return false;">More Options</a -->
<fieldset id="xmlrpc_validator_advanced_settings" style="margin-top:10px;">
<p>
<label for="user_agent"><?php _e('User Agent'); ?></label>
<select name='user_agent'>
<label for="user_agent_selection"><?php _e('User Agent'); ?></label>
<select id="user_agent_selection">
<?php if (!isset($_REQUEST['user_agent'])) { ?>
<option value="custom">Custom User Agent</option>
<option selected="selected" value="WordPress XML-RPC Client">WordPress XML-RPC Client</option>
<option value="wp-android/2.0">WordPress for Android</option>
<?php } else { ?>
<option selected="selected" value="">Custom User Agent</option>
<option value="WordPress XML-RPC Client">WordPress XML-RPC Client</option>
<?php } ?>
<option value="wp-android/2.6.4 (Android 4.3; en_US; samsung GT-I9505/jfltezh)">WordPress for Android</option>
<option value="wp-iphone/4.8.1 (iPhone OS 8.1.3, iPad) Mobile">WordPress for iOS</option>
<option value="wp-blackberry/1.6">WordPress for BlackBerry</option>
<option value="wp-iphone/3.0">WordPress for iOS</option>
<option value="wp-nokia/1.0">WordPress for Nokia</option>
<option value="wp-windowsphone/1.5">WordPress for Windows Phone7</option>
</select>
<?php if (!isset($_REQUEST['user_agent'])) { ?>
<input type='text' name='user_agent' id='user_agent' class='input' value='WordPress XML-RPC Client/1.1' size='70' tabindex='10'/>
<?php } else { ?>
<input type='text' name='user_agent' id='user_agent' class='input' value='<?php echo esc_attr($_REQUEST['user_agent']); ?>' size='70' tabindex='10'/>
<?php } ?>
</p>
<br/>
<p>
<label for="enable_401_auth"><?php _e('Enable HTTP Auth'); ?></label>
<input type="checkbox" name="enable_401_auth" value="yes" />
</p>
<p>
<p style="margin-top:10px">
<label for="HTTP_auth_user_login"><?php _e('Username'); ?></label>
<input type="text" name="HTTP_auth_user_login" id="HTTP_auth_user_login" class="input" value="" size="20" tabindex="200" />
</p>
<p>
<p style="margin-top:10px;margin-bottom:10px;">
<label for="HTTP_auth_user_pass"><?php _e('Password'); ?></label>
<input type="password" name="HTTP_auth_user_pass" id="HTTP_auth_user_pass" class="input" value="" size="20" tabindex="210" />
</p>
@@ -108,16 +119,17 @@
<?php echo $xml_rpc_validator_utils->printErrors($xmlrpcEndpointURL);
} else {
$xmlrpcEndpointURL = esc_url($xmlrpcEndpointURL);
?><p class="tick">Congratulation! Your site passed the first check.
<br />You can add the blog within the mobile app using the following URL: <em><?php echo ($xmlrpcEndpointURL); ?></em></p>
?><p class="tick"style="margin-bottom:10px;"><b>Congratulation! Your site passed the first check.</b>
<br /><br />You can add the blog within the mobile app using the following URL: <em><?php echo ($xmlrpcEndpointURL); ?></em>
</p>
<form name="credentialInfoform" id="credentialInfoform" action="#" method="post">
<p>Please insert your credentials below to start a deep test on the blog. (Credentials will not be stored or sent to 3rd party sites)</p>
<p>Please insert your credentials below to start a deep test of the blog. (Credentials will not be stored or sent to 3rd party sites)</p>
<?php if ( function_exists('wp_nonce_field') ) echo wp_nonce_field('checkstep2', 'name_of_nonce_field_checkstep2',true, false); ?>
<p>
<p style="margin-top:10px">
<label for="user_login"><?php _e('Username'); ?></label>
<input type="text" name="user_login" id="user_login" class="input" value="" size="20" tabindex="20" />
</p>
<p>
<p style="margin-top:10px;margin-bottom:10px;">
<label for="user_pass"><?php _e('Password'); ?></label>
<input type="password" name="user_pass" id="user_pass" class="input" value="" size="20" tabindex="30" />
</p>
@@ -171,7 +183,7 @@
<form name="xml_rpc_single_site_form" id="xml_rpc_single_site_form" action="#" method="post" onsubmit="return false;">
<p>Please select the blog you wanna test:</p>
<?php foreach ($client->userBlogs as $blog) {
echo '<p><input type="radio" name="single_site_xmlrpc_url" value="'.$blog['xmlrpc'].'">'.$blog['blogName'].' - '.$blog['xmlrpc'].'</input></p>';
echo '<p style="margin-top:10px"><input type="radio" name="single_site_xmlrpc_url" value="'.$blog['xmlrpc'].'"> '.$blog['blogName'].' - '.$blog['xmlrpc'].'</input></p>';
}//end foreach
?>
<input type="hidden" name="user_login" id="user_login" value="<?php esc_attr_e($_REQUEST['user_login']); ?>"/>
@@ -17,7 +17,7 @@ br, input, button, textarea, h1, h2, h3, h4, h5, strong {
font-size: 100%;
font-family: Helvetica, Arial, Sans-Serif;
vertical-align: baseline;
background-color: white;
background-color: #EAEBEE;
color: #1f2126;
line-height: 1;
text-align: left;
@@ -125,7 +125,10 @@ div#frontforms input {
background-color: #EAEBEE;
}

input#user_pass, input#user_login, input#site_url, input#uri, input#file, input#uploaded_file, input#keywords, input#short_desc, textarea {

input#user_pass, input#user_login, input#site_url, input#user_agent,
input#uri, input#file, input#uploaded_file, input#keywords, input#short_desc, textarea,
input#HTTP_auth_user_pass, input#HTTP_auth_user_login{
font-family: Monaco, "Courier New", Monospace;
font-size: 0.9em;
border: 1px solid #bbb;
@@ -137,6 +140,10 @@ input#user_pass, input#user_login, input#site_url, input#uri, input#file, input#
font-variant: normal;
}

input#user_agent:disabled {
background: #dddddd;
}

input#site_url, input#uri, input#file, input#uploaded_file {
width: 85%;
margin: 0.3em 0 0 1em;
@@ -187,7 +194,6 @@ p.submit_button input {
border-right: 2px solid #444;
border-top: 1px solid #aaa;
border-left: 1px solid #aaa;
background: #eee url(../images/grad.png) repeat-x top left;
cursor: pointer;
}

@@ -740,7 +746,6 @@ div#don_program span#don_program_text a {font-weight: bold;}
}

#xmlrpc_validator_log_view_switcher {
float: right;
clear: both;
margin-right: 10px;
background-color: #EAEBEE;
@@ -3,9 +3,20 @@ var jq = jQuery;
// setup everything when document is ready
jq(document).ready(function($) {
jq('#xml_rpc_single_site_form-submit').click( xml_rpc_validator.start_ajax_calls );
jq('select#user_agent_selection').change(function(){ //the event here is change
if (jq(this).val() === "custom" ) //check the value into the select
{
//jq('input#user_agent').removeAttr('disabled');
jq('input#user_agent').val("");
}
else
{
//jq('input#user_agent').attr('disabled','disabled');
jq('input#user_agent').val(jq(this).val());
}
});
});


var xml_rpc_validator = {
request: false,
xml_rpc_test_calls : [

0 comments on commit 1b3b996

Please sign in to comment.
You can’t perform that action at this time.