WP Facebook Auto Publish - Version 1.0.1

Version Description

= Facebook Auto Publish 1.0.1 = If you had issues with default image used for auto publishing, you may apply this upgrade.

= Facebook Auto Publish 1.0 = First official launch.

Download this release

Release Info

Developer f1logic
Plugin Icon 128x128 WP Facebook Auto Publish
Version 1.0.1
Comparing to
See all releases

Code changes from version 1.0 to 1.0.1

admin/about.php CHANGED
@@ -24,9 +24,9 @@ Facebook Auto Publish automatically publishes posts from your blog to your Face
24
  <tr style="background-color: #EDEDED">
25
  <td><h2>Feature group</h2></td>
26
  <td><h2>Feature</h2></td>
27
- <td><h2>FBAP Free</h2>
28
  </td>
29
- <td><h2>SMAP Premium</h2></td>
30
  </tr>
31
  <!-- Supported Media -->
32
  <tr>
24
  <tr style="background-color: #EDEDED">
25
  <td><h2>Feature group</h2></td>
26
  <td><h2>Feature</h2></td>
27
+ <td><h2>Free</h2>
28
  </td>
29
+ <td><h2>Premium</h2></td>
30
  </tr>
31
  <!-- Supported Media -->
32
  <tr>
admin/menu.php CHANGED
@@ -1,19 +1,21 @@
1
  <?php
2
- if ( is_admin() )
3
- {
4
 
5
- add_action('admin_menu', 'xyz_fbap_menu');
6
- //add_action('admin_print_styles', 'xyz_fbap_admin_style');
7
-
8
  wp_enqueue_script('jquery');
 
9
  wp_register_script( 'xyz_notice_script', plugins_url('facebook-auto-publish/js/notice.js') );
10
  wp_enqueue_script( 'xyz_notice_script' );
11
 
12
  wp_register_style('xyz_fbap_style', plugins_url('facebook-auto-publish/admin/style.css'));
13
  wp_enqueue_style('xyz_fbap_style');
14
-
15
  }
16
 
 
 
 
 
17
  function xyz_fbap_menu()
18
  {
19
  add_menu_page('Facebook Auto Publish - Manage settings', 'Facebook Auto Publish', 'manage_options', 'facebook-auto-publish-settings', 'xyz_fbap_settings');
1
  <?php
2
+ add_action('admin_menu', 'xyz_fbap_menu');
 
3
 
4
+ function xyz_fbap_add_admin_scripts()
5
+ {
 
6
  wp_enqueue_script('jquery');
7
+
8
  wp_register_script( 'xyz_notice_script', plugins_url('facebook-auto-publish/js/notice.js') );
9
  wp_enqueue_script( 'xyz_notice_script' );
10
 
11
  wp_register_style('xyz_fbap_style', plugins_url('facebook-auto-publish/admin/style.css'));
12
  wp_enqueue_style('xyz_fbap_style');
 
13
  }
14
 
15
+ add_action("admin_enqueue_scripts","xyz_fbap_add_admin_scripts");
16
+
17
+
18
+
19
  function xyz_fbap_menu()
20
  {
21
  add_menu_page('Facebook Auto Publish - Manage settings', 'Facebook Auto Publish', 'manage_options', 'facebook-auto-publish-settings', 'xyz_fbap_settings');
admin/publish.php CHANGED
@@ -37,10 +37,15 @@ function xyz_fbap_getimage($post_ID,$description_org)
37
 
38
  }
39
  else {
40
- $first_img = '';
41
- preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $description_org, $matches);
42
  if(isset($matches[1][0]))
43
  $attachmenturl = $matches[1][0];
 
 
 
 
 
 
44
 
45
 
46
  }
@@ -147,7 +152,8 @@ function xyz_fbap_link_publish($post_ID) {
147
  $description = $content;
148
 
149
  $description_org=$description;
150
- $attachmenturl=xyz_fbap_getimage($post_ID, $description_org);
 
151
  if($attachmenturl!="")
152
  $image_found=1;
153
  else
@@ -208,7 +214,8 @@ function xyz_fbap_link_publish($post_ID) {
208
  'caption' => $caption,
209
  'description' => $description,
210
  'actions' => array(array('name' => $name,
211
- 'link' => $link))
 
212
 
213
  );
214
  }
@@ -219,7 +226,8 @@ function xyz_fbap_link_publish($post_ID) {
219
  'link' => $link,
220
  'name' => $name,
221
  'caption' => $caption,
222
- 'description' => $description
 
223
 
224
 
225
  );
37
 
38
  }
39
  else {
40
+ preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/is', $description_org, $matches);
 
41
  if(isset($matches[1][0]))
42
  $attachmenturl = $matches[1][0];
43
+ else {
44
+ apply_filters('the_content', $description_org);
45
+ preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/is', $description_org, $matches);
46
+ if(isset($matches[1][0]))
47
+ $attachmenturl = $matches[1][0];
48
+ }
49
 
50
 
51
  }
152
  $description = $content;
153
 
154
  $description_org=$description;
155
+
156
+ $attachmenturl=xyz_fbap_getimage($post_ID, $postpp->post_content);
157
  if($attachmenturl!="")
158
  $image_found=1;
159
  else
214
  'caption' => $caption,
215
  'description' => $description,
216
  'actions' => array(array('name' => $name,
217
+ 'link' => $link)),
218
+ 'picture' => $attachmenturl
219
 
220
  );
221
  }
226
  'link' => $link,
227
  'name' => $name,
228
  'caption' => $caption,
229
+ 'description' => $description,
230
+ 'picture' => $attachmenturl
231
 
232
 
233
  );
admin/settings.php CHANGED
@@ -314,6 +314,8 @@ function dethide(id)
314
  $pagearray1 = json_decode($result1);
315
  $data = array_merge($data, $pagearray1->data);
316
  }
 
 
317
  $offset += $limit;
318
  }while(array_key_exists("next", $pagearray1->paging));
319
 
314
  $pagearray1 = json_decode($result1);
315
  $data = array_merge($data, $pagearray1->data);
316
  }
317
+ else
318
+ break;
319
  $offset += $limit;
320
  }while(array_key_exists("next", $pagearray1->paging));
321
 
facebook-auto-publish.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Facebook Auto Publish
4
  Plugin URI: http://xyzscripts.com/wordpress-plugins/facebook-auto-publish/
5
  Description: Publish posts automatically from your blog to Facebook social media. You can publish your posts to Facebook as simple text message, text message with image or as attached link to your blog. The plugin supports filtering posts by custom post-types and categories.
6
- Version: 1.0
7
  Author: xyzscripts.com
8
  Author URI: http://xyzscripts.com/
9
  License: GPLv2 or later
3
  Plugin Name: Facebook Auto Publish
4
  Plugin URI: http://xyzscripts.com/wordpress-plugins/facebook-auto-publish/
5
  Description: Publish posts automatically from your blog to Facebook social media. You can publish your posts to Facebook as simple text message, text message with image or as attached link to your blog. The plugin supports filtering posts by custom post-types and categories.
6
+ Version: 1.0.1
7
  Author: xyzscripts.com
8
  Author URI: http://xyzscripts.com/
9
  License: GPLv2 or later
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://xyzscripts.com/donate/
4
  Tags: facebook, facebook auto publish, publish post to facebook, add link to facebook, facebook publishing, post to facebook, post to fb, social media auto publish, social media publishing, social network auto publish, social media, social network
5
  Requires at least: 2.8
6
  Tested up to: 3.6
7
- Stable tag: 1.0
8
  License: GPLv2 or later
9
 
10
  Publish posts automatically to Facebook page or profile.
@@ -117,11 +117,21 @@ More questions ? [Drop a mail](http://xyzscripts.com/members/support/ "XYZScript
117
 
118
  == Changelog ==
119
 
 
 
 
 
120
  = Facebook Auto Publish 1.0 =
121
  * First official launch.
122
 
123
  == Upgrade Notice ==
124
 
 
 
 
 
 
 
125
  == More Information ==
126
 
127
  ★ [Facebook Auto Publish User Guide](http://docs.xyzscripts.com/wordpress-plugins/facebook-auto-publish/ "Facebook Auto Publish User Guide")
4
  Tags: facebook, facebook auto publish, publish post to facebook, add link to facebook, facebook publishing, post to facebook, post to fb, social media auto publish, social media publishing, social network auto publish, social media, social network
5
  Requires at least: 2.8
6
  Tested up to: 3.6
7
+ Stable tag: 1.0.1
8
  License: GPLv2 or later
9
 
10
  Publish posts automatically to Facebook page or profile.
117
 
118
  == Changelog ==
119
 
120
+ = Facebook Auto Publish 1.0.1 =
121
+ * Default image fetch logic for auto publish updated.
122
+ * Thumbnail image logic updated.
123
+
124
  = Facebook Auto Publish 1.0 =
125
  * First official launch.
126
 
127
  == Upgrade Notice ==
128
 
129
+ = Facebook Auto Publish 1.0.1 =
130
+ If you had issues with default image used for auto publishing, you may apply this upgrade.
131
+
132
+ = Facebook Auto Publish 1.0 =
133
+ First official launch.
134
+
135
  == More Information ==
136
 
137
  ★ [Facebook Auto Publish User Guide](http://docs.xyzscripts.com/wordpress-plugins/facebook-auto-publish/ "Facebook Auto Publish User Guide")