Changeset 803512
- Timestamp:
- 11/13/2013 02:57:33 AM (11 years ago)
- Location:
- roost-for-bloggers/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
roost-for-bloggers/trunk/readme.txt
r797862 r803512 1 1 === Roost For Bloggers === 2 2 Contributors: noticesoftware 3 Tags: notifications, push notifications, alerts, website notifications, web alerts, roost, alert rocket, web push, mobile website push notification 3 Tags: notifications, push notifications, alerts, website notifications, web alerts, roost, alert rocket, web push, mobile website push notification, safari web push, desktop push notification, OS X Mavericks, web push, desktop push 4 4 Requires at least: 3.0 5 5 Tested up to: 3.7 6 Stable tag: 1. 06 Stable tag: 1.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 12 12 == Description == 13 13 14 [Roost](http://roost.me/) For Bloggers Wordpress plugin provides direct engagement with your readers by sending push notifications to their mobile device swhen you create a new post. Notifications are sent with links, pushing readers back to your site.14 [Roost](http://roost.me/) For Bloggers Wordpress plugin provides direct engagement with your readers by sending push notifications to their mobile device, or web browser, when you create a new post. Notifications are sent with links, pushing readers back to your site. 15 15 16 16 Your readers will be able to subscribe to receive notification using either one of the pre-built registration options, or a custom one that you define. … … 18 18 Roost For Bloggers Wordpress Plugin Features: 19 19 20 * *NEW* Safari Web Push (Desktop Push Notifications) on OS X Mavericks 20 21 * Free Roost For Bloggers account 21 22 * Auto notifications when creating a new post … … 25 26 * Roost social button and mobile button for registration 26 27 * Easy registration from both mobile devices and desktop browsers 28 * Detailed analytics provided through the Roost dashboard 27 29 28 30 == Installation == … … 43 45 44 46 **Auto Push** 45 46 47 Auto Push is what makes this plugin stellar. When you create a new post, your post's title and link will be sent to all of your subscribed readers. That's it. Really. You don't have to do anything else. (It works just like magic.) 47 48 49 **Safari Web Push** 50 To use Safari Web Push, simply activate the *Roost for Bloggers* plugin. When your site is viewed in a push-enabled browser and a Roost button or bar is clicked, the browser will prompt for permission. No additional setup is needed. 51 48 52 **Use Custom Text** 49 50 53 When enabled, the text you enter here will be attached to the auto-pushed messages. You can choose to place this text before or after the auto message. 51 54 52 55 **Send Manual Alert** 53 54 56 You can send a manual alert to all subscribed users by entering your message text in the "Message" box and a link in the "Link" box. 55 57 56 58 **Roost Buttons** 57 58 59 Two button types are provided, a social-style button and a mobile-style button. These need to be manually put into your theme templates or used on individual posts. We tried to make it as easy as possible... 59 60 60 61 To use the Roost social button, simply place this shortcode into your content: 61 '[Roost]' 62 [Roost] 62 63 63 64 The mobile style button is generated by using this shortcode: 64 '[RoostMobile]' 65 [RoostMobile] 66 67 **Roost Analytics & Roost JS** 68 Detailed metrics are provided in the Roost dashboard about your subscribers. These metrics include reads, pages view, messages received, and time on site. 65 69 66 70 **Notes** 67 68 To use any of the integrated registration options below, you will need to be using a Wordpress template that generates the *Content* section on pages. If you use a *static* page, such as a custom homepage, you will need to manually insert the blank containers and Roost JavaScript on those pages. 71 To use any of the integrated registration options below, you will need to be using a Wordpress template that generates the *Content* section on pages. If you use a *static* page, such as a custom homepage, you will need to manually insert the empty containers. The Roost JS is inserted into the footer via the *wp_footer()* function. If your theme does not use this function, you will need to manually copy / paste the Roost JS code snippet. 69 72 70 73 **Roost Header / Footer Bar** 71 72 74 To enable the Roost Header / Footer bar, select it from the dropdown in the registration section of the Roost dashboard. A *Custom Text* box will appear. Here you are able to customize the text that is displayed on the bar. 73 75 74 76 **Custom Registration** 75 76 77 If you would like to handle your own registration code, choose this method. Anything you put in this box will be inserted into the *Content* section of each page. 77 78 … … 103 104 104 105 = 1.0 = 105 *Initial Release 106 * Initial Release 107 108 = 1.1 = 109 * Added support for Safari Web Push (Desktop Push Notifications) on OS X Mavericks 110 * Prefixed functions to avoid conflicts 111 * Updated settings to be removed on uninstall instead of deactivation 112 * Included Roost JS on every page via wp_footer() - (Needed for Roost analytics such as page views and time on site) -
roost-for-bloggers/trunk/roost.php
r797566 r803512 4 4 Plugin URI: http://www.roost.me/ 5 5 Description: Wordpress plugin for Roost.me Web-Push. Automate Push Notifications with new posts or send manually from the dashboard. 6 Version: 1. 06 Version: 1.1 7 7 Author: Roost.me 8 8 Author URI: http://www.roost.me/ … … 33 33 add_action('publish_post', 'roostme'); 34 34 register_activation_hook(__FILE__, 'roost_install'); 35 register_ deactivation_hook(__FILE__, 'roost_uninstall');35 register_uninstall_hook(__FILE__, 'roost_uninstall'); 36 36 37 37 function roost_install(){ … … 59 59 VALUES('', '', 1, 0, '', '', '0', '', '', '' )"); 60 60 } 61 register_sidebar(array(62 'name' => 'Roost Top',63 'id' => 'roost-top',64 'before_widget' => '<li>',65 'after_widget' => "</li>",66 'before_title' => "<h3>",67 'after_title' => "</h3>"68 ));69 61 } 70 62 … … 80 72 "Roost.me", 81 73 "Roost.me", 82 8,74 "manage_options", 83 75 __FILE__, 84 76 "roost_admin_menu_list", … … 95 87 add_action('admin_menu', 'roost_admin_menu'); 96 88 97 function r emoteRequest($remoteData) {89 function roost_remoteRequest($remoteData) { 98 90 $authCreds = ''; 99 91 if(!empty($remoteData['appkey'])) { … … 129 121 'remoteContent' => json_encode($remoteContent) 130 122 ); 131 return r emoteRequest($remoteData);132 } 133 134 function saveUsername($roostUser){123 return roost_remoteRequest($remoteData); 124 } 125 126 function roost_saveUsername($roostUser){ 135 127 global $wpdb; 136 128 $table = $wpdb->prefix . "roostsettings"; … … 139 131 } 140 132 141 function updateKeys($formKeys){133 function roost_updateKeys($formKeys){ 142 134 global $wpdb; 143 135 $table = $wpdb->prefix . "roostsettings"; … … 148 140 } 149 141 150 function updateSettings($formData){142 function roost_updateSettings($formData){ 151 143 global $wpdb; 152 144 $table = $wpdb->prefix . "roostsettings"; … … 201 193 $customhtml = $custommsg; 202 194 } 203 $content = $customhtml . $content . roostJS($appkey);195 $content = $customhtml . $content; 204 196 } 205 197 if(!is_page() && !is_single()){ … … 249 241 } 250 242 $url = $siteurl . "/?p=" . $post_ID; 251 sendNotification($alert, $url, $appkey, $appsecret);243 roost_sendNotification($alert, $url, $appkey, $appsecret); 252 244 } 253 245 } 254 246 } 255 247 256 function buildMsg($manualtext, $manuallink) {248 function roost_buildMsg($manualtext, $manuallink) { 257 249 global $wpdb; 258 250 $table = $wpdb->prefix . "roostsettings"; … … 267 259 } 268 260 } 269 sendNotification($manualtext, $manuallink, $appkey, $appsecret);270 } 271 272 function sendNotification($alert, $url, $appkey, $appsecret) {261 roost_sendNotification($manualtext, $manuallink, $appkey, $appsecret); 262 } 263 264 function roost_sendNotification($alert, $url, $appkey, $appsecret) { 273 265 if(!$url){ 274 266 $remoteContent = array( … … 287 279 'remoteContent' => json_encode($remoteContent) 288 280 ); 289 remoteRequest($remoteData); 290 } 291 292 function roostJS($appkey) { 293 $roostJS = "<script>"; 294 $roostJS = $roostJS . "var _roost = _roost || [];"; 295 $roostJS = $roostJS . "_roost.push(['appkey','". $appkey ."']);"; 296 $roostJS = $roostJS . "!function(d,s,id){"; 297 $roostJS = $roostJS . "var js, fjs = d.getElementsByTagName(s)[0];"; 298 $roostJS = $roostJS . "if(!d.getElementById(id)){"; 299 $roostJS = $roostJS . "js=d.createElement(s); js.id=id;"; 300 $roostJS = $roostJS . "js.src='//get.roost.me/js/roost.js';"; 301 $roostJS = $roostJS . "fjs.parentNode.insertBefore(js,fjs);"; 302 $roostJS = $roostJS . "}"; 303 $roostJS = $roostJS . "}(document, 'script', 'roost-js');"; 304 $roostJS = $roostJS . "</script>"; 305 return $roostJS; 281 roost_remoteRequest($remoteData); 306 282 } 307 283 … … 319 295 $roostButton = "<div class='roost-button' data-segments='" . $segments . "'></div>"; 320 296 } 321 return $roostButton . roostJS($appkey);297 return $roostButton; 322 298 } 323 299 add_shortcode('Roost', 'roostbtn'); … … 336 312 $roostButton = "<div class='roost-button-mobile' data-segments='" . $segments . "'></div>"; 337 313 } 338 return $roostButton . roostJS($appkey);314 return $roostButton; 339 315 } 340 316 add_shortcode('RoostMobile', 'roostmbtn'); … … 346 322 $logginIntoRoost = json_decode(wp_remote_retrieve_body(roostLogin($roostUser, $roostPass)), true); 347 323 if($logginIntoRoost['success'] === true) { 348 saveUsername($roostUser);324 roost_saveUsername($roostUser); 349 325 if(count($logginIntoRoost['apps']) > 1){ 350 326 //Work in the handling for multiple configs … … 355 331 "Appsecret" => $logginIntoRoost['apps'][0]['secret'] 356 332 ); 357 updateKeys($formKeys);333 roost_updateKeys($formKeys); 358 334 $status = 'Logged in to Roost. You\'re Good to Go!'; 359 335 } … … 372 348 "Appsecret" => $roostSiteSecret 373 349 ); 374 updateKeys($formKeys);350 roost_updateKeys($formKeys); 375 351 $status = 'Logged in to Roost. You\'re Good to Go!'; 376 352 } … … 382 358 ); 383 359 $roostUser = ''; 384 updateKeys($formKeys);385 saveUsername($roostUser);360 roost_updateKeys($formKeys); 361 roost_saveUsername($roostUser); 386 362 $status = 'Roost has been disconnected.'; 387 363 } … … 397 373 "customtext" => mysql_real_escape_string($_POST['customtext']) 398 374 ); 399 updateSettings($formData);375 roost_updateSettings($formData); 400 376 $status = 'Settings Saved.'; 401 377 } … … 409 385 $status = 'Please Enter a Valid URL. - (Must contain "http://" and your ".com" or respective domain.'; 410 386 } else { 411 buildMsg($manualtext, $manuallink);387 roost_buildMsg($manualtext, $manuallink); 412 388 $status = 'Message Sent.'; 413 389 } … … 419 395 $status = 'Your Message Can Not Be Blank.'; 420 396 } else { 421 buildMsg($manualtext, "");397 roost_buildMsg($manualtext, ""); 422 398 $status = 'Message Sent.'; 423 399 } 424 400 } 425 require_once('layout/admin.php'); 426 } 401 require_once('layout/admin.php'); 402 } 403 404 function roost_load_scripts() { 405 global $wpdb; 406 $table = $wpdb->prefix . "roostsettings"; 407 $sql = "SELECT * FROM " . $table . " where 1"; 408 $results = $wpdb->get_results($sql); 409 if (count($results) > 0) { 410 foreach ($results as $result) { 411 $appkey = $result->appkey; 412 } 413 } 414 if($appkey && !is_admin()) { 415 wp_enqueue_script( 'roostjs', ROOST_URL . 'layout/js/roostjs.js', array('jquery'), false, true ); 416 wp_localize_script( 'roostjs', 'roostjsParams', array( 'appkey' => $appkey) ); 417 } 418 } 419 add_action('wp_enqueue_scripts', 'roost_load_scripts'); 420 427 421 ?>
Note: See TracChangeset
for help on using the changeset viewer.