• Resolved Ghostpengy

    (@ghostpengy)


    Hello,

    I am loading WordPress in an external PHP file (will be run via CLI). WordPress loading:

    require_once("../../../wp-load.php");

    When the external file is run it returns the following error:

    PHP Fatal error:  Uncaught Error: 
    Class 'Cyr_To_Lat\Main' not found in 
    /pathtowp/wp-content/plugins/cyr2lat/cyr-to-lat.php:88

    When the plugin is deactivated WordPress loads fine without any errors. Any possible solutions? If need any clarification, please ask!

    Version 5.0.0

    • This topic was modified 3 years, 8 months ago by Ghostpengy.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author kaggdesign

    (@kaggdesign)

    Hello,

    You are doing something wrong. cyr2lat works well with WP-CLI and even has its own CLI command regenerate. Right now I have tested the external load of WordPress from a PHP file – cyr2lat works.

    What I can assume, you have cloned cyr2lat from the GitHub repository and did not run make (composer). In this case, any class cannot be found. Please read Readme.md.

    If it not so, please let me know how to reproduce the problem on a clean WordPress install.

    Thread Starter Ghostpengy

    (@ghostpengy)

    Ok, I was able to resolve it. The plugin itself was loaded from the WordPress directory, not from git. However, I did clone WPML REST API in a different plugin, where autoload.php was throwing the error. Renaming the autoload seems to have resolved the issue.

    Plugin Author kaggdesign

    (@kaggdesign)

    Thanks for the clarifications!

    У меня аналогичная проблема и оно появилась через стандартное обновление плагина до версии 5.0 через админку WP

    Plugin Author kaggdesign

    (@kaggdesign)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Class ‘Cyr_To_Lat\Main’ not found when loading in external php file’ is closed to new replies.