Support » Plugin: AceIDE » Scrambled Code in 2.6.0 and 2.6.1

  • Hi guys,

    We’ve reverted back to version 2.5.5 as after updating to 2.6.1 or 2.6.0 PHP code is scrambled, chunks removed, etc.

    Have you seen this happen elsewhere?

    2.5.5 seems to work fine.

    Thanks,

    Oliver

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author shanept

    (@shanept)

    Hi Oliver,

    Scrambled code? That’s a new one… Files missing could simply be an issue with the WordPress plugin update, if you mean files are missing? Did you try the update more than one?

    Thanks
    Shane Thompson

    Thread Starter Oliver Campion

    (@domainsupport)

    Hi Shane,

    The actual code is scrambled in the editor! I’d send you screen grabs of how 2.5.5 looks compared to the later versions. This is how your own AceIDE.php is shown in the editor in version 2.6.1 …

    extend($fileops);
    // As long as the GitOps module is under development, let's only make it
    // available to WordPress users with WP_DEBUG enabled.
    if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
    $gitops = new AceIDE\Editor\Modules\GitOps;
    $ide->extend($gitops);
    }
    

    Weird, eh?

    Kind regards,

    Oliver

    Plugin Author shanept

    (@shanept)

    So all I can see is that it’s missing whitespace – is that correct?

    Thread Starter Oliver Campion

    (@domainsupport)

    Not really! Here’s the corresponding code in version 2.5.5 …

    
    <?php
    /**
     * Plugin Name: AceIDE
     * Plugin URI: https://github.com/AceIDE/AceIDE
     * Description: WordPress code editor with auto completion of both WordPress and PHP functions with reference, syntax highlighting, line numbers, tabbed editing, automatic backup.
     * Version: 2.5.5
     * Author: AceIDE
     **/
    
    // Exit if accessed directly
    if ( !defined( 'ABSPATH' ) ) exit;
    
    if ( !file_exists( __DIR__ . '/vendor/' ) ) {
    	trigger_error( 'Composer "vendor/" directory missing.', E_USER_ERROR );
    }
    
    require_once __DIR__ . '/vendor/autoload.php';
    
    $fileops = new AceIDE\Editor\Modules\FileOps;
    $ide = new AceIDE\Editor\IDE;
    
    $ide->extend($fileops);
    
    // As long as the GitOps module is under development, let's only make it
    // available to WordPress users with WP_DEBUG enabled.
    if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
    	$gitops = new AceIDE\Editor\Modules\GitOps;
    	$ide->extend($gitops);
    }
    

    Looks like there’s quite a bit missing!

    Oliver

    Plugin Author shanept

    (@shanept)

    That’s interesting…
    Are you able to look at the network log in your browser and tell me whether the server is sending the full file in 2.6?

    Thread Starter Oliver Campion

    (@domainsupport)

    Safari Network Inspector shows that Ajax.php is returning …

    
    extend($fileops);
    // As long as the GitOps module is under development, let's only make it
    // available to WordPress users with WP_DEBUG enabled.
    if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
    $gitops = new AceIDE\Editor\Modules\GitOps;
    $ide->extend($gitops);
    }
    
    Thread Starter Oliver Campion

    (@domainsupport)

    In version 2.5.5, Safari Network Inspector shows that admin-ajax.php is returning …

    
    ===FILE_CONTENTS_START===<?php
    /**
     * Plugin Name: AceIDE
     * Plugin URI: https://github.com/AceIDE/AceIDE
     * Description: WordPress code editor with auto completion of both WordPress and PHP functions with reference, syntax highlighting, line numbers, tabbed editing, automatic backup.
     * Version: 2.5.5
     * Author: AceIDE
     **/
    
    // Exit if accessed directly
    if ( !defined( 'ABSPATH' ) ) exit;
    
    if ( !file_exists( __DIR__ . '/vendor/' ) ) {
    	trigger_error( 'Composer "vendor/" directory missing.', E_USER_ERROR );
    }
    
    require_once __DIR__ . '/vendor/autoload.php';
    
    $fileops = new AceIDE\Editor\Modules\FileOps;
    $ide = new AceIDE\Editor\IDE;
    
    $ide->extend($fileops);
    
    // As long as the GitOps module is under development, let's only make it
    // available to WordPress users with WP_DEBUG enabled.
    if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
    	$gitops = new AceIDE\Editor\Modules\GitOps;
    	$ide->extend($gitops);
    }
    
    Thread Starter Oliver Campion

    (@domainsupport)

    So you’ve moved from using admin-ajax.php in version 2.5.5?

    Plugin Author shanept

    (@shanept)

    Wow, that’s very weird… I’m thinking it’s related to output buffering.

    Do you have any other way of modifying the code in 2.6 Ajax.php?

    I’d like to see what happens if you disable output buffering – that is the whole initial if statement.

    See https://github.com/AceIDE/editor/blob/master/src/Ajax.php

    As you can see, we are using admin-ajax.php, however starting output buffering first.

    Thread Starter Oliver Campion

    (@domainsupport)

    I commented this out …

    
    	// if (!ob_get_level()) {
    	// 	ob_start();
    	// }
    

    … but still the same scrambled code?

    Plugin Author shanept

    (@shanept)

    Ok, that’s bizarre for sure… I’ve got no idea why it might be doing that, beyond a server config issue, at this point. This is the first occurrence of this that I’m aware of.

    Would you mind me having a look at your website myself to track down the issue?

    Thread Starter Oliver Campion

    (@domainsupport)

    Sure, although it’s a development server so can’t show the world its address. Let me know how I can PM details.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Scrambled Code in 2.6.0 and 2.6.1’ is closed to new replies.