PluginProbe
CSS & JavaScript Toolbox / 8.3
CSS & JavaScript Toolbox v8.3
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
← All changes | framework/wordpress/feed.php +10 -7 8.28.3 View file →
@@ -42,23 +42,26 @@
42 42 * @param mixed $site
43 43 * @param mixed $path
44 44 * @return CJT_Framework_Wordpress_Feed
45 45 */
46 - public function __construct($site, $path, $fields) {
47 - # Initialize.
46 + public function __construct($site, $path, $fields)
47 + {
48 +
48 49 $this->site =& $site;
49 50 $this->path =& $path;
50 51 $this->fields = $fields;
52 +
51 53 # Request server => get raw XML feed
52 - $feed = wp_remote_get("http://{$this->site}/{$this->path}");
54 + $feed = wp_remote_get( "http://{$this->site}/{$this->path}" );
55 +
53 56 # Getting XML content
54 - $xmlContent = ((gettype($feed) !== 'WP_Error') && ($feed['response']['code'] == 200)) ?
55 - wp_remote_retrieve_body($feed) :
57 + $xmlContent = ( is_array( $feed ) && ( $feed[ 'response' ][ 'code' ] == 200 ) ) ?
58 + wp_remote_retrieve_body( $feed ) :
56 59 '<cjterrorrequest>
57 60 <channel cjt_error="true">
58 61 <item>
59 - <title>ERROR</title>
60 - <description>ERROR</description>
62 + <title>ERROR !!!</title>
63 + <description>ERROR Fetching data from CJT Server</description>
61 64 <link>http://css-javascript-toolbox.com/</link>
62 65 </item>
63 66 </channel>
64 67 </cjterrorrequest>';