Forum Replies Created

Viewing 15 replies - 31 through 45 (of 114 total)
  • Plugin Author shanept

    (@shanept)

    I’m not sure where the disconnect is here…

    The path it is building, and is attempting to require, as evidenced by the error message is as follows:

    /wp_admin/admin-ajax.php

    Do you disagree with this?
    The WP install as evidenced by the error message is at:

    /wpcom-19758243

    And therefore the path that we should be requiring should be as follows:

    /wpcom-19758243/wp_admin/admin-ajax.php

    The path for the WordPress install will have all appropriate permissions for us to include files, otherwise the whole website would not run at all. This is the directory in which we have files like wp-blog-header.php and (usually) wp-config.php that bootstrap the whole environment.

    Thanks

    Plugin Author shanept

    (@shanept)

    Hey,

    It doesn’t build the path properly.

    The path that is being required is /wp-admin/admin-ajax.php, where the initial forward slash indicates the top directory of the hard drive in the server, not the top directory of the WordPress install. This path does not exist, and as the WP.com guys are saying, there are no permissions to access this location.

    If you examine the error message, the wp-content directory sits in its own directory – which is the same directory as wp-admin:

    PHP Fatal error: require(): Failed opening required ‘/wp-admin/admin-ajax.php’ (include_path=’/:.’) in /wpcom-19758243/wp-content/plugins/aceide/src/Ajax.php on line 23

    Therefore I expect to be requiring this file:

    /wpcom-19758243/wp_admin/admin-ajax.php

    However somewhere, it is going wrong. With the code I sent above, we can see each step that is being taken to traverse up a directory and can see where things are going wrong. If you can help me by providing this output then I can help you by fixing the plugin.

    Thanks for your cooperation
    Shane Thompson

    Plugin Author shanept

    (@shanept)

    Hi again,

    var_dump will output the variable in the browser, so it will be the contents of the ajax response. You will have to watch the ajax request in the network tab.

    The functions you mentioned, they all use dirname inside them. Not only that, the WordPress plugins you mentioned are WordPress specific and as such are not available until admin-ajax has been included.

    They are telling you why you are having this issue, whereas I’m trying to figure out how we got there. If you place the above modifications in the src/Ajax.php file, I’ll have a better idea what’s going on and we can figure out the solution ??

    Thanks
    Shane Thompson

    Plugin Author shanept

    (@shanept)

    Hey,

    wp_localize_script is used for a very different use case in context to ajax.

    And debugging is not a problem – I’d like to see what dirname is doing at every step… i.e.

    
    $dir = __FILE__;
    var_dump( $dir );
    $dir = dirname( $dir ); // src
    var_dump( $dir );
    $dir = dirname( $dir ); // aceide
    var_dump( $dir );
    $dir = dirname( $dir ); // plugins
    var_dump( $dir );
    $dir = dirname( $dir ); // wp-content
    var_dump( $dir );
    $dir = dirname( $dir ); // WP
    var_dump( $dir );
    $dir .= '/wp-admin/admin-ajax.php';
    var_dump( $dir );
    
    require_once $dir;
    

    This should work on any server. This will, however output the full path of the WordPress installation. If you have issues publishing that, please feel free to send the output to:

    me (at) shane (dot) pt

    Thank you for your patience!

    Shane Thompson

    Plugin Author shanept

    (@shanept)

    Hi retetecugust,

    If it is requiring in only “/wp-admin/admin-ajax.php”, then it is referencing the root directory of the hard drive. I’m not quite sure why it would be doing this…

    As you can see here, there’s nothing fancy going on. There’s no code there that is too new to run on their servers, this is bizarre. Your use-case might require some more in-depth debugging. Are you confident enough to do this?

    @thatsinsurance did you have the same error in your logs as is above?

    Thanks,

    Shane Thompson

    Plugin Author shanept

    (@shanept)

    Hmm that’s bizarre…

    Any chance you’re able to see debug logs on your server?

    Plugin Author shanept

    (@shanept)

    Ahh right. That’s definitely an Ajax issue. Can you please open the network monitor then click on a file, and let me know what the monitor reports?

    Thanks

    Plugin Author shanept

    (@shanept)

    Is that all you see? This plugin doesn’t use web sockets, so I’m not sure why you’re getting that.

    So when you load the page, what are you seeing? Do you have the WordPress menu but no editor or file tree?

    Plugin Author shanept

    (@shanept)

    Hi retetecugust,

    I did reply to you in a separate thread, but it was a busy thread so you probably didn’t see it.

    I believe in your case that maybe WordPress is aborting the ajax call pre-ajax-hook. You do not seem to have any issues in regards to server configuration.

    Are you able to provide network logs from your browser so I can better see what’s going on?

    Thanks,
    Shane Thompson

    Plugin Author shanept

    (@shanept)

    Yeah this one sounds fun and complex.
    How do you want to tackle this one, are you going to look into it yourself, or would you like a hand?

    Plugin Author shanept

    (@shanept)

    Hmm that would be a curious edge case. What issues are you experiencing?

    The issues thus far are common to both 2.6.0 and 2.6.1.

    Plugin Author shanept

    (@shanept)

    Hi Philip,

    The ajax handler did change from admin-ajax.php in the wp-admin directory to Ajax.php in the plugin directory, therefore under wp-content. This change happened in 2.6, so you are correct.

    There must be something common with your setup, maybe a WordPress hardening plugin you use in all installs? I’d be surprised if it’s doing it on a non-hardened cPanel installation without it being the WordPress installation itself.

    I eagerly await your results.

    Thanks again to all

    Plugin Author shanept

    (@shanept)

    I figured as much – no worries. I don’t believe server logs will be of much use in your case. I think WordPress is somehow aborting the ajax call pre ajax hooks. That’s all I can assume thus far, as it’s not disallowing PHP code in wp-content.

    I’d be interested in working with you to solve your issue, if that’s ok with you.

    In regards to automatic updates, WordPress can be configured to allow automatic updates of non-major releases. This is the setup of your site, not anything the plugin is doing. If you wish to disable this feature or exclude AceIDE from doing this, the following instructions should help:

    https://www.wpbeginner.com/plugins/how-to-enable-automatic-updates-for-wordpress-plugins/

    Regards,
    Shane Thompson

    Plugin Author shanept

    (@shanept)

    @retetecugust – I’ve noticed you’re still on 2.5.5 – have you rolled back?
    I have also noticed you are hosting your website with wordpress.com, and was wondering whether your issue was shared with @primathon above however it is not.

    If you are having issues with 2.6.1, they must be a different cause.

    Plugin Author shanept

    (@shanept)

    So what I can tell from the website @primathon is hosting, is that WP-Engine doesn’t like the plugin. Specifically, they don’t like serving PHP files out of wp content.

    Is WP-Engine hosting a common factor here with everyone else?

    Thanks for your patience

Viewing 15 replies - 31 through 45 (of 114 total)