Title: [Plugin: Shortcode Exec PHP] How to use external class
Last modified: August 20, 2016

---

# [Plugin: Shortcode Exec PHP] How to use external class

 *  Resolved [mav666](https://wordpress.org/support/users/mav666/)
 * (@mav666)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-shortcode-exec-php-how-to-use-external-class/)
 * Hello!
 * I try to implement external class [SEOstats](https://github.com/eyecatchup/SEOstats).
 * In shortcode [test] I have example usage of this class:
 *     ```
       include '../src/class.seostats.php';
       try
       {
         $url = new SEOstats("http://www.google.com/");
         print $url->Google_Page_Rank();
       }
       catch (SEOstatsException $e)
       {
         die($e->getMessage());
       }
       ```
   
 * When I save shortcode and test it – everything is ok:
    [test]=”9″ (Google PR).
 * But when I insert shortcode into post, I have a lot on errors:
 * Warning: include(../src/class.seostats.php) [function.include]: failed to open
   stream: No such file or directory in /home/wordpress/domains/mydomain/public_html/
   wp-content/plugins/shortcode-exec-php/shortcode-exec-php-class.php(967) : eval()’
   d code on line 1
 * Warning: include(../src/class.seostats.php) [function.include]: failed to open
   stream: No such file or directory in /home/wordpress/domains/mydomain/public_html/
   wp-content/plugins/shortcode-exec-php/shortcode-exec-php-class.php(967) : eval()’
   d code on line 1
 * Warning: include() [function.include]: Failed opening ‘../src/class.seostats.
   php’ for inclusion (include_path=’.:/usr/local/php5/lib/php’) in /home/wordpress/
   domains/mydomain/public_html/wp-content/plugins/shortcode-exec-php/shortcode-
   exec-php-class.php(967) : eval()’d code on line 1
 * Fatal error: Class ‘SEOstats’ not found in /home/wordpress/domains/mydomain/public_html/
   wp-content/plugins/shortcode-exec-php/shortcode-exec-php-class.php(967) : eval()’
   d code on line 4
 * What I do wrong?
    Is any way to include this class?
 * [http://wordpress.org/extend/plugins/shortcode-exec-php/](http://wordpress.org/extend/plugins/shortcode-exec-php/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Contributor [M66B](https://wordpress.org/support/users/m66b/)
 * (@m66b)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-shortcode-exec-php-how-to-use-external-class/#post-2915117)
 * You will need an absolute path for the include, something like this:
 * `include WP_CONTENT_DIR . '/.../class.seostats.php'`
 * More info [here](http://codex.wordpress.org/Determining_Plugin_and_Content_Directories).
 *  Thread Starter [mav666](https://wordpress.org/support/users/mav666/)
 * (@mav666)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-shortcode-exec-php-how-to-use-external-class/#post-2915170)
 * Thanks! It works.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Shortcode Exec PHP] How to use external class’ is closed to 
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/shortcode-exec-php.svg)
 * [Shortcode Exec PHP](https://wordpress.org/plugins/shortcode-exec-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcode-exec-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcode-exec-php/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcode-exec-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcode-exec-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcode-exec-php/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [mav666](https://wordpress.org/support/users/mav666/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-shortcode-exec-php-how-to-use-external-class/#post-2915170)
 * Status: resolved