• RezaY

    (@mohammad983)


    I have a scheduling post plugin for WordPress. It works pretty well. but today I see an error on Query Monitoring plugin.

    ScheduleMenu->load_pre_schedule_queue()
    Error: Method ScheduleMenu::load_pre_schedule_queue() does not exist

    I do not know why WordPress could not find the method! but everything works fine!

    admin-menu.php:

    require_once SCHEDULE_PLUGIN_DIR . 'libs/admin-page-framework/admin-page-framework.php';
    require_once SCHEDULE_PLUGIN_DIR . 'admin/settings.php';
    require_once SCHEDULE_PLUGIN_DIR . 'admin/queue.php';
    class ScheduleMenu extends LazyCoala_AdminPageFramework
    {
        public function setUp() {
            $this->setRootMenuPage('Post Timing');
            $this->addSubMenuItems(
                array(
                    'title'     => 'Setup Time',
                    'page_slug' => 'schedule_settings',
                ),
                array(
                    'title'     => 'Queue',
                    'page_slug' => 'schedule_queue',
                )
            );
        }
        
    }
    new ScheduleMenu();

    index.php:

    define("SCHEDULE_PLUGIN_DIR", trailingslashit(dirname(__FILE__)));
    define("SCHEDULE_PLUGIN_URL", trailingslashit(plugin_dir_url(__FILE__)));
    require_once SCHEDULE_PLUGIN_DIR . "functions.php";
    require_once SCHEDULE_PLUGIN_DIR . "admin/admin-menu.php";
Viewing 1 replies (of 1 total)
  • Plugin Author miunosoft

    (@miunosoft)

    Hi,

    It is a sort of false positive.

    The framework uses the overloading magic method, __call() for undeclared callback methods.

    To get the grasp of the mechanism, try the test plugin. You can download it via the Download button at the top right corner of the page and use it as a plugin.

    If you are uncomfortable seeing such warnings by Query Monitor, ask the developer of Query Monitor whether they can handle such cases.

Viewing 1 replies (of 1 total)
  • The topic ‘Error: Method does not exist’ is closed to new replies.