• Resolved Gahapati

    (@gahapati)


    Fatal error: Call to undefined function WCFE\Installer\get_main_network_id() in /wp-content/plugins/wp-config-file-editor/Installer/WordpressOptions.class.php on line 37

    Hi Ahmed!
    The above error occurred while trying to activate WP Config File Editor version 1.5.2. If I am not mistaken, the undefined function get_main_network_id() has only been added to WP in version 4.3. – Currently, I am still running WP 4.1.8.

    I was able to solve this, apparently, by creating an MU-plugin which provides the missing function to WP 4.1.8.

    Even though your plugin looks very promising, I have nevertheless uninstalled it for now, when I noticed that it does not (yet) correctly/fully take into account the current state of one’s config.php file.
    I feel this is something that really needs to be addressed, otherwise there simply is too great a potential for much harm inadvertently being done.

    https://ww.wp.xz.cn/plugins/wp-config-file-editor/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Code Machine

    (@xpointer)

    Hello Gahapati,

    Yes, you’re correct, I will take care of this.

    Yeah, I understand what you did

    What do you mean by ” it does not (yet) correctly/fully take into account the current state of one’s config.php file.”

    Are you talking about losing custom constants (those not defined in the form) like those defined for other Plugins?

    Thanks,
    AHMeD

    Thread Starter Gahapati

    (@gahapati)

    Hello Ahmed!

    Are you talking about losing custom constants (those not defined in the form) like those defined for other Plugins?

    Yes, that is what I was referring to.

    Your plugin seems like a great idea for newly set up instances of WordPress without any manual changes having been made to the config file as yet.

    I noticed a few things specifically:

    1. my DB collation setting

    define('DB_COLLATE', 'utf8_unicode_ci');

    is not being picked up by WP Config File Editor, resulting in an empty string written to the config file.

    2. although DOMAIN_CURRENT_SITE is commented out (because of WP Multi Network), WP Config File Editor insists on putting it back in.

    3. although I have commented out define('DISABLE_WP_CRON',true);, WP Config File Editor wants to uncomment it.

    Also, in my config.php I have things like, for example

    define( 'WP_DEBUG', false ); // true or false
    if ( WP_DEBUG ) {
        define( 'WP_DEBUG_LOG', true );
        define( 'WP_DEBUG_DISPLAY', false );
        @ini_set( 'display_errors', 0 );
    }

    which, as it stands, is changed to define( 'WP_DEBUG', true );.

    Would it perhaps be feasible to have WP Config File Editor enclose the code it generates within markers, just like WordPress does in the .htaccess file?

    You might have a setting for new/untouched vs. customized/tweaked installations, so that new/untouched installations are regarded safe for WP Config File Editor to handle generated code as it does right now.

    When an installation has already been played with, you could have WP Config File Editor put the generated code just before the closing /* That's all, stop editing! Happy blogging. */ line, leaving the original content untouched.
    That way any configuration done from within WP Config File Editor would simply redefine the one(s) already present in config.php, which I assume would greatly reduce the risk of messing things up too badly.

    The admin could then manually delete any redundant settings, leaving in the ones WP Config File Editor is not set to handle yet, or which it shouldn’t override.

    Just my 2 cents, anyway.

    Plugin Author Code Machine

    (@xpointer)

    Thanks for the valuable notes you provided.

    i’m making a list of the new features I will include on the next release and your notes creates my list however few things need much consideration as its outside of plugin scope.

    This Plugin is not reading the exists config file directly, it picks up the defined values through PHP constants, this is intentionally done as to make the plugin more reliable, this is because parsing the file is complex more than reading the values through defined PHP constants.

    The Plugin then generates a completely new file based on, only, the submitted values, no deals with the exists file.

    So doing this by the regular way is completely another plugin, I will check to see how I can do both with the exists method. I also have no problem to completely rewrite this Plugin however I really want to feel that its important to community, I created this plugin as to check if its being desired by community.

    For now I’m thinking to allow raw editing without any interaction from wcfe plugin. Just a cool editor with emergency backup and restore features.

    I will make you posted.

    Regards,
    AHMeD

    SooBahkDo

    (@soobahkdo)

    Hello,

    I really like the idea of this plugin!

    I concur with Gahapati about some of those points.

    We have multiple multisite networks with highly customized w-config files and it would be important that your plugin provide a user setting option for

    A) create new wp-config or
    B) modify existing wp-config file

    I understand the challenges you discuss, but your plugin will be a very valuable tool for the community when it can interact with existing wp-config files.

    I shall need to postpone use until that is the case, but look forward to following your continued development of this excellent tool. 🙂

    Thanks for considering these inputs.

    Plugin Author Code Machine

    (@xpointer)

    Hello,

    Thanks for the advices

    Yeah, there is some challenge but I already get around by providing MASK-SAVE feature that easy to bne implemented.

    I’m already working on some features, including:

    1. Mask save: Saving Only the generated fields, leaving any custom code untouched

    2. Custom Fields: Allow site admin to define w-config custom fields so that site admin edit those fields using WCFE form instead of writing them manually every time.

    3. Send backup link to admin mail, as some users still ignoring backup warning message and get their site down as the backup link cannot be reached

    Just need sometime to get those done but I already did good progress.

    I will make you updated

    Thanks again for your notes.

    I appreciate your review

    Thanks

    AHMeD

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

The topic ‘Fatal Error on Activation’ is closed to new replies.