Support » Plugin: File Permissions & Size Check » [Plugin: File Permissions & Size Check] JavaScript error

Viewing 4 replies - 1 through 4 (of 4 total)
  • There are some things wrong with this plugin but easy to fix.

    1. Path to plugin folders is wrong in file-perm-check.php
    2. The version jQuery tools that is called is outdated and loads jQuery main file itself = WP do not like = JS errors
    3. Actually there are more JS errors as the init file file-perm.js is wrong. You just do not see tabs, your screenshot show how tables are one long string.
    4. When you have fixed those errors you see empty screen. Turns out there is a display: none for those tabs. That is why it works out of the box because CSS file is not even loaded due to wrong path.

    Fix 1 and 2:
    I commented out first chunk in file-perm-check.php, then changed next one to use correct file from jQuery tools and to use correct paths.

    //register jquery tools and tab styles
    add_action('admin_init', 'load_custom_perm_scripts_lcp');
    function load_custom_perm_scripts_lcp() {
    	 wp_register_script('my-jquery-ui', '');
    	 wp_register_script('my-perm-js', WP_PLUGIN_URL . '/file-permission-check/file-perm.js');
    	 wp_register_style('jquery-style', WP_PLUGIN_URL . '/file-permission-check/file-perm-check.css');
    //load stuff only on plugin page
    //add_action( 'admin_print_styles',  'load_admin_perm_styles' );
    add_action( 'admin_init',  'load_admin_perm_styles_lap' );
    function load_admin_perm_styles_lap(){
    	if( (is_admin() ) && (isset($_GET['page']) == "perm_check") ) {
    		wp_enqueue_style('jquery-style', WP_PLUGIN_URL . '/wp-file-permission-check/file-perm-check.css'); // path to plugin is not file-permission-check
    		wp_enqueue_script('my-jquery-ui', '', array('jquery')); // Does not load jQuery, only tabs
    		wp_enqueue_script('my-perm-js', WP_PLUGIN_URL . '/wp-file-permission-check/file-perm.js'); // path to plugin is not file-permission-check

    Fix 3:
    Change content of file-perm.js to this

    (function($) {
    	   $('ul.tabs').tabs('div.panes > div');

    Fix 4:
    Comment out or delete in file-perm-check-css

    /* tab pane */
    .panes div{
    /*	display:none; */
    	border:1px solid #666;
    	border-width:0 1px 1px 1px;
    /*	padding:15px 20px; */

    And plugin seem to be fully working.

    Edit: actually it is not because there are still some tab issues. You can look up correct syntax at jquery tools site, then fix in plugin. Not so sure it is a CSS issue. Could be a HTML bug.

    Neat little plugin so would be cool if dev. did real fixes.

    I got the briliant idea to NOT check on a superfat install and found something interesting. Tabs DO work with this in file-perm.js

    jQuery(document).ready(function () {
    	   jQuery("ul.tabs").tabs("div.panes > div");

    They do NOT work with what I posted before. Not for me… They look as if they work but they are dead. JS never kicks in.

    Back to fat install with new tab init code but nope, they freaking still do not work. Tried forcing file-perm.js in footer, same result. There are no erors so I have no clue. Conflict I asssume.

    So try a bit of both 🙂 May be dev. should use jQuery UI instead if he/she can reproduce the working/not working states. Could very well be a conflict on my end though.

    Aaand it was. CSS from Post Snippets kill the fun. A little too generic naming scheme for a file that apparently must be loaded on all pages! – or is it that this plugin believe there is no reason to be specific, it is not, as it only loads on 1 page! Dont know 🙂

    Plugin Author wycks


    The name “tabs” is hardcoded in jquery.ui AND I did not know these before and would have never chosen, so the plugin has to be rewritten to just use jquery.ui.

    Plugin Author wycks


    Plugin has been re-written from scratch please report any new issues in a new thread or via github:

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: File Permissions & Size Check] JavaScript error’ is closed to new replies.