• Resolved imdreamer

    (@imdreamer)


    when i tried to click : “add language” for certain plugin ,and then occurred :

    loco translate > plugins > click a plugin from list > add language > error

    Invalid admin route: “config”
    plugins/loco-translate/src/mvc/AdminRouter.php#299

    how can i solve this problem ?

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Tim W

    (@timwhitlock)

    “config” is a valid admin route, so I don’t know how this error is possible. Maybe there’s a conflict with another plugin.

    As I can’t debug your site, please try to do this yourself. The code where this failure occurs is here: https://github.com/loco/wp-loco/blob/2.3.0/src/mvc/AdminRouter.php#L297

    Could you please see what the values of $page and $url are at this point?

    Plugin Author Tim W

    (@timwhitlock)

    I’ve just pushed a potential fix for this. Can you try the dev version please?
    https://localise.biz/wordpress/plugin/developers

    I think the issue is a conflicting menu item from another plugin.

    Thread Starter imdreamer

    (@imdreamer)

    sorry, i am not familiar with debug , but i have installed “Debug this” plugin , but it show a list items to debug , which i need to choose ?

    Debug > “active plugins”
    or
    Debug > “php”

    i found there was no a way to debug : AdminRouter.php

    and it show this related result , i guess it’s not what you want

    [loco-translate/loco.php] => Array
    (
    [WC requires at least] =>
    [WC tested up to] =>
    [Name] => Loco Translate
    [PluginURI] => https://www.ads-software.com/plugins/loco-translate/
    [Version] => 2.3.0
    [Description] => Translate themes and plugins directly in WordPress
    [Author] => Tim Whitlock
    [AuthorURI] => https://localise.biz/wordpress/plugin
    [TextDomain] => loco-translate
    [DomainPath] => /languages/
    [Network] =>
    [Title] => Loco Translate
    [AuthorName] => Tim Whitlock
    )

    Plugin Author Tim W

    (@timwhitlock)

    No, this isn’t useful.

    Please just try the dev version.

    Thread Starter imdreamer

    (@imdreamer)

    this the code around line 297 from my ftp same file AdminRouter.php

    $page,5 and $url ?? i have no idea what did you mean,

    public static function generate( $route, array $args = array() ){
    $url = null;
    $page = null;
    $action = null;
    // empty action targets plugin root
    if( ! $route ){
    $route = ‘loco’;
    }
    // support direct usage of page hooks
    if( $url = menu_page_url( $route, false ) ){
    $page = $route;
    }
    // else split action into admin page (e.g. “loco-themes”) and sub-action (e.g. “view-theme”)
    else {
    $page = ‘loco’;
    $path = explode( ‘-‘, $route );
    if( $sub = array_shift($path) ){
    $page .= ‘-‘.$sub;
    if( $path ){
    $action = implode(‘-‘,$path);
    }
    }
    }
    // sanitize extended route in debug mode only. useful in tests
    if( loco_debugging() ){
    $tmp = array();
    $class = self::pageToClass( substr($page,5), $action, $tmp );
    if( ! $class ){
    throw new UnexpectedValueException( sprintf(‘Invalid admin route: %s’, json_encode($route) ) );
    }
    else {
    class_exists( $class, true ); // <- autoloader will throw if not class found
    }
    }
    // if url found, it should contain the page
    if( $url ){
    unset( $args[‘page’] );
    }
    // else start with base URL
    else {
    $url = admin_url(‘admin.php’);
    $args[‘page’] = $page;
    }

    Thread Starter imdreamer

    (@imdreamer)

    and this can’t be find via debug tool .. elm-error-logs plugin : this is its php-errors.log

    [12-Oct-2019 11:36:28 UTC] PHP Fatal error: Call to a member function get() on null in /home/imoxieco/public_html/wp-includes/cache.php on line 123
    [12-Oct-2019 11:36:35 UTC] PHP Notice: ob_end_clean(): failed to delete buffer. No buffer to delete in /home/imoxieco/public_html/wp-content/plugins/loco-translate/src/mvc/View.php on line 69
    [12-Oct-2019 11:41:15 UTC] PHP Notice: ob_end_clean(): failed to delete buffer. No buffer to delete in /home/imoxieco/public_html/wp-content/plugins/loco-translate/src/mvc/View.php on line 69
    [12-Oct-2019 11:42:27 UTC] PHP Fatal error: Call to a member function get() on null in /home/imoxieco/public_html/wp-includes/cache.php on line 123
    [12-Oct-2019 11:42:34 UTC] PHP Notice: ob_end_clean(): failed to delete buffer. No buffer to delete in /home/imoxieco/public_html/wp-content/plugins/loco-translate/src/mvc/View.php on line 69
    [12-Oct-2019 11:42:50 UTC] PHP Fatal error: Call to a member function get() on null in /home/imoxieco/public_html/wp-includes/cache.php on line 123
    [12-Oct-2019 11:43:20 UTC] PHP Fatal error: Call to a member function get() on null in /home/imoxieco/public_html/wp-includes/cache.php on line 123
    [12-Oct-2019 11:44:50 UTC] PHP Fatal error: Call to a member function get() on null in /home/imoxieco/public_html/wp-includes/cache.php on line 123
    [12-Oct-2019 11:45:52 UTC] PHP Fatal error: Call to a member function get() on null in /home/imoxieco/public_html/wp-includes/cache.php on line 123
    [12-Oct-2019 11:52:25 UTC] PHP Notice: Trying to get property of non-object in /home/imoxieco/public_html/wp-includes/taxonomy.php on line 4206
    [12-Oct-2019 11:52:40 UTC] PHP Notice: Trying to get property of non-object in /home/imoxieco/public_html/wp-includes/taxonomy.php on line 4206
    [12-Oct-2019 12:01:56 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:02:09 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:02:24 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:02:40 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:02:49 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:03:07 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:03:24 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:03:44 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:04:03 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:04:18 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:04:35 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:04:48 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:05:00 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:05:18 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:05:37 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:05:54 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:06:12 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:06:31 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:06:46 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:07:00 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321
    [12-Oct-2019 12:09:20 UTC] PHP Warning: illegal character ‘? in /home/imoxieco/public_html/wp-content/plugins/woocommerce/includes/libraries/class-wc-eval-math.php on line 321

    your view.php around line 69
    /**
    * @internal
    * Clean up if something ubruptly stopped rendering before graceful end
    */
    public function __destruct(){
    if( $this->block ){
    ob_end_clean();
    }
    }

    Thread Starter imdreamer

    (@imdreamer)

    after i uploaded you update git version manually , now it can work in admin, but after i edit chinese language for a certain plugin, it can’t really see result from frontend table , for example “submit” button still show english, not chinese , i have removed all cache

    https://moxiecorp.com/xcharging5in1-2019-10-event/

    Thread Starter imdreamer

    (@imdreamer)

    although i can find them on ftp :
    /public_html/wp-content/languages/loco/plugins

    custom-registration-form-builder-with-submission-manager-zh_TW.po
    custom-registration-form-builder-with-submission-manager-zh_TW.mo
    custom-registration-form-builder-with-submission-manager-zh_TW-backup-201910121320390.po~

    but they can’t show chinese at all, weird

    Plugin Author Tim W

    (@timwhitlock)

    after i uploaded you update git version manually , now it can work in admin

    So the fix works. Thanks for updating me. I’m marking this as resolved as your original problem is solved by this.

    Regarding your subsequent problems. Please read the available for support for translations not showing: https://localise.biz/wordpress/plugin/support#l10n

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘how to solve error : Invalid admin route: “config”’ is closed to new replies.