96 changes: 61 additions & 35 deletions assets/js/build/dashboard.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions assets/js/build/dashboard.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions composer.json
Expand Up @@ -52,6 +52,7 @@
"require-dev": {
"wp-coding-standards/wpcs": "2.3.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"phpunit/phpunit": "5.*"
"phpunit/phpunit": "5.*",
"yoast/phpunit-polyfills": "^1.0"
}
}
}
65 changes: 63 additions & 2 deletions composer.lock
50 changes: 33 additions & 17 deletions includes/admin/class-rop-admin.php
Expand Up @@ -1134,13 +1134,25 @@ public function rop_cron_job() {
$revive_network_settings = Revive_Network_Rop_Post_Helper::revive_network_get_plugin_settings();
$delete_post_after_share = $revive_network_settings['delete_rss_item_after_share'];

// adjust post data to suit Revive Network
// Adjust post data to suit Revive Network
$post_data = Revive_Network_Rop_Post_Helper::revive_network_prepare_revive_network_share( $post_data );
}
}

$response = false;
$logger->info( 'Posting', array( 'extra' => $post_data ) );
$response = $service->share( $post_data, $account_data );

/*
* Extra check to make sure the post isn't already in the buffer for the given account.
* If it is then don't share it again until the buffer is cleared.
*/
$duplicate = $posts_selector_model->buffer_has_post_id( $account, $post );

if ( $duplicate === false ) {
$response = $service->share( $post_data, $account_data );
} else {
$logger->info( Rop_I18n::get_labels( 'sharing.post_already_shared' ), array( 'extra' => $post_data ) );
}

if ( $revive_network_active ) {

Expand All @@ -1154,12 +1166,12 @@ public function rop_cron_job() {
}
}

$posts_selector_model->update_buffer( $account, $post_data['post_id'] );

if ( $response === true ) {
update_option( 'rop_last_post_shared', $post_shared );
do_action( 'rop_after_share', $post_data );
}

$posts_selector_model->update_buffer( $account, $post_data['post_id'] );

}
} catch ( Exception $exception ) {
$error_message = sprintf( Rop_I18n::get_labels( 'accounts.service_error' ), $account_data['service'] );
Expand Down Expand Up @@ -1657,38 +1669,40 @@ public function rop_remove_remote_cron_notice() {
if ( version_compare( $installed_at_version, '9.0.3', '>' ) ) {
return;
}

$user_id = get_current_user_id();

if ( get_user_meta( $user_id, 'rop-remove-remote-cron-notice-dismissed' ) ) {
return;
}

$using_remote_cron = (bool) get_option('rop_use_remote_cron');
$using_remote_cron = (bool) get_option( 'rop_use_remote_cron' );

if( $using_remote_cron ){
if ( $using_remote_cron ) {
delete_option( 'rop_use_remote_cron' );
}

$dismiss_link = add_query_arg( array(
'rop-remove-remote-cron-notice-dismissed' => '1',
));
$dismiss_link = add_query_arg(
array(
'rop-remove-remote-cron-notice-dismissed' => '1',
)
);

$rop = __('Revive Old Posts: ', 'tweet-old-post');
$admin_url = admin_url('admin.php?page=TweetOldPost');
$notice_text = sprintf( __('We\'ve removed the Remote Cron service feature of Revive Old Posts. If you used this option in the past, then please %1$shead to the Revive Old Posts dashboard%2$s to start sharing using the default WordPress cron. If post sharing is not working for you, then please see %3$shere for solutions.%2$s', 'tweet-old-post'), "<a href='$admin_url'>", "</a>", "<a href='https://docs.revive.social/article/686-fix-revive-old-post-not-posting' target='blank'>" );
$rop = __( 'Revive Old Posts: ', 'tweet-old-post' );
$admin_url = admin_url( 'admin.php?page=TweetOldPost' );
$notice_text = sprintf( __( 'We\'ve removed the Remote Cron service feature of Revive Old Posts. If you used this option in the past, then please %1$shead to the Revive Old Posts dashboard%2$s to start sharing using the default WordPress cron. If post sharing is not working for you, then please see %3$shere for solutions.%2$s', 'tweet-old-post' ), "<a href='$admin_url'>", '</a>', "<a href='https://docs.revive.social/article/686-fix-revive-old-post-not-posting' target='blank'>" );

$message = <<<MSG
$message = <<<HTML
<p style="font-size: 14px">
<b>$rop</b> $notice_text
<a style='float: right;' href='$dismiss_link'>Dismiss</a>
</p>
MSG;
HTML;

?>

<div class="notice notice-error">
<?php echo $message ?>
<?php echo $message; ?>
</div>
<?php

Expand All @@ -1707,4 +1721,6 @@ public function rop_dismiss_remove_remote_cron() {
}

}


}
2 changes: 1 addition & 1 deletion includes/admin/class-rop-global-settings.php
Expand Up @@ -386,7 +386,7 @@ public static function instance() {
self::$instance->services_defaults
);

self::$instance->settings_defaults['min_interval'] = apply_filters( 'rop_min_interval_bw_shares_min', ROP_DEBUG ? 0.1 : 0.5 );
self::$instance->settings_defaults['min_interval'] = apply_filters( 'rop_min_interval_bw_shares_min', ROP_DEBUG ? 0.05 : 0.5 );
self::$instance->settings_defaults['step_interval'] = apply_filters( 'rop_min_interval_bw_shares_step', 0.1 );

self::$instance->settings = apply_filters(
Expand Down
4 changes: 2 additions & 2 deletions includes/admin/class-rop-logger.php
Expand Up @@ -158,8 +158,8 @@ public function clear_user_logs() {
* @return mixed
*/
public function translate_messages( $direct_message ) {
if( ! is_string( $direct_message ) ){

if ( ! is_string( $direct_message ) ) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions includes/admin/helpers/class-rop-post-format-helper.php
Expand Up @@ -91,7 +91,7 @@ public function get_formated_object( $post_id, $account_id = 0 ) {

$filtered_post['shortner_credentials'] = ( isset( $this->post_format['shortner_credentials'] ) ) ? $this->post_format['shortner_credentials'] : array();

return $filtered_post;
return apply_filters( 'rop_formatted_post_object', $filtered_post, $post_id, $this->account_id );
}

/**
Expand Down Expand Up @@ -957,7 +957,7 @@ public function build_image( $post_id ) {
add_filter( 'image_downsize', array( Jetpack_Photon::instance(), 'filter_image_downsize' ), 10, 3 );
}

return $image;
return apply_filters( 'rop_post_share_image', $image, $post_id );
}

/**
Expand Down
57 changes: 52 additions & 5 deletions includes/admin/models/class-rop-posts-selector-model.php
Expand Up @@ -446,8 +446,9 @@ public function select( $account_id = false ) {
* @param array $tax_queries The taxonomies query array.
* @param array $excluded_by_user Excluded post ID's by the user.
*
* @return mixed
* @return array
* @since 8.0.0
* @since 9.0.6 Added code to prevent posts from being scheduled if they are already in the queue when there's more than enough unique posts available to schedule.
* @access private
*/
private function query_results( $account_id, $post_types, $tax_queries, $excluded_by_user ) {
Expand All @@ -468,15 +469,26 @@ private function query_results( $account_id, $post_types, $tax_queries, $exclude
*/
$posts = array_diff( $posts, $exclude );

$number_of_posts_to_share = ( new Rop_Settings_Model )->get_number_of_posts();
$events_per_account = Rop_Scheduler_Model::EVENTS_PER_ACCOUNT;

/**
* Reset indexes to avoid missing ones.
* If the number of available posts(post pool) is greater than whats allowed per account(10),
* Then drop posts that are already scheduled in favor of having a posts pool comprising of posts that are not scheduled yet.
*/
$posts = array_values( $posts );
if ( count( $posts ) > ( $number_of_posts_to_share * $events_per_account ) ) {
$queue = get_option( 'rop_queue', array() );
$account_queue = $queue['queue'][ $account_id ] ?? '';
if ( ! empty( $account_queue ) ) {
$current_account_queue = array_unique( array_merge( ...$account_queue ) );
$posts = array_diff( $posts, $current_account_queue );
}
}

/**
* Shuffle retrieved posts
* Reset indexes to avoid missing ones.
*/
shuffle( $posts );
$posts = array_values( $posts );

if ( function_exists( 'icl_object_id' ) ) {
$posts = $this->rop_wpml_id( $posts, $account_id );
Expand Down Expand Up @@ -596,6 +608,41 @@ public function has_buffer_items( $account_id ) {
return ( isset( $this->buffer[ $account_id ] ) ) ? true : false;
}

/**
* Get the current buffer in the Database.
*
* @since 9.0.6
* @return array An array of Accounts and the post IDs that have been shared.
*/
public function get_buffer() {
return $this->get( 'posts_buffer' );
}

/**
* Check if a post has already been shared to an account.
*
* Checks the account buffer for a given Post ID.
*
* @since 9.0.6
* @param mixed $account_id The account ID to check.
* @param mixed $post_id The Post ID to look for.
* @return bool Wher or not the post ID exists in the buffer(meaning if it has already been shared).
*/
public function buffer_has_post_id( $account_id, $post_id ) {

$buffer = $this->get_buffer();
$account_posts = $buffer[ $account_id ] ?? array();

$post_ids = array_values( $account_posts );

if ( in_array( $post_id, $post_ids ) ) {
return true;
}

return false;

}

/**
* Method to clear buffer.
*
Expand Down
27 changes: 14 additions & 13 deletions includes/admin/models/class-rop-queue-model.php
Expand Up @@ -238,10 +238,6 @@ public function get_queue() {
continue;
}

if ( empty( $post_pool ) ) {
continue;
}

$items_needed = $no_of_posts - count( $event_queue );
$i = 0;

Expand All @@ -250,25 +246,30 @@ public function get_queue() {
break;
}
$rand_key = rand( 0, count( $post_pool ) - 1 );
// Below is a second layer of randomness to choosing posts to add to queue
// Grab a random post id from the pool to add to the queue.
$post_id = $post_pool[ $rand_key ];

$event_queue[] = $post_id;
$i++;
unset( $post_pool[ $rand_key ] );

$post_pool = array_values( $post_pool );
$i++;

}

$normalized_queue[ $account_id ][ $index ] = $event_queue;
$current_normalized_queue = $normalized_queue[ $account_id ];
// Get the last 4 items in the queue.
$last_four = array_slice( $current_normalized_queue, apply_filters( 'rop_allowed_consecutive_posts', -4 ) );

// Below causes more issues with post stacking. Solution
// Is to regen account queue keys
// $new_queue = array_merge( $account_queue, array($event_queue) );
// $normalized_queue[ $account_id ] = $new_queue;
// $account_queue = $new_queue;
$is_consecutive = array_search( $event_queue, $last_four );

/**
* If the new entry is not the same as any of the last 4 items, then add it to the queue.
* Here we're preventing posts from being scheduled too close to each other for any specific account.
*/
if ( $is_consecutive === false && ! empty( $event_queue ) ) {
$normalized_queue[ $account_id ][ $index ] = $event_queue;
}
}
}

Expand Down Expand Up @@ -311,7 +312,7 @@ public function get_ordered_queue() {
}

/*
Prevents queue from showing posts that do not exist
* Prevents queue from showing posts that do not exist
* on the website. This can occur when a post is deleted
* and queue hasn't yet refreshed.
*/
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/models/class-rop-scheduler-model.php
Expand Up @@ -127,7 +127,7 @@ public function create_schedule( $schedule_data = array() ) {

if ( isset( $schedule_data['interval_r'] ) ) {

$min_allowed = apply_filters( 'rop_min_interval_bw_shares_min', ROP_DEBUG ? 0.1 : 0.5 );
$min_allowed = apply_filters( 'rop_min_interval_bw_shares_min', ROP_DEBUG ? 0.05 : 0.5 );

if ( $schedule_data['interval_r'] < $min_allowed ) {
$this->logger->alert_error( sprintf( Rop_I18n::get_labels( 'misc.min_recurring_schedule_interval' ), $min_allowed * 60 ) );
Expand Down
11 changes: 11 additions & 0 deletions includes/admin/models/class-rop-settings-model.php
Expand Up @@ -619,4 +619,15 @@ public function get_true_instant_share() {
return isset( $this->settings['true_instant_share'] ) ? $this->settings['true_instant_share'] : false;
}

/**
* Getter for Update Post Published Date After Share feature.
*
* @since 9.0.6
* @access public
* @return bool
*/
public function get_update_post_published_date() {
return isset( $this->settings['update_post_published_date'] ) ? $this->settings['update_post_published_date'] : false;
}

}
65 changes: 60 additions & 5 deletions includes/admin/services/class-rop-tumblr-service.php
Expand Up @@ -410,6 +410,51 @@ public function request_api_token() {
return $request_token;
}

/**
*
* Check if a post has custom variations saved for it.
*
* @param mixed $post_id The Post ID.
* @return bool
*/
private function has_custom_share_variations( $post_id ) {

$custom_content = get_post_meta( $post_id, 'rop_custom_messages_group' );

// If there's no variations in the DB for this post bail.
if ( empty( $custom_content ) ) {
return false;
}

return true;
}

/**
* Extract the hashtags from custom share variation if it exists.
*
* Also remove the hashtags from the content since they are not clickable.
*
* @param array $post_details The post details array for the post that is being shared.
* @return string
*/
private function get_custom_share_variation_hashtags( $post_details ) {

// If there's no variations in the DB for this post bail.
if ( empty( $this->has_custom_share_variations( $post_details['post_id'] ) ) ) {
return;
}

$content = $post_details['content'];

preg_match_all( '/#(\w+)/', $content, $hashtags );

$hashtags_array = $hashtags[0];

$hashtags_string = implode( ' ', $hashtags_array );

return $hashtags_string;
}

/**
* Method for publishing with Twitter service.
*
Expand All @@ -430,13 +475,23 @@ public function share( $post_details, $args = array() ) {

$api = $this->get_api( $args['credentials']['consumer_key'], $args['credentials']['consumer_secret'], $args['credentials']['oauth_token'], $args['credentials']['oauth_token_secret'] );

$post_type = new Rop_Posts_Selector_Model();
$post_id = $post_details['post_id'];

$model = new Rop_Post_Format_Model;
$model = new Rop_Post_Format_Model();
$post_format = $model->get_post_format( $post_details['account_id'] );

$hashtags = $post_details['hashtags'];
$settings = new Rop_Settings_Model();
$post_id = $post_details['post_id'] ?? '';

/*
* If the Share Variations feature is turned off, or the post does not have share variations, check for hashtags in the post_details array,
* Otherwise check for it inside the custom share message.
*/
if ( empty( $settings->get_custom_messages() ) || $this->has_custom_share_variations( $post_id ) === false ) {
$hashtags = $post_details['hashtags'];
} else {
$hashtags = $this->get_custom_share_variation_hashtags( $post_details );
// Users might want the hashtags to be removed from the content. Provide a filter for custom manipulation.
$post_details = apply_filters( 'rop_tumblr_custom_post_details', $post_details, $hashtags );
}

if ( ! empty( $post_format['hashtags_randomize'] ) && $post_format['hashtags_randomize'] ) {
$hashtags = $this->shuffle_hashtags( $hashtags );
Expand Down
46 changes: 12 additions & 34 deletions includes/class-rop-i18n.php
Expand Up @@ -122,6 +122,8 @@ public static function get_labels( $key = '' ) {
'limit_reached' => __( 'Limit reached', 'tweet-old-post' ),
),
'settings' => array(
'yes_text' => __( 'Yes', 'tweet-old-post' ),
'available_in_pro' => __( ' This feature is only available in the Pro version.', 'tweet-old-post' ),
'post_types_exclude_limit' => sprintf( __( 'Upgrade to Pro version to select more than 30 posts. You can upgrade %1$shere%2$s.', 'tweet-old-post' ), '<a href="https://revive.social/plugins/revive-old-post/" target="_blank">', '</a>' ),
'post_types_exclude_limit_tooltip' => __( 'Upgrade to Pro version to select more than 30 posts.', 'tweet-old-post' ),
'menu_item' => __( 'General Settings', 'tweet-old-post' ),
Expand All @@ -134,27 +136,18 @@ public static function get_labels( $key = '' ) {
'no_posts_title' => __( 'Number of Posts', 'tweet-old-post' ),
'no_posts_desc' => __( 'Number of posts to share per account when a share occurs.', 'tweet-old-post' ),
'share_once_title' => __( 'Share More Than Once?', 'tweet-old-post' ),
'share_once_yes' => __( 'Yes', 'tweet-old-post' ),
'share_once_desc' => __(
'If all available posts have been shared to your active accounts, should we automatically restart the sharing?',
'tweet-old-post'
),
'post_types_title' => __( 'Post Types', 'tweet-old-post' ),
'post_types_taxonomy_limit' => sprintf( __( 'Upgrade to Pro version to select more than 4 taxonomies. You can upgrade %1$shere%2$s.', 'tweet-old-post' ), '<a href="https://revive.social/plugins/revive-old-post/" target="_blank">', '</a>' ),
'post_types_attachament_info' => sprintf( __( 'You need to select the media files which you want to share, find out more information %1$shere%2$s.', 'tweet-old-post' ), '<a href="https://docs.revive.social/article/934-how-to-use-revive-old-post-media-sharing-feature" target="_blank">', '</a>' ),
'post_types_desc' => __( 'Which post types should Revive Old Posts share? <a href="https://docs.revive.social/article/968-how-to-share-different-wordpress-post-types-to-social-media-w-revive-old-posts" target="_blank">Learn more</a>.', 'tweet-old-post' ),
'filter_by_post_types_desc' => __( 'Filter posts list by Post Type', 'tweet-old-post' ),
'number_of_posts_upsell' => __(
'Changing the number of posts per share is available in the Pro
version.',
'tweet-old-post'
),
'maximum_post_age_upsell' => __(
'Changing the maximum post age is available in the Pro
version..',
'tweet-old-post'
),
'post_types_upsell' => __(
'post_types_title' => __( 'Post Types', 'tweet-old-post' ),
'post_types_taxonomy_limit' => sprintf( __( 'Upgrade to Pro version to select more than 4 taxonomies. You can upgrade %1$shere%2$s.', 'tweet-old-post' ), '<a href="https://revive.social/plugins/revive-old-post/" target="_blank">', '</a>' ),
'post_types_attachament_info' => sprintf( __( 'You need to select the media files which you want to share, find out more information %1$shere%2$s.', 'tweet-old-post' ), '<a href="https://docs.revive.social/article/934-how-to-use-revive-old-post-media-sharing-feature" target="_blank">', '</a>' ),
'post_types_desc' => __( 'Which post types should Revive Old Posts share? <a href="https://docs.revive.social/article/968-how-to-share-different-wordpress-post-types-to-social-media-w-revive-old-posts" target="_blank">Learn more</a>.', 'tweet-old-post' ),
'update_post_published_date_title' => __( 'Update Post Published Date After Share', 'tweet-old-post' ),
'update_post_published_date_desc' => sprintf( __( 'Update the post published date after it has been shared to your social media account. %1$sLearn more%2$s.', 'tweet-old-post' ), '<a href="https://docs.revive.social/article/1489-automatically-updating-post-publish-date-after-sharing-a-post" target="_blank">', '</a>' ),
'filter_by_post_types_desc' => __( 'Filter posts list by Post Type', 'tweet-old-post' ),
'post_types_upsell' => __(
'Selecting custom post types is available in the Pro
version.',
'tweet-old-post'
Expand All @@ -175,37 +168,26 @@ public static function get_labels( $key = '' ) {
traffic from Revive Old Posts.',
'tweet-old-post'
),
'ga_yes' => __( 'Yes', 'tweet-old-post' ),
'custom_share_title' => __( 'Enable Share Content Variations', 'tweet-old-post' ),
'custom_share_desc' => __( 'These messages will override the Post Content option in Post Format settings. You can go to each post and add multiple share content variations. <a href="https://docs.revive.social/article/971-how-to-add-variations-to-revive-old-posts-shares" target="_blank">Learn more</a>.', 'tweet-old-post' ),
'custom_share_yes' => __( 'Yes', 'tweet-old-post' ),
'custom_share_upsell' => __( 'Using a custom share message is available in the Pro version.', 'tweet-old-post' ),
'custom_share_order_title' => __( 'Share Message Variations In the Order They Are Added.', 'tweet-old-post' ),
'custom_share_order_desc' => __( 'By default message variations are shared randomly. Checking this box will cause them to share in the order they were added.', 'tweet-old-post' ),
'custom_share_order_yes' => __( 'Yes', 'tweet-old-post' ),
'instant_share_title' => __( 'Enable Instant Sharing Feature (Post on Publish)', 'tweet-old-post' ),
'instant_share_desc' => __( 'Allows you to share posts immediately on publish/update. <a href="https://docs.revive.social/article/933-how-to-share-posts-immediately-with-revive-old-posts" target="_blank">Learn more</a>.', 'tweet-old-post' ),
'instant_share_yes' => __( 'Yes', 'tweet-old-post' ),
'true_instant_share_title' => __( 'Use True Instant Share', 'tweet-old-post' ),
'true_instant_share_desc' => __( 'This option sends the post out as soon as you click the publish button, instead of relying on a Cron task. <a href="https://docs.revive.social/article/1259-how-to-make-instant-share-feature-truly-immediate" target="_blank">Learn more</a>.', 'tweet-old-post' ),
'true_instant_share_yes' => __( 'Yes', 'tweet-old-post' ),
'instant_share_default_title' => __( 'Enable Instant Sharing By Default', 'tweet-old-post' ),
'instant_share_default_desc' => __( 'Instant sharing option will be checked by default when creating new posts.', 'tweet-old-post' ),
'instant_share_default_yes' => __( 'Yes', 'tweet-old-post' ),
'instant_share_choose_accounts_manually_title' => __( 'Choose Accounts Manually', 'tweet-old-post' ),
'instant_share_choose_accounts_manually_desc' => __( 'This option allows you to choose which accounts you\'d like to share to instead of having them all checked automatically.', 'tweet-old-post' ),
'instant_share_choose_accounts_manually_yes' => __( 'Yes', 'tweet-old-post' ),
'instant_share_future_scheduled_title' => __( 'Share Scheduled Posts to Social Media On Publish', 'tweet-old-post' ),
'instant_share_future_scheduled_desc' => __( 'Allows for the sharing of posts scheduled to publish at a future date by WordPress to your active social media accounts as soon as they change from "Scheduled" to "Published". <a href="https://docs.revive.social/article/1194-share-scheduled-posts-to-social-media-on-publish-with-revive-old-posts" target="_blank">Learn more</a>.', 'tweet-old-post' ),
'instant_share_future_scheduled_yes' => __( 'Yes', 'tweet-old-post' ),
'instant_share_future_scheduled_upsell' => __( ' This feature is only available in the Pro version.', 'tweet-old-post' ),
'cron_type_label' => __( 'Cron Job Type', 'tweet-old-post' ),
'cron_type_label_desc' => sprintf( __( 'Select the between your local built-in WordPress task scheduler, or Revive Social\'s, %1$sLearn More%2$s.', 'tweet-old-post' ), '<a href="https://docs.revive.social/article/1303-rop-local-cron-vs-remote-cron" target="_blank">', '</a>' ),
'cron_type_label_desc_terms' => __( 'I understand that some site data is stored on the ROP\'s Remote Cron System to provide this service <a href="https://docs.revive.social/article/1317-info-we-collect-for-remote-cron-service" target="_blank">Read More Here</a>.', 'tweet-old-post' ),
'cron_type_notice' => sprintf( __( '%1$sNOTE:%2$s This is a BETA Remote Cron feature to be used mainly if your %1$sposts aren\'t sharing%2$s. If the Remote Cron feature is used, and you notice that your posts are still not sharing, then please %1$sturn the setting back to "Local Cron"%2$s and read the following guide for alternative solutions that are sure to work: %1$s%3$sLearn More%4$s%2$s.', 'tweet-old-post' ), '<strong>', '</strong>', '<a href="https://docs.revive.social/article/686-fix-revive-old-post-not-posting" target="_blank">', '</a>' ),
'housekeeping' => __( 'Housekeeping', 'tweet-old-post' ),
'housekeeping_desc' => __( 'Should we delete all saved settings on deletion of the Revive Old Posts plugin?', 'tweet-old-post' ),
'housekeeping_yes' => __( 'Yes', 'tweet-old-post' ),
'save' => __( 'Save', 'tweet-old-post' ),
'taxonomies_exclude_explicit' => __( 'Exclude taxononmies', 'tweet-old-post' ),
'save_filters' => __( 'Save filters', 'tweet-old-post' ),
Expand All @@ -218,6 +200,7 @@ public static function get_labels( $key = '' ) {
'load_more_posts' => __( 'Load more posts.', 'tweet-old-post' ),
),
'post_format' => array(
'yes_text' => __( 'Yes', 'tweet-old-post' ),
'menu_item' => __( 'Post Format', 'tweet-old-post' ),
'language_title' => __( 'Language', 'tweet-old-post' ),
'language_title_desc' => __( 'We\'ve detected that this is a multilingual website. Select the post language you want to share to this account.', 'tweet-old-post' ),
Expand All @@ -242,16 +225,13 @@ public static function get_labels( $key = '' ) {
'add_pos_option_end' => __( 'End of Caption', 'tweet-old-post' ),
'add_link_title' => __( 'Include Link', 'tweet-old-post' ),
'add_link_desc' => __( 'Should ROP include the post permalink or not?', 'tweet-old-post' ),
'add_link_yes' => __( 'Yes', 'tweet-old-post' ),
'meta_link_title' => __( 'Custom Field', 'tweet-old-post' ),
'meta_link_desc' => __( 'Fetch URL from custom field?', 'tweet-old-post' ),
'meta_link_yes' => __( 'Yes', 'tweet-old-post' ),
'meta_link_name_title' => __( 'Custom Field', 'tweet-old-post' ),
'meta_link_name_desc' => __( 'Custom Field from which to get the URL.', 'tweet-old-post' ),
'taxonomy_based_sharing_upsell' => __( 'Per account Taxonomy filters feature is available in the Pro version (Personal Plan and higher).', 'tweet-old-post' ),
'use_shortner_title' => __( 'Use URL Shortener', 'tweet-old-post' ),
'use_shortner_desc' => __( 'Should we use a shortener when adding the links to the content?', 'tweet-old-post' ),
'use_shortner_yes' => __( 'Yes', 'tweet-old-post' ),
'shortner_title' => __( 'URL Shortener Service', 'tweet-old-post' ),
'shortner_desc' => __( 'Which service to use for URL shortening?', 'tweet-old-post' ),
'shortner_api_field' => __( 'Service API', 'tweet-old-post' ),
Expand All @@ -272,10 +252,8 @@ public static function get_labels( $key = '' ) {
'hashtags_length_desc' => __( 'The maximum hashtags length to be used when publishing.', 'tweet-old-post' ),
'hashtags_randomize' => __( 'Randomize hashtags', 'tweet-old-post' ),
'hashtags_randomize_desc' => __( 'Randomize the list of hashtags on every successful share. You won\'t see this change in the Sharing Queue, the randomization happens at share time.', 'tweet-old-post' ),
'hashtags_randomize_yes' => __( 'Yes', 'tweet-old-post' ),
'image_title' => __( 'Share As Image Post', 'tweet-old-post' ),
'image_desc' => __( 'Should ROP share your posts as an image post? <a href="https://docs.revive.social/article/958-how-to-share-posts-as-image-posts-to-social-accounts" target="_blank">Learn more</a>.', 'tweet-old-post' ),
'image_yes' => __( 'Yes', 'tweet-old-post' ),
'utm_campaign_medium' => __( 'Campaign Medium', 'tweet-old-post' ),
'utm_campaign_medium_desc' => __( 'The marketing medium you want to show in Google Analytics e.g: "social", "website", etc.', 'tweet-old-post' ),
'utm_campaign_name' => __( 'Campaign Name', 'tweet-old-post' ),
Expand Down Expand Up @@ -319,7 +297,7 @@ public static function get_labels( $key = '' ) {
'sharing_not_started' => __( 'Sharing is not started!', 'tweet-old-post' ),
'sharing_not_started_desc' => __( 'You need to start sharing in order to see any posts in the queue.', 'tweet-old-post' ),
'queue_desc' => __( 'You can choose to edit any of the post, skip the sharing or block a specific one from sharing in the future.', 'tweet-old-post' ),
'business_or_higher_only' => sprintf( __( 'You can edit the posts from the queue only the Business and Marketer versions of the plugin. View more details %1$shere%2$s.', 'tweet-old-post' ), '<a href="' . self::UPSELL_LINK . '" target="_blank">', '</a>' ),
'business_or_higher_only' => sprintf( __( 'You can edit the posts from the queue with the Business or Marketer versions of the plugin. View more details %1$shere%2$s.', 'tweet-old-post' ), '<a href="' . self::UPSELL_LINK . '" target="_blank">', '</a>' ),
'no_posts' => __( 'No queued posts!', 'tweet-old-post' ),
'no_posts_desc' => __( 'Check if you have at least an <b>"Active account"</b>, what posts and pages are selected in <b>"General Settings"</b> and if a <b>"Schedule"</b> is defined.', 'tweet-old-post' ),
'refresh_btn' => __( 'Refresh Queue', 'tweet-old-post' ),
Expand Down
2 changes: 1 addition & 1 deletion includes/class-rop.php
Expand Up @@ -68,7 +68,7 @@ class Rop {
public function __construct() {

$this->plugin_name = 'rop';
$this->version = '9.0.5';
$this->version = '9.0.6';

$this->load_dependencies();
$this->set_locale();
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "tweet-old-post",
"version": "9.0.5",
"version": "9.0.6",
"description": "Tweet Old Posts plugin",
"repository": {
"type": "git",
Expand Down
1 change: 1 addition & 0 deletions phpcs.xml
Expand Up @@ -10,6 +10,7 @@
<exclude-pattern>tests/*</exclude-pattern>
<exclude-pattern>assets/*</exclude-pattern>
<exclude-pattern>vue/*</exclude-pattern>
<exclude-pattern>dist/*</exclude-pattern>
<rule ref="WordPress-Core">
<exclude name="Squiz.Commenting.FileComment.SpacingAfterComment" />
<exclude name="Generic.Files.LowercasedFilename" />
Expand Down
14 changes: 14 additions & 0 deletions readme.txt
Expand Up @@ -73,6 +73,10 @@ Once set, the plugin will then be able to determine which content to auto share

With our Revive Network addon, you can share posts from any RSS feed to Facebook, Twitter, Linkedin, Tumblr, Google My Business, Vkontakte(VK) or Instagram (imported post needs to have an image).

### A WP Auto Republish Plugin

Revive Old Posts can work as a WP Auto Republish plugin that updates your post's publish date after it has been shared to your connected social media accounts.

---

Revive Old Posts isn't like every other social media marketing tool. We've tailored its features while keeping the following in mind:
Expand Down Expand Up @@ -143,6 +147,8 @@ Some of the available networks and features require the Pro version of the plugi

- Post to Vk Communities [Pro]

- WordPress Auto Republish post after sharing [Pro]

- Share multilingual posts to respective pages with WPML example, share English Posts to your English social media accounts and Spanish posts to your Spanish social media accounts. [Pro]

And More! Try Revive Old Posts, see why it's the **best** WordPress social media marketing tool to boost your site traffic and keep your followers engaged.
Expand Down Expand Up @@ -299,6 +305,14 @@ http://revive.social/plugins/revive-old-post

== Changelog ==

##### [Version 9.0.6](https://github.com/Codeinwp/tweet-old-post/compare/v9.0.5...v9.0.6) (2021-12-13)

### Fixes
- The same post would some times get shared too soon after it had previously been shared.




##### [Version 9.0.5](https://github.com/Codeinwp/tweet-old-post/compare/v9.0.4...v9.0.5) (2021-08-17)

### Changes
Expand Down
4 changes: 2 additions & 2 deletions tweet-old-post.php
Expand Up @@ -16,7 +16,7 @@
* Plugin Name: Revive Old Posts
* Plugin URI: https://revive.social/
* Description: WordPress plugin that helps you to keeps your old posts alive by sharing them and driving more traffic to them from twitter/facebook or linkedin. It also helps you to promote your content. You can set time and no of posts to share to drive more traffic.For questions, comments, or feature requests, <a href="http://revive.social/support/?utm_source=plugindesc&utm_medium=announce&utm_campaign=top">contact </a> us!
* Version: 9.0.5
* Version: 9.0.6
* Author: revive.social
* Author URI: https://revive.social/
* Requires at least: 3.5
Expand Down Expand Up @@ -162,7 +162,7 @@ function run_rop() {
define( 'ROP_CRON_ALTERNATIVE', $use_remote_cron );

define( 'ROP_PRO_URL', 'http://revive.social/plugins/revive-old-post/' );
define( 'ROP_LITE_VERSION', '9.0.5' );
define( 'ROP_LITE_VERSION', '9.0.6' );
define( 'ROP_LITE_BASE_FILE', __FILE__ );
$debug = false;
if ( function_exists( 'wp_get_environment_type' ) ) {
Expand Down
10 changes: 5 additions & 5 deletions vue/src/vue-elements/post-format.vue
Expand Up @@ -108,7 +108,7 @@
<div class="input-group">
<label class="form-checkbox">
<input type="checkbox" v-model="post_format.include_link"/>
<i class="form-icon"></i> {{labels.add_link_yes}}
<i class="form-icon"></i> {{labels.yes_text}}
</label>
</div>
<p v-if="allAccounts[this.account_id].account_type === 'instagram_account'" v-html="labels.instagram_disable_link_recommendation"></p>
Expand All @@ -124,7 +124,7 @@
<div class="input-group">
<label class="form-checkbox">
<input type="checkbox" v-model="post_format.url_from_meta"/>
<i class="form-icon"></i> {{labels.meta_link_yes}}
<i class="form-icon"></i> {{labels.yes_text}}
</label>
</div>
</div>
Expand Down Expand Up @@ -179,7 +179,7 @@
<div class="input-group">
<label class="form-checkbox">
<input type="checkbox" v-model="post_format.short_url"/>
<i class="form-icon"></i> {{labels.use_shortner_yes}}
<i class="form-icon"></i> {{labels.yes_text}}
</label>
</div>
<p v-if="allAccounts[this.account_id].service === 'vk'" v-html="labels.vk_unsupported_shorteners"></p>
Expand Down Expand Up @@ -281,7 +281,7 @@
<div class="input-group">
<label class="form-checkbox">
<input type="checkbox" v-model="post_format.hashtags_randomize" />
<i class="form-icon"></i> {{labels.hashtags_randomize_yes}}
<i class="form-icon"></i> {{labels.yes_text}}
</label>
</div>
</div>
Expand All @@ -302,7 +302,7 @@
<!-- For instagram accounts -->
<input v-if="is_instagram_account" type="checkbox" v-model="is_instagram_account"
:disabled="!isPro || is_instagram_account"/>
<i class="form-icon"></i> {{labels.image_yes}}
<i class="form-icon"></i> {{labels.yes_text}}
</label>
</div>
<p v-if="is_instagram_account" v-html="labels.instagram_image_post_default"></p>
Expand Down
86 changes: 56 additions & 30 deletions vue/src/vue-elements/settings-tab-panel.vue
Expand Up @@ -71,8 +71,8 @@
<span class="divider"></span>

<!-- Max Post Age -->
<div class="columns py-2">
<div class="column col-6 col-sm-12 vertical-align">
<div class="columns py-2" :class="'rop-control-container-'+isPro">
<div class="column col-6 col-sm-12 vertical-align rop-control">
<b>{{labels.max_days_title}}</b>
<p class="text-gray">{{labels.max_days_desc}}</p>
</div>
Expand All @@ -84,7 +84,7 @@

<div class="columns " v-if="!isPro">
<div class="column text-center">
<p class="upsell"><i class="fa fa-info-circle"></i> {{labels.maximum_post_age_upsell}}</p>
<p class="upsell"><i class="fa fa-info-circle"></i> {{labels.available_in_pro}}</p>
</div>
</div>
<span class="divider"></span>
Expand All @@ -101,7 +101,7 @@
</div>
<div class="columns " v-if="!isPro">
<div class="column text-center">
<p class="upsell"><i class="fa fa-info-circle"></i> {{labels.number_of_posts_upsell}}</p>
<p class="upsell"><i class="fa fa-info-circle"></i> {{labels.available_in_pro}}</p>
</div>
</div>
<span class="divider"></span>
Expand All @@ -116,15 +116,14 @@
<div class="form-group">
<label class="form-checkbox" id="share_more_than_once">
<input type="checkbox" v-model="generalSettings.more_than_once"/>
<i class="form-icon"></i> {{labels.share_once_yes}}
<i class="form-icon"></i> {{labels.yes_text}}
</label>
</div>
</div>
</div>
<span class="divider"></span>

<!-- Post Types -->

<div class="columns py-2" :class="'rop-control-container-'+isPro">
<div class="column col-6 col-sm-12 vertical-align rop-control">
<b>{{labels.post_types_title}}</b>
Expand All @@ -146,6 +145,7 @@
</div>

<span class="divider" v-if="!isPro || license_price_id === 7"></span>

<!-- Taxonomies -->
<!-- Price ID 7 is Starter Plan -->
<div class="columns py-2" v-if="!isPro || license_price_id === 7">
Expand All @@ -172,6 +172,28 @@

<span class="divider"></span>

<!-- Update publish date -->
<div class="columns py-2" :class="'rop-control-container-'+isPro">
<div class="column col-6 col-sm-12 vertical-align rop-control">
<b>{{labels.update_post_published_date_title}}</b>
<p class="text-gray"><span v-html="labels.update_post_published_date_desc"></span></p>
</div>
<div class="column col-6 col-sm-12 vertical-align text-left rop-control">
<div class="form-group">
<label class="form-checkbox" id="share_more_than_once">
<input type="checkbox" v-model="generalSettings.update_post_published_date" :disabled="!isPro"/>
<i class="form-icon"></i> {{labels.yes_text}}
</label>
</div>
</div>
</div>
<div class="columns " v-if="!isPro">
<div class="column text-center">
<p class="upsell"><i class="fa fa-info-circle"></i> {{labels.available_in_pro}}</p>
</div>
</div>
<span class="divider"></span>

<!-- Google Analytics -->
<div class="columns py-2">
<div class="column col-6 col-sm-12 vertical-align">
Expand All @@ -182,14 +204,14 @@
<div class="form-group">
<label class="form-checkbox">
<input type="checkbox" v-model="generalSettings.ga_tracking"/>
<i class="form-icon"></i>{{labels.ga_yes}}
<i class="form-icon"></i>{{labels.yes_text}}
</label>
</div>
</div>
</div>

<span class="divider"></span>

<!-- Enable Instant Sharing Feature (Post on Publish) -->
<div class="columns py-2">
<div class="column col-6 col-sm-12 vertical-align rop-control">
<b>{{labels.instant_share_title}}</b>
Expand All @@ -199,14 +221,15 @@
<div class="form-group">
<label id="rop_instant_share" class="form-checkbox">
<input type="checkbox" v-model="generalSettings.instant_share"/>
<i class="form-icon"></i>{{labels.instant_share_yes}}
<i class="form-icon"></i>{{labels.yes_text}}
</label>
</div>
</div>
</div>

<span class="divider"></span>

<!-- Use True Instant Share -->
<div class="columns py-2" v-if="isInstantShare">
<div class="column col-6 col-sm-12 vertical-align rop-control">
<b>{{labels.true_instant_share_title}}</b>
Expand All @@ -216,14 +239,15 @@
<div class="form-group">
<label class="form-checkbox">
<input type="checkbox" v-model="generalSettings.true_instant_share"/>
<i class="form-icon"></i>{{labels.true_instant_share_yes}}
<i class="form-icon"></i>{{labels.yes_text}}
</label>
</div>
</div>
</div>

<span class="divider" v-if="isInstantShare"></span>

<!-- Enable Instant Sharing By Default -->
<div class="columns py-2" v-if="isInstantShare">
<div class="column col-6 col-sm-12 vertical-align rop-control">
<b>{{labels.instant_share_default_title}}</b>
Expand All @@ -233,14 +257,14 @@
<div class="form-group">
<label class="form-checkbox">
<input type="checkbox" v-model="generalSettings.instant_share_default"/>
<i class="form-icon"></i>{{labels.instant_share_default_yes}}
<i class="form-icon"></i>{{labels.yes_text}}
</label>
</div>
</div>
</div>

<span class="divider" v-if="isInstantShare && isInstantShareByDefault"></span>


<!-- Choose Accounts Manually -->
<div class="columns py-2" v-if="isInstantShare && isInstantShareByDefault">
<div class="column col-6 col-sm-12 vertical-align rop-control">
<b>{{labels.instant_share_choose_accounts_manually_title}}</b>
Expand All @@ -250,14 +274,14 @@
<div class="form-group">
<label class="form-checkbox">
<input type="checkbox" v-model="generalSettings.instant_share_choose_accounts_manually"/>
<i class="form-icon"></i>{{labels.instant_share_choose_accounts_manually_yes}}
<i class="form-icon"></i>{{labels.yes_text}}
</label>
</div>
</div>
</div>

<span class="divider" v-if="isInstantShare"></span>


<!-- Share Scheduled Posts to Social Media On Publish -->
<div class="columns py-2" v-if="isInstantShare" :class="'rop-control-container-'+isPro">
<div class="column col-6 col-sm-12 vertical-align rop-control">
<b>{{labels.instant_share_future_scheduled_title}}</b>
Expand All @@ -266,20 +290,21 @@
<div class="column col-6 col-sm-12 vertical-align text-left rop-control">
<div class="form-group">
<label class="form-checkbox">
<input type="checkbox" v-model="generalSettings.instant_share_future_scheduled"/>
<i class="form-icon"></i>{{labels.instant_share_future_scheduled_yes}}
<input type="checkbox" v-model="generalSettings.instant_share_future_scheduled" :disabled="!isPro"/>
<i class="form-icon"></i>{{labels.yes_text}}
</label>
</div>
</div>
</div>
<!-- Upsell -->
<div class="columns " v-if="!isPro && isInstantShare">
<div class="column text-center">
<p class="upsell"><i class="fa fa-info-circle"></i> {{labels.instant_share_future_scheduled_upsell}}</p>
<p class="upsell"><i class="fa fa-info-circle"></i> {{labels.available_in_pro}}</p>
</div>
</div>
<span class="divider" v-if="isInstantShare"></span>

<!-- Enable Share Content Variations -->
<div class="columns py-2" :class="'rop-control-container-'+isPro">
<div class="column col-6 col-sm-12 vertical-align rop-control">
<b>{{labels.custom_share_title}}</b>
Expand All @@ -289,14 +314,20 @@
<div class="form-group">
<label id="rop_custom_share_msg" class="form-checkbox">
<input type="checkbox" :disabled="!isPro" v-model="generalSettings.custom_messages"/>
<i class="form-icon"></i>{{labels.custom_share_yes}}
<i class="form-icon"></i>{{labels.yes_text}}
</label>
</div>
</div>
</div>
<!-- Upsell -->
<div class="columns " v-if="!isPro">
<div class="column text-center">
<p class="upsell"><i class="fa fa-info-circle"></i> {{labels.available_in_pro}}</p>
</div>
</div>
<span class="divider"></span>


<!-- Share Message Variations In the Order They Are Added -->
<div class="columns py-2" :class="'rop-control-container-'+isPro" v-if="isCustomMsgs">
<div class="column col-6 col-sm-12 vertical-align rop-control">
<b>{{labels.custom_share_order_title}}</b>
Expand All @@ -306,20 +337,14 @@
<div class="form-group">
<label id="rop_custom_share_msg" class="form-checkbox">
<input type="checkbox" :disabled="!isPro" v-model="generalSettings.custom_messages_share_order"/>
<i class="form-icon"></i>{{labels.custom_share_order_yes}}
<i class="form-icon"></i>{{labels.yes_text}}
</label>
</div>
</div>
</div>

<!-- Upsell -->
<div class="columns " v-if="!isPro">
<div class="column text-center">
<p class="upsell"><i class="fa fa-info-circle"></i> {{labels.custom_share_upsell}}</p>
</div>
</div>
<span class="divider" v-if="isCustomMsgs"></span>

<!-- Housekeeping -->
<div class="columns py-2">
<div class="column col-6 col-sm-12 vertical-align rop-control">
<b>{{labels.housekeeping}}</b>
Expand All @@ -329,7 +354,7 @@
<div class="form-group">
<label class="form-checkbox">
<input type="checkbox" v-model="generalSettings.housekeeping"/>
<i class="form-icon"></i>{{labels.housekeeping_yes}}
<i class="form-icon"></i>{{labels.yes_text}}
</label>
</div>
</div>
Expand Down Expand Up @@ -558,6 +583,7 @@
selected_post_types: postTypesSelected,
selected_taxonomies: taxonomiesSelected,
exclude_taxonomies: excludeTaxonomies,
update_post_published_date: this.generalSettings.update_post_published_date,
ga_tracking: this.generalSettings.ga_tracking,
custom_messages: this.generalSettings.custom_messages,
custom_messages_share_order: this.generalSettings.custom_messages_share_order,
Expand Down