Changeset 940152
- Timestamp:
- 06/28/2014 08:39:44 PM (11 years ago)
- Location:
- roost-for-bloggers
- Files:
-
- 23 added
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
roost-for-bloggers/trunk/includes/class-roost-api.php
r925987 r940152 12 12 $auth_creds = 'Basic ' . base64_encode( $remote_data['appkey'] .':'.$remote_data['appsecret'] ); 13 13 } 14 $remote_url = 'https://g et.roost.me/api/' . $remote_data['remoteAction'];14 $remote_url = 'https://go.goroost.com/api/' . $remote_data['remoteAction']; 15 15 16 16 $headers = array( … … 104 104 105 105 public static function save_remote_settings( $app_key, $app_secret, $roost_server_settings, $POST ) { 106 if ( isset( $POST['mobilePush'] ) ) {107 if ( 'TOP' != $roost_server_settings['roostBarSetting'] || 'BOTTOM' != $roost_server_settings['roostBarSetting'] ) {108 $remote_content['roostBarSetting'] = 'TOP';109 }110 } else {111 if ( 'OFF' != $roost_server_settings['roostBarSetting'] ) {112 $remote_content['roostBarSetting'] = 'OFF';113 }114 }115 116 106 if ( isset( $POST['autoUpdate'] ) ) { 117 107 if ( true != $roost_server_settings['autoUpdate'] ) { -
roost-for-bloggers/trunk/includes/class-roost-core.php
r928005 r940152 11 11 } 12 12 13 public static $roost_version = '2.1. 2';13 public static $roost_version = '2.1.3'; 14 14 15 15 public static function site_url() { … … 18 18 19 19 public static function registration_url() { 20 $tld = 'https://g et.roost.me/signup?returnURL=';20 $tld = 'https://go.goroost.com/signup?returnURL='; 21 21 $admin_path = admin_url('admin.php?page=roost-web-push'); 22 22 $url = $tld . urlencode( $admin_path . '&source=wpplugin' ); … … 25 25 26 26 public static function login_url( $sso ) { 27 $tld = 'https://g et.roost.me/login?returnURL=';27 $tld = 'https://go.goroost.com/login?returnURL='; 28 28 $admin_path = admin_url('admin.php?page=roost-web-push'); 29 29 $url = $tld . urlencode( $admin_path ); … … 76 76 } 77 77 } 78 78 79 79 public static function uninstall(){ 80 80 delete_option('roost_settings'); … … 88 88 add_action( 'post_submitbox_misc_actions', array( $this, 'note_override' ) ); 89 89 add_action( 'wp_head', array( $this, 'byline' ), 1 ); 90 add_action( 'wp_footer', array( $this, 'roostJS' ) ); 90 91 add_action( 'save_post', array( $this, 'save_post_meta_roost' ) ); 91 add_action( 'wp_enqueue_scripts', array( $this, 'load_scripts' ) );92 92 add_filter( 'clean_url', array( $this, 'add_async' ), 2, 1 ); 93 93 add_action( 'wp_ajax_graph_reload', array( $this, 'graph_reload' ) ); … … 99 99 add_filter( 'plugin_action_links_roost-for-bloggers/roost.php', array( $this, 'add_action_links' ) ); 100 100 add_action( 'admin_init', array( $this, 'activate_redirect' ) ); 101 add_action( 'admin_init', array( $this, 'roost_logout' ) ); 102 add_action( 'admin_init', array( $this, 'manual_send' ) ); 101 103 add_action( 'admin_notices', array( $this, 'setup_notice' ) ); 102 104 add_action( 'admin_enqueue_scripts', array( __CLASS__, 'admin_scripts' ) ); … … 111 113 return array_merge( $rlink, $links ); 112 114 } 113 114 public function load_scripts() {115 $roost_settings = self::roost_settings();116 $app_key = $roost_settings['appKey'];117 if ($app_key && !is_admin()) {118 wp_enqueue_script( 'roostjs', '//get.roost.me/js/roost.js#async', '', self::$roost_version, false );119 wp_enqueue_script( 'roostvars', ROOST_URL . 'layout/js/roost_vars.js#async', array( 'roostjs' ), self::$roost_version, false );120 wp_localize_script( 'roostvars', 'pushNotificationsByRoostMe', array( 'appkey' => $app_key) );121 }122 }123 115 124 116 public function add_async( $url ) { … … 133 125 134 126 public function byline() { 135 $byline = "<!-- Push notifications for this website enabled by Roost. Support for Safari, Firefox, and Chrome Browser Push. (v ". self::$roost_version .") - http:// roost.me/ -->";127 $byline = "<!-- Push notifications for this website enabled by Roost. Support for Safari, Firefox, and Chrome Browser Push. (v ". self::$roost_version .") - http://goroost.com/ -->"; 136 128 echo "\n${byline}\n"; 137 129 } 138 130 131 public function roostJS() { 132 $roost_settings = self::roost_settings(); 133 $app_key = $roost_settings['appKey']; 134 ?> 135 <script>var _roost = _roost || [];_roost.push(['appkey','<?php echo( $app_key ); ?>']);</script><noscript><a href="http://goroost.com/site-contact?noscript&appkey=<?php echo($app_key); ?>" title="Contact Us" target="_blank">Questions or feedback? Need help?</a> powered by <a href="http://goroost.com" title="Roost Web Push">Roost - Push notifications for websites</a></noscript><script src="//cdn.goroost.com/js/roost.js" async></script> 136 <?php 137 } 138 139 139 public static function setup_notice() { 140 140 global $hook_suffix; … … 167 167 if ( is_wp_error( $api_check ) ) { 168 168 ?> 169 <div class="error" id="roost-api-error">There was a problem accessing the <strong>Roost API</strong>. You may not be able to log in. Contact Roost support at <a href="mailto:support@ roost.me" target="_blank">[email protected]</a> for more information.</div>169 <div class="error" id="roost-api-error">There was a problem accessing the <strong>Roost API</strong>. You may not be able to log in. Contact Roost support at <a href="mailto:support@goroost.com" target="_blank">[email protected]</a> for more information.</div> 170 170 <?php 171 171 } … … 375 375 } 376 376 377 public static function admin_menu_page() { 377 public function roost_logout() { 378 if ( isset( $_POST['clearkey'] ) ) { 379 $form_keys = array( 380 'appKey' => '', 381 'appSecret' => '', 382 ); 383 self::update_keys( $form_keys ); 384 wp_dequeue_script( 'roostscript' ); 385 $status = 'Roost has been disconnected.'; 386 $status = urlencode( $status ); 387 wp_redirect( admin_url( 'admin.php?page=roost-web-push' ) . '&status=' . $status ); 388 exit; 389 } 390 } 391 392 public function manual_send() { 393 if ( isset( $_POST['manualtext'] ) ) { 394 $manual_text = $_POST['manualtext']; 395 $manual_link = $_POST['manuallink']; 396 $manual_text = stripslashes( $manual_text ); 397 if ( '' == $manual_text || '' == $manual_link ) { 398 $status = 'Your message or link can not be blank.'; 399 } else { 400 $roost_settings = self::roost_settings(); 401 $app_key = $roost_settings['appKey']; 402 $app_secret = $roost_settings['appSecret']; 403 if ( false === strpos( $manual_link, 'http' ) ) { 404 $manual_link = 'http://' . $manual_link; 405 } 406 $msg_status = Roost_API::send_notification( $manual_text, $manual_link, null, $app_key, $app_secret, null ); 407 if ( true === $msg_status['success'] ) { 408 $status = 'Message Sent.'; 409 } else { 410 $status = 'Message failed. Please make sure you have a valid URL.'; 411 } 412 } 413 $status = urlencode( $status ); 414 wp_redirect( admin_url( 'admin.php?page=roost-web-push' ) . '&status=' . $status ); 415 exit; 416 } 417 } 418 419 public static function admin_menu_page() { 378 420 $roost_settings = self::roost_settings(); 379 421 380 422 if ( empty( $roost_settings ) ) { 381 423 self::install(); … … 383 425 $app_key = $roost_settings['appKey']; 384 426 $app_secret = $roost_settings['appSecret']; 427 } 428 429 if ( !empty( $app_key ) ) { 430 $roost_active_key = true; 431 $bbPress_active = Roost_bbPress::bbPress_active(); 432 } else { 433 $roost_active_key = false; 385 434 } 386 435 … … 398 447 $roost_server_settings = $response['server_settings']; 399 448 $roost_stats = $response['stats']; 449 $roost_active_key = true; 400 450 } 401 451 … … 415 465 $roost_server_settings = $response['server_settings']; 416 466 $roost_stats = $response['stats']; 467 $roost_active_key = true; 417 468 } 418 469 } … … 425 476 $roost_server_settings = $response['server_settings']; 426 477 $roost_stats = $response['stats']; 478 $roost_active_key = true; 427 479 } 428 429 if ( isset( $_POST['clearkey'] ) ) { 430 $form_keys = array( 431 'appKey' => '', 432 'appSecret' => '', 433 ); 434 self::update_keys( $form_keys ); 435 wp_dequeue_script( 'roostscript' ); 436 $status = 'Roost has been disconnected.'; 437 } 438 480 481 if ( isset( $_GET['status'] ) ) { 482 $status = urldecode( $_GET['status'] ); 483 } 484 439 485 if ( isset( $_POST['savesettings'] ) ) { 440 486 $autoPush = false; 441 487 $bbPress = false; 488 442 489 if ( isset( $_POST['autoPush'] ) ) { 443 490 $autoPush = true; … … 459 506 } 460 507 461 if ( isset( $_POST['manualpush'] ) ) {462 $manual_text = $_POST['manualtext'];463 $manual_link = $_POST['manuallink'];464 if ( '' == $manual_text || '' == $manual_link ) {465 $status = 'Your message or link can not be blank.';466 } else {467 $roost_settings = self::roost_settings();468 $app_key = $roost_settings['appKey'];469 $app_secret = $roost_settings['appSecret'];470 if ( false === strpos( $manual_link, 'http' ) ) {471 $manual_link = 'http://' . $manual_link;472 }473 $msg_status = Roost_API::send_notification( $manual_text, $manual_link, null, $app_key, $app_secret, null );474 if ( true === $msg_status['success'] ) {475 $status = 'Message Sent.';476 } else {477 $status = 'Message failed. Please make sure you have a valid URL.';478 }479 }480 }481 508 require_once( dirname( plugin_dir_path( __FILE__ ) ) . '/layout/admin.php'); 482 509 } -
roost-for-bloggers/trunk/layout/admin.php
r928005 r940152 1 <?php2 $roost = new Roost();3 $roost_settings = get_option( 'roost_settings' );4 if ( strlen( $roost_settings['appKey'] ) > 0 ) {5 $roost_active_key = true;6 $roost = new Roost;7 } else {8 $roost_active_key = false;9 }10 $bbPress_active = Roost_bbPress::bbPress_active();11 ?>12 13 1 <div id="rooster"> 14 2 <div id="roost-header"> … … 74 62 <p> 75 63 Welcome! Creating an account only takes a few seconds and will give you access 76 to additional features like our analytics dashboard at roost.me64 to additional features like our analytics dashboard at goroost.com 77 65 </p> 78 66 <a href="<?php echo( Roost::registration_url() ); ?>" id="roost-create-account" class="roost-signin-link"><img src="<?php echo ROOST_URL; ?>layout/images/roost-arrow-white.png" />Create an account</a> … … 126 114 <input type="Submit" class="type-submit" id="roost-middle-save" name="<?php echo isset($roost_sites) ? 'roostconfigselect' : 'roostlogin' ?>" value="<?php echo isset( $roost_sites ) ? 'Choose Site' : 'Login' ?>" tabindex="3" /> 127 115 <?php submit_button( 'Cancel', 'delete', 'cancel', false, array( 'tabindex' => '4' ) ); ?> 128 <span class="left-link"><a href="https://g et.roost.me/login?forgot=true" target="_blank">forget password?</a></span>116 <span class="left-link"><a href="https://go.goroost.com/login?forgot=true" target="_blank">forget password?</a></span> 129 117 </div> 130 118 <div id="roost-sso"> … … 271 259 </div> 272 260 <div class="roost-setting-wrapper"> 273 274 <span class="roost-label">Mobile push support:</span>275 <input type="checkbox" name="mobilePush" class="roost-control-secondary" value="1" <?php if( 'TOP' == $roost_server_settings['roostBarSetting'] || 'BOTTOM' == $roost_server_settings['roostBarSetting'] ){ echo( 'checked' ); } ?> />276 <span class="roost-setting-caption">Enabling this will allow your readers to subscribe and recieve push notifications on their phone or tablet when they view your mobile site.277 First-time subscribers will be prompted to install the iOS or Android Roost app in order to recieve notifications.</span>278 279 </div>280 <div class="roost-setting-wrapper">281 261 <span class="roost-label">Activate all Roost features:</span> 282 262 <input type="checkbox" name="autoUpdate" class="roost-control-secondary" value="1" <?php if( true == $roost_server_settings['autoUpdate'] ){ echo( 'checked' ); } ?> /> … … 290 270 291 271 </div> 292 293 272 <input type="Submit" class="type-submit roost-control-secondary" id="roost-middle-save" name="savesettings" value="Save Settings" /> 294 273 </div> … … 300 279 <?php } ?> 301 280 <!--END SETTINGS SECTION--> 302 <div id="roostSupportTag">Have Questions, Comments, or Need a Hand? Hit us up at <a href="mailto:support@ roost.me" target="_blank">[email protected]</a> We're Here to Help.</div>281 <div id="roostSupportTag">Have Questions, Comments, or Need a Hand? Hit us up at <a href="mailto:support@goroost.com" target="_blank">[email protected]</a> We're Here to Help.</div> 303 282 </div> 304 283 </div> -
roost-for-bloggers/trunk/readme.txt
r928005 r940152 1 1 === Roost Web Push for Safari === 2 2 Contributors: noticesoftware, danstever 3 Tags: safari, push, push notifications, web push notifications, Mavericks, mobile, web push, roost, roost.me, roost_me, Post, plugin, admin, posts, page, links, widget, ajax, social, wordpress, dashboard, news, notifications, services4 Requires at least: 3. 03 Tags: safari, push, push notifications, web push notifications, Mavericks, mobile, web push, roost, roost.me, roost_me, goroost, goroost.com Post, plugin, admin, posts, page, links, widget, ajax, social, wordpress, dashboard, news, notifications, services 4 Requires at least: 3.8 5 5 Tested up to: 3.9.1 6 Stable tag: 2.1. 26 Stable tag: 2.1.3 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 [Browser Push by Roost](http:// roost.me/) - Fundamentally changing the way people consume content on the web.14 [Browser Push by Roost](http://goroost.com/) - Fundamentally changing the way people consume content on the web. 15 15 16 16 Push Plugin Features: … … 25 25 **Free** Roost account included. No setup fees, no surprises, and no limitations on your site visitors. 26 26 27 [vimeo http://vimeo.com/ 88533265]27 [vimeo http://vimeo.com/99195697] 28 28 29 29 == Installation == … … 70 70 71 71 = Free? Really? What's the catch? = 72 No catch! We believe in providing a great service and making it accessible to everyone. So... It's free. (Up to 1 ,000,000 messages. If you hit that... We'll need to talk.)72 No catch! We believe in providing a great service and making it accessible to everyone. So... It's free. (Up to 100,000 messages. If you hit that... We'll need to talk.) 73 73 74 74 = Is it really this easy to use Safari Web Push on my site? = … … 80 80 = Do you support Google Chrome or Firefox for desktop push? = 81 81 Almost. We will be releasing support for Google Chrome very soon. Firefox will follow. To take advantage of them as we include support, make sure to have *Activate all Roost Features* checked. 82 83 = If I'm using Mobile Push Support, Why do subscribers have to download the Roost mobile app? =84 In order for a device to receive a true push notification, a native mobile app must be installed. That's where Roost comes in. We are there to provide that *native bridge.* We do not pull readers into our app, but push them back to your website. Notifications also stay in the Roost app, which makes them able to be viewed at any time.85 82 86 83 = Do my readers / subscribers have to create an account with Roost? = … … 95 92 96 93 == Changelog == 94 = 2.1.3 = 95 * RoostJS now served from CDN (BAM! Blazing fast! You didn't see that one did you?) 96 * Removed mobile app setting 97 * Updated API URLs and references to goroost.com (Go Go Gadget Roosters... Or something like that.) 98 * Fixed bug when manual sending notification to eliminate multiple messages. 97 99 98 100 = 2.1.2 = … … 167 169 168 170 == Upgrade Notice == 171 = 2.1.3 = 172 * RoostJS now served from CDN (BAM! Blazing fast! You didn't see that one did you?) 173 * Removed mobile app setting 174 169 175 = 2.1.2 = 170 176 * Fixed a bug when sending manual notifications from the dashboard and with charts -
roost-for-bloggers/trunk/roost.php
r928005 r940152 2 2 /** 3 3 * Plugin Name: Roost Web Push 4 * Plugin URI: http:// www.roost.me/4 * Plugin URI: http://goroost.com/ 5 5 * Description: Drive traffic to your website with Safari Mavericks push notifications and Roost. 6 * Version: 2.1. 27 * Author: Roost .me8 * Author URI: http:// roost.me6 * Version: 2.1.3 7 * Author: Roost 8 * Author URI: http://goroost.com 9 9 * License: GPLv2 or later 10 10 */ … … 18 18 $roost = new Roost(); 19 19 $bbPress_active = Roost_bbPress::bbPress_active(); 20 20 21 if( !empty( $bbPress_active['present'] ) && !empty( $bbPress_active['enabled'] ) ) { 21 22 $roost_bbp = new Roost_bbPress(); 22 23 } 24 23 25 register_activation_hook( __FILE__, array( 'ROOST', 'init' ) ); 24 26 register_uninstall_hook( __FILE__, array( 'ROOST', 'uninstall' ) );
Note: See TracChangeset
for help on using the changeset viewer.