• Resolved bractar

    (@bractar)


    Hello,
    everything is fine on my local machine but as soon as I upload to my server, I get the following error message:

    PHP Fatal error: Class ‘MY_Analytics’ not found in /vhosts/production/httpdocs/portal/analytics/index.php on line 22

    here’s the beginning of my external php page (based on https://cooltrainer.org/fixing-false-404-headers-on-external-pages-including-wp-blog-header-php/):

    require_once('../wp-config.php');
    $wp->init();  //set up the current user.
    $wp->parse_request(); //Parse request to find correct WordPress query.
    $wp->query_posts(); //Set up the Loop based on the query variables.
    $wp->register_globals();  //Set up the WordPress Globals.
    $wp->send_headers();  //Sets the X-Pingback header, 404 status (if 404), Content-type. If showing a feed, it will also send last-modified, etag, and 304 status if needed.
    require_once('../wp-load.php');

    Then line 22, I have
    $MYA = new MY_Analytics();

    It seems that my plugin is not loaded at this point.
    How can I solve the issue?

    Thanks

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Plugin issue in external php page’ is closed to new replies.