Version Description
Download this release
Release Info
Developer | codeinwp |
Plugin | Revive Old Posts – Auto Post to Social Media |
Version | 6.7.4 |
Comparing to | |
See all releases |
Code changes from version 6.7.2 to 6.7.4
- css/style.css +27 -3
- inc/core.php +92 -20
- inc/view.php +6 -4
- js/master.js +27 -3
- readme.txt +17 -0
- tweet-old-post.php +10 -3
css/style.css
CHANGED
@@ -37,7 +37,7 @@ html[xmlns] .clearfix { display: block;}
|
|
37 |
|
38 |
/* Announcement */
|
39 |
.cwp_top_wrapper .announcement { width: 100%; background: url("../img/reviewgine_announcement.png") no-repeat left -10px top -45px, #f16848; margin-top: 20px;}
|
40 |
-
.cwp_top_wrapper .announcement h2 { float: left; font-family: "Helvetica Neue", HelveticaNeue, sans-serif; color:#fff; font-weight: 100; font-size: 17px; line-height: 1; padding-left: 180px; }
|
41 |
.cwp_top_wrapper .announcement h2 b { font-weight: bold; }
|
42 |
.cwp_top_wrapper .announcement .show-me { float: right; background:#fff; border-radius: 5px; font-family: "Helvetica Neue", HelveticaNeue, sans-serif; color:#5c5c5c; text-decoration: none; text-transform: uppercase;padding: 7px 15px; margin-top: 9px; margin-right: 20px; -webkit-transition: all 0.3s ease-in-out;-moz-transition: all 0.3s ease-in-out;-o-transition: all 0.3s ease-in-out;transition: all 0.3s ease-in-out; line-height: 1;}
|
43 |
.cwp_top_wrapper .announcement .show-me:hover { cursor: pointer; opacity: 0.8; }
|
@@ -88,7 +88,7 @@ html[xmlns] .clearfix { display: block;}
|
|
88 |
/* Tweet Now Button Style */
|
89 |
.cwp_top_wrapper .cwp_top_container .cwp_top_footer .tweet-now { background:#52c4ef; text-decoration: none; border-radius: 3px; display: block; height: 30px; border-radius: 3px; font-family: "Open Sans", sans-serif; color:#fff; text-transform: uppercase; font-weight: bold; line-height: 2.3; padding-right: 10px; display:inline-block; margin-top: 14px; margin-right: 5px; }
|
90 |
.cwp_top_wrapper .cwp_top_container .cwp_top_footer .tweet-now span { background:url("../img/twitter_icon.png") no-repeat center center, #3eaed8; width: 30px; height: 30px; display: block; float: left; border-radius: 3px 0px 0px 3px; margin-right: 10px; }
|
91 |
-
|
92 |
/* Stop Tweet Button Styles */
|
93 |
.cwp_top_wrapper .cwp_top_container .cwp_top_footer .stop-tweet-old-post { background:#f9866b; text-decoration: none; border-radius: 3px; display: block; height: 30px; border-radius: 3px; font-family: "Open Sans", sans-serif; color:#fff; text-transform: uppercase; font-weight: bold; line-height: 2.3; padding-right: 10px; display:inline-block; margin-top: 14px; margin-right: 5px; }
|
94 |
.cwp_top_wrapper .cwp_top_container .cwp_top_footer .stop-tweet-old-post span { background:url("../img/twitter_icon.png") no-repeat center center, #f16848; width: 30px; height: 30px; display: block; float: left; border-radius: 3px 0px 0px 3px; margin-right: 10px; }
|
@@ -108,7 +108,7 @@ html[xmlns] .clearfix { display: block;}
|
|
108 |
.cwp_top_wrapper .cwp_sample_tweet_preview .cwp_sample_tweet_preview_inner { background:#fff; width: 60%; margin: 0 auto; margin-top: 759px; padding: 20px; border-radius: 5px;box-shadow: 0px 5px 5px rgba(0,0,0,0.1); }
|
109 |
.cwp_top_wrapper .cwp_sample_tweet_preview .cwp_sample_tweet_preview_inner .sample_tweet { min-height:60px; display: block; width: 100%; border: 1px solid #e8e8e8; padding: 10px; border-radius: 5px; font-family: "Helvetica Neue", HelveticaNeue, sans-serif; font-size: 14px;}
|
110 |
.cwp_top_wrapper .cwp_sample_tweet_preview .cwp_sample_tweet_preview_inner .sample_tweet a { text-decoration: none; }
|
111 |
-
.cwp_top_wrapper .cwp_sample_tweet_preview .cwp_sample_tweet_preview_inner button { display: block; margin
|
112 |
.cwp_top_wrapper .cwp_sample_tweet_preview .cwp_sample_tweet_preview_inner button:hover { cursor: pointer; }
|
113 |
.top_preview {
|
114 |
width: 40px;
|
@@ -128,4 +128,28 @@ float: left;}
|
|
128 |
width: 99%;
|
129 |
float: left;
|
130 |
border-right: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
}
|
37 |
|
38 |
/* Announcement */
|
39 |
.cwp_top_wrapper .announcement { width: 100%; background: url("../img/reviewgine_announcement.png") no-repeat left -10px top -45px, #f16848; margin-top: 20px;}
|
40 |
+
.cwp_top_wrapper .announcement h2 { width:85%; float: left; font-family: "Helvetica Neue", HelveticaNeue, sans-serif; color:#fff; font-weight: 100; font-size: 17px; line-height: 1; padding-left: 180px; }
|
41 |
.cwp_top_wrapper .announcement h2 b { font-weight: bold; }
|
42 |
.cwp_top_wrapper .announcement .show-me { float: right; background:#fff; border-radius: 5px; font-family: "Helvetica Neue", HelveticaNeue, sans-serif; color:#5c5c5c; text-decoration: none; text-transform: uppercase;padding: 7px 15px; margin-top: 9px; margin-right: 20px; -webkit-transition: all 0.3s ease-in-out;-moz-transition: all 0.3s ease-in-out;-o-transition: all 0.3s ease-in-out;transition: all 0.3s ease-in-out; line-height: 1;}
|
43 |
.cwp_top_wrapper .announcement .show-me:hover { cursor: pointer; opacity: 0.8; }
|
88 |
/* Tweet Now Button Style */
|
89 |
.cwp_top_wrapper .cwp_top_container .cwp_top_footer .tweet-now { background:#52c4ef; text-decoration: none; border-radius: 3px; display: block; height: 30px; border-radius: 3px; font-family: "Open Sans", sans-serif; color:#fff; text-transform: uppercase; font-weight: bold; line-height: 2.3; padding-right: 10px; display:inline-block; margin-top: 14px; margin-right: 5px; }
|
90 |
.cwp_top_wrapper .cwp_top_container .cwp_top_footer .tweet-now span { background:url("../img/twitter_icon.png") no-repeat center center, #3eaed8; width: 30px; height: 30px; display: block; float: left; border-radius: 3px 0px 0px 3px; margin-right: 10px; }
|
91 |
+
.top_close_popup {margin-left:30%;float:left;}
|
92 |
/* Stop Tweet Button Styles */
|
93 |
.cwp_top_wrapper .cwp_top_container .cwp_top_footer .stop-tweet-old-post { background:#f9866b; text-decoration: none; border-radius: 3px; display: block; height: 30px; border-radius: 3px; font-family: "Open Sans", sans-serif; color:#fff; text-transform: uppercase; font-weight: bold; line-height: 2.3; padding-right: 10px; display:inline-block; margin-top: 14px; margin-right: 5px; }
|
94 |
.cwp_top_wrapper .cwp_top_container .cwp_top_footer .stop-tweet-old-post span { background:url("../img/twitter_icon.png") no-repeat center center, #f16848; width: 30px; height: 30px; display: block; float: left; border-radius: 3px 0px 0px 3px; margin-right: 10px; }
|
108 |
.cwp_top_wrapper .cwp_sample_tweet_preview .cwp_sample_tweet_preview_inner { background:#fff; width: 60%; margin: 0 auto; margin-top: 759px; padding: 20px; border-radius: 5px;box-shadow: 0px 5px 5px rgba(0,0,0,0.1); }
|
109 |
.cwp_top_wrapper .cwp_sample_tweet_preview .cwp_sample_tweet_preview_inner .sample_tweet { min-height:60px; display: block; width: 100%; border: 1px solid #e8e8e8; padding: 10px; border-radius: 5px; font-family: "Helvetica Neue", HelveticaNeue, sans-serif; font-size: 14px;}
|
110 |
.cwp_top_wrapper .cwp_sample_tweet_preview .cwp_sample_tweet_preview_inner .sample_tweet a { text-decoration: none; }
|
111 |
+
.cwp_top_wrapper .cwp_sample_tweet_preview .cwp_sample_tweet_preview_inner button { display: block; margin-top: 17px; background:#52c4ef; border: none; border-radius: 3px; padding: 5px 10px; color:#fff; font-family: "Open Sans", sans-serif; color:#fff; text-transform: uppercase; font-weight: bold; }
|
112 |
.cwp_top_wrapper .cwp_sample_tweet_preview .cwp_sample_tweet_preview_inner button:hover { cursor: pointer; }
|
113 |
.top_preview {
|
114 |
width: 40px;
|
128 |
width: 99%;
|
129 |
float: left;
|
130 |
border-right: none;
|
131 |
+
}
|
132 |
+
|
133 |
+
.twptop_opt_post_type {
|
134 |
+
display: none;
|
135 |
+
}
|
136 |
+
|
137 |
+
@media all and (max-width:1280px) {
|
138 |
+
.cwp_top_wrapper {
|
139 |
+
width:100%;
|
140 |
+
}
|
141 |
+
.cwp_top_wrapper .cwp_top_container form {
|
142 |
+
width:100%;
|
143 |
+
border-right: none;
|
144 |
+
}
|
145 |
+
.cwp_top_wrapper .cwp_top_container .sidebar {
|
146 |
+
display: none;
|
147 |
+
}
|
148 |
+
|
149 |
+
|
150 |
+
}
|
151 |
+
@media all and (max-width:970px) {
|
152 |
+
.slogan {
|
153 |
+
display: none;
|
154 |
+
}
|
155 |
}
|
inc/core.php
CHANGED
@@ -14,6 +14,7 @@ if (!class_exists('CWP_TOP_Core')) {
|
|
14 |
|
15 |
// Consumer key, Consumer Secret key, oAuth Callback Key
|
16 |
public $consumer;
|
|
|
17 |
public $consumerSecret;
|
18 |
public $oAuthCallback;
|
19 |
public $bitly_key;
|
@@ -120,6 +121,16 @@ if (!class_exists('CWP_TOP_Core')) {
|
|
120 |
|
121 |
}
|
122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
public function getTweetsFromDB()
|
124 |
{
|
125 |
// Global WordPress $wpdb object.
|
@@ -202,10 +213,14 @@ WHERE {$wpdb->prefix}term_taxonomy.taxonomy = 'category'
|
|
202 |
return true;
|
203 |
}
|
204 |
|
205 |
-
public function tweetOldPost()
|
206 |
|
207 |
{
|
208 |
$returnedPost = $this->getTweetsFromDB();
|
|
|
|
|
|
|
|
|
209 |
|
210 |
|
211 |
$k = 0; // Iterator
|
@@ -222,10 +237,11 @@ WHERE {$wpdb->prefix}term_taxonomy.taxonomy = 'category'
|
|
222 |
|
223 |
if (get_option('top_opt_tweet_multiple_times')=="on") $isNotAlreadyTweeted = true;
|
224 |
|
225 |
-
if($isNotAlreadyTweeted) {
|
226 |
|
227 |
// Foreach returned post
|
228 |
-
|
|
|
229 |
// Generate a tweet from it based on user settings.
|
230 |
$finalTweet = $this->generateTweetFromPost($post);
|
231 |
// Tweet the post
|
@@ -254,9 +270,12 @@ WHERE {$wpdb->prefix}term_taxonomy.taxonomy = 'category'
|
|
254 |
update_option("top_opt_already_tweeted_posts", $tweetedPosts);
|
255 |
// Increase
|
256 |
$k = $k + 1;
|
257 |
-
}
|
258 |
} else {
|
259 |
-
|
|
|
|
|
|
|
260 |
}
|
261 |
}
|
262 |
|
@@ -271,11 +290,15 @@ WHERE {$wpdb->prefix}term_taxonomy.taxonomy = 'category'
|
|
271 |
else if (is_object($notice) && $notice->text) {
|
272 |
echo "Congrats! The following tweet was posted successfully: '".$notice->text."' at ".$notice->created_at;
|
273 |
} else if ($notice!="") {
|
274 |
-
echo "Error for your last tweet was :".$notice;
|
275 |
}
|
276 |
die();
|
277 |
}
|
278 |
|
|
|
|
|
|
|
|
|
279 |
public function viewSampleTweet()
|
280 |
{
|
281 |
|
@@ -283,8 +306,8 @@ WHERE {$wpdb->prefix}term_taxonomy.taxonomy = 'category'
|
|
283 |
$image="";
|
284 |
//var_dump($returnedTweets);
|
285 |
$finalTweetsPreview = $this->generateTweetFromPost($returnedTweets[0]);
|
286 |
-
$result = $finalTweetsPreview;
|
287 |
-
|
288 |
|
289 |
if (function_exists('topProImage') && get_option('top_opt_post_with_image')=="on") {
|
290 |
|
@@ -484,7 +507,7 @@ WHERE {$wpdb->prefix}term_taxonomy.taxonomy = 'category'
|
|
484 |
|
485 |
$finalTweetLength = 139 - $finalTweetLength - 5;
|
486 |
|
487 |
-
$tweetContent =
|
488 |
|
489 |
$finalTweet = $additionalTextBeginning . $tweetContent . $post_url . $newHashtags . $additionalTextEnd;
|
490 |
$finalTweet = substr($finalTweet,0, 139);
|
@@ -915,7 +938,8 @@ WHERE {$wpdb->prefix}term_taxonomy.taxonomy = 'category'
|
|
915 |
'cwp_topnew_active_status' => 'false',
|
916 |
'cwp_topnew_notice' => '',
|
917 |
'top_opt_excluded_post' => '',
|
918 |
-
'top_opt_tweet-multiple-times' => 'off'
|
|
|
919 |
);
|
920 |
|
921 |
foreach ($defaultOptions as $option => $defaultValue) {
|
@@ -960,7 +984,7 @@ WHERE {$wpdb->prefix}term_taxonomy.taxonomy = 'category'
|
|
960 |
case 'checkbox':
|
961 |
if ($field['option']=='top_opt_post_with_image'&& !function_exists('topProImage')) {
|
962 |
$disabled = "disabled='disabled'";
|
963 |
-
$pro = "This is only available in the PRO
|
964 |
}
|
965 |
print "<input id='".$field['option']."' type='checkbox' ".$disabled." name='".$field['option']."'";
|
966 |
if($field['option_value'] == 'on') { echo "checked=checked"; }
|
@@ -1022,15 +1046,6 @@ WHERE {$wpdb->prefix}term_taxonomy.taxonomy = 'category'
|
|
1022 |
|
1023 |
}
|
1024 |
|
1025 |
-
public function top_plugin_action_links($links, $file) {
|
1026 |
-
|
1027 |
-
$mylinks = array(
|
1028 |
-
'<a href="' . admin_url( 'admin.php?page=TweetOldPost' ) . '">Settings</a>',
|
1029 |
-
);
|
1030 |
-
return array_merge( $links, $mylinks );
|
1031 |
-
|
1032 |
-
|
1033 |
-
}
|
1034 |
|
1035 |
public function getTime() {
|
1036 |
|
@@ -1039,10 +1054,61 @@ WHERE {$wpdb->prefix}term_taxonomy.taxonomy = 'category'
|
|
1039 |
die();
|
1040 |
}
|
1041 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1042 |
public function loadAllHooks()
|
1043 |
{
|
1044 |
// loading all actions and filters
|
1045 |
add_action('admin_menu', array($this, 'addAdminMenuPage'));
|
|
|
1046 |
add_action('admin_enqueue_scripts', array($this, 'loadAllScriptsAndStyles'));
|
1047 |
|
1048 |
// Update all options ajax action.
|
@@ -1073,6 +1139,10 @@ WHERE {$wpdb->prefix}term_taxonomy.taxonomy = 'category'
|
|
1073 |
add_action('wp_ajax_nopriv_view_sample_tweet_action', array($this, 'viewSampleTweet'));
|
1074 |
add_action('wp_ajax_view_sample_tweet_action', array($this, 'viewSampleTweet'));
|
1075 |
|
|
|
|
|
|
|
|
|
1076 |
add_action('wp_ajax_nopriv_gettime_action', array($this, 'getTime'));
|
1077 |
add_action('wp_ajax_gettime_action', array($this, 'getTime'));
|
1078 |
|
@@ -1094,6 +1164,8 @@ WHERE {$wpdb->prefix}term_taxonomy.taxonomy = 'category'
|
|
1094 |
// Filter to add new custom schedule based on user input
|
1095 |
add_filter('cron_schedules', array($this, 'createCustomSchedule'));
|
1096 |
|
|
|
|
|
1097 |
add_action('cwp_top_tweet_cron', array($this, 'tweetOldPost'));
|
1098 |
|
1099 |
}
|
14 |
|
15 |
// Consumer key, Consumer Secret key, oAuth Callback Key
|
16 |
public $consumer;
|
17 |
+
public $lastID;
|
18 |
public $consumerSecret;
|
19 |
public $oAuthCallback;
|
20 |
public $bitly_key;
|
121 |
|
122 |
}
|
123 |
|
124 |
+
public function getTweetsFromDBbyID($id)
|
125 |
+
{
|
126 |
+
global $wpdb;
|
127 |
+
$query = "
|
128 |
+
SELECT * FROM {$wpdb->prefix}posts where ID = '{$id}'";
|
129 |
+
$returnedPost = $wpdb->get_results($query);
|
130 |
+
//echo $query;
|
131 |
+
return $returnedPost;
|
132 |
+
}
|
133 |
+
|
134 |
public function getTweetsFromDB()
|
135 |
{
|
136 |
// Global WordPress $wpdb object.
|
213 |
return true;
|
214 |
}
|
215 |
|
216 |
+
public function tweetOldPost($byID = false)
|
217 |
|
218 |
{
|
219 |
$returnedPost = $this->getTweetsFromDB();
|
220 |
+
if ($byID!==false) {
|
221 |
+
|
222 |
+
$returnedPost = $this->getTweetsFromDBbyID($byID);
|
223 |
+
}
|
224 |
|
225 |
|
226 |
$k = 0; // Iterator
|
237 |
|
238 |
if (get_option('top_opt_tweet_multiple_times')=="on") $isNotAlreadyTweeted = true;
|
239 |
|
240 |
+
if($isNotAlreadyTweeted && ($k<count($returnedPost))) {
|
241 |
|
242 |
// Foreach returned post
|
243 |
+
$post = $returnedPost[$k];
|
244 |
+
//foreach ($returnedPost as $post) {
|
245 |
// Generate a tweet from it based on user settings.
|
246 |
$finalTweet = $this->generateTweetFromPost($post);
|
247 |
// Tweet the post
|
270 |
update_option("top_opt_already_tweeted_posts", $tweetedPosts);
|
271 |
// Increase
|
272 |
$k = $k + 1;
|
273 |
+
//}
|
274 |
} else {
|
275 |
+
if (count($returnedPost)!=$tweetCount)
|
276 |
+
update_option('cwp_topnew_notice', 'You have tried to post more tweets that they are available, try to include more categories or increase the date range');
|
277 |
+
else
|
278 |
+
update_option('cwp_topnew_notice', 'Tweet was already tweeted, if you want to tweet your old tweets more than once, select "Tweet old posts more than once" option');
|
279 |
}
|
280 |
}
|
281 |
|
290 |
else if (is_object($notice) && $notice->text) {
|
291 |
echo "Congrats! The following tweet was posted successfully: '".$notice->text."' at ".$notice->created_at;
|
292 |
} else if ($notice!="") {
|
293 |
+
echo "Error for your last tweet was : ".$notice;
|
294 |
}
|
295 |
die();
|
296 |
}
|
297 |
|
298 |
+
public function tweetNow() {
|
299 |
+
$this->tweetOldPost(get_option('top_lastID'));
|
300 |
+
}
|
301 |
+
|
302 |
public function viewSampleTweet()
|
303 |
{
|
304 |
|
306 |
$image="";
|
307 |
//var_dump($returnedTweets);
|
308 |
$finalTweetsPreview = $this->generateTweetFromPost($returnedTweets[0]);
|
309 |
+
$result = $finalTweetsPreview;
|
310 |
+
update_option( 'top_lastID', $returnedTweets[0]->ID);
|
311 |
|
312 |
if (function_exists('topProImage') && get_option('top_opt_post_with_image')=="on") {
|
313 |
|
507 |
|
508 |
$finalTweetLength = 139 - $finalTweetLength - 5;
|
509 |
|
510 |
+
$tweetContent = mb_substr($tweetContent,0, $finalTweetLength) . " ";
|
511 |
|
512 |
$finalTweet = $additionalTextBeginning . $tweetContent . $post_url . $newHashtags . $additionalTextEnd;
|
513 |
$finalTweet = substr($finalTweet,0, 139);
|
938 |
'cwp_topnew_active_status' => 'false',
|
939 |
'cwp_topnew_notice' => '',
|
940 |
'top_opt_excluded_post' => '',
|
941 |
+
'top_opt_tweet-multiple-times' => 'off',
|
942 |
+
'cwp_top_logged_in_users' => ''
|
943 |
);
|
944 |
|
945 |
foreach ($defaultOptions as $option => $defaultValue) {
|
984 |
case 'checkbox':
|
985 |
if ($field['option']=='top_opt_post_with_image'&& !function_exists('topProImage')) {
|
986 |
$disabled = "disabled='disabled'";
|
987 |
+
$pro = "This is only available in the <a href='http://themeisle.com/plugins/tweet-old-post-pro/?utm_source=imagepro&utm_medium=link&utm_campaign=top&upgrade=true' target='_blank'>PRO version</a>";
|
988 |
}
|
989 |
print "<input id='".$field['option']."' type='checkbox' ".$disabled." name='".$field['option']."'";
|
990 |
if($field['option_value'] == 'on') { echo "checked=checked"; }
|
1046 |
|
1047 |
}
|
1048 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1049 |
|
1050 |
public function getTime() {
|
1051 |
|
1054 |
die();
|
1055 |
}
|
1056 |
|
1057 |
+
function top_plugin_action_links($links, $file) {
|
1058 |
+
|
1059 |
+
if ($file == PLUGINBASENAME) {
|
1060 |
+
// The "page" query string value must be equal to the slug
|
1061 |
+
// of the Settings admin page we defined earlier, which in
|
1062 |
+
// this case equals "myplugin-settings".
|
1063 |
+
$settings_link = '<a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=TweetOldPost">Settings</a>';
|
1064 |
+
array_unshift($links, $settings_link);
|
1065 |
+
}
|
1066 |
+
|
1067 |
+
return $links;
|
1068 |
+
}
|
1069 |
+
|
1070 |
+
public function fixCron() {
|
1071 |
+
update_option('cwp_topnew_notice','');
|
1072 |
+
|
1073 |
+
if ( defined( 'ALTERNATE_WP_CRON' ) ) {
|
1074 |
+
|
1075 |
+
//delete_option( 'hmbkp_wp_cron_test_failed' );
|
1076 |
+
|
1077 |
+
//echo 1;
|
1078 |
+
|
1079 |
+
return 0;
|
1080 |
+
|
1081 |
+
}
|
1082 |
+
else {
|
1083 |
+
|
1084 |
+
$response = wp_remote_head( site_url( 'wp-cron.php' ), array( 'timeout' => 30 ) );
|
1085 |
+
|
1086 |
+
if ( is_wp_error( $response ) ) {
|
1087 |
+
|
1088 |
+
update_option('cwp_topnew_notice', "Looks like there is an issue with your WP Cron and Tweet Old Post relies on wp-cron to schedule tweets, see the <a href='http://wordpress.org/plugins/tweet-old-post/faq/'>FAQ</a> for more details!");
|
1089 |
+
|
1090 |
+
} elseif ( wp_remote_retrieve_response_code( $response ) != 200 ) {
|
1091 |
+
|
1092 |
+
update_option('cwp_topnew_notice', "Looks like there is an issue with your WP Cron and Tweet Old Post relies on wp-cron to schedule tweets, see the <a href='http://wordpress.org/plugins/tweet-old-post/faq/'>FAQ</a> for more details!");
|
1093 |
+
|
1094 |
+
}
|
1095 |
+
|
1096 |
+
|
1097 |
+
$timestamp = wp_next_scheduled( 'cwp_top_tweet_cron' );
|
1098 |
+
$timenow = current_time('timestamp',1);
|
1099 |
+
|
1100 |
+
if ($this->pluginStatus == 'true' && $timenow > $timestamp) {
|
1101 |
+
update_option('cwp_topnew_notice', "Looks like there is an issue with your WP Cron, read more <a href='http://wordpress.org/plugins/tweet-old-post/faq/'>here</a>");
|
1102 |
+
|
1103 |
+
}
|
1104 |
+
}
|
1105 |
+
}
|
1106 |
+
|
1107 |
public function loadAllHooks()
|
1108 |
{
|
1109 |
// loading all actions and filters
|
1110 |
add_action('admin_menu', array($this, 'addAdminMenuPage'));
|
1111 |
+
|
1112 |
add_action('admin_enqueue_scripts', array($this, 'loadAllScriptsAndStyles'));
|
1113 |
|
1114 |
// Update all options ajax action.
|
1139 |
add_action('wp_ajax_nopriv_view_sample_tweet_action', array($this, 'viewSampleTweet'));
|
1140 |
add_action('wp_ajax_view_sample_tweet_action', array($this, 'viewSampleTweet'));
|
1141 |
|
1142 |
+
// Tweet Old Post tweet now action.
|
1143 |
+
add_action('wp_ajax_nopriv_tweet_now_action', array($this, 'tweetNow'));
|
1144 |
+
add_action('wp_ajax_tweet_now_action', array($this, 'tweetNow'));
|
1145 |
+
|
1146 |
add_action('wp_ajax_nopriv_gettime_action', array($this, 'getTime'));
|
1147 |
add_action('wp_ajax_gettime_action', array($this, 'getTime'));
|
1148 |
|
1164 |
// Filter to add new custom schedule based on user input
|
1165 |
add_filter('cron_schedules', array($this, 'createCustomSchedule'));
|
1166 |
|
1167 |
+
add_filter('plugin_action_links',array($this,'top_plugin_action_links'), 10, 2);
|
1168 |
+
|
1169 |
add_action('cwp_top_tweet_cron', array($this, 'tweetOldPost'));
|
1170 |
|
1171 |
}
|
inc/view.php
CHANGED
@@ -38,7 +38,8 @@
|
|
38 |
</p>
|
39 |
<?php } ?>
|
40 |
<p class='inactive'>
|
41 |
-
|
|
|
42 |
</p>
|
43 |
|
44 |
</div><!-- end .cwp_top_status -->
|
@@ -72,7 +73,7 @@
|
|
72 |
|
73 |
|
74 |
<?php foreach ($cwp_top_fields as $field) { ?>
|
75 |
-
<fieldset class="option">
|
76 |
<div class="left">
|
77 |
<label for="<?php echo $field['option']; ?>"> <?php echo $field['name'] ?> </label>
|
78 |
<span class="description"> <?php echo $field['description']; ?> </span>
|
@@ -90,7 +91,7 @@
|
|
90 |
|
91 |
<div class="cwp_top_footer">
|
92 |
<a class="reset-settings" href="#"><span></span> <?php _e("Reset", CWP_TEXTDOMAIN); ?></a>
|
93 |
-
<a class="update-options" href="#"><span></span><?php _e("Save
|
94 |
<a class="tweet-now" href="#"><span></span> <?php _e("Start Tweeting", CWP_TEXTDOMAIN); ?></a>
|
95 |
<a class="stop-tweet-old-post" href="#"><span></span> <?php _e("Stop Tweeting", CWP_TEXTDOMAIN); ?></a>
|
96 |
<a class="see-sample-tweet" href="#"><span></span> <?php _e("See Sample Tweet", CWP_TEXTDOMAIN); ?></a>
|
@@ -111,7 +112,8 @@
|
|
111 |
<div class="cwp_sample_tweet_preview_inner">
|
112 |
<h2>Sample Tweet Preview</h2>
|
113 |
<span class="sample_tweet">Lorem ipsum dolor sit amet consectetutem! <a href="#">Lorem ipsum</a></span>
|
114 |
-
<button>
|
|
|
115 |
</div><!-- end .cwp_sample_tweet_preview_inner -->
|
116 |
</div><!-- end .cwp_sample_tweet_preview -->
|
117 |
</div><!-- end .cwp_top_wrapper -->
|
38 |
</p>
|
39 |
<?php } ?>
|
40 |
<p class='inactive'>
|
41 |
+
|
42 |
+
<?php _e("Once you click start tweet a tweet will be sent in 15 sec, also here you can see the error message if is any.", CWP_TEXTDOMAIN); $this->fixCron(); ?>
|
43 |
</p>
|
44 |
|
45 |
</div><!-- end .cwp_top_status -->
|
73 |
|
74 |
|
75 |
<?php foreach ($cwp_top_fields as $field) { ?>
|
76 |
+
<fieldset class="option twp<?php echo $field['option']; ?>" >
|
77 |
<div class="left">
|
78 |
<label for="<?php echo $field['option']; ?>"> <?php echo $field['name'] ?> </label>
|
79 |
<span class="description"> <?php echo $field['description']; ?> </span>
|
91 |
|
92 |
<div class="cwp_top_footer">
|
93 |
<a class="reset-settings" href="#"><span></span> <?php _e("Reset", CWP_TEXTDOMAIN); ?></a>
|
94 |
+
<a class="update-options" href="#"><span></span><?php _e("Save", CWP_TEXTDOMAIN); ?></a>
|
95 |
<a class="tweet-now" href="#"><span></span> <?php _e("Start Tweeting", CWP_TEXTDOMAIN); ?></a>
|
96 |
<a class="stop-tweet-old-post" href="#"><span></span> <?php _e("Stop Tweeting", CWP_TEXTDOMAIN); ?></a>
|
97 |
<a class="see-sample-tweet" href="#"><span></span> <?php _e("See Sample Tweet", CWP_TEXTDOMAIN); ?></a>
|
112 |
<div class="cwp_sample_tweet_preview_inner">
|
113 |
<h2>Sample Tweet Preview</h2>
|
114 |
<span class="sample_tweet">Lorem ipsum dolor sit amet consectetutem! <a href="#">Lorem ipsum</a></span>
|
115 |
+
<button class="top_close_popup">Close preview</button>
|
116 |
+
<button class="tweetitnow">Tweet Now</button>
|
117 |
</div><!-- end .cwp_sample_tweet_preview_inner -->
|
118 |
</div><!-- end .cwp_sample_tweet_preview -->
|
119 |
</div><!-- end .cwp_top_wrapper -->
|
js/master.js
CHANGED
@@ -210,11 +210,11 @@ jQuery(document).ready(function(){
|
|
210 |
if(response !== '') {
|
211 |
if (response.substring(0,5)=="Error") {
|
212 |
jQuery(".cwp_top_status p:nth-child(2)").css( "color", "red" );
|
213 |
-
jQuery(".cwp_top_status p:nth-child(2)").
|
214 |
} else {
|
215 |
|
216 |
//jQuery(".cwp_top_status p:nth-child(2)").addClass("active").removeClass("inactive");
|
217 |
-
jQuery(".cwp_top_status p:nth-child(2)").
|
218 |
jQuery(".cwp_top_status p:nth-child(2)").css( "color", "#218618" );
|
219 |
|
220 |
}
|
@@ -284,10 +284,34 @@ jQuery(document).ready(function(){
|
|
284 |
//location.reload();
|
285 |
});
|
286 |
|
287 |
-
jQuery(".cwp_top_wrapper .cwp_sample_tweet_preview .cwp_sample_tweet_preview_inner button").click(function(e){
|
288 |
jQuery(this).parent().parent().fadeOut().removeClass("active");
|
289 |
});
|
290 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
// Transform the date into a countdown.
|
292 |
var nextTweetDate = jQuery(".cwp_top_container .nextTweet").html();
|
293 |
jQuery(".cwp_top_container .nextTweet").html('');
|
210 |
if(response !== '') {
|
211 |
if (response.substring(0,5)=="Error") {
|
212 |
jQuery(".cwp_top_status p:nth-child(2)").css( "color", "red" );
|
213 |
+
jQuery(".cwp_top_status p:nth-child(2)").html(response);
|
214 |
} else {
|
215 |
|
216 |
//jQuery(".cwp_top_status p:nth-child(2)").addClass("active").removeClass("inactive");
|
217 |
+
jQuery(".cwp_top_status p:nth-child(2)").html(response);
|
218 |
jQuery(".cwp_top_status p:nth-child(2)").css( "color", "#218618" );
|
219 |
|
220 |
}
|
284 |
//location.reload();
|
285 |
});
|
286 |
|
287 |
+
jQuery(".cwp_top_wrapper .cwp_sample_tweet_preview .cwp_sample_tweet_preview_inner button.top_close_popup").click(function(e){
|
288 |
jQuery(this).parent().parent().fadeOut().removeClass("active");
|
289 |
});
|
290 |
|
291 |
+
jQuery(".cwp_top_wrapper .cwp_sample_tweet_preview .cwp_sample_tweet_preview_inner button.tweetitnow").click(function(e){
|
292 |
+
e.preventDefault();
|
293 |
+
startAjaxIntro();
|
294 |
+
|
295 |
+
jQuery.ajax({
|
296 |
+
type: "POST",
|
297 |
+
url: cwp_top_ajaxload.ajaxurl,
|
298 |
+
data: {
|
299 |
+
action: "tweet_now_action"
|
300 |
+
},
|
301 |
+
success: function(response) {
|
302 |
+
endAjaxIntro();
|
303 |
+
jQuery(".cwp_top_wrapper .cwp_sample_tweet_preview").fadeOut().removeClass("active");
|
304 |
+
jQuery('html, body').animate({
|
305 |
+
scrollTop: jQuery(".cwp_top_wrapper .cwp_top_status").offset().top+150
|
306 |
+
}, 2000);
|
307 |
+
},
|
308 |
+
error: function(MLHttpRequest, textStatus, errorThrown) {
|
309 |
+
console.log("There was an error: "+errorThrown);
|
310 |
+
endAjaxIntro();
|
311 |
+
}
|
312 |
+
});
|
313 |
+
});
|
314 |
+
|
315 |
// Transform the date into a countdown.
|
316 |
var nextTweetDate = jQuery(".cwp_top_container .nextTweet").html();
|
317 |
jQuery(".cwp_top_container .nextTweet").html('');
|
readme.txt
CHANGED
@@ -148,6 +148,19 @@ http://themeisle.com/contact/
|
|
148 |
|
149 |
- Unfortunately wp_cron function isn't perfect, it trigger just when somebody visit your site, so you nobody visit your site in 3 hours, TOP won't trigger
|
150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
|
152 |
**If new version doesn't works**
|
153 |
|
@@ -183,6 +196,10 @@ http://themeisle.com/plugins/tweet-old-post-lite/
|
|
183 |
|
184 |
== Changelog ==
|
185 |
|
|
|
|
|
|
|
|
|
186 |
**New in v6.6**
|
187 |
|
188 |
Fixed excluded category issue and some small others.
|
148 |
|
149 |
- Unfortunately wp_cron function isn't perfect, it trigger just when somebody visit your site, so you nobody visit your site in 3 hours, TOP won't trigger
|
150 |
|
151 |
+
**What do I do is a get the WP CRON error ?
|
152 |
+
|
153 |
+
The issue is that your wp-cron.php is not returning a 200 response when hit with a http request originating from your own server, it could be several things, most of the time it's an issue with the server / site and not with TOP.
|
154 |
+
|
155 |
+
Some things you can test are.
|
156 |
+
|
157 |
+
- Are scheduled posts working? (They use wp-cron too).
|
158 |
+
- Are you hosted on Heart Internet? (wp-cron is known not to work with them).
|
159 |
+
- If you click tweet now from sample tweet popup does it work?
|
160 |
+
- Try adding define( 'ALTERNATE_WP_CRON', true ); to your wp-config.php`, does the plugin work?
|
161 |
+
- Is your site private (I.E. is it behind some kind of authentication, maintenance plugin, .htaccess) if so wp-cron won't work until you remove it, if you are and you temporarily remove the authentication, do tweets start working?
|
162 |
+
|
163 |
+
If you have tried all these then feel free to contact support.
|
164 |
|
165 |
**If new version doesn't works**
|
166 |
|
196 |
|
197 |
== Changelog ==
|
198 |
|
199 |
+
**New in v6.7.3**
|
200 |
+
|
201 |
+
Added settings link, fixed tweet cutting and added cron debug messages
|
202 |
+
|
203 |
**New in v6.6**
|
204 |
|
205 |
Fixed excluded category issue and some small others.
|
tweet-old-post.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
# Plugin URI: http://themeisle.com/plugins/tweet-old-post-lite/
|
5 |
# Description: Wordpress plugin that helps you to keeps your old posts alive by tweeting about them and driving more traffic to them from twitter. It also helps you to promote your content. You can set time and no of tweets to post to drive more traffic.For questions, comments, or feature requests, <a href="http://themeisle.com/contact/?utm_source=plugindesc&utm_medium=announce&utm_campaign=top">contact </a> us!
|
6 |
# Author: ThemeIsle
|
7 |
-
# Version: 6.7.
|
8 |
# Author URI: http://themeisle.com/
|
9 |
# */
|
10 |
|
@@ -13,6 +13,7 @@ define("PLUGINPATH", realpath(dirname(__FILE__) ));
|
|
13 |
define("CSSFILE", plugins_url('css/style.css',__FILE__ ));
|
14 |
define("JSFILE", plugins_url('js/master.js',__FILE__ ));
|
15 |
define("JSCOUNTDOWN", plugins_url('js/countdown.js',__FILE__ ));
|
|
|
16 |
|
17 |
// Require core.
|
18 |
require_once(PLUGINPATH."/inc/core.php");
|
@@ -21,8 +22,14 @@ require_once(PLUGINPATH."/inc/exclude-posts.php");
|
|
21 |
if (!class_exists('TAV_Remote_Notification_Client')) {
|
22 |
require( PLUGINPATH.'/inc/class-remote-notification-client.php' );
|
23 |
}
|
24 |
-
|
|
|
|
|
|
|
|
|
25 |
// Clear scheduled tweets on plugin deactivation
|
26 |
register_deactivation_hook(__FILE__, array($CWP_TOP_Core, 'deactivationHook'));
|
27 |
// Reset all settings on plugin activation.
|
28 |
-
register_activation_hook(__FILE__, array($CWP_TOP_Core, 'resetAllOptions'));
|
|
|
|
4 |
# Plugin URI: http://themeisle.com/plugins/tweet-old-post-lite/
|
5 |
# Description: Wordpress plugin that helps you to keeps your old posts alive by tweeting about them and driving more traffic to them from twitter. It also helps you to promote your content. You can set time and no of tweets to post to drive more traffic.For questions, comments, or feature requests, <a href="http://themeisle.com/contact/?utm_source=plugindesc&utm_medium=announce&utm_campaign=top">contact </a> us!
|
6 |
# Author: ThemeIsle
|
7 |
+
# Version: 6.7.4
|
8 |
# Author URI: http://themeisle.com/
|
9 |
# */
|
10 |
|
13 |
define("CSSFILE", plugins_url('css/style.css',__FILE__ ));
|
14 |
define("JSFILE", plugins_url('js/master.js',__FILE__ ));
|
15 |
define("JSCOUNTDOWN", plugins_url('js/countdown.js',__FILE__ ));
|
16 |
+
define("PLUGINBASENAME", plugin_basename(__FILE__));
|
17 |
|
18 |
// Require core.
|
19 |
require_once(PLUGINPATH."/inc/core.php");
|
22 |
if (!class_exists('TAV_Remote_Notification_Client')) {
|
23 |
require( PLUGINPATH.'/inc/class-remote-notification-client.php' );
|
24 |
}
|
25 |
+
if (!function_exists('topProImage'))
|
26 |
+
$notification = new TAV_Remote_Notification_Client( 37, 'a8be784b898fa2fb', 'http://themeisle.com?post_type=notification' );
|
27 |
+
else
|
28 |
+
$notification = new TAV_Remote_Notification_Client( 38, 'b7fbcc8d0c58614a', 'http://themeisle.com?post_type=notification' );
|
29 |
+
|
30 |
// Clear scheduled tweets on plugin deactivation
|
31 |
register_deactivation_hook(__FILE__, array($CWP_TOP_Core, 'deactivationHook'));
|
32 |
// Reset all settings on plugin activation.
|
33 |
+
register_activation_hook(__FILE__, array($CWP_TOP_Core, 'resetAllOptions'));
|
34 |
+
|
35 |
+
|