Skip to content

Commit

Permalink
Remove any dependency to our RSS feed (very stupid choice to include …
Browse files Browse the repository at this point in the history
…this - lesson learned)

Add missing class on our single announcement banner images
Bump versions to 1.2.7.1 (temporary quick fix patch)
  • Loading branch information
Evan Herman committed Jun 3, 2016
1 parent 8ea99eb commit 02b0861
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 80 deletions.
2 changes: 1 addition & 1 deletion constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Define the current version of Timeline Express
*/
if ( ! defined( 'TIMELINE_EXPRESS_VERSION_CURRENT' ) ) {
define( 'TIMELINE_EXPRESS_VERSION_CURRENT', '1.2.7' );
define( 'TIMELINE_EXPRESS_VERSION_CURRENT', '1.2.7.1' );
}

/**
Expand Down
74 changes: 0 additions & 74 deletions lib/admin/metaboxes/metaboxes.announcements.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,80 +103,6 @@
'type' => 'te_help_docs_metabox',
) );


/**
* Check for our RSS feed transient
* - if not found - execute the RSS Feed
*/
if ( false === ( $te_ad_rss_feed = get_transient( 'timeline_express_ad_rss_feed' ) ) ) {
/* Get RSS Feed(s) */
require_once( ABSPATH . WPINC . '/class-feed.php' );
/* Create the SimplePie object */
$feed = new SimplePie();
/* Setup the URL */
$feed_url = esc_url( 'https://www.wp-timelineexpress.com/?feed=ads' );
/* Pass the URL */
$feed->set_feed_url( $feed_url );
/* Retreive an advertisments */
$feed->set_item_limit( 1 );
/* Tell SimplePie to cache the feed using WordPress' cache class */
$feed->set_cache_class( 'WP_Feed_Cache' );
/* Tell SimplePie to use the WordPress class for retrieving feed files */
$feed->set_file_class( 'WP_SimplePie_File' );
$feed->enable_cache( true );
/* Tell SimplePie how long to cache the feed data in the WordPress database */
$feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', 43200, $feed_url ) );
/* Run any other functions or filters that WordPress normally runs on feeds */
do_action_ref_array( 'wp_feed_options', array( $feed, $feed_url ) );
/* Initiate the SimplePie instance */
$feed->init();
/* Tell SimplePie to send the feed MIME headers */
$feed->handle_content_type();
if ( $feed->error() ) {
return $feed = new WP_Error( 'simplepie-error', $feed->error() );
}
$te_ad_rss_feed = $feed->get_items();
// setup the transients
if ( 0 < count( $te_ad_rss_feed ) ) {
$ad_title = $te_ad_rss_feed[0]->get_title();
$ad_image = $te_ad_rss_feed[0]->get_item_tags( '', 'customImage' );
$ad_content = $te_ad_rss_feed[0]->get_item_tags( '', 'customContent' );
$ad_link = $te_ad_rss_feed[0]->get_item_tags( '', 'productLink' );

// store the data for later
set_transient( 'timeline_express_ad_title', $ad_title );
set_transient( 'timeline_express_ad_image', $ad_image[0]['child'][ null ]['img'][0]['attribs'][ null ]['src'] );
set_transient( 'timeline_express_ad_content', $ad_content[0]['data'] );
set_transient( 'timeline_express_ad_url', $ad_link[0]['data'] );
// cache used for comparison
set_transient( 'timeline_express_ad_rss_feed', $te_ad_rss_feed, 2 * HOUR_IN_SECONDS );
}
}

/**
* Render the Advertisment metabox when an RSS feed is Found
* @since 1.0
*/
if ( $te_ad_rss_feed ) {
// Create our advertisment metaboxes
$advert_metabox = new_cmb2_box( array(
'id' => 'timeline_express_ads',
'title' => get_transient( 'timeline_express_ad_title' ),
'object_types' => array( 'te_announcements' ),
'context' => 'side',
'priority' => 'low',
'show_names' => true,
) );

// Advertisment Metabox Field
$advert_metabox->add_field( array(
'name' => __( '', 'timeline-express' ),
'desc' => __( '', 'timeline-express' ),
'id' => $prefix . 'advertisments',
'type' => 'te_advert_metabox',
) );
}

// Filter here is to allow extra fields to be added
// loop to add fields to our array
$custom_fields = apply_filters( 'timeline_express_custom_fields', $custom_field );
Expand Down
5 changes: 3 additions & 2 deletions lib/classes/class.timeline-express-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function timeline_express_admin_menus() {
'timeline-express-settings',
array( $this, 'timeline_express_options_page' )
);
/* Addon Page */
/* Addon Page
add_submenu_page(
'edit.php?post_type=te_announcements',
__( 'Timeline Express Add-ons', 'timeline-express' ),
Expand All @@ -100,6 +100,7 @@ public function timeline_express_admin_menus() {
'timeline-express-addons',
array( $this, 'timeline_express_addons_page' )
);
*/
/* Welcome Page */
add_submenu_page(
'edit.php?post_type=te_announcements',
Expand Down Expand Up @@ -236,7 +237,7 @@ public function timeline_express_action_links( $links, $file ) {
/* Remove the edit button */
unset( $links['edit'] );
$links[] = '<a href="' . admin_url( 'edit.php?post_type=te_announcements&page=timeline-express-settings' ) . '">' . esc_attr__( 'Settings', 'timeline-express' ) . '</a>';
$links[] = '<a href="' . admin_url( 'edit.php?post_type=te_announcements&page=timeline-express-addons' ) . '">' . esc_attr__( 'Add-ons', 'timeline-express' ) . '</a>';
// $links[] = '<a href="' . admin_url( 'edit.php?post_type=te_announcements&page=timeline-express-addons' ) . '">' . esc_attr__( 'Add-ons', 'timeline-express' ) . '</a>';
$links[] = '<a href="https://www.wp-timelineexpress.com/documentation/" target="_blank">' . esc_attr__( 'Documentation', 'timeline-express' ) . '</a>';
return $links;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ function timeline_express_get_announcement_image( $post_id, $image_size = 'timel
if ( is_single() ) {
$img_src = wp_get_attachment_image_url( get_post_meta( $post_id, 'announcement_image_id', true ), $image_size );
$img_srcset = wp_get_attachment_image_srcset( get_post_meta( $post_id, 'announcement_image_id', true ), $image_size );
?><img src="<?php echo esc_url( $img_src ); ?>" srcset="<?php echo esc_attr( $img_srcset ); ?>" sizes="(max-width: 100%) 75vw, 680px" alt="<?php esc_attr( get_the_title() ); ?>"><?php
?><img class="announcement-banner-image" src="<?php echo esc_url( $img_src ); ?>" srcset="<?php echo esc_attr( $img_srcset ); ?>" sizes="(max-width: 100%) 75vw, 680px" alt="<?php esc_attr( get_the_title() ); ?>"><?php
return;
}
/* Escaped on output in the timeline/single page */
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: codeparrots, eherman24
Tags: vertical, timeline, animated, css3, animations, evan, herman, evan herman, easy, time, line, font awesome, font, awesome, announcements, notifications, simple, events, calendar, scroll, triggered, scrolling, animated, fade, in, fade in
Requires at least: 4.0
Tested up to: 4.5.2
Stable tag: 1.2.7
Stable tag: 1.2.7.1
License: GPLv2 or later

Timeline Express allows you to create a beautiful vertical animated and responsive timeline of posts, without writing a single line of code. Sweet!
Expand Down Expand Up @@ -357,6 +357,10 @@ The above example will load font awesome version 4.4.0 instead of the current st

== Changelog ==

= 1.2.7.1 - June 3rd, 2016 =
- Quick patch to completely remove any RSS feed dependency (which was not well thought out to begin with).
- Added missing class to the announcement image on single templates.

= 1.2.7 - May 24th, 2016 =
* Bumped version numbers.
* Fixed uninstall file throwing errors.
Expand Down
2 changes: 1 addition & 1 deletion timeline-express.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin Name: Timeline Express
Plugin URI: https://www.wp-timelineexpress.com
Description: Create a beautiful vertical, CSS3 animated and responsive timeline in minutes flat without writing code.
Version: 1.2.7
Version: 1.2.7.1
Author: Code Parrots
Text Domain: timeline-express
Author URI: http://www.codeparrots.com
Expand Down

0 comments on commit 02b0861

Please sign in to comment.