WordPress.org

Plugin Directory

Changeset 361811


Ignore:
Timestamp:
03/18/11 19:30:31 (3 years ago)
Author:
JonBishop
Message:

New visual editor button

Location:
hubspot
Files:
45 added
6 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • hubspot/trunk/hs-admin.php

    r355407 r361811  
    4444          $contextual_help = 
    4545          '<p><h2>' . __('What are Actions?') . '</h2></p>' . 
    46           '<p>' . __('An action is a request for your reader to do something. You can use the Call to Action manager below to create calls to action. You can then use the <code>[hs-action]</code> shortcode or sidebar widget to randomly display your actions. The manager keeps track of clicks, impressions and CTR.') . '</p>' ; 
     46          '<p>' . __('An action is a request for your reader to do something. You can use the Call to Action manager below to create calls to action. You can then use the <code>[hs_action]</code> shortcode or sidebar widget to randomly display your actions. The manager keeps track of clicks, impressions and CTR.') . '</p>' ; 
    4747 
    4848      } elseif ($screen_id == 'hubspot_page_hubspot_settings') { 
     
    6464            $contextual_help =  
    6565          '<p><h2>What are Shortcodes?</h2></p>' . 
    66           '<p>Shortcodes are small bits of code that make the creation of advanced HTML elements easy. The HubSpot WordPress plugin uses shortcodes to display contact info, <code>[hs_contact]</code>, and team info, <code>[hs_team]</code>, to make inserting and managing the content associated with these pages effortless.</p>' .  
     66          '<p>Shortcodes are small bits of code that make the creation of advanced HTML elements easy. The HubSpot WordPress plugin uses shortcodes to display contact info <code>[hs_contact]</code>, team info <code>[hs_team]</code>, custom forms <code>[hs_form]</code> and Calls to Action <code>[hs_action]</code> to make inserting and managing the content associated with these pages effortless.</p>' . 
    6767          '<p><h3>' . __('Contact Shortcode Settings') . '</h3></p>' . 
    6868          '<p>' . __('Fill in the Contact Shortcode Settings and use the <code>[hs_contact]</code> shortcode to display your company info with a map on any page.') . '</p>'  . 
    69           '<p><h3>' . __('Team Page Shortcode Settings') . '</h3></p>' . 
     69                  '<p>' . __('You can use the HubSpot button on the visual editor of any page, post or custom post type to easily insert the shortcode or to enter a custom address.') . '</p>'  . 
     70                  '<p><h3>' . __('Team Page Shortcode Settings') . '</h3></p>' . 
    7071          '<p>' . __('Add Team Members as new users in the <a href="'.HUBSPOT_ADMIN.'/users.php">Users Section</a> and use the <code>[hs_team]</code> shortcode to display a list of your team members with an image, bio and links to their social media profiles. You can choose to hide user images and the site admin from the Team Page listing on this page.') . '</p>'  . 
    71           '<p><h3>' . __('Lead Form Shortcode Settings') . '</h3></p>' . 
    72           '<p>' . __('If you are a HubSpot customer and entered your Portal ID on the <a href="'.HUBSPOT_ADMIN.'/admin.php?page=hubspot_settings">HubSpot Settings Page</a> you can use the <code>[hs_form]</code> shortcode to display a contact form on any page that sends leads to your HubSpot account. The form displays Name, Email, Twitter and Message by default.') . '</p>' . 
    73           '<p>' . __('You can optionally paste HTML into the \'Custom Form HTML\' field from your <a href="http://'.str_replace('.app','.web',$hs_settings['hs_appdomain']).'/app/LeadGen?subpage=EditContactForm&subaction=ManageForms" target="_blank">HubSpot Form Manager</a> to use a custom form. Each time you save a custom form a new text area will appear to allow multiple forms.') . '</p>' ; 
     72          '<p>' . __('You can use the HubSpot button on the visual editor of any page, post or custom post type to easily insert the team page shortcode or to select which team members to display on a specific page.') . '</p>' . 
     73                  '<p><h3>' . __('Lead Form Shortcode Settings') . '</h3></p>' . 
     74          '<p>' . __('HubSpot customers can paste HTML into the \'Custom Form HTML\' field from your <a href="http://'.str_replace('.app','.web',$hs_settings['hs_appdomain']).'/app/LeadGen?subpage=EditContactForm&subaction=ManageForms" target="_blank">HubSpot Form Manager</a> to use a custom form. Each time you save a custom form a new text area will appear to allow multiple forms. You can use the HubSpot button on the visual editor of any page, post or custom post type to easily insert a specific form.') . '</p>' ; 
    7475      } 
    7576      return $contextual_help; 
     
    195196                if(isset($_POST['hs_team_admin'])){ $hs_settings['hs_team_admin']=$_POST['hs_team_admin']; } else { $hs_settings['hs_team_admin']=''; } 
    196197                if(isset($_POST['hs_leads_enabled'])){ $hs_settings['hs_leads_enabled']=$_POST['hs_leads_enabled']; } else { $hs_settings['hs_leads_enabled']=''; } 
    197                 if(isset($_POST['hs_leads_url'])){ $hs_settings['hs_leads_url']=$_POST['hs_leads_url']; } 
     198 
    198199                 
    199200                // Process all custom HTML forms (if any) 
     
    243244        if($myhubspotwp->hs_is_customer($hs_settings['hs_portal'], $hs_settings['hs_appdomain']) ){ 
    244245            $form_content = '<table class="form-table">'; 
    245             $form_content .= '<tr><th scope="row"><label for="hs_leads_enabled">' . __("Enable Form Shortcode") . '</label></th><td><input type="checkbox" name="hs_leads_enabled" ' .checked($hs_settings['hs_leads_enabled'], 'on', false) . ' /></td></tr>'; 
    246             $form_content .= '<tr><th scope="row"><label for="hs_leads_url">' . __("API Post URL") . '</label></th><td><input type="text" class="regular-text code" name="hs_leads_url" value="' . $hs_settings['hs_leads_url'] . '" /> <small><a href="http://'.$hs_settings['hs_appdomain'].'/?app=LeadDirectorSetup" target="_blank">Get URL Here</small></td></tr>';     
    247              
    248             $form_content .= '<tr><th scope="row"><label for="hs_leads_html">' . __("Advanced: Custom Form HTML") . '</label></th><td><small>If you do not wish to use the default lead form you can copy and paste HTML from your <a href="http://'.str_replace('.app','.web',$hs_settings['hs_appdomain']).'/app/LeadGen?subpage=EditContactForm&subaction=ManageForms" target="_blank">HubSpot Form Manager</a> here.</small></td></tr>'; 
     246            $form_content .= '<tr><th scope="row"><label for="hs_leads_enabled">' . __("Enable Form Shortcode") . '</label></th><td><input type="checkbox" name="hs_leads_enabled" ' .checked($hs_settings['hs_leads_enabled'], 'on', false) . ' /></td></tr>';  
     247            $form_content .= '<tr><th scope="row"><label for="hs_leads_html">' . __("Custom Form HTML") . '</label></th><td><small>Copy and paste HTML from your <a href="http://'.str_replace('.app','.web',$hs_settings['hs_appdomain']).'/app/LeadGen?subpage=EditContactForm&subaction=ManageForms" target="_blank">HubSpot Form Manager</a> here.</small></td></tr>'; 
    249248             
    250249            // Loop through all saved custom forms (if any) and display forms plus an empty text area for a new form 
  • hubspot/trunk/hs-widgets.php

    r355407 r361811  
    7171        extract( $args ); 
    7272        $hide_title = $instance['hide_title'] ? '1' : '0'; 
    73         $action_ids = $instance['action_ids']; 
     73                 
     74                $action_array = array(); 
     75                $args = array('post_type' => 'hs-action'); 
     76                $hs_actions = get_posts($args); 
     77                foreach ($hs_actions as $hs_action) { 
     78                    if($instance['action_ids_' . $hs_action->ID]){ 
     79                        array_push($action_array, $hs_action->ID); 
     80                    } 
     81                } 
     82        $action_ids =  implode(",", $action_array); 
    7483 
    7584                echo $myhubspotwp_action->hs_display_action($before_widget, $after_widget, $before_title, $after_title, $hide_title, $action_ids); 
     
    7786 
    7887    /** @see WP_Widget::update */ 
    79     function update($new_instance, $old_instance) {              
     88    function update($new_instance, $old_instance) { 
    8089        $instance = $old_instance; 
    8190        $instance['hide_title'] = $new_instance['hide_title'] ? 1 : 0; 
    82                 $instance['action_ids'] = $new_instance['action_ids']; 
     91 
     92                $args = array('post_type' => 'hs-action'); 
     93                $hs_actions = get_posts($args); 
     94                foreach ($hs_actions as $hs_action) { 
     95                    $instance['action_ids_' . $hs_action->ID] = $new_instance['action_ids_' . $hs_action->ID] ? 1 : 0; 
     96                } 
    8397        return $instance; 
    8498    } 
     
    86100    /** @see WP_Widget::form */ 
    87101    function form($instance) { 
    88         $instance = wp_parse_args($instance, array('hide_title' => '', 'action_ids' => null)); 
     102            $default_instance = array('hide_title' => ''); 
     103            $args = array('post_type' => 'hs-action'); 
     104            $hs_actions = get_posts($args); 
     105            foreach ($hs_actions as $hs_action) { 
     106                $action_key = 'action_ids_' . $hs_action->ID; 
     107                $default_instance[$action_key] = 0; 
     108            } 
     109            $instance = wp_parse_args($instance, $default_instance); 
     110            ?> 
     111            <p><input class="checkbox" type="checkbox" <?php checked($instance['hide_title'], '1'); ?> id="<?php echo $this->get_field_id('hide_title'); ?>" name="<?php echo $this->get_field_name('hide_title'); ?>" /> <label for="<?php echo $this->get_field_id('hide_title'); ?>"><?php _e('Hide Title'); ?></label></p> 
     112            <p><strong>Select Calls to Action:</strong><br /> 
     113            <?php 
     114            foreach ($hs_actions as $hs_action) { 
     115                setup_postdata($hs_action); ?> 
     116                <input class="checkbox" type="checkbox" <?php checked($instance['action_ids_' . $hs_action->ID], '1'); ?> value="<?php _e($hs_action->ID); ?>" name="<?php echo $this->get_field_name('action_ids_' . $hs_action->ID); ?>" id="<?php echo $this->get_field_id('hs-action-' . $hs_action->ID); ?>" /> <label for="<?php echo $this->get_field_id('hs-action-' . $hs_action->ID); ?>"><?php _e($hs_action->post_title); ?></label> 
     117                <br /> 
     118                <?php 
     119            } 
     120        ?> 
     121        </p> 
    89122 
    90         ?>   
    91         <p><input class="checkbox" type="checkbox" <?php checked($instance['hide_title'], '1'); ?> id="<?php echo $this->get_field_id('hide_title'); ?>" name="<?php echo $this->get_field_name('hide_title'); ?>" /> <label for="<?php echo $this->get_field_id('hide_title'); ?>"><?php _e('Hide Title'); ?></label></p> 
    92         <p><label for="<?php echo $this->get_field_id('action_ids'); ?>"><?php _e('Action IDs:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('action_ids'); ?>" name="<?php echo $this->get_field_name('action_ids'); ?>" type="text" value="<?php echo $instance['action_ids']; ?>" /></label></p> 
    93123        <?php 
    94124    } 
  • hubspot/trunk/hubspot.php

    r355407 r361811  
    44Description: The HubSpot for WordPress plugin integrates the power of HubSpot with your WordPress site 
    55Author: HubSpot 
    6 Version: 1.2.3 
     6Version: 1.3 
    77Requires at least: 2.9 
    88Author URI: http://www.hubspot.com 
     
    4343// Include needed files 
    4444//============================================= 
    45 require_once(HUBSPOT_PATH."/hs-social.php"); 
    46 require_once(HUBSPOT_PATH."/hs-action.php"); 
    47 require_once(HUBSPOT_PATH."/hs-analytics.php"); 
    48 require_once(HUBSPOT_PATH."/hs-contact.php"); 
    49 require_once(HUBSPOT_PATH."/hs-team.php"); 
    50 require_once(HUBSPOT_PATH."/hs-leads.php"); 
     45require_once(HUBSPOT_PATH."/inc/hs-social.php"); 
     46require_once(HUBSPOT_PATH."/inc/hs-action.php"); 
     47require_once(HUBSPOT_PATH."/inc/hs-analytics.php"); 
     48require_once(HUBSPOT_PATH."/inc/hs-contact.php"); 
     49require_once(HUBSPOT_PATH."/inc/hs-team.php"); 
     50require_once(HUBSPOT_PATH."/inc/hs-leads.php"); 
    5151require_once(HUBSPOT_PATH."/hs-admin.php"); 
    5252require_once(HUBSPOT_PATH."/hs-widgets.php"); 
     53require_once(HUBSPOT_PATH."/hs-wysiwyg.php"); 
    5354require_once(HUBSPOT_PATH."/hs-notice.php"); 
    5455 
     
    6465         
    6566        $myhubspotwp_admin = new WPHubspotAdmin(); 
     67                $myhubspotwp_editor = new WPHubspotCustomEditor(); 
    6668         
    6769        $myhubspotwp_analytics = new WPHubspotAnalytics(); 
     
    108110                        "hs_actions_stats_disabled" =>'', 
    109111                        "hs_leads_enabled"          =>'on', 
    110                         "hs_leads_url"          =>'', 
    111112                        "hs_leads_html"         =>array(""), 
    112113                        "hs_hubfeed_url"        =>'', 
  • hubspot/trunk/readme.txt

    r355407 r361811  
    11=== HubSpot for WordPress === 
    22Contributors: bwhalley, JonBishop, hubspot 
    3 Tags: analytics, hubspot, tracking code, feedburner, action, call to action, team, about, contact, form, leads, api, shortcode, widget, dashboard, post, admin, sidebar, twitter, page, inbound, business, marketing 
     3Tags: analytics, hubspot, tracking code, feedburner, action, call to action, team, about, contact, form, leads, api, shortcode, widget, dashboard, post, admin, sidebar, twitter, page, inbound, business, marketing, google map, call to action, cta, ad manager 
    44Requires at least: 2.9 
    55Tested up to: 3.1 
    6 Stable tag: 1.2.3 
     6Stable tag: 1.3 
    77 
    88Allows WordPress users to take advantage of HubSpot lead nurturing, website analytics, and assorted features of the HubSpot CMS. 
     
    6868= Can I run this plugin together with a Google Analytics plugin? = 
    6969 
    70 Yes, definitely. Go for it!  
     70Yes, definitely. Go for it! 
     71 
     72= Do you have to be a HubSpot client to use this plugin? = 
     73 
     74For most of the functionality, yes. Some things (Like the Call to Action manager, some widgets and some shortcodes) work without being a HubSpot customer, but the really good stuff (like Lead Tracking and Analytics) require a HubSpot account. 
     75 
     76= How do you monitor in analytics how the call to action lead to a goal? = 
     77 
     78Right now, there is not a clear path from a specific call to action to a specific Lead. You can look at how many leads you have received from a certain form, against the number of clicks that call to action has had, and find out how successful a specific Call to Action has been at generating Leads. 
     79 
     80= Which version of HubSpot do we have to be using in order to use plugin? = 
     81 
     82To use the Analytics integration, you need a version of HubSpot that supports the external site tracking code, which includes Medium, Large, and some editions of Small. 
     83 
     84= Can they be coded? = 
     85 
     86I think you're asking if you can use HTML in Calls to Action. The answer is yes :) It uses the default WordPress editor, 
     87 
     88= What steps we need to take if we already have the tracking code and would like to use this new plugin? = 
     89 
     90If you're already using HubSpot's tracking code, you should remove the original tracking code you added before adding this plugin. Otherwise, you will wind up with visits being counted twice, as two copies of the JavaScript are installed. 
     91 
     92= What about validation errors, will it still maintain my WP theme? = 
     93 
     94The plugin uses minimum CSS and inserts valid HTML when necessary. 
     95 
     96= What are the guidelines for when we include CTAs with the plug-in or when we use Hubspot directly? = 
     97 
     98If I were in your position, I would always use CTAs, which point to Pages on my WordPress site. I'd use HubSpot Exported HTML Forms on those pages. That way, you have a smooth consistent experience on your site, 
     99 
     100= Can you set up categories for the Call to Action feature so that you can control which forms are shown versus a free for all of all forms? = 
     101 
     102You can choose which CTAs to randomly rotate through when inserting CTAs into your site. 
     103 
     104= Can you use the Hubspot plug in with themes like Headway, Thesis or others? = 
     105 
     106Yup! The WordPress plugin is theme-agnostic. 
     107 
     108= Can you do image CTAs? = 
     109 
     110Definitely! We use the standard WordPress editor, so you can even use anything that is in your WordPress image library for your CTA. 
     111 
     112= Do you put the shortcode into the HTML tab or can you put it in the visual tab, too? = 
     113 
     114You can put it in either. On the visual editor there is a button to make inserting shortcodes a snap. 
     115 
     116= If you have multiple wordpress pages under the same account - that have different social media sites can you use the "follow me" function with different social media site links in the follow me widget? = 
     117 
     118The Follow Me block is set up the same as however you configured Follow Me in HubSpot. If you can set up the HubSpot Follow Me block to work the way that you'd like, it will work here as well. 
     119 
     120= Is there any written information as a guide? = 
     121 
     122There is written documentation inside of the plugin, which you can access by clicking on "Help" in the top right of any page. 
     123 
     124= Can I use the subscriber Form without Feedburner, which I can't use because I have various feeds = 
     125 
     126Unfortunately no - This Subscriber widget is a frontend to Feedburner's interface specifically. 
     127 
     128= Where do we find the Hubspot Feed again? = 
     129 
     130It's available by clicking on the orange RSS icon next to the word "HubFeed" on your dashboard. 
    71131 
    72132= Where do I find my feedburner feed? = 
     
    1001603. Actions Manager with stats 
    1011614. Shortcodes settings 
     1625. Visual Editor pop-up for inserting shortcodes 
    102163 
    103164== Changelog == 
     165 
     166= 1.3 = 
     167* Added button with pop-up to visual editor to make inserting shortcodes easier 
     168* Changed call to action notices 
     169* Can select which team members to display 
     170* Can now add custom maps on pages/posts 
     171* Changed contextual help to reflect new features 
     172* New screenshot and FAQ 
    104173 
    105174= 1.2.3 = 
     
    174243== Upgrade Notice == 
    175244 
     245= 1.3 = 
     246Button on visual editor makes adding HubSpot shortcodes easier than ever. New settings also let you selectively display team members and calls to action. 
     247 
    176248= 1.2 = 
    177249Support for multiple HubSpot forms and added HubFeed as a dashboard widget 
Note: See TracChangeset for help on using the changeset viewer.