GithubHelp home page GithubHelp logo

aceide / editor Goto Github PK

View Code? Open in Web Editor NEW
22.0 7.0 12.0 8.17 MB

Fork of the WPide ACE editor plugin for WordPress

License: GNU General Public License v3.0

PHP 11.60% CSS 3.91% Shell 0.57% JavaScript 83.91%

editor's Introduction

AceIDE WordPress Plugin

AceIDE is a fork of the WPide project.

AceIDE is a WordPress code editor with the long term goal of becoming the ultimate environment to code/develop WordPress themes and plugins. You can edit any files in your wp-content, not just plugins and themes. Code completion will help you remember your WordPress/PHP commands providing function reference along the way. AceIDE allows you to work with multiple files, with basic features such as the tabbed editor, syntax highlighting and line numbers. It also provides some more advanced features such as syntax verification and automatic backups upon saving.

Contributions and feedback is encouraged! If you find an issue, please let us know via the WordPress support forums, or the GitHub issue tracker. Code contributions are welcomed as a pull request to our GitHub repo.

This plugin would not be possible without the Ajax.org Cloud9 Editor which is the embedded code editor that powers much of the functionality.

This plugin performs best in the Chrome web browser.

Contributors: Shane Thompson, WPsites, Thomas Wieczorek, X-Raym, Kevin Young Tags: code, theme editor, plugin editor, code editor
Requires at least: 3.0
Tested up to: 4.9.1
Stable tag: 2.6.2

Current Features:

  • Syntax highlighting
  • PHP syntax checking before saving to disk to try and banish white screen of death after uploading invalid PHP
  • Line numbers
  • Find+replace
  • Code autocomplete for WordPress and PHP functions along with function description, arguments and return value where applicable
  • Colour assist - a colour picker that only shows once you double click a hex colour code in the editor. You can also drag your own image into the colour picker to use instead of the default swatch (see other notes for info).
  • Automatic backup of every file you edit. (one daily backup and one hourly backup of each file stored in plugins/AceIDE/backups/filepath)
  • File tree allowing you to access and edit any file in your wp-content folder (plugins, themes, uploads etc)
  • Use the file browser to rename, delete, download, zip and unzip files (so you can download a zipped version of your whole theme for example)
  • Create new files and directories
  • Highlight matching parentheses
  • Code folding
  • Auto indentation
  • Tabbed interface for editing multiple files (editing both plugin and theme files at the same time)
  • Using the WordPress filesystem API, although currently direct access is forced (edit AceIDE.php in the constructor to change this behaviour) ftp/ssh connections aren't setup yet, since WP will not remember a password need to work out how that will work. Maybe use modal to request password when you save but be able to click save all and save a batch with that password. Passwords defined in wp-config.php are persistent and would fix this problem but people don't generally add those details. Open to ideas here.
  • Image editing/drawing
  • WordPress Multisite support

Feature ideas and improvements:

  • Improve the code autocomplete command information, providing more information on the commands, adding links through to the WordPress codex and PHP.net website for further info.
  • Create an admin panel to choose between syntax highlighting themes and turn on/off other Ajax.org Cloud9 functionality
  • Better automated file backup process
  • Templates/shortcuts for frequently used code snippets, maybe even with an interface to accept variables that could be injected into code snippet templates.
  • Integration with version control systems such as Git

As with most plugins this one is open source. For issue tracking, further information and anyone wishing to get involved and help contribute to this project can do so over on GitHub.
Please read CONTRIBUTING.md before submitting a pull request.

Installation

  1. Run composer install to install project dependencies
  2. Upload the AceIDE folder to the /wp-content/plugins/ directory
  3. Activate the plugin through the 'Plugins' menu in WordPress
  4. Access AceIDE by clicking the AceIDE menu item in your main administration menu

Screenshots

  1. Editor view, showing line numbers and syntax highlighting.
  2. Image editor in action
  3. Showing auto complete, function reference and file tree.
  4. Default colour picker image

Changelog

Please have a look at CHANGELOG.md

Contributors

Simon Dunton - http://www.wpsites.co.uk
Thomas Wieczorek - http://www.wieczo.net
Shane Thompson
X-Raym Kevin Young - https://rdytogo.com/

Please read CONTRIBUTING.md before submitting a pull request.

editor's People

Contributors

drewapicture avatar jhstatewide avatar lukefiji avatar shanept avatar wieczo avatar wpsites avatar x-raym avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

editor's Issues

Error on plugin activation

After installing the plugin and attempted to activate I get this fatal error:
Fatal error: Composer "vendor/" directory missing. in /home/ciwork/public_html/southfloridasinusandallergy.com/wp-content/plugins/editor/AceIDE.php on line 15

AJAX handler breaks ajax functionality in WP Admin

The AJAX handler introduced in commit 80e8adf occasionally breaks AJAX requests.
This is due to being outside the wp-admin directory, and then loading admin-ajax.php. WordPress is unaware the request was made to a file outside the wp-admin directory, resulting in errors.

File Not opening in WP 4.9.2

Can you please figure-out why Ace IDE not opening any file in WP 4.9.2 but WPide working fine.

Appreciate your work (y)

Thanks

AceIDE isn't showing up in the WordPress dashboard menu

Hello! I've been using the AceIDE plugin and out of nowhere it's no longer showing up in the list on the left-hand side of the WordPress dashboard. The plugin is definitely installed and activated, and I haven't changed anything else on the site at all recently. I just logged in today to check for updates and couldn't find AceIDE anymore. Any thoughts? Attached are screenshots. Thank you so much!
screen1
screen2

Downloaded files have zero-width spaces at character 1

Hi !

When you download a file with right click-> Download from AceIDE, the downloaded file have a zero-width space character at position 1.

Zero-width spaces are pretty hard to see in a code editor, but I can clearly see it in Atom with Highlight Bad Characters plugin.

Demo

I can't really copy paste this character cause it is cleaned when I paste.

Could AceIDE be responsible of this ? I didn't find which files can be the culprit.

Thanks for your support !

Zip functionality broken

PclZip zipping functionality broken since code refactor. This is due to the PclZip class not being imported from the global namespace in the appropriate file.

FR: Tab / Spaces code Indentation

Hi,

Currently, code indentation is made with 4 spaces.

It could be nice to be able to choose between tab or /spaces, and how many spaces number in this case.

Did I miss something ?

Thanks for listening !

Change Menu capability

Currently the capability required to create the menu is 'create_users'. This can create issues with a modified capability hierarchy.

The plugin capability should be changed to the more appropriate 'edit_plugins' capability to better avoid this issue.

Dialog box has double cross icon !!!

Whenever we open a dialog box like "find" or "go to" there is a double cross icon. It harts to see that kind of bug in a favorite plugin.

Please check the below screenshot for clarification.

aceide-dialog-box

Unable to get file tree information

Hello,

Thank you for the wonderful plugin, it really helped me a lot .
I've been using the plugin for some time without any issues but after the latest WP update 4.9.8, I get this error when I access the plugin page "Unable to get file tree information ".

Is there any conflict with WP or did you test it with latest version?

Hope you can assist me.

Kind regards

Name Disappears

Hi,
I am using the latest wordpress (ver 4.9.2) and your AceIDE plugin (ver 2.6.1). I have to deactivate all of my plug-in's to see AceIDE in the menu on the left side in admin panel. With all of my plug-in's enabled, it is nowhere to be found. It completely disappears. Can you tell me how I can access AceIDE without clicking on the missing icon?

Thanks,
Garfie222

PHP 7 Compatability

The 'phpseclib' dependency is not compatible with PHP 7.
Dependency on this package will be removed, and the functionality will be coded into the plugin itself.

FILE: /home/sitename/public_html/wp-content/plugins/aceide/vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php
———————————————————————————————————————————
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 2 LINES
———————————————————————————————————————————
65 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
65 | WARNING | Function mcrypt_create_iv() is deprecated since PHP 7.1; use OpenSSL instead
104 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
104 | WARNING | Function mcrypt_create_iv() is deprecated since PHP 7.1; use OpenSSL instead
———————————————————————————————————————————

FILE: /home/sitename/public_html/wp-content/plugins/aceide/vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php
———————————————————————————————————————————-
FOUND 0 ERRORS AND 39 WARNINGS AFFECTING 20 LINES
———————————————————————————————————————————-
777 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
777 | WARNING | Function mcrypt_generic_init() is deprecated since PHP 7.1; use OpenSSL instead
810 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
810 | WARNING | Function mcrypt_generic_init() is deprecated since PHP 7.1; use OpenSSL instead
813 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
813 | WARNING | Function mcrypt_generic() is deprecated since PHP 7.1; use OpenSSL instead
818 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
818 | WARNING | Function mcrypt_generic() is deprecated since PHP 7.1; use OpenSSL instead
827 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
827 | WARNING | Function mcrypt_generic() is deprecated since PHP 7.1; use OpenSSL instead
837 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
837 | WARNING | Function mcrypt_generic() is deprecated since PHP 7.1; use OpenSSL instead
840 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
840 | WARNING | Function mcrypt_generic_init() is deprecated since PHP 7.1; use OpenSSL instead
1089 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
1089 | WARNING | Function mcrypt_generic_init() is deprecated since PHP 7.1; use OpenSSL instead
1117 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
1117 | WARNING | Function mcrypt_generic() is deprecated since PHP 7.1; use OpenSSL instead
1122 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
1122 | WARNING | Function mcrypt_generic() is deprecated since PHP 7.1; use OpenSSL instead
1131 | WARNING | Function mdecrypt_generic() is deprecated since PHP 7.1; use OpenSSL instead
1134 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
1134 | WARNING | Function mcrypt_generic_init() is deprecated since PHP 7.1; use OpenSSL instead
1596 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
1596 | WARNING | Function mcrypt_list_algorithms() is deprecated since PHP 7.1; use OpenSSL instead
1675 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
1675 | WARNING | Function mcrypt_module_close() is deprecated since PHP 7.1; use OpenSSL instead
1676 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
1676 | WARNING | Function mcrypt_module_close() is deprecated since PHP 7.1; use OpenSSL instead
1681 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
1681 | WARNING | Function mcrypt_module_close() is deprecated since PHP 7.1; use OpenSSL instead
1795 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
1795 | WARNING | Function mcrypt_module_open() is deprecated since PHP 7.1; use OpenSSL instead
1796 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
1796 | WARNING | Function mcrypt_module_open() is deprecated since PHP 7.1; use OpenSSL instead
1802 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
1802 | WARNING | Function mcrypt_module_open() is deprecated since PHP 7.1; use OpenSSL instead
1807 | WARNING | Extension ‘mcrypt’ is deprecated since PHP 7.1 – use openssl (preferred) or pecl/mcrypt once available instead.
1807 | WARNING | Function mcrypt_generic_init() is deprecated since PHP 7.1; use OpenSSL instead
———————————————————————————————————————————-

FILE: /home/sitename/public_html/wp-content/plugins/aceide/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php
——————————————————————————————————————-
FOUND 1 ERROR AFFECTING 1 LINE
——————————————————————————————————————-
182 | ERROR | Global with variable variables is not allowed since PHP 7.0
——————————————————————————————————————-

FILE: /home/sitename/public_html/wp-content/plugins/aceide/vendor/phpseclib/phpseclib/phpseclib/File/X509.php
————————————————————————————————————-
FOUND 4 ERRORS AFFECTING 4 LINES
————————————————————————————————————-
4387 | ERROR | Using a call-time pass-by-reference is deprecated since PHP 5.3 and prohibited since PHP 5.4
4412 | ERROR | Using a call-time pass-by-reference is deprecated since PHP 5.3 and prohibited since PHP 5.4
4479 | ERROR | Using a call-time pass-by-reference is deprecated since PHP 5.3 and prohibited since PHP 5.4
4551 | ERROR | Using a call-time pass-by-reference is deprecated since PHP 5.3 and prohibited since PHP 5.4
————————————————————————————————————-

Missing License

I went to see how this project was licensed, but I didn't find one. I'd suggest adding one!

Feature Request: Apply IDE to page/post editors

Would it be possible to use the IDE functionality (syntax highlighting, tabbing, etc...) in the post and page editors? It would be great if there was an option to enable the IDE (minus the file explorer of course) in the page and post editor. Currently I use the HTML Editor Syntax Highlighter plugin to accomplish this, but it would be awesome if AceIDE could do this as I'm a huge fan of this project and it would mean 1 more plugin that I can remove from my installs.

Search and Replace Issue

Hi !

When you make Search and Replace, once you click on the replace field (to enter what you need), it automatically replace the first occurence of the search results by what was in the replace field, without even clicking on the replace button.

Demo

This is not very convenient as it doesn't let the user write his request properly.

BUG: CSS syntax highlighting now working

I noticed that the syntax highlighting is not working for CSS files.
The php and html syntax highlighting seems to be working, just no the css files. It appears to not recognize the file as css, when you use the keyboard shortcut to create a comment, it adds an html comment rather then the css comment.

Documentation

One of my favorite features of Sublime Text is the ability to have multiple editing cursors.
If you have not seen it before, Sublime's website has an animation of it on their homepage.
https://www.sublimetext.com/ It's a major selling point.

Recently, I found out that the ACE editor is already capable of doing the same thing. Here is the default keybindings documentation. https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts Soon as I learned the keyboard bindings I started using it right away.

That is when it hit me, AceIDE could use some basic documentation. I propose two things:

  1. Develop the Ace IDE Wiki pages https://github.com/AceIDE/editor/wiki. The first page I would add is the keybindings. I would be willing to contribute some basic content to the wiki if needed.

  2. Create a simple icon in the app interface to direct people to the wiki for help.
    documentation-idea

What do you think?

Increase backup naming precision

Currently, backup names contain the date at which they were created, accurate to an hour. We should increase the accuracy to 1 second.

// set backup filename
$backup_path = 'backups' . preg_replace( "#\.php$#i", "_" . date( "Y-m-d-H-i-s" ) . ".php", $_POST['filename'] );
$backup_path_full = plugin_dir_path( dirname( dirname( __FILE__ ) ) ) . $backup_path;

Reported: https://wordpress.org/support/topic/save-as-3/#post-10476350

Sumopaint image editing broken

The image URL passed to SumoPaint is invalid, so SumoPaint may not download the image for manipulation.

The save handler for SumoPaint is also broken. SumoPaint no longer passes the image in the POST content, rather a URL from which to fetch the image.

HTTP server error message during failed file upload

In the event of a failed file upload, the browser simply alerts the user 'NO', with no indication as to why the server rejected to handle the request.

See here.

The alert should better represent the issue the browser has with processing the request.

3 issues with the plugin

Hi,
thanks for creating awesome plugin. I love it!
But there are few issues I'd like to ask:
1/ Is there any way to stop admin vertical menu bar from collapsing after reloading.
2/ File locations and Tab are not saved after reloading.
Could you pls help me how to resolve the 2 issues above?
Thank you so much!

BUG: AceIDE doesn't seem to work on some websites.

I run a number of sites. Many of them are running AceIDE just fine. However one in particular, well, doesn't. It's a multisite and whenever I enable AceIDE on it, well, it 'borks' :) WPIDE runs fine on it however, except of course that WPIDE has gotten so old as to start to become un-usable.

I don't see any PHP errors, I do see some Javascript errors in the console. They are:
screen shot 2018-01-16 at 8 19 29 pm

From looking at this, looks like the URLs for the javascript are getting messed up somehow. I went a bit deeper and seemed to find the problem.

There are two lines in the IDE.php file that are incorrect inside of add_admin_js() ... After doing a fair bit of effort to get the proper $plugin_url ... It's then ignored for both the Ajax endpoint, and the jqueru-file-tree lines.

Changing them respectively to the following seems to fix this for me:

line 153:
wp_enqueue_script( 'jquery-file-tree', "{$plugin_url}src/js/jqueryFileTree.js", array( 'jquery' ), $idever );

line 181:
'url' => "{$plugin_url}src/Ajax.php"

Noisy plugins and themes altering contents of file upon open

Some plugins and themes that are not properly coded or that contain errors will alter the contents of a file upon opening.

When opening a file, AceIDE creates an AJAX request to WordPress, which returns the output of the file. If there are plugins or themes creating extra output, it will be prepended to the file, which can, at best create a large amount of whitespace in a file, and at worst can break scripts.

The editor needs to strip out this output.

Error when attempting to be activated.

Clean install on Wordpress v4.74. All other plugins are deactivated.

When activating this plugin, the following message is displayed.

Parse error: syntax error, unexpected T_STRING in /hsphere/local/home/gluckfs/wp1.fbgluck.com/wp-content/plugins/aceide/AceIDE.php on line 19

The plugin will not activate.

Not sure of the version of PhP that is being used. Install information does not state a requirement. I have installed this on other hosts and on other sites and it works OK.

Thanks

BUG: Latest PHP syntax not being supported: ??

When attempting to use the ?? coalesce operator, it claims incorrect syntax, and refuses to save the code.

For example:
$output->address_1 = $data['raw']['charge']['source']['address_line1'] ?? $output->data['raw']['token']['card']['address_line1'] ?? '';

PHP8 Syntax Error

I got a fatal error after updating to PHP8:
PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /var/www/html/wp-content/plugins/aceide/src/Modules/FileOps.php

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.