Title: [Plugin: Ultimate TinyMCE] Bug report: relative path causes problems
Last modified: August 20, 2016

---

# [Plugin: Ultimate TinyMCE] Bug report: relative path causes problems

 *  [redcocker](https://wordpress.org/support/users/redcocker/)
 * (@redcocker)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-ultimate-tinymce-bug-report-relative-path-causes-problems/)
 * Hi,
 * Thanks good plugin!
 * Ultimate TinyMCE contains relative path names.
 * `../../../../wp-content/plugins/ultimate-tinymce/img/normal.png`
 * But they may cause problems.
    Because It’s not always true that WordPress is 
   installed in root directory.
 * If WordPress was installed in `www.eample.com/blog/`, images will disappear in
   setting panel.
 * [http://wordpress.org/extend/plugins/ultimate-tinymce/](http://wordpress.org/extend/plugins/ultimate-tinymce/)

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Thread Starter [redcocker](https://wordpress.org/support/users/redcocker/)
 * (@redcocker)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-ultimate-tinymce-bug-report-relative-path-causes-problems/#post-2418275)
 * I modified main.php to correct this issue and shared it.
 * [http://www.near-mint.com/blog/download/ultimate-tinymce.1.5.5.zip](http://www.near-mint.com/blog/download/ultimate-tinymce.1.5.5.zip)
 * Note: This file includes main.php file for ver. 1.5.5
 *  Plugin Author [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-ultimate-tinymce-bug-report-relative-path-causes-problems/#post-2418342)
 * Thank you very very much!! I didn’t think about that when writing the code.
 * I am going to make your adjustments to my new `main.php` file, since I just rewrote
   it to include language localization support. And I will most certainly give you
   credit in the update changelog.
 * So, were the only places you did this is in the image calls?
 * For example, this:
 *     ```
       function jwl_fontselect_callback_function() {
        	echo '<input name="jwl_fontselect_field_id" id="fontselect" type="checkbox" value="1" class="code" ' . checked( 1, get_option('jwl_fontselect_field_id'), false ) . ' /> ';
       	?><img src="../../../../wp-content/plugins/ultimate-tinymce/img/fontselect.png" style="margin-left:10px;margin-bottom:-5px;" /><?php
        }
       ```
   
 * To this:
 *     ```
       function jwl_fontselect_callback_function() {
        	echo '<input name="jwl_fontselect_field_id" id="fontselect" type="checkbox" value="1" class="code" ' . checked( 1, get_option('jwl_fontselect_field_id'), false ) . ' /> ';
       	?><img src="<?php echo plugin_dir_url( __FILE__ ) ?>img/fontselect.png" style="margin-left:10px;margin-bottom:-5px;" /><?php
        }
       ```
   
 *  Thread Starter [redcocker](https://wordpress.org/support/users/redcocker/)
 * (@redcocker)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-ultimate-tinymce-bug-report-relative-path-causes-problems/#post-2418416)
 * >So, were the only places you did this is in the image calls?
 * I also modified following lines.
 * Line 106-108
 *     ```
       array( 'title' => 'Normal Alert', 'block' => 'p', 'styles' => array( 'border' => 'solid 1px #DEDEDE', 'background' => '#EFEFEF url(../../../../wp-content/plugins/ultimate-tinymce/img/normal.png) 8px 4px no-repeat', 'color' => '#222222' , 'padding' => '4px 4px 4px 30px' , 'text-align' => 'left'  )),
       array( 'title' => 'Green Alert', 'block' => 'p', 'styles' => array( 'border' => 'solid 1px #1EDB0D', 'background' => '#A9FCA2 url(../../../../wp-content/plugins/ultimate-tinymce/img/green.png) 8px 4px no-repeat', 'color' => '#222222' , 'padding' => '4px 4px 4px 30px' , 'text-align' => 'left'  )),
       array( 'title' => 'Yellow Alert', 'block' => 'p', 'styles' => array( 'border' => 'solid 1px #F5F531', 'background' => '#FAFAB9 url(../../../../wp-content/plugins/ultimate-tinymce/img/yellow.png) 8px 4px no-repeat', 'color' => '#222222' , 'padding' => '4px 4px 4px 30px' , 'text-align' => 'left'  )),
       array( 'title' => 'Red Alert', 'block' => 'p', 'styles' => array( 'border' => 'solid 1px #ED220C', 'background' => '#FABDB6 url(../../../../wp-content/plugins/ultimate-tinymce/img/red.png) 8px 4px no-repeat', 'color' => '#222222' , 'padding' => '4px 4px 4px 30px' , 'text-align' => 'left'  ))
       ```
   
 * to
 *     ```
       array( 'title' => 'Normal Alert', 'block' => 'p', 'styles' => array( 'border' => 'solid 1px #DEDEDE', 'background' => '#EFEFEF url('.plugin_dir_url( __FILE__ ).'img/normal.png) 8px 4px no-repeat', 'color' => '#222222' , 'padding' => '4px 4px 4px 30px' , 'text-align' => 'left'  )),
       array( 'title' => 'Green Alert', 'block' => 'p', 'styles' => array( 'border' => 'solid 1px #1EDB0D', 'background' => '#A9FCA2 url('.plugin_dir_url( __FILE__ ).'img/green.png) 8px 4px no-repeat', 'color' => '#222222' , 'padding' => '4px 4px 4px 30px' , 'text-align' => 'left'  )),
       array( 'title' => 'Yellow Alert', 'block' => 'p', 'styles' => array( 'border' => 'solid 1px #F5F531', 'background' => '#FAFAB9 url('.plugin_dir_url( __FILE__ ).'img/yellow.png) 8px 4px no-repeat', 'color' => '#222222' , 'padding' => '4px 4px 4px 30px' , 'text-align' => 'left'  )),
       array( 'title' => 'Red Alert', 'block' => 'p', 'styles' => array( 'border' => 'solid 1px #ED220C', 'background' => '#FABDB6 url('.plugin_dir_url( __FILE__ ).'img/red.png) 8px 4px no-repeat', 'color' => '#222222' , 'padding' => '4px 4px 4px 30px' , 'text-align' => 'left'  ))
       ```
   
 * Line 78, 79
 *     ```
       $siteurl = get_option('siteurl');
       $url = $siteurl . '/wp-content/plugins/' . basename(dirname(__FILE__)) . '/admin_panel.css';
       ```
   
 * to
 * `$url = plugin_dir_url( __FILE__ ) . 'admin_panel.css';`
 * You should not hardcode plugin directory path.
    Because users can change it easily.
 * I use `plugin_dir_url( __FILE__ )` many times.
    You put no variable definitions
   in the global scope. I respect it.
 *  Plugin Author [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-ultimate-tinymce-bug-report-relative-path-causes-problems/#post-2418428)
 * Thank you. I know my share, but I’m definitely still learning as I go.
 * What’s your website, and I’ll include it in my next update?
 *  Thread Starter [redcocker](https://wordpress.org/support/users/redcocker/)
 * (@redcocker)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-ultimate-tinymce-bug-report-relative-path-causes-problems/#post-2418431)
 * Josh san,
 * Thanks.
 * My web site is [http://www.near-mint.com/blog/](http://www.near-mint.com/blog/)
 *  Plugin Author [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-ultimate-tinymce-bug-report-relative-path-causes-problems/#post-2418432)
 * Your name is Josh too?
 * Do you by chance speak any other languages?
 *  Thread Starter [redcocker](https://wordpress.org/support/users/redcocker/)
 * (@redcocker)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-ultimate-tinymce-bug-report-relative-path-causes-problems/#post-2418434)
 * Josh san,(means “Mr./Mrs./Ms. Josh” in Japanese.)
 * I’m sorry,I wrote misleading information.
    My name(online name) is redcocker.
 *  Plugin Author [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-ultimate-tinymce-bug-report-relative-path-causes-problems/#post-2418435)
 * lol… gotcha. I’ve heard it before but never seen it written 🙂
 * Thank you very much for the info and the fix. Please stay in touch!!
 *  Plugin Author [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-ultimate-tinymce-bug-report-relative-path-causes-problems/#post-2418594)
 * Hey, I was thinking about something. Would you mind taking a look at the file
   at this location:
 * /plugins/ultimate-tinymce/advimage/image.htm
 * Do you think these need to be changed as well?
 *     ```
       <script type="text/javascript" src="../../../../wp-includes/js/tinymce/tiny_mce_popup.js"></script>
       	<script type="text/javascript" src="../../../../wp-includes/js/tinymce/utils/mctabs.js"></script>
       	<script type="text/javascript" src="../../../../wp-includes/js/tinymce/utils/form_utils.js"></script>
       	<script type="text/javascript" src="../../../../wp-includes/js/tinymce/utils/validate.js"></script>
       	<script type="text/javascript" src="../../../../wp-includes/js/tinymce/utils/editable_selects.js"></script>
       ```
   

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘[Plugin: Ultimate TinyMCE] Bug report: relative path causes problems’
is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ultimate-tinymce.svg)
 * [Ultimate TinyMCE](https://wordpress.org/plugins/ultimate-tinymce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-tinymce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-tinymce/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-tinymce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-tinymce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-tinymce/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [Josh](https://wordpress.org/support/users/josh401/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-ultimate-tinymce-bug-report-relative-path-causes-problems/#post-2418594)
 * Status: not resolved