Yii Framework Forum: Error With Wordpress Plugins - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Error With Wordpress Plugins Rate Topic: -----

#1 User is offline   dmweyer 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 09-February 13

Posted 19 February 2013 - 04:56 AM

Hi All,

Sorry if I have posted this in the incorrect place. I have a website (wordpress) and I had a develop create me a custom plugin to work with wordpress. The custom plugin is a online course booking form. All works fine, but if I try and install a new plugin, I receive the following error message (see below). This only seems to happen when I install a plugin which needs to access the entire site e.g. an XML sitemap generated or SEO plugin.

This one below is with an seo plugin
Warning: include(Yoast_Tracking.php) [function.include]: failed to open stream: No such file or directory in /home/scrumwrw/public_html/crm/yii/framework/YiiBase.php on line 396

Warning: include(Yoast_Tracking.php) [function.include]: failed to open stream: No such file or directory in /home/scrumwrw/public_html/crm/yii/framework/YiiBase.php on line 396

Warning: include() [function.include]: Failed opening 'Yoast_Tracking.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/scrumwrw/public_html/crm/yii/framework/YiiBase.php on line 396

This error is from a XML sitemap generator:


Warning: include(no80dj_qi3hixluxpblec6ksy4p6.php) [function.include]: failed to open stream: No such file or directory in /home/scrumwrw/public_html/crm/yii/framework/YiiBase.php on line 396

Warning: include(no80dj_qi3hixluxpblec6ksy4p6.php) [function.include]: failed to open stream: No such file or directory in /home/scrumwrw/public_html/crm/yii/framework/YiiBase.php on line 396

Warning: include() [function.include]: Failed opening 'no80dj_qi3hixluxpblec6ksy4p6.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/scrumwrw/public_html/crm/yii/framework/YiiBase.php on line 396

Warning: include(no80dj_qi3hixluxpblec6ksy4p6.php) [function.include]: failed to open stream: No such file or directory in /home/scrumwrw/public_html/crm/yii/framework/YiiBase.php on line 396

Warning: include(no80dj_qi3hixluxpblec6ksy4p6.php) [function.include]: failed to open stream: No such file or directory in /home/scrumwrw/public_html/crm/yii/framework/YiiBase.php on line 396

Warning: include() [function.include]: Failed opening 'no80dj_qi3hixluxpblec6ksy4p6.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/scrumwrw/public_html/crm/yii/framework/YiiBase.php on line 396

Warning: include(no80dj_qi3hixluxpblec6ksy4p6.php) [function.include]: failed to open stream: No such file or directory in /home/scrumwrw/public_html/crm/yii/framework/YiiBase.php on line 396

Warning: include(no80dj_qi3hixluxpblec6ksy4p6.php) [function.include]: failed to open stream: No such file or directory in /home/scrumwrw/public_html/crm/yii/framework/YiiBase.php on line 396

Warning: include() [function.include]: Failed opening 'no80dj_qi3hixluxpblec6ksy4p6.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/scrumwrw/public_html/crm/yii/framework/YiiBase.php on line 396

Warning: include(no80dj_qi3hixluxpblec6ksy4p6.php) [function.include]: failed to open stream: No such file or directory in /home/scrumwrw/public_html/crm/yii/framework/YiiBase.php on line 396

Warning: include(no80dj_qi3hixluxpblec6ksy4p6.php) [function.include]: failed to open stream: No such file or directory in /home/scrumwrw/public_html/crm/yii/framework/YiiBase.php on line 396

Warning: include() [function.include]: Failed opening 'no80dj_qi3hixluxpblec6ksy4p6.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/scrumwrw/public_html/crm/yii/framework/YiiBase.php on line 396
Skip to main content

Dashboard
Home
Updates
2

Posts
All Posts
Add New
Categories
Tags

Media
Library
Add New

Links
All Links
Add New
Link Categories

Pages
All Pages
Add New

Comments
5

Portfolio Items
Portfolio Items
Add New
Portfolio Categories

Sentence

Customer Reviews

Appearance
Themes
Widgets
Menus
Editor

Plugins
Installed Plugins
Add New
Editor

Users
All Users
Add New
Your Profile

Tools
Available Tools
Import
Export

Settings
General
Writing
Reading
Discussion
Media
Permalinks
MailChimp Setup
Customer Reviews
XML-Sitemap
Collapse menu
Skip to toolbar
ScrumSense.com
22 Theme Updates
5
New
Theme Options
Howdy, dillon
Log Out
PHP Error

include(no80dj_qi3hixluxpblec6ksy4p6.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory

/home/scrumwrw/public_html/crm/yii/framework/YiiBase.php(396)

384 * @return boolean whether the class has been loaded successfully
385 */
386 public static function autoload($className)
387 {
388 // use include so that the error PHP file may appear
389 if(isset(self::$_coreClasses[$className]))
390 include(YII_PATH.self::$_coreClasses[$className]);
391 else if(isset(self::$classMap[$className]))
392 include(self::$classMap[$className]);
393 else
394 {
395 if(strpos($className,'\\')===false)
396 include($className.'.php');
397 else // class name with namespace in PHP 5.3
398 {
399 $namespace=str_replace('\\','.',ltrim($className,'\\'));
400 if(($path=self::getPathOfAlias($namespace))!==false)
401 include($path.'.php');
402 else
403 return false;
404 }
405 return class_exists($className,false) || interface_exists($className,false);
406 }
407 return true;
408 }
Stack Trace
#0
+ /home/scrumwrw/public_html/crm/yii/framework/YiiBase.php(396): YiiBase::autoload()
#1
– /home/scrumwrw/public_html/wp-content/plugins/scrumsense.php(77): YiiBase::autoload("no80dj_qi3hixluxpblec6ksy4p6")
72 'avia_social_count',
73
74 //'',
75 );
76 if(!in_array($className, $wp_classes))
77 YiiBase::autoload($className);
78 }
79 }
80
81 function yiiapp_shortcode( $attr ) {
82 global $yii_app;
#2
unknown(0): YiiAuto::autoload("no80dj_qi3hixluxpblec6ksy4p6")
#3
unknown(0): spl_autoload_call("no80dj_qi3hixluxpblec6ksy4p6")
#4
– /home/scrumwrw/public_html/wp-includes/plugin.php(173): call_user_func_array(array("GoogleSitemapGeneratorLoader", "CallHtmlShowHelpList"), array(array(), WP_Screen))
168
169 do {
170 foreach( (array) current($wp_filter[$tag]) as $the_ )
171 if ( !is_null($the_['function']) ){
172 $args[1] = $value;
173 $value = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args']));
174 }
175
176 } while ( next($wp_filter[$tag]) !== false );
177
178 array_pop( $wp_current_filter );
#5
– /home/scrumwrw/public_html/wp-admin/includes/screen.php(766): apply_filters("contextual_help_list", array(), WP_Screen)
761 * @since 3.3.0
762 */
763 public function render_screen_meta() {
764
765 // Call old contextual_help_list filter.
766 self::$_old_compat_help = apply_filters( 'contextual_help_list', self::$_old_compat_help, $this );
767
768 $old_help = isset( self::$_old_compat_help[ $this->id ] ) ? self::$_old_compat_help[ $this->id ] : '';
769 $old_help = apply_filters( 'contextual_help', $old_help, $this->id, $this );
770
771 // Default help only if there is no old-style block of text and no new-style help tabs.
#6
+ /home/scrumwrw/public_html/wp-admin/admin-header.php(127): WP_Screen->render_screen_meta()
#7
+ /home/scrumwrw/public_html/wp-admin/plugins.php(362): require_once("/home/scrumwrw/public_html/wp-admin/admin-header.php")
2013-02-19 09:54:58 Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_fcgid/2.3.6 Yii Framework/1.1.7
0

#2 User is offline   SteveVB 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 10-September 12

Posted 19 February 2013 - 01:53 PM

Looks like you're basing your plugin on the document
http://www.yiiframew...with-wordpress/

He had built a bit of a class loader to handle the few classes Wordpress used back then. Wordpress uses a lot more now. I've updated his code to handle what seems to currently be there in Wordpress 3.5.1. My new index file looks like this:

<?php

/**
 * @package Yii Test
 */
/*
  Plugin Name: Yii Test
 */

function yiiapp_init() {
    global $yii_app;

    $config = dirname(__FILE__) . '/protected/config/main.php';
    $yii_app = Yii::createWebApplication($config);
    //$yii_app = Yii::createApplication('SiteController',$config);
    //Yii::setApplication($yii_app);
}

function yiiapp_admin_actions() {
    global $yii_app;
    add_menu_page("Yii", "Yii Transitions", 1, 'site/', array(&$yii_app, "run"));
    add_submenu_page('site/', 'Yii', 'About', 1, 'site/page/view/about', array(&$yii_app, "run"));
    add_submenu_page('site/', 'Yii', 'Contact', 1, 'site/contact', array(&$yii_app, "run"));
    //add_submenu_page(basename(__FILE__), "Yii", "Contact", 3, __FILE__, array(&$yii_app,"run"));
}

global $yii_app;
$yii = dirname(__FILE__) . '/../../../yii/framework/yii.php';
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG', true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 6);
require_once($yii);

if (!defined('WP_AUTOLOAD_CLASSES')) {
    define(
            'WP_AUTOLOAD_CLASSES', function_exists('spl_autoload_register')
    );
}

if (WP_AUTOLOAD_CLASSES) {

    function wp_autoload($class, $path = null) {
        $classes = array(
            'SimplePie' => ABSPATH . 'wp-includes/class-simplepie.php',
            'WP_User_Search' => ABSPATH . 'wp-admin/includes/user.php');

        // Being called by PHP's autoloader
        if (is_null($path)) {

            if (!class_exists($class, false)) {
                if (isset($classes[$class])) {
                    include_once( $classes[$class] );
                
                } else {
                    $pieces = explode("_", $class);
                    $pathToClass = ABSPATH . 'wp-includes';
                    foreach ($pieces as $piece) {
                        $pathToClass .= "/" . $piece;
                    }
                    $pathToClass .= ".php";
                    if (file_exists($pathToClass)) {
                        include_once($pathToClass);
                    }
                }
            }
            return;
        }

        // Being called by us
        // $classes[$class] = $path;
        // spl_autoload_unregister( 'wp_autoload' );
    }

    // Register it
    spl_autoload_register('wp_autoload');
} else {

    function wp_autoload($class, $path) {
        require_once( $path );
    }

}

class YiiAutoLoad extends YiiBase {
     

    public static function autoload($className) {
        $doNotLoadClases = array('idna_convert');
        
        if (!in_array($className, $doNotLoadClases) && !class_exists($className, false))
            parent::autoload($className);
    }

}

Yii::registerAutoloader(wp_autoload);

add_action('admin_init', 'yiiapp_init');
add_action('admin_menu', 'yiiapp_admin_actions');
//add_action('');
spl_autoload_unregister(array('YiiBase', 'autoload'));
spl_autoload_register(array('YiiAutoLoad', 'autoload'));
?>

1

#3 User is offline   dmweyer 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 09-February 13

Posted 08 March 2013 - 05:19 AM

Thanks Steve,

Can I just use your index page and replace it with mine?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users