Revive Old Posts – Auto Post to Social Media - Version 8.0.6

Version Description

  • 2018-05-08
Download this release

Release Info

Developer codeinwp
Plugin Icon 128x128 Revive Old Posts – Auto Post to Social Media
Version 8.0.6
Comparing to
See all releases

Code changes from version 8.0.5 to 8.0.6

CHANGELOG.md CHANGED
@@ -1,4 +1,12 @@
1
 
 
 
 
 
 
 
 
 
2
  ### v8.0.5 - 2018-05-04
3
  **Changes:**
4
  * Fix issue with common hashtags using post content.
1
 
2
+ ### v8.0.6 - 2018-05-08
3
+ **Changes:**
4
+ * Fix hashtags issue when using post content as a source.
5
+ * Fix LinkedIn broken link when no image is used.
6
+ * Fix issue with sharing when multiple accounts are used with different custom schedules.
7
+ * Adds link only in the preview, remove from facebook message content.
8
+ * Adds limit for the number of logs.
9
+
10
  ### v8.0.5 - 2018-05-04
11
  **Changes:**
12
  * Fix issue with common hashtags using post content.
includes/admin/helpers/class-rop-log-handler.php CHANGED
@@ -125,7 +125,8 @@ class Rop_Log_Handler extends AbstractProcessingHandler {
125
  'time' => Rop_Scheduler_Model::get_current_time(),
126
  );
127
  if ( count( self::$current_logs ) > $this->limit ) {
128
- $this->current_logs = array_slice( self::$current_logs, count( self::$current_logs ) - $this->limit, $this->limit );
 
129
  }
130
  $this->save_logs( self::$current_logs );
131
  }
125
  'time' => Rop_Scheduler_Model::get_current_time(),
126
  );
127
  if ( count( self::$current_logs ) > $this->limit ) {
128
+
129
+ self::$current_logs = array_slice( self::$current_logs, count( self::$current_logs ) - $this->limit, $this->limit );
130
  }
131
  $this->save_logs( self::$current_logs );
132
  }
includes/admin/helpers/class-rop-post-format-helper.php CHANGED
@@ -152,7 +152,7 @@ class Rop_Post_Format_Helper {
152
  */
153
 
154
  $base_content = $this->build_base_content( $post_id );
155
-
156
  $custom_length = $this->get_custom_length();
157
 
158
  $result = $this->make_hashtags( $base_content, $content_helper, $post_id );
152
  */
153
 
154
  $base_content = $this->build_base_content( $post_id );
155
+ $base_content = $content_helper->token_truncate( $base_content, $max_length );
156
  $custom_length = $this->get_custom_length();
157
 
158
  $result = $this->make_hashtags( $base_content, $content_helper, $post_id );
includes/admin/models/class-rop-scheduler-model.php CHANGED
@@ -175,7 +175,7 @@ class Rop_Scheduler_Model extends Rop_Model_Abstract {
175
  * @since 8.0.0
176
  * @access public
177
  *
178
- * @param string $account_id The account ID.
179
  * @param bool $schedule_data The schedule data.
180
  *
181
  * @return mixed
@@ -522,7 +522,7 @@ class Rop_Scheduler_Model extends Rop_Model_Abstract {
522
  *
523
  * @return bool Success or not.
524
  */
525
- public function update_timeline( $new_events ) {
526
  if ( ! is_array( $new_events ) ) {
527
  return false;
528
  }
@@ -531,10 +531,12 @@ class Rop_Scheduler_Model extends Rop_Model_Abstract {
531
  */
532
  $valid_events = array();
533
  $schedules = $this->get_schedules();
 
534
  foreach ( $schedules as $id => $schedule ) {
535
- $valid_events[ $id ] = isset( $new_events[ $id ] ) ? $new_events[ $id ] : array();
 
536
  }
537
- $this->set( $this->events_namespace, $new_events );
538
 
539
  return true;
540
  }
@@ -542,7 +544,7 @@ class Rop_Scheduler_Model extends Rop_Model_Abstract {
542
  /**
543
  * Remove timestamp from timeline.
544
  *
545
- * @param int $timestamp Timestamp value.
546
  * @param string $account_id Account id.
547
  *
548
  * @return int Index to remove.
@@ -553,7 +555,7 @@ class Rop_Scheduler_Model extends Rop_Model_Abstract {
553
  $key = array_search( $timestamp, $schedule );
554
  $new_schedule = array_diff( $schedule, array( $timestamp ) );
555
  $new_schedule = array_values( $new_schedule );
556
- $this->update_timeline( $new_schedule );
557
 
558
  return $key;
559
  }
175
  * @since 8.0.0
176
  * @access public
177
  *
178
+ * @param string $account_id The account ID.
179
  * @param bool $schedule_data The schedule data.
180
  *
181
  * @return mixed
522
  *
523
  * @return bool Success or not.
524
  */
525
+ public function update_timeline( $new_events, $account_id = '' ) {
526
  if ( ! is_array( $new_events ) ) {
527
  return false;
528
  }
531
  */
532
  $valid_events = array();
533
  $schedules = $this->get_schedules();
534
+ $old_events = $this->get( $this->events_namespace );
535
  foreach ( $schedules as $id => $schedule ) {
536
+ $valid_events[ $id ] = isset( $old_events[ $id ] ) ? $old_events[ $id ] : array();
537
+ $valid_events[ $id ] = empty( $account_id ) ? $new_events[ $id ] : ( $id === $account_id ? $new_events : $valid_events[ $id ] );
538
  }
539
+ $this->set( $this->events_namespace, $valid_events );
540
 
541
  return true;
542
  }
544
  /**
545
  * Remove timestamp from timeline.
546
  *
547
+ * @param int $timestamp Timestamp value.
548
  * @param string $account_id Account id.
549
  *
550
  * @return int Index to remove.
555
  $key = array_search( $timestamp, $schedule );
556
  $new_schedule = array_diff( $schedule, array( $timestamp ) );
557
  $new_schedule = array_values( $new_schedule );
558
+ $this->update_timeline( $new_schedule, $account_id );
559
 
560
  return $key;
561
  }
includes/admin/services/class-rop-facebook-service.php CHANGED
@@ -147,6 +147,9 @@ class Rop_Facebook_Service extends Rop_Services_Abstract {
147
  */
148
  public function set_api( $app_id = '', $secret = '' ) {
149
  try {
 
 
 
150
  $this->api = new \Facebook\Facebook(
151
  array(
152
  'app_id' => $app_id,
@@ -447,9 +450,8 @@ class Rop_Facebook_Service extends Rop_Services_Abstract {
447
  $new_post['message'] = $post_details['content'];
448
 
449
  if ( ! empty( $post_details['post_url'] ) ) {
450
- $link = ' ' . $this->get_url( $post_details );
451
- $new_post['message'] = $new_post['message'] . $link;
452
- $new_post['link'] = $link;
453
  }
454
 
455
  if ( ! isset( $args['id'] ) || ! isset( $args['access_token'] ) ) {
@@ -488,7 +490,6 @@ class Rop_Facebook_Service extends Rop_Services_Abstract {
488
  private function try_post( $new_post, $page_id, $token ) {
489
  $this->set_api( $this->credentials['app_id'], $this->credentials['secret'] );
490
  $api = $this->get_api();
491
-
492
  try {
493
  $api->post( '/' . $page_id . '/feed', $new_post, $token );
494
 
147
  */
148
  public function set_api( $app_id = '', $secret = '' ) {
149
  try {
150
+ if ( empty( $app_id ) || empty( $secret ) ) {
151
+ return false;
152
+ }
153
  $this->api = new \Facebook\Facebook(
154
  array(
155
  'app_id' => $app_id,
450
  $new_post['message'] = $post_details['content'];
451
 
452
  if ( ! empty( $post_details['post_url'] ) ) {
453
+ $new_post['name'] = get_the_title( $post_details['post_id'] );
454
+ $new_post['link'] = $this->get_url( $post_details );
 
455
  }
456
 
457
  if ( ! isset( $args['id'] ) || ! isset( $args['access_token'] ) ) {
490
  private function try_post( $new_post, $page_id, $token ) {
491
  $this->set_api( $this->credentials['app_id'], $this->credentials['secret'] );
492
  $api = $this->get_api();
 
493
  try {
494
  $api->post( '/' . $page_id . '/feed', $new_post, $token );
495
 
includes/admin/services/class-rop-linkedin-service.php CHANGED
@@ -103,7 +103,7 @@ class Rop_Linkedin_Service extends Rop_Services_Abstract {
103
  * @since 8.0.0
104
  * @access public
105
  *
106
- * @param string $client_id The Client ID. Default empty.
107
  * @param string $client_secret The Client Secret. Default empty.
108
  *
109
  * @return \LinkedIn\Client Client Linkedin.
@@ -122,7 +122,7 @@ class Rop_Linkedin_Service extends Rop_Services_Abstract {
122
  * @since 8.0.0
123
  * @access public
124
  *
125
- * @param string $client_id The Client ID. Default empty.
126
  * @param string $client_secret The Client Secret. Default empty.
127
  *
128
  * @return mixed
@@ -345,7 +345,7 @@ class Rop_Linkedin_Service extends Rop_Services_Abstract {
345
  * @access public
346
  *
347
  * @param array $post_details The post details to be published by the service.
348
- * @param array $args Optional arguments needed by the method.
349
  *
350
  * @return mixed
351
  */
@@ -358,10 +358,9 @@ class Rop_Linkedin_Service extends Rop_Services_Abstract {
358
  $new_post = array(
359
  'comment' => '',
360
  'content' => array(
361
- 'title' => '',
362
- 'description' => '',
363
- 'submitted-url' => '',
364
- 'submitted-image-url' => '',
365
  ),
366
  'visibility' => array(
367
  'code' => 'anyone',
@@ -373,6 +372,7 @@ class Rop_Linkedin_Service extends Rop_Services_Abstract {
373
 
374
  $new_post['comment'] = $post_details['content'];
375
  $new_post['content']['description'] = $post_details['content'];
 
376
  $new_post['content']['submitted-url'] = $this->get_url( $post_details );
377
 
378
  $new_post['visibility']['code'] = 'anyone';
103
  * @since 8.0.0
104
  * @access public
105
  *
106
+ * @param string $client_id The Client ID. Default empty.
107
  * @param string $client_secret The Client Secret. Default empty.
108
  *
109
  * @return \LinkedIn\Client Client Linkedin.
122
  * @since 8.0.0
123
  * @access public
124
  *
125
+ * @param string $client_id The Client ID. Default empty.
126
  * @param string $client_secret The Client Secret. Default empty.
127
  *
128
  * @return mixed
345
  * @access public
346
  *
347
  * @param array $post_details The post details to be published by the service.
348
+ * @param array $args Optional arguments needed by the method.
349
  *
350
  * @return mixed
351
  */
358
  $new_post = array(
359
  'comment' => '',
360
  'content' => array(
361
+ 'title' => '',
362
+ 'description' => '',
363
+ 'submitted-url' => '',
 
364
  ),
365
  'visibility' => array(
366
  'code' => 'anyone',
372
 
373
  $new_post['comment'] = $post_details['content'];
374
  $new_post['content']['description'] = $post_details['content'];
375
+ $new_post['content']['title'] = get_the_title( $post_details['post_id'] );
376
  $new_post['content']['submitted-url'] = $this->get_url( $post_details );
377
 
378
  $new_post['visibility']['code'] = 'anyone';
includes/class-rop.php CHANGED
@@ -68,7 +68,7 @@ class Rop {
68
  public function __construct() {
69
 
70
  $this->plugin_name = 'rop';
71
- $this->version = '8.0.5';
72
 
73
  $this->load_dependencies();
74
  $this->set_locale();
68
  public function __construct() {
69
 
70
  $this->plugin_name = 'rop';
71
+ $this->version = '8.0.6';
72
 
73
  $this->load_dependencies();
74
  $this->set_locale();
languages/tweet-old-post.pot CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Revive Old Posts (Former Tweet Old Post) 8.0.5\n"
6
  "Report-Msgid-Bugs-To: https://github.com/Codeinwp/tweet-old-post/issues\n"
7
- "POT-Creation-Date: 2018-05-04 09:15:16+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
4
  msgstr ""
5
  "Project-Id-Version: Revive Old Posts (Former Tweet Old Post) 8.0.5\n"
6
  "Report-Msgid-Bugs-To: https://github.com/Codeinwp/tweet-old-post/issues\n"
7
+ "POT-Creation-Date: 2018-05-08 10:01:55+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
readme.md CHANGED
@@ -131,6 +131,15 @@ http://revive.social/plugins/revive-old-post
131
 
132
 
133
  ## Changelog ##
 
 
 
 
 
 
 
 
 
134
  ### 8.0.5 - 2018-05-04 ###
135
 
136
  * Fix issue with common hashtags using post content.
131
 
132
 
133
  ## Changelog ##
134
+ ### 8.0.6 - 2018-05-08 ###
135
+
136
+ * Fix hashtags issue when using post content as a source.
137
+ * Fix LinkedIn broken link when no image is used.
138
+ * Fix issue with sharing when multiple accounts are used with different custom schedules.
139
+ * Adds link only in the preview, remove from facebook message content.
140
+ * Adds limit for the number of logs.
141
+
142
+
143
  ### 8.0.5 - 2018-05-04 ###
144
 
145
  * Fix issue with common hashtags using post content.
readme.txt CHANGED
@@ -131,6 +131,15 @@ http://revive.social/plugins/revive-old-post
131
 
132
 
133
  == Changelog ==
 
 
 
 
 
 
 
 
 
134
  = 8.0.5 - 2018-05-04 =
135
 
136
  * Fix issue with common hashtags using post content.
131
 
132
 
133
  == Changelog ==
134
+ = 8.0.6 - 2018-05-08 =
135
+
136
+ * Fix hashtags issue when using post content as a source.
137
+ * Fix LinkedIn broken link when no image is used.
138
+ * Fix issue with sharing when multiple accounts are used with different custom schedules.
139
+ * Adds link only in the preview, remove from facebook message content.
140
+ * Adds limit for the number of logs.
141
+
142
+
143
  = 8.0.5 - 2018-05-04 =
144
 
145
  * Fix issue with common hashtags using post content.
themeisle-hash.json CHANGED
@@ -1 +1 @@
1
- {"class-rop-autoloader.php":"7bfbb1554230d0ace777adb2e42bebeb","index.php":"39ab8276fb0e4bd3fcab3270822c5977","tweet-old-post.php":"440387679a752c0e86d640adfe7b49f3","uninstall.php":"9bd7c020209e4a73f7f541d958afac43"}
1
+ {"class-rop-autoloader.php":"7bfbb1554230d0ace777adb2e42bebeb","index.php":"39ab8276fb0e4bd3fcab3270822c5977","tweet-old-post.php":"d2d159cbcc7b2e37c5d1c80a353430ac","uninstall.php":"9bd7c020209e4a73f7f541d958afac43"}
tweet-old-post.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: Revive Old Posts (Former Tweet Old Post)
17
  * Plugin URI: https://revive.social/
18
  * 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!
19
- * Version: 8.0.5
20
  * Author: revive.social
21
  * Author URI: https://revive.social/
22
  * Requires at least: 3.5
@@ -68,7 +68,7 @@ register_deactivation_hook( __FILE__, 'deactivate_rop' );
68
  function run_rop() {
69
 
70
  define( 'ROP_PRO_URL', 'http://revive.social/plugins/revive-old-post/' );
71
- define( 'ROP_LITE_VERSION', '8.0.5' );
72
  define( 'ROP_LITE_BASE_FILE', __FILE__ );
73
  define( 'ROP_DEBUG', false );
74
  define( 'ROP_LITE_PATH', plugin_dir_path( __FILE__ ) );
16
  * Plugin Name: Revive Old Posts (Former Tweet Old Post)
17
  * Plugin URI: https://revive.social/
18
  * 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!
19
+ * Version: 8.0.6
20
  * Author: revive.social
21
  * Author URI: https://revive.social/
22
  * Requires at least: 3.5
68
  function run_rop() {
69
 
70
  define( 'ROP_PRO_URL', 'http://revive.social/plugins/revive-old-post/' );
71
+ define( 'ROP_LITE_VERSION', '8.0.6' );
72
  define( 'ROP_LITE_BASE_FILE', __FILE__ );
73
  define( 'ROP_DEBUG', false );
74
  define( 'ROP_LITE_PATH', plugin_dir_path( __FILE__ ) );
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit144f119861b88b7619028208fecec0d7::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit82d9c7dc55c32774d6dff6ebd135c720::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit144f119861b88b7619028208fecec0d7
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit144f119861b88b7619028208fecec0d7
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit144f119861b88b7619028208fecec0d7', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit144f119861b88b7619028208fecec0d7', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInit144f119861b88b7619028208fecec0d7
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
- composerRequire144f119861b88b7619028208fecec0d7($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
- function composerRequire144f119861b88b7619028208fecec0d7($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit82d9c7dc55c32774d6dff6ebd135c720
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit82d9c7dc55c32774d6dff6ebd135c720', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit82d9c7dc55c32774d6dff6ebd135c720', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
+ composerRequire82d9c7dc55c32774d6dff6ebd135c720($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
+ function composerRequire82d9c7dc55c32774d6dff6ebd135c720($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;