I tried to use this plugin on a single page, without hacking up my theme, by combining it with exec-php and incorporating the following code into the page:
echo "This is the Exec-PHP 'Hello World'";
include_once (WP_PLUGIN_DIR . '/external-markup/external_markup_functions.php');
em_showContent("start", "end", "scorecard_partner_demo.html", false);
The echo appears. The plugin is loaded. However all I get in the Apache error logs is:
[Tue Jan 25 17:12:19 2011] [error] [client 127.0.0.1] PHP Warning: include(scorecard_partner_demo.html): failed to open stream: No such file or directory in /home/shared/projects/reactionscorecards3/wordpress/wp-content/plugins/external-markup/external_markup_functions.php on line 36 [Tue Jan 25 17:12:19 2011] [error] [client 127.0.0.1] PHP Warning: include(): Failed opening 'scorecard_partner_demo.html' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/shared/projects/reactionscorecards3/wordpress/wp-content/plugins/external-markup/external_markup_functions.php on line 36
It doesn't appear to have downloaded the file at all. I have php5-curl installed, phpinfo() shows that it's enabled, and I can access that URL in my browser, but the plugin never downloaded the file and doesn't tell me why.
There is also some nasty black magic in the plugin, and duplicated code:
$start = "<!-- ".$retrive_start." -->"; $end = "<!-- ".$retrive_stop." -->"; $data_bit = strstr($markup, $start); $array = explode($end, $data_bit); $length = strlen($retrive_start) + 9; $data = substr($array,$length);
- Why are there no examples of actual use and configuration?
- Where does the magic number 9 come from, and why is this code repeated twice?
- Why do I have to define a variable to set the external URL?
- Why can't I set the timeout for CURL?
- Why do I have to invent my own filename for caching, including /em_cache?
- Why is /em_cache/ hard-coded?
- Why do we need to modify templates in the first place?
- fclose($fp) is missing.