JavaScript Inserter

Описание

An easy to use, with intuitive interface, WordPress plugin that gives you the ability to easily and safely add your custom JavaScript code to your WordPress website, directly out of the WordPress Admin Area, without the need to have an external editor.

This is a must have tool for authors and website’s owners. Its purpose is to provide a familiar experience to WordPress users. There is no need for any more editing of the files of your theme or plugins for to add custom JavaScript code. Just add your custom JavaScript code in the field on the plugin page and this plugin will do the rest for you. It will automatically add your JavaScript code to the desired section of your website, without changing any of your theme files and without slowing down your website.

The plugin works completely independently of the theme, so you can use it with any theme. The code you place on the plugin page will be entirely unaffected if you edit the contents of the theme’s files, or even completely change the theme. This is really useful in case of updating theme or plugins, because your custom JavaScript code would never be overwritten. Your custom JavaScript code will keep on working, no matter how many times you upgrade or switch your theme and plugins.

On the plugin page you find the code editor powered by CodeMirror. This code editor has options such as syntax highlighting, line numbering, and more. And if you want more options, let us know and we will be happy to add them.

Features

  • Lightweight and fast
  • Secure code with using clear coding standards
  • Intuitive interface
  • Cross browser compatible (work smooth in any modern browser)
  • Compatible with all WordPress themes
  • RTL compatible (right to left)
  • Translation ready

Key features include

  • Insert custom JavaScript code into the site
  • Manage which JavaScript code load on HEAD or FOOTER
  • Controlling the priority of loading JavaScript code
  • Code syntax highlighting
  • Line numbering
  • Active line highlighting
  • Editor allow for Tab indentation
  • And much, much more!

PRO features include

  • Ability to easily customize the code editor by selecting the desired settings
  • 56 themes for syntax highlighting
  • Toolbar with useful buttons, such as Undo, Redo, etc.
  • Ability to use shortcut keys (both Mac and PC) for Search, Replace, etc.
  • Unlimited number of fields for snippets
  • Automatic backup of all snippets to a downloadable text file
  • Separate activation and deactivation of snippets
  • No ads on the settings page
  • Well documented

Get the PRO version now!

Supported languages

  • JavaScript

Translation

This plugin is ready for translation and has already been translated into several languages. But If your language is not available then you can make one. It is also possible that not all existing translations are up-to-date or correct, so you are welcome to make corrections. Many of plugin users would be delighted if you share your translation with the community. Thanks for your contribution!

  • English (default)
  • Russian (translation by Milena Kiseleva)
  • German (translation by Michael)
  • Polish (translation by Paweł K.)
  • Spanish (translation by Ramiro Garcés and Patricio Toledo)
  • Dutch (translation by Peter Leenders)
  • French (translation by Jean-Michel, Theophil Bethel and Hervé Bouzin)

If you want to help translate this plugin, please visit the translation page.

Minimum system requirements:

  • PHP version 5.2 or higher.
  • MySQL version 5.0 or higher.

Recommended system requirements:

  • PHP version 7.0 or higher.
  • MySQL version 5.6 or higher.

Contribution

Developing plugins is long and tedious work. If you benefit or enjoy this plugin please take the time to:

«JavaScript Inserter» is one of the own software projects of Space X-Chimp.

License

This plugin is licensed under the GNU General Public License, version 3 (GPLv3) and is distributed free of charge.
Commercial licensing (e.g. for projects that can’t use an open-source license) is available upon request.

Credits

Links

Скриншоты

  • Plugin page.
  • Plugin page with Google Analytics tracking code added.

Установка

Install «JavaScript Inserter» just as you would any other WordPress Plugin.

Automatically via WordPress Admin Area:

  1. Log in to Admin Area of your WordPress website.
  2. Go to «Plugins» -> «Add New«.
  3. Find this plugin and click install.
  4. Activate this plugin through the «Plugins» tab.

Manually via FTP access:

  1. Download a copy (ZIP file) of this plugin from WordPress.org.
  2. Unzip the ZIP file.
  3. Upload the unzipped catalog to your website’s plugin directory (/wp-content/plugins/).
  4. Log in to Admin Area of your WordPress website.
  5. Activate this plugin through the «Plugins» tab.

After installation and activation, the «JS Inserter» menu item will appear in the «Settings» section of Admin Area. Click on it in order to view the plugin settings page.

More help installing plugins

Часто задаваемые вопросы

Q. Will this plugin work on my wordpress.COM website?

A. Sorry, this plugin is available for use only on self-hosted (wordpress.ORG) websites.

Q. Can I use this plugin on my language?

A. Yes. This plugin is ready for translation and has already been translated into several languages. But If your language is not available then you can make one. It is also possible that not all existing translations are up-to-date or correct, so you are welcome to make corrections. Many of plugin users would be delighted if you share your translation with the community. Thanks for your contribution!

If you want to help translate this plugin, please use the POT file that is included and placed in the languages folder to create a translation PO file. Just send the PO file to us and we will include this translation within the next plugin update.

Q. How does it work?

A. Simply go to the plugin settings page, place your custom JavaScript code in the code editor field and click the «Save changes» button. Enjoy the result of applying your custom JavaScript code. It’s that simple!
You can find the plugin settings page at «WordPress Admin Area» -> «Settings» -> «JS Inserter«.

Q. How much of JavaScript code (characters) I can enter in the code editor?

A. We don’t limit the number of characters.

Q. Does this plugin requires any modification of the theme?

A. Absolutely not. This plugin is configurable entirely from the plugin settings page that you can find in the Admin Area of your WordPress website.

Q. Does this require any knowledge of HTML or CSS?

A. Absolutely not. This plugin can be configured with no knowledge of HTML or CSS, using an easy-to-use plugin settings page.

Q. Can I add my custom JavaScript code to a specific page of my website?

A. For now, this plugin does not have an option to apply the custom JavaScript code only on specific pages. We plan to add this feature soon. But for now in order to apply your custom JavaScript code only on specific pages of your website, you need to wrap your custom JavaScript code in a PHP code that will determine the page you want. You need something like this:

function my_custom_js_code() {

    // Stop the function if this is not the Home page of website
    if ( !is_home() ) {
        return;
    }

    // Print the custom JavaScript code
    echo '<script>YOUR CUSTOM JAVASCRIPT CODE HERE</script>';

}
add_action( 'wp_head', 'my_custom_js_code' );

To apply the PHP code on a website, we can recommend you to use another our plugin called My Custom Functions.

Q. My custom JavaScript code is not working. What could be wrong?

A. It happens that your custom JavaScript code that you insert on the plugin page does not work, even if an error message does not appear. Here are a few of the most likely causes of the issue:

  1. You have a typo during the insertion of your custom JavaScript code.
  2. Your custom JavaScript code has a syntax error.
  3. Your custom JavaScript code is incorrect and may not work.
Q. It’s not working. What could be wrong?

A. As with every plugin, it’s possible that things don’t work. It’s impossible to tell what could be wrong exactly. The most common reason for this is a web browser’s cache. Every web browser stores a cache of the websites you visit (pages, images, and etc.) to reduce bandwidth usage and server load. This is called the browser’s cache. Clearing your browser’s cache may solve the problem.

If you post a support request in the plugin’s support forum on WordPress.org, we’d be happy to give it a look and try to help out. Please include as much information as possible, including a link to your website where the problem can be seen.

Q. The last WordPress update is preventing me from editing my website that is using this plugin. Why is this?

A. This plugin can not cause such problem. More likely, the problem are related to the settings of the website. It could just be a cache, so please try to clear your website’s cache (may be you using a caching plugin, or some web service such as the CloudFlare) and then the cache of your web browser. Also please try to re-login to the website, this too can help.

Q. Where to report bug if found?

A. Bug reports are very welcome! Please visit our contact page and report. Thank you!

Q. Where to share any ideas or suggestions to make the plugin better?

A. Any suggestions are very welcome! Please visit our contact page and share. Thank you!

Q. I love this plugin! Can I help somehow?

A. Yes, any contributions are very welcome! Please visit our donation page. Thank you!

Участники и разработчики

«JavaScript Inserter» — проект с открытым исходным кодом. В развитие плагина внесли свой вклад следующие участники:

Участники

Перевести «JavaScript Inserter» на ваш язык.

Заинтересованы в разработке?

Посмотрите код, проверьте SVN репозиторий, или подпишитесь на журнал разработки по RSS.

Журнал изменений

1.18 — Nov 11, 2019

  • Maintenance: Compatibility with upcoming WordPress 5.3.
  • Framework update: Bootstrap library updated to the latest version; v3.4.1.
  • Framework update: The list control has been redesigned.

1.17 — Oct 2, 2019

  • French translation updated. (Thanks to Hervé Bouzin)

1.16.1 — Jul 16, 2019

  • Fixed: Prints a warning since PHP/7.1: «Notice: A non well formed numeric value encountered in /inc/php/versioning.php on line 43».

1.16 — Mar 31, 2019

  • Framework updated: Code formatting improved.
  • Framework updated: Code commenting improved.
  • Framework updated: The change log design is improved.

1.15 — Mar 24, 2019

  • Framework updated: Added function «_plugin», which returns an array with the contents of plugin constants. The mention of plugin constants is replaced by the use of the function «_plugin».
  • Framework updated: The functions «_settings_link» and «_upgrade_link» are combined and improved.
  • Framework updated: The function «_plugin_row_meta» is improved.
  • Framework updated: Code formatting improved.
  • Framework updated: Code commenting improved.
  • Framework updated: All translation files are updated.

1.14 — Mar 18, 2019

  • Improvement: Notification display system updated
  • Code commenting improved.
  • Style sheet for the back end is optimised.

1.13 — Mar 1, 2019

  • Framework updated: The file «page.php» is divided into the following parts: «page.php», «usage.php», «faq.php», «support.php».
  • Framework updated: The files «settings.php», «usage.php», «faq.php», «support.php» are moved to the subfolder «tabs».

1.12 — Feb 24, 2019

  • Added French translation. (Thanks to Hervé Bouzin)

1.11 — Feb 21, 2019

  • The readme «Tested up to:» value changed to 5.1 after full testing process and ensuring compatibility.
  • Content of the «F.A.Q.» section updated.
  • Some texts are corrected or replaced with new ones.
  • All translation files are updated.
  • Code formatting improved.
  • Added CSS class «.custom-list» for displaying a custom list, which is used on the plugin settings page.
  • The «humans.txt» file updated.
  • The copyright date corrected.

1.10 — Jan 11, 2019

  • Content of the «Usage» section updated.
  • Content of the «FAQ» section updated.
  • Code formatting in the «admin.js» file improved.
  • Code commenting improved.
  • The copyright date updated.
  • Translation files are updated.

1.9 — Nov 2, 2018

  • Improvement: Design of the plugin settings page is improved.

1.8 — Oct 23, 2018

  • Improvement: Design of the plugin settings page is improved.
  • Content of the «Usage Instructions» section updated.
  • Translation files are updated.

1.7 — Oct 8, 2018

  • Added new feature: If the changes in the code editor were made, but not saved, the message «NOT SAVED» is displayed.
  • Translation files are updated.

1.6 — Sep 22, 2018

  • Added information about the PRO version of the plugin.
  • Content of the «FAQ» section updated.
  • CSS code, which is located in the file «admin.css» and is related to the «FAQ» section, is improved.
  • The sidebar items are rearranged.
  • Some texts are updated.
  • Translation files are updated.

1.5 — Sep 12, 2018

  • The design of the message «Successful» is improved.
  • The «readme.txt» file is updated.
  • Some texts are updated.
  • Translation files are updated.

1.4 — Aug 19, 2018

  • Changed the sorting of functions in the file ‘functional.php’.
  • The ‘_output’ function renamed to ‘_prepare’.
  • The function ‘_prepare’ is improved.
  • Functions ‘_inject_head_beginning’, ‘_inject_head_end’, ‘_inject_footer_beginning’ and ‘_inject_footer_end’ are renamed to ‘_exec_head_0’, ‘_exec_head_1’, ‘_exec_footer_0’ and ‘_exec_footer_1’ respectively.
  • The comment (name of the plugin and link) added to the custom code is deleted.
  • Code commenting improved.
  • Some texts are updated.
  • Translation files are updated.

1.3 — Aug 7, 2018

  • Some texts are updated.
  • Translation files are updated.
  • The translation into Russian has been corrected.

1.2 — Jul 24, 2018

  • Dutch translation added. (Thanks to Peter Leenders)
  • The function ‘_load_scripts_codemirror’ is improved. Removed an unnecessary call of constants.
  • The function ‘_load_scripts_admin’ is improved.
  • The banner of Space X-Chimp, located on the settings page of the plugin, is updated. The image ‘banner.png’ is deleted.
  • Some texts are updated.
  • All translation files are updated.

1.1 — Jul 12, 2018

  • Enqueue of the CodeMirror addons is moved to the beginning of the queue, before enqueuing the CodeMirror mods.
  • The code number of the plugin is changed from ‘p015’ to ‘p016’.
  • All translation files are updated.

1.0

  • Initial release.

0.3

  • Release candidate.

0.2

  • Beta version.

0.1

  • Alpha version.