Version Description
- Add restore recent backup facility - It's a primative implementation at this point but it does the job. See FAQ note.
- Turned on the LESS mode when a .LESS file is edited
- Made the autocomplete functionality only be enabled for PHP files otherwise it can be a pain to write txt files like this one!
Download this release
Release Info
Developer | WPsites |
Plugin | WPide |
Version | 2.2 |
Comparing to | |
See all releases |
Code changes from version 2.1 to 2.2
- WPide.php +86 -37
- images/restore.png +0 -0
- js/load-editor.js +58 -12
- readme.txt +19 -1
- wpide.css +84 -49
WPide.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WPide
|
4 |
Plugin URI: https://github.com/WPsites/WPide
|
5 |
Description: WordPress code editor with auto completion of both WordPress and PHP functions with reference, syntax highlighting, line numbers, tabbed editing, automatic backup.
|
6 |
-
Version: 2.
|
7 |
Author: Simon @ WPsites
|
8 |
Author URI: http://www.wpsites.co.uk
|
9 |
*/
|
@@ -149,6 +149,7 @@ class wpide
|
|
149 |
wp_enqueue_script('ace', plugins_url("ace-0.2.0/src/ace.js", __FILE__ ) );
|
150 |
//include ace modes for css, javascript & php
|
151 |
wp_enqueue_script('ace-mode-css', $plugin_path . 'ace-0.2.0/src/mode-css.js');
|
|
|
152 |
wp_enqueue_script('ace-mode-javascript', $plugin_path . 'ace-0.2.0/src/mode-javascript.js');
|
153 |
wp_enqueue_script('ace-mode-php', $plugin_path . 'ace-0.2.0/src/mode-php.js');
|
154 |
//include ace theme
|
@@ -352,9 +353,13 @@ class wpide
|
|
352 |
if ( !current_user_can('edit_themes') )
|
353 |
wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');
|
354 |
|
|
|
|
|
355 |
//check file syntax of PHP files by parsing the PHP
|
356 |
if ( preg_match("#\.php$#i", $_POST['filename']) ){
|
357 |
|
|
|
|
|
358 |
require('PHP-Parser/lib/bootstrap.php');
|
359 |
ini_set('xdebug.max_nesting_level', 2000);
|
360 |
|
@@ -386,17 +391,47 @@ class wpide
|
|
386 |
$file_name = $root . stripslashes($_POST['filename']);
|
387 |
|
388 |
//set backup filename
|
389 |
-
$backup_path =
|
390 |
-
|
391 |
-
|
|
|
392 |
if (!$wp_filesystem->is_dir($new_file_info['dirname'])) wp_mkdir_p( $new_file_info['dirname'] ); //should use the filesytem api here but there isn't a comparable command right now
|
393 |
|
394 |
-
|
395 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
396 |
|
397 |
//save file
|
398 |
if( $wp_filesystem->put_contents( $file_name, stripslashes($_POST['content'])) ) {
|
399 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
400 |
}
|
401 |
|
402 |
die($result); // this is required to return a proper result
|
@@ -437,8 +472,10 @@ class wpide
|
|
437 |
$file_name = $root . stripslashes($_POST['filename']);
|
438 |
|
439 |
//set backup filename
|
440 |
-
|
441 |
-
|
|
|
|
|
442 |
$new_file_info = pathinfo($backup_path);
|
443 |
if (!$wp_filesystem->is_dir($new_file_info['dirname'])) wp_mkdir_p( $new_file_info['dirname'] ); //should use the filesytem api here but there isn't a comparable command right now
|
444 |
|
@@ -550,30 +587,7 @@ class wpide
|
|
550 |
|
551 |
|
552 |
die();
|
553 |
-
|
554 |
-
//set backup filename
|
555 |
-
$backup_path = ABSPATH .'wp-content/plugins/' . basename(dirname(__FILE__)) .'/backups/' . str_replace( str_replace('\\', "/", ABSPATH), '', $file_name) .'.'.date("YmdH");
|
556 |
-
//create backup directory if not there
|
557 |
-
$new_file_info = pathinfo($backup_path);
|
558 |
-
if (!$wp_filesystem->is_dir($new_file_info['dirname'])) wp_mkdir_p( $new_file_info['dirname'] ); //should use the filesytem api here but there isn't a comparable command right now
|
559 |
-
|
560 |
-
//do backup
|
561 |
-
$wp_filesystem->move( $file_name, $backup_path );
|
562 |
-
|
563 |
-
|
564 |
-
//save file
|
565 |
-
if( $wp_filesystem->put_contents( $file_name, $_POST['content']) ) {
|
566 |
-
$result = "success";
|
567 |
-
}
|
568 |
-
|
569 |
-
if ($result == "success"){
|
570 |
-
wp_die('<p>'.__('<strong>Image saved.</strong> <br />You may <a href="JavaScript:window.close();">close this window / tab</a>.').'</p>');
|
571 |
-
}else{
|
572 |
-
wp_die('<p>'.__('<strong>Problem saving image.</strong> <br /><a href="JavaScript:window.close();">Close this window / tab</a> and try editing the image again.').'</p>');
|
573 |
-
}
|
574 |
-
|
575 |
-
|
576 |
-
//return;
|
577 |
}
|
578 |
|
579 |
|
@@ -596,7 +610,8 @@ class wpide
|
|
596 |
|
597 |
var wpide_app_path = "<?php echo plugin_dir_url( __FILE__ ); ?>";
|
598 |
//dont think this is needed any more.. var wpide_file_root_url = "<?php echo apply_filters("wpide_file_root_url", WP_CONTENT_URL );?>";
|
599 |
-
|
|
|
600 |
function the_filetree() {
|
601 |
jQuery('#wpide_file_browser').fileTree({ script: ajaxurl }, function(parent, file) {
|
602 |
|
@@ -702,7 +717,36 @@ class wpide
|
|
702 |
$("#wpide_color_assist").hide(); //hide it until it's needed again
|
703 |
});
|
704 |
|
705 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
706 |
|
707 |
|
708 |
});
|
@@ -762,13 +806,18 @@ class wpide
|
|
762 |
</div>
|
763 |
|
764 |
<div id="wpide_toolbar_buttons">
|
765 |
-
<div id="wpide_message"
|
766 |
-
<a
|
|
|
|
|
767 |
|
768 |
|
769 |
<div id='fancyeditordiv'></div>
|
770 |
|
771 |
<form id="wpide_save_container" action="" method="get">
|
|
|
|
|
|
|
772 |
<a href="#" id="wpide_save" alt="Keyboard shortcut to save [Ctrl/Cmd + S]" title="Keyboard shortcut to save [Ctrl/Cmd + S]" class="button-primary">SAVE
|
773 |
FILE</a>
|
774 |
<input type="hidden" id="filename" name="filename" value="" />
|
3 |
Plugin Name: WPide
|
4 |
Plugin URI: https://github.com/WPsites/WPide
|
5 |
Description: WordPress code editor with auto completion of both WordPress and PHP functions with reference, syntax highlighting, line numbers, tabbed editing, automatic backup.
|
6 |
+
Version: 2.2
|
7 |
Author: Simon @ WPsites
|
8 |
Author URI: http://www.wpsites.co.uk
|
9 |
*/
|
149 |
wp_enqueue_script('ace', plugins_url("ace-0.2.0/src/ace.js", __FILE__ ) );
|
150 |
//include ace modes for css, javascript & php
|
151 |
wp_enqueue_script('ace-mode-css', $plugin_path . 'ace-0.2.0/src/mode-css.js');
|
152 |
+
wp_enqueue_script('ace-mode-less', $plugin_path . 'ace-0.2.0/src/mode-less.js');
|
153 |
wp_enqueue_script('ace-mode-javascript', $plugin_path . 'ace-0.2.0/src/mode-javascript.js');
|
154 |
wp_enqueue_script('ace-mode-php', $plugin_path . 'ace-0.2.0/src/mode-php.js');
|
155 |
//include ace theme
|
353 |
if ( !current_user_can('edit_themes') )
|
354 |
wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');
|
355 |
|
356 |
+
$is_php = false;
|
357 |
+
|
358 |
//check file syntax of PHP files by parsing the PHP
|
359 |
if ( preg_match("#\.php$#i", $_POST['filename']) ){
|
360 |
|
361 |
+
$is_php = true;
|
362 |
+
|
363 |
require('PHP-Parser/lib/bootstrap.php');
|
364 |
ini_set('xdebug.max_nesting_level', 2000);
|
365 |
|
391 |
$file_name = $root . stripslashes($_POST['filename']);
|
392 |
|
393 |
//set backup filename
|
394 |
+
$backup_path = 'backups' . preg_replace( "#\.php$#i", "_".date("Y-m-d-H").".php", $_POST['filename'] );
|
395 |
+
$backup_path_full = plugin_dir_path(__FILE__) . $backup_path;
|
396 |
+
//create backup directory if not there
|
397 |
+
$new_file_info = pathinfo($backup_path_full);
|
398 |
if (!$wp_filesystem->is_dir($new_file_info['dirname'])) wp_mkdir_p( $new_file_info['dirname'] ); //should use the filesytem api here but there isn't a comparable command right now
|
399 |
|
400 |
+
|
401 |
+
|
402 |
+
if ($is_php){
|
403 |
+
//create the backup file adding some php to the file to enable direct restore
|
404 |
+
global $current_user;
|
405 |
+
get_currentuserinfo();
|
406 |
+
$user_md5 = md5( serialize($current_user) );
|
407 |
+
|
408 |
+
$restore_php = '<?php /* start WPide restore code */
|
409 |
+
if ($_POST["restorewpnonce"] === "'. $user_md5.$_POST['_wpnonce'] .'"){
|
410 |
+
if ( file_put_contents ( "'.$file_name.'" , preg_replace("#<\?php /\* start WPide(.*)end WPide restore code \*/ \?>#s", "", file_get_contents("'.$backup_path_full.'") ) ) ){
|
411 |
+
echo "Your file has been restored, overwritting the recently edited file! \n\n The active editor still contains the broken or unwanted code. If you no longer need that content then close the tab and start fresh with the restored file.";
|
412 |
+
}
|
413 |
+
}else{
|
414 |
+
echo "-1";
|
415 |
+
}
|
416 |
+
die();
|
417 |
+
/* end WPide restore code */ ?>';
|
418 |
+
|
419 |
+
file_put_contents ( $backup_path_full , $restore_php . file_get_contents($file_name) );
|
420 |
+
|
421 |
+
}else{
|
422 |
+
//do normal backup
|
423 |
+
$wp_filesystem->copy( $file_name, $backup_path_full );
|
424 |
+
}
|
425 |
|
426 |
//save file
|
427 |
if( $wp_filesystem->put_contents( $file_name, stripslashes($_POST['content'])) ) {
|
428 |
+
|
429 |
+
//lets create an extra long nonce to make it less crackable
|
430 |
+
global $current_user;
|
431 |
+
get_currentuserinfo();
|
432 |
+
$user_md5 = md5( serialize($current_user) );
|
433 |
+
|
434 |
+
$result = "\"". $backup_path . ":::" . $user_md5 ."\"";
|
435 |
}
|
436 |
|
437 |
die($result); // this is required to return a proper result
|
472 |
$file_name = $root . stripslashes($_POST['filename']);
|
473 |
|
474 |
//set backup filename
|
475 |
+
$backup_path = 'backups' . preg_replace( "#\.php$#i", "_".date("Y-m-d-H").".php", $_POST['filename'] );
|
476 |
+
$backup_path = plugin_dir_path(__FILE__) . $backup_path;
|
477 |
+
|
478 |
+
//create backup directory if not there
|
479 |
$new_file_info = pathinfo($backup_path);
|
480 |
if (!$wp_filesystem->is_dir($new_file_info['dirname'])) wp_mkdir_p( $new_file_info['dirname'] ); //should use the filesytem api here but there isn't a comparable command right now
|
481 |
|
587 |
|
588 |
|
589 |
die();
|
590 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
591 |
}
|
592 |
|
593 |
|
610 |
|
611 |
var wpide_app_path = "<?php echo plugin_dir_url( __FILE__ ); ?>";
|
612 |
//dont think this is needed any more.. var wpide_file_root_url = "<?php echo apply_filters("wpide_file_root_url", WP_CONTENT_URL );?>";
|
613 |
+
var user_nonce_addition = '';
|
614 |
+
|
615 |
function the_filetree() {
|
616 |
jQuery('#wpide_file_browser').fileTree({ script: ajaxurl }, function(parent, file) {
|
617 |
|
717 |
$("#wpide_color_assist").hide(); //hide it until it's needed again
|
718 |
});
|
719 |
|
720 |
+
$("#wpide_toolbar_buttons").on('click', "a.restore", function(e){
|
721 |
+
e.preventDefault();
|
722 |
+
var file_path = jQuery(".wpide_tab.active", "#wpide_toolbar").data( "backup" );
|
723 |
+
|
724 |
+
jQuery("#wpide_message").hide(); //might be shortly after a save so a message may be showing, which we don't need
|
725 |
+
jQuery("#wpide_message").html('<span><strong>File available for restore</strong><p> ' + file_path + '</p><a class="button red restore now" href="'+ wpide_app_path + file_path +'">Restore this file now ✜</a><a class="button restore cancel" href="#">Cancel ✗</a><br /><em class="note"><strong>note: </strong>You can browse all file backups if you navigate to the backups folder (plugins/WPide/backups/..) using the filetree.</em></span>');
|
726 |
+
jQuery("#wpide_message").show();
|
727 |
+
});
|
728 |
+
$("#wpide_toolbar_buttons").on('click', "a.restore.now", function(e){
|
729 |
+
e.preventDefault();
|
730 |
+
|
731 |
+
var data = { restorewpnonce: user_nonce_addition + jQuery('#_wpnonce').val() };
|
732 |
+
jQuery.post( wpide_app_path + jQuery(".wpide_tab.active", "#wpide_toolbar").data( "backup" )
|
733 |
+
, data, function(response) {
|
734 |
+
|
735 |
+
if (response == -1){
|
736 |
+
alert("Problem restoring file.");
|
737 |
+
}else{
|
738 |
+
alert( response);
|
739 |
+
jQuery("#wpide_message").hide();
|
740 |
+
}
|
741 |
+
|
742 |
+
});
|
743 |
+
|
744 |
+
});
|
745 |
+
$("#wpide_toolbar_buttons" ).on('click', "a.cancel", function(e){
|
746 |
+
e.preventDefault();
|
747 |
+
|
748 |
+
jQuery("#wpide_message").hide(); //might be shortly after a save so a message may be showing, which we don't need
|
749 |
+
});
|
750 |
|
751 |
|
752 |
});
|
806 |
</div>
|
807 |
|
808 |
<div id="wpide_toolbar_buttons">
|
809 |
+
<div id="wpide_message"></div>
|
810 |
+
<a class="button restore" style="display:none;" title="Restore the active tab" href="#">Restore ✜</a>
|
811 |
+
|
812 |
+
</div>
|
813 |
|
814 |
|
815 |
<div id='fancyeditordiv'></div>
|
816 |
|
817 |
<form id="wpide_save_container" action="" method="get">
|
818 |
+
<div id="wpide_footer_message"></div>
|
819 |
+
<div id="wpide_footer_message_last_saved"></div>
|
820 |
+
<div id="wpide_footer_message_unsaved"></div>
|
821 |
<a href="#" id="wpide_save" alt="Keyboard shortcut to save [Ctrl/Cmd + S]" title="Keyboard shortcut to save [Ctrl/Cmd + S]" class="button-primary">SAVE
|
822 |
FILE</a>
|
823 |
<input type="hidden" id="filename" name="filename" value="" />
|
images/restore.png
ADDED
Binary file
|
js/load-editor.js
CHANGED
@@ -15,6 +15,10 @@ var TokenIterator = require("ace/token_iterator").TokenIterator;
|
|
15 |
var oHandler;
|
16 |
|
17 |
function onSessionChange(e) {
|
|
|
|
|
|
|
|
|
18 |
|
19 |
if( editor.getSession().enable_autocomplete === false){
|
20 |
return;
|
@@ -475,15 +479,17 @@ function wpide_set_file_contents(file, callback_func){
|
|
475 |
mode = require("ace/mode/css").Mode;
|
476 |
}
|
477 |
else if (/\.less$/.test(currentFilename)) {
|
478 |
-
mode = require("ace/mode/
|
479 |
}
|
480 |
else if (/\.js$/.test(currentFilename)) {
|
481 |
mode = require("ace/mode/javascript").Mode;
|
482 |
}
|
483 |
else {
|
484 |
-
mode = require("ace/mode/php").Mode; //default to
|
485 |
-
|
486 |
-
|
|
|
|
|
487 |
}
|
488 |
editor.getSession().setMode(new mode());
|
489 |
|
@@ -495,7 +501,30 @@ function wpide_set_file_contents(file, callback_func){
|
|
495 |
editor.focus();
|
496 |
//make a note of current editor
|
497 |
current_editor_session = clicksesh;
|
498 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
499 |
});
|
500 |
|
501 |
//add click event for tab close.
|
@@ -543,13 +572,30 @@ function saveDocument() {
|
|
543 |
//ajax call to save the file and generate a backup if needed
|
544 |
var data = { action: 'wpide_save_file', filename: jQuery('input[name=filename]').val(), _wpnonce: jQuery('#_wpnonce').val(), _wp_http_referer: jQuery('#_wp_http_referer').val(), content: editor.getSession().getValue() };
|
545 |
jQuery.post(ajaxurl, data, function(response) {
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
553 |
});
|
554 |
}
|
555 |
|
15 |
var oHandler;
|
16 |
|
17 |
function onSessionChange(e) {
|
18 |
+
|
19 |
+
//set the document as unsaved
|
20 |
+
jQuery(".wpide_tab.active", "#wpide_toolbar").data( "unsaved", true);
|
21 |
+
jQuery("#wpide_footer_message_unsaved").html("[ Document contains unsaved content ✎ ]").show();
|
22 |
|
23 |
if( editor.getSession().enable_autocomplete === false){
|
24 |
return;
|
479 |
mode = require("ace/mode/css").Mode;
|
480 |
}
|
481 |
else if (/\.less$/.test(currentFilename)) {
|
482 |
+
mode = require("ace/mode/less").Mode;
|
483 |
}
|
484 |
else if (/\.js$/.test(currentFilename)) {
|
485 |
mode = require("ace/mode/javascript").Mode;
|
486 |
}
|
487 |
else {
|
488 |
+
mode = require("ace/mode/php").Mode; //default to PHP
|
489 |
+
|
490 |
+
//only enable session change / auto complete for PHP
|
491 |
+
if (/\.php$/.test(currentFilename))
|
492 |
+
editor.getSession().enable_autocomplete = true;
|
493 |
}
|
494 |
editor.getSession().setMode(new mode());
|
495 |
|
501 |
editor.focus();
|
502 |
//make a note of current editor
|
503 |
current_editor_session = clicksesh;
|
504 |
+
|
505 |
+
//hide/show the restore button if it's a php file and the restore url is set (i.e saved in this session)
|
506 |
+
if ( /\.php$/i.test( currentFilename ) && jQuery(".wpide_tab.active", "#wpide_toolbar").data( "backup" ) != undefined ){
|
507 |
+
jQuery("#wpide_toolbar_buttons .button.restore").show();
|
508 |
+
}else{
|
509 |
+
jQuery("#wpide_toolbar_buttons .button.restore").hide();
|
510 |
+
}
|
511 |
+
|
512 |
+
//show hide unsaved content message
|
513 |
+
if ( jQuery(".wpide_tab.active", "#wpide_toolbar").data( "unsaved" ) ){
|
514 |
+
jQuery("#wpide_footer_message_unsaved").html("[ Document contains unsaved content ✎ ]").show();
|
515 |
+
}else{
|
516 |
+
jQuery("#wpide_footer_message_unsaved").hide();
|
517 |
+
}
|
518 |
+
|
519 |
+
//show last saved message if it's been saved
|
520 |
+
if ( jQuery(".wpide_tab.active", "#wpide_toolbar").data( "lastsave" ) != undefined){
|
521 |
+
jQuery("#wpide_footer_message_last_saved").html("<strong>Last saved: </strong>" + jQuery(".wpide_tab.active", "#wpide_toolbar").data( "lastsave" ) ).show();
|
522 |
+
}else{
|
523 |
+
jQuery("#wpide_footer_message_last_saved").hide();
|
524 |
+
}
|
525 |
+
|
526 |
+
//hide the message if we have a fresh tab
|
527 |
+
jQuery("#wpide_message").hide();
|
528 |
});
|
529 |
|
530 |
//add click event for tab close.
|
572 |
//ajax call to save the file and generate a backup if needed
|
573 |
var data = { action: 'wpide_save_file', filename: jQuery('input[name=filename]').val(), _wpnonce: jQuery('#_wpnonce').val(), _wp_http_referer: jQuery('#_wp_http_referer').val(), content: editor.getSession().getValue() };
|
574 |
jQuery.post(ajaxurl, data, function(response) {
|
575 |
+
var regexchk=/^\".*\"$/;
|
576 |
+
var saved_when = Date();
|
577 |
+
|
578 |
+
if ( regexchk.test(response) ){
|
579 |
+
//store the resulting backup file name just incase we need to restore later
|
580 |
+
//temp note: you can then access the data like so jQuery(".wpide_tab.active", "#wpide_toolbar").data( "backup" );
|
581 |
+
user_nonce_addition = response.match(/:::(.*)\"$/)[1]; //need this to send with restore request
|
582 |
+
jQuery(".wpide_tab.active", "#wpide_toolbar").data( "backup", response.replace(/(^\"|:::.*\"$)/g, "") );
|
583 |
+
jQuery(".wpide_tab.active", "#wpide_toolbar").data( "lastsave", saved_when );
|
584 |
+
jQuery(".wpide_tab.active", "#wpide_toolbar").data( "unsaved", false);
|
585 |
+
|
586 |
+
if ( /\.php$/i.test( data.filename ) )
|
587 |
+
jQuery("#wpide_toolbar_buttons .button.restore").show();
|
588 |
+
|
589 |
+
jQuery("#wpide_footer_message_last_saved").html("<strong>Last saved: </strong>" + saved_when).show();
|
590 |
+
jQuery("#wpide_footer_message_unsaved").hide();
|
591 |
+
|
592 |
+
jQuery("#wpide_message").html('<strong>File saved ✔</strong>')
|
593 |
+
.show()
|
594 |
+
.delay(2000)
|
595 |
+
.fadeOut(600);
|
596 |
+
}else{
|
597 |
+
alert("error: " + response);
|
598 |
+
}
|
599 |
});
|
600 |
}
|
601 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: WPsites, Thomas Wieczorek
|
|
3 |
Tags: code, theme editor, plugin editor, code editor
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 3.5
|
6 |
-
Stable tag: 2.
|
7 |
|
8 |
WordPress code editor with auto completion of both WordPress and PHP functions with reference, syntax highlighting, line numbers, tabbed editing, automatic backup.
|
9 |
|
@@ -55,6 +55,18 @@ As with most plugins this one is open source. For issue tracking, further inform
|
|
55 |
|
56 |
== Frequently Asked Questions ==
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
= Can I override the default file permissions when creating files/directories on the local filesystem =
|
59 |
|
60 |
Yes you can using the below WordPress settings in wp-config.php which will effect files created with WPide and files added during the WordPress upgrade process.
|
@@ -73,6 +85,12 @@ Either the image contains no image data (its a new empty file) or the image is n
|
|
73 |
4. Default colour picker image
|
74 |
|
75 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
= 2.1 =
|
77 |
* Ramped up the version number because the last one was just getting silly
|
78 |
* Interface changes to make the editor take up more screen space. Including hiding the WP admin menu and footer.
|
3 |
Tags: code, theme editor, plugin editor, code editor
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 3.5
|
6 |
+
Stable tag: 2.2
|
7 |
|
8 |
WordPress code editor with auto completion of both WordPress and PHP functions with reference, syntax highlighting, line numbers, tabbed editing, automatic backup.
|
9 |
|
55 |
|
56 |
== Frequently Asked Questions ==
|
57 |
|
58 |
+
= What is in place to stop me from breaking my website - "The white screen of death" =
|
59 |
+
|
60 |
+
When you edit a PHP file, before that file is saved to the filesystem it is syntax checked to make sure there isn't something obvious that will break your site.
|
61 |
+
|
62 |
+
Every file that you edit is backed up before your first save to the filesystem and then on subsequent saves WPide will try and make a backup. It will save a maximum of 1 backup per hour to the server.
|
63 |
+
|
64 |
+
As you edit or more specifically save PHP files the restore button will display which will allow you to restore the most recent backup.
|
65 |
+
|
66 |
+
If your WordPress install is fully functional then you can use the file tree to browse all of your backed up files (plugins/WPide/backups..), if your WordPress install isn't responding then restoring the file using the restore button or directly via FTP/SSH is the only way.
|
67 |
+
|
68 |
+
The backed up PHP files cannot be accessed/restored from the web directly without the 40 digit nonce/key so should not pose a security concern.
|
69 |
+
|
70 |
= Can I override the default file permissions when creating files/directories on the local filesystem =
|
71 |
|
72 |
Yes you can using the below WordPress settings in wp-config.php which will effect files created with WPide and files added during the WordPress upgrade process.
|
85 |
4. Default colour picker image
|
86 |
|
87 |
== Changelog ==
|
88 |
+
|
89 |
+
= 2.2 =
|
90 |
+
* Add restore recent backup facility - It's a primative implementation at this point but it does the job. See FAQ note.
|
91 |
+
* Turned on the LESS mode when a .LESS file is edited
|
92 |
+
* Made the autocomplete functionality only be enabled for PHP files otherwise it can be a pain to write txt files like this one!
|
93 |
+
|
94 |
= 2.1 =
|
95 |
* Ramped up the version number because the last one was just getting silly
|
96 |
* Interface changes to make the editor take up more screen space. Including hiding the WP admin menu and footer.
|
wpide.css
CHANGED
@@ -116,17 +116,24 @@
|
|
116 |
border-top-left-radius: 0px;
|
117 |
}
|
118 |
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
#wpide_save_container{
|
131 |
float: left;
|
132 |
clear: left;
|
@@ -194,44 +201,72 @@
|
|
194 |
font-size: 80%;
|
195 |
line-height: 100%;
|
196 |
}
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
|
236 |
/* color assist */
|
237 |
.ImageColorPickerWrapper{
|
116 |
border-top-left-radius: 0px;
|
117 |
}
|
118 |
|
119 |
+
#wpide_toolbar_buttons a{
|
120 |
+
display: block;
|
121 |
+
float: right;
|
122 |
+
margin: 2px;
|
123 |
+
padding: 0 10px;
|
124 |
+
height: auto;
|
125 |
+
margin-top: 4px;
|
126 |
+
}
|
127 |
+
#wpide_toolbar_buttons .red{
|
128 |
+
color:#bc201d;
|
129 |
+
}
|
130 |
+
|
131 |
+
#wpwrap div.ace_gutter{
|
132 |
+
background-color:#f4f4f4;
|
133 |
+
color:#aaa;
|
134 |
+
z-index:999;
|
135 |
+
}
|
136 |
+
|
137 |
#wpide_save_container{
|
138 |
float: left;
|
139 |
clear: left;
|
201 |
font-size: 80%;
|
202 |
line-height: 100%;
|
203 |
}
|
204 |
+
|
205 |
+
.inner-sidebar{
|
206 |
+
background-image: url(images/wpide_logo.jpg);
|
207 |
+
background-repeat: no-repeat;
|
208 |
+
background-position: top right;
|
209 |
+
}
|
210 |
+
|
211 |
+
#fancyeditordiv{
|
212 |
+
width:75%;
|
213 |
+
height:1000px;
|
214 |
+
margin-right:0!important;
|
215 |
+
float:left;
|
216 |
+
}
|
217 |
+
|
218 |
+
#wpide_message{
|
219 |
+
display:none;
|
220 |
+
width: 80%;
|
221 |
+
float: left;
|
222 |
+
text-align: left;
|
223 |
+
margin: 0;
|
224 |
+
padding: 7px;
|
225 |
+
}
|
226 |
+
|
227 |
+
#wpide_message a{
|
228 |
+
float:none;
|
229 |
+
display:inline-block;
|
230 |
+
margin:2px;
|
231 |
+
}
|
232 |
+
|
233 |
+
#wpide_message span{
|
234 |
+
width: 80%;
|
235 |
+
}
|
236 |
+
|
237 |
+
#wpide_message .note{
|
238 |
+
font-size: 10px;
|
239 |
+
margin: 10px 0;
|
240 |
+
display: block;
|
241 |
+
}
|
242 |
+
|
243 |
+
#wpide_footer_message,
|
244 |
+
#wpide_footer_message_last_saved,
|
245 |
+
#wpide_footer_message_unsaved{
|
246 |
+
display:none;
|
247 |
+
float: left;
|
248 |
+
padding: 8px;
|
249 |
+
font-size: 12px;
|
250 |
+
color: #666;
|
251 |
+
}
|
252 |
+
#wpide_footer_message_unsaved{
|
253 |
+
color:#bc201d;
|
254 |
+
}
|
255 |
+
|
256 |
+
#wpide_save{
|
257 |
+
float: right;
|
258 |
+
}
|
259 |
+
|
260 |
+
#publishing-action img{
|
261 |
+
visibility: hidden;
|
262 |
+
}
|
263 |
+
|
264 |
+
div#side-info-column{
|
265 |
+
width:23%;
|
266 |
+
}
|
267 |
+
#submitdiv.postbox{
|
268 |
+
min-width:220px;
|
269 |
+
}
|
270 |
|
271 |
/* color assist */
|
272 |
.ImageColorPickerWrapper{
|