=== iG:Syntax Hiliter === Contributors: amit Tags: syntax highlighter, code highlighter, code, source code, php, mysql, html, css, javascript Requires at least: 4.1 Tested up to: 5.9 Requires PHP: 7.4.0 Stable tag: 5.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html A plugin to easily present source code on your site with syntax highlighting and formatting (as seen in code editors, IDEs). == Description == **iG:Syntax Hiliter** allows you to post source code to your site with syntax highlighting and formatting (as seen in code editors, IDEs). You can paste the code as is from your code editor or IDE and this plugin will take care of all the code colouring and preserve your formatting. It uses the [GeSHi library](http://qbnz.com/highlighter/) to colourize your code and supports over a 100 programming languages. Most common languages are included with the plugin and it includes drop in support for more languages used by GeSHi. **NOTE :** For fast results and less load on your server, you should have a cache plugin installed. That way the plugin won't have to parse the code blocks on a post every time its loaded in browser. = Minimum Requirements = * WordPress 4.1 or above * PHP 7.4.0 or above Pull requests are welcome on Github. Github: [https://github.com/coolamit/ig-syntax-hiliter/](https://github.com/coolamit/ig-syntax-hiliter/) == Installation == ###UPGRADING from v4.0 or later### Just click `update now` link below the plugin listing on the plugins page in your `wp-admin`. That's quite easy!! ###UPGRADING from v3.x### Just deactivate plugin in WordPress admin, delete the `syntax_hilite.php` file & `ig_syntax_hilite` directory from plugins folder and follow the installation process below. That's quite easy!! ###UPGRADING from v2.1 or lower### Just deactivate plugin in WordPress admin, delete the `syntax_hilite.php` and `geshi.php` files & `geshi` directory from plugins folder and follow the installation process below. That's quite easy!! ###Installing The Plugin### 1. Login to your WordPress `wp-admin` area. 2. Click `Add New` in the `Plugins` menu on left. 3. Enter `iG:Syntax Hiliter` in the search bar on the right on the page that opens and press Enter key. 4. WordPress would show the **iG:Syntax Hiliter** plugin with install button, click that to install the plugin. 5. Click on `Activate Plugin` link on the page that opens after the plugin has been installed successfully. **See Also:** ["Installing Plugins" article on the WP Codex](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins) == Other Notes == [Documentation on plugin usage and configuration](https://github.com/coolamit/ig-syntax-hiliter/blob/master/README.md) == Frequently Asked Questions == = My code looks all odd, characters appear as HTML entities. Why is your plugin screwing up my code? = If you are using the WYSIWYG (rich text) editor to compose your post then that is what's messing things up for you. iG:Syntax Hiliter does not support composing posts and posting code using WYSIWYG at present. If you are not using WYSIWYG editor and still have same issue, please report it. = I see some code that I can improve. Do you accept pull requests? = By all means, feel free to submit a pull request. = I want XYZ feature. Can you implement it? = Please feel free to suggest a new feature. Its inclusion might be speedier if you can provide the code to make it work. == Screenshots == 1. Settings page of the plugin where default options can be set for plugin 2. Example display of syntax highlighted PHP code 3. Example display of plain text view of some PHP code == ChangeLog == = v5.1 = * Minimum required PHP version bumped to 7.4.0. The plugin simply won't load its code on lower versions. * Refactored plugin code for PHP 7.4.x for better performing code. * **This is the last release using the GeSHi library.** GeSHi library has not been updated in several years and it looks unlikely that it will continue. Next release of the plugin will use a different syntax highlighting library. All existing shortcodes will continue to work and so the update and transition would be seamless for the most part, except a feature or two that will phase out and a few changes in plugin configuration options. = v5.0 = * Minimum required PHP version bumped to 5.3.0. The plugin simply won't load its code on lower versions. * Major re-write of plugin for cleaner, modular & better performing code. * Assets are enqueued only if needed. * NEW: You can now disable plugin stylesheet which styles code boxes. People who have their own styling don't need it anyway. * NEW: 2 new options allow more control on GeSHi behaviour. * BUGFIX: Language name cache was not re-building automatically. = v4.3 = * BUGFIX: some language file names got snipped when building language name cache = v4.2 = * BUGFIX: Shorthand tags for all languages supported now - props to Karol Kuczmarski for spotting it * NEW: Added C++ language file = v4.1 = * BUGFIX: Github Gist URL XSS security hole * BUGFIX: `__dir__` doesn't work below PHP 5.3 - props to Karol Kuczmarski for spotting it * NEW: Added "lang" as shorthand for "language" attribute * NEW: Additional GeSHi language files can be put in "geshi" directory in theme, which will prevent their deletion on plugin upgrade * IMPROVED: If a code block is repeated with same attributes then its parsed only once and output is reused = v4.0 = * NEW: Ability to embed Github Gist in post and comments (configurable) * NEW: Ability to highlight one or multiple lines in a code block to show them as different * NEW: New code box layout * NEW: Ability to escape plugin tags to prevent their processing * NEW: New GeSHi core (v 1.0.8.11) * IMPROVED: Removed quirks from plain text view & its now much more smoother * IMPROVED: Handling of how code is prevented from beautification. The rest of the post/comment text is not affected as wptexturize is not removed anymore. * IMPROVED: Simpler and faster options page in wp-admin = v3.5 = * BUGFIX: BB Tags except the ones of iG:Syntax Hiliter are allowed. The language file's existence is checked before parsing the code. If the language file does not exist then the code is not parsed. * BUGFIX: 'C' code hiliting is now fixed. * BUGFIX: 'Plain Text' has been improved to strip the extra blank lines and spaces in Opera and FireFox. * The latest stable GeSHi core(v1.0.7.6). * NEW: Code Hiliting for Comments has been implemented. This feature can be Enabled/Disabled from the admin interface for iG:Syntax Hiliter. The tags are same for hiliting the code. * NEW: A cross-browser Colour Picker(tested in IE6, FireFox1.5 and Opera8.5) is now available to easily set the line colours displayed in the code box. * NEW: A new type of view implemented for seeing "Plain Text" code. Besides opening the plain text code in a new window, you can have it displayed in the code box itself with an option to display the hilited HTML code back again. The "Plain Text" view type can be set in the admin interface. * The language file for Ruby that I created a while back is now bundled with the plugin and its also a part of the default GeSHi package. = v3.1 = * BUGFIX: Critical bug, which broke the plugin when the square brackets([ & ]) were used in the posts in places other than tags, has been fixed. * BUGFIX: Another bug, which allowed any attribute in the tags besides the 'num' and also allowed any attribute value for it, affecting the processing. Now only the 'num' attribute is accepted and if you specify the 'num' attribute then its value must be a positive number otherwise your code won't be hilited. The 'num' attribute is optional and you can leave it out without any problems. * BUGFIX: Fixed the unclosed