Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't throw notices if the response is for a failed connection #63

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
9af364e
Don't throw notices if the response is for a failed connection
tomjn Jan 21, 2014
b5138e7
Merge pull request #1 from sanchothefat/master
tomjn Apr 23, 2014
d255537
move the wp-less class into its own file
tomjn Apr 27, 2014
41fd3c3
ignore the lessc directory
tomjn Apr 27, 2014
c74e07d
some cleanup
tomjn Apr 27, 2014
df1d816
move if statement around
tomjn Apr 27, 2014
3e237d9
add an admin page
tomjn Apr 27, 2014
3156868
Add myself and cftp as contributors
tomjn Apr 27, 2014
5797af5
display recent messages
tomjn Apr 27, 2014
dfce5be
log messages explaining what when and why a rebuild ocurred, but only…
tomjn Apr 27, 2014
37a9ea5
changed the message format and handled timestamps and empty message l…
tomjn Apr 27, 2014
f2f9cd4
greater than or equal to
tomjn Apr 27, 2014
ec34bdf
prettier table with a quick note on the 20 message limit
tomjn May 2, 2014
8df927a
add the protocol handle to the start of the cache and css files, so t…
tomjn May 2, 2014
899f49d
add a missing closing code tag in a message
tomjn May 2, 2014
bfedcf9
remove the wp_die, and return the original
tomjn Jun 2, 2014
53fc608
fix the wp die
tomjn Jun 2, 2014
ee9b32b
Merge branch 'master' of github.com:Tarendai/wp-less
tomjn Jun 2, 2014
622541a
Change compiler to less.php (https://github.com/oyejorge/less.php). O…
scottsweb Jun 13, 2014
89cef9d
escape the log messages
tomjn Apr 1, 2015
6e37534
escape wp_die message
tomjn Apr 1, 2015
b53621c
fix the comment from appearing red in GitHub
tomjn Apr 1, 2015
800ef33
Merge pull request #2 from scottsweb/master
tomjn Apr 1, 2015
e466810
pull across some changes by @rmccue in the original wp less plugin
tomjn Apr 1, 2015
ea6c6eb
switch to md5 based check, and bring some other improvements over suc…
tomjn Apr 1, 2015
cc0efc7
bring across disabling of LESS compilation via an option by @joehoyle
tomjn Apr 1, 2015
37c4a9d
Bring across fixes by @johnbillion in https://github.com/johnbillion/…
tomjn Apr 1, 2015
c201fe0
fix authors json
tomjn Apr 1, 2015
7eb4313
Changed wp_kses to wp_strip_all_tags as wp_kses requires two args
Apr 8, 2015
449895b
Still requires you to create directory if it doesnt exist. Should not…
Apr 8, 2015
53de286
Lets reach the if statement please
Apr 8, 2015
8c06f8c
Merge pull request #3 from spacedmonkey/master
tomjn Apr 20, 2015
639006e
Changed less.php version number
spacedmonkey Aug 5, 2015
97365b0
Merge pull request #4 from TimeIncOSS/master
tomjn Aug 5, 2015
d5bc40a
Removed output of nonexistant var cache_path, fixes a warning
tomjn Apr 3, 2016
fb5b6a4
Add 2 error messages and braces
tomjn Apr 11, 2016
bfd87f4
closing semicolon
tomjn Apr 11, 2016
a7f5e30
Missing dot
tomjn Apr 11, 2016
df61d18
output a log message if the cache folder couldnt be created
Apr 11, 2016
15d5cdb
fixes a warning if the response body isn't set in the update check fi…
tomjn Aug 22, 2016
7911090
$r isn't an array, switch to isset for now in the update filter function
tomjn Aug 22, 2016
f1738e9
type hint $r to an array and use isset rather than !isset in the check
tomjn Aug 22, 2016
85dd821
extract a variable out of an array lookup
tomjn Aug 22, 2016
1e280d6
prevent a fatal error from happening with a temporary work around whe…
tomjn Aug 22, 2016
92e1e5c
switch the plugin update filter to be more reliable
tomjn Aug 28, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor/
composer.lock
.DS_Store
/lessc/
8 changes: 3 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@
{
"name": "Robert O'Rourke",
"email": "rob@interconnectit.com"
}
],
"authors": [
},
{
"name": "Interconnect/IT",
"homepage": "http://interconnectit.com/"
}
],
"require": {
"php": ">5.2.4",
"php": ">=5.2.4",
"composer/installers": "~1.0",
"leafo/lessphp": "0.4.0"
"oyejorge/less.php": "1.7.0.x"
}
}
70 changes: 70 additions & 0 deletions wp-less-admin.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?php

class wp_less_admin {

/**
* @static
* @var \wp_less_admin Reusable object instance.
*/
protected static $instance = null;


/**
* Creates a new instance. Called on 'after_setup_theme'.
* May be used to access class methods from outside.
*
* @see __construct()
* @static
* @return \wp_less_admin
*/
public static function instance() {
null === self :: $instance AND self :: $instance = new self;
return self :: $instance;
}


public function __construct() {
add_action( 'admin_menu', array( $this, 'add_pages' ) );
}

public function add_pages() {
add_management_page( 'WP LESS', 'WP LESS', 'manage_options', 'wpless', array( $this, 'display' ) );
}

public function display() {
?>
<div class="wrap">
<h2>WP-LESS</h2>

<p>Here are messages from attempts to build/rebuild stylesheets. Only the last 20 messages are kept.</p>

<table class="wp-list-table widefat fixed">
<thead>
<th width="120px">Time</th>
<th>Message</th>
</thead>
<tbody>
<?php
$recent_messages = get_option('wpless-recent-messages');
if ( !empty( $recent_messages ) ) {
foreach ( $recent_messages as $message ) {
echo '<tr>';
if ( is_array( $message ) ) {
echo '<td>'.date( 'D, d M Y H:i:s', absint( $message['time'] ) ).'</td>';
echo '<td>'.wp_strip_all_tags( $message['payload'] ).'</td>';
} else {
echo '<td colspan="2">'.wp_strip_all_tags( $message ).'</td>';
}
echo '</tr>';
}
} else {
echo '<tr><td colspan="2">No messages</td></tr>';
}
?>
</tbody>
</table>
</div>
<?php
}

}
Loading