Skip to content

Commit

Permalink
Merge branch 'release/1.9.9.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
atwellpub committed Feb 22, 2019
2 parents acf5714 + 04f2185 commit 5a4613a
Show file tree
Hide file tree
Showing 18 changed files with 251 additions and 118 deletions.
4 changes: 2 additions & 2 deletions classes/admin/class.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -880,8 +880,8 @@ public static function render_fields( $page ) {
case false:
/* WPEngine advertisement here */
echo ' <div class="inbound-settings-group" style="margin-left:auto;margin-right:auto;text-align:center;">
<h4><b>Sponsored Moment: Inbound PRO works great on WPEngine.</b></h4>
<a target="_blank" href="https://shareasale.com/r.cfm?b=1291526&amp;u=1220301&amp;m=41388&amp;urllink=&amp;afftrack="><img src="https://static.shareasale.com/image/41388/SPThemePromoWebBanner728x90V1.png" border="0" /></a>
<h4><b>Sponsored Moment: Inbound PRO works great on WPEngine. Get 4 months free on annual Startup, Growth, and Scale plans when you use our coupon code WPE20OFF.</b></h4>
<a target="_blank" href="http://www.shareasale.com/r.cfm?B=1255604&U=1220301&M=41388"><img src="https://www.inboundnow.com/wp-content/uploads/2016/12/Inbound-Now-728x90.png" border="0" /></a>
</div>';
echo ' </div>';
break;
Expand Down
64 changes: 61 additions & 3 deletions core/automation/classes/class.post-type.automation.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ private function load_hooks() {

/* Load Admin Only Hooks */
if (is_admin()) {
add_action( 'admin_init' , array( __CLASS__ , 'register_role_capabilities' ) ,999);

/* Register Columns */
add_filter( 'manage_automation_posts_columns' , array( __CLASS__ , 'register_columns') );
Expand Down Expand Up @@ -50,6 +51,9 @@ private function load_hooks() {

/* process bulk actions */
add_action('load-edit.php', array(__CLASS__, 'process_bulk_actions'));

add_action('admin_notices', array( __CLASS__ , 'prompt_rebuild_database' ) );

}
}

Expand Down Expand Up @@ -78,7 +82,7 @@ public static function register_post_type() {
'menu_icon' => '',
'show_in_menu' => true,
'show_in_nav_menus' => false,
'capability_type' => 'post',
'capability_type' => array('rule','rules'),
'hierarchical' => false,
'menu_position' => 35,
'supports' => array('title')
Expand All @@ -88,6 +92,35 @@ public static function register_post_type() {

}

/**
* Register Role Capabilities
*/
public static function register_role_capabilities() {
// Add the roles you'd like to administer the custom post types
$roles = array('inbound_marketer','administrator');

// Loop through each role and assign capabilities
foreach($roles as $the_role) {

$role = get_role($the_role);
if (!$role) {
continue;
}

$role->add_cap( 'read' );
$role->add_cap( 'read_rules');
$role->add_cap( 'read_private_rules' );
$role->add_cap( 'edit_rule' );
$role->add_cap( 'edit_rules' );
$role->add_cap( 'edit_others_rules' );
$role->add_cap( 'edit_published_rules' );
$role->add_cap( 'publish_rules' );
$role->add_cap( 'delete_others_rules' );
$role->add_cap( 'delete_private_rules' );
$role->add_cap( 'delete_published_rules' );
}
}

/**
* Get Automation Rules as Array
* @return array
Expand Down Expand Up @@ -198,7 +231,7 @@ public static function enqueue_admin_scripts( $hook ) {
}

public static function setup_menus() {
if ( !current_user_can('manage_options')) {
if ( !current_user_can('edit_rules')) {
remove_menu_page( 'edit.php?post_type=automation' );
}
}
Expand Down Expand Up @@ -264,7 +297,7 @@ public static function process_bulk_actions() {
return;
}

if (!current_user_can('manage_options')) {
if (!current_user_can('edit_rules')) {
die();
}

Expand Down Expand Up @@ -369,6 +402,31 @@ public static function ajax_clear_rule_tasks() {
echo $rule_id;
exit;
}

/**
* Checks to see if email service Key is inputed. If it's not then it throws the notice
*/
public static function prompt_rebuild_database() {
global $post , $wpdb;


if (!isset($post)||$post->post_type!='automation'){
return false;
}

/* Check if database table exists exists */
$table_name = $wpdb->prefix.'inbound_automation_queue';
if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name) {
return;
}
?>
<div class="error">
<p><?php echo sprintf(__('WARNING: Required database table %s not found. %sClick here to rebuild table.%s' ,'inbound-pro') , $table_name, '<a href="' . admin_url('edit.php?post_type=automation&force_upgrade_routines=true') . '">','</a>'); ?></p>
</div>
<?php

}

}

/* Load Automation Post Type Pre Init */
Expand Down
4 changes: 2 additions & 2 deletions core/cta/calls-to-action.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Calls to Action
Plugin URI: http://www.inboundnow.com/cta/
Description: Display Targeted Calls to Action on your WordPress site.
Version: 3.3.10
Version: 3.3.11
Author: Inbound Now
Author URI: https://www.inboundnow.com/
Text Domain: cta
Expand Down Expand Up @@ -34,7 +34,7 @@ public function __construct() {
*/
private static function define_constants() {

define('WP_CTA_CURRENT_VERSION', '3.3.10' );
define('WP_CTA_CURRENT_VERSION', '3.3.11' );
define('WP_CTA_URLPATH', plugins_url( '/' , __FILE__ ) );
define('WP_CTA_PATH', plugin_dir_path( __FILE__ ) );
define('WP_CTA_SLUG', 'cta' );
Expand Down
4 changes: 2 additions & 2 deletions core/cta/classes/class.cta.variations.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public static function load_hooks() {
/* Listens for commands */
public static function add_listeners() {

/* Start session */
if(session_id() == '') {
/* Start session - file fixes issue with wp editor*/
if(session_id() == '' && !isset($_GET['file']) ) {
session_start();
}

Expand Down
48 changes: 42 additions & 6 deletions core/cta/classes/class.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public static function display_navigation() {
self::$active_tab = sanitize_text_field($_REQUEST['open-tab']);
}

echo '<h2 class="nav-tab-wrapper">';
echo '<h2 class="nav-tab-wrapper" style="height:27px;">';

foreach (self::$core_settings as $key => $data) {
?>
Expand All @@ -170,7 +170,7 @@ public static function display_navigation() {
}
echo "</h2>";

echo "<form action='edit.php?post_type=wp-call-to-action&page=wp_cta_global_settings' method='POST'>
echo "<form action='edit.php?post_type=wp-call-to-action&page=wp_cta_global_settings' method='POST' style='margin-bottom:20px;'>
<input type='hidden' name='nature' value='wp-cta-global-settings-save'>
<input type='hidden' name='open-tab' id='id-open-tab' value='" . self::$active_tab . "'>";

Expand Down Expand Up @@ -232,7 +232,7 @@ public static function display_stand_alone_settings() {

self::inline_js();
self::save_stand_alone_settings();
self::display_sidebar();
//self::display_sidebar();
self::display_navigation();

foreach (self::$core_settings as $key => $data) {
Expand All @@ -242,7 +242,7 @@ public static function display_stand_alone_settings() {
}


echo '<div style="float:left;padding-left:9px;padding-top:20px;">
echo '<div style="float:left;padding-left:9px;padding-top:20px;margin-bottom:20px;">
<input type="submit" value="Save Settings" tabindex="5" id="wp-cta-button-create-new-group-open" class="button-primary" >
</div>';
echo "</form>";
Expand Down Expand Up @@ -323,6 +323,42 @@ public static function display_stand_alone_settings() {
</tr>
</table>
</div>
<div id="lp-additional-resources" class="clear">
<hr>
<?php
$rand = rand(0,3);
switch ($rand) {
case 0:
echo ' <div class="" style="margin-left:auto;margin-right:auto;">
<h4><b>Sponsored Moment: Need to hire WordPress assistance? Agents at Codeable are ready to help.</b></h4>
<a href="https://codeable.io/?ref=WwUol">
<img src=\'https://referoo.co/creatives/21/asset.png\' />
</a>
</div>';
echo ' </div>';
break;
case 1:
echo ' <div class="" style="margin-left:auto;margin-right:auto;">
<h4><b>This plugin works great on WPEngine! Use our special offer below to receive 20% off the first annual payment.</b></h4>
<a target="_blank" href="http://www.shareasale.com/r.cfm?B=1255604&U=1220301&M=41388"><img src="https://www.inboundnow.com/wp-content/uploads/2016/12/Inbound-Now-728x90.png" border="0" /></a>
</div>';
echo ' </div>';
break;
case 2:
echo '<div class="" style="margin-left:auto;margin-right:auto;">
<h4>Did you know we offer an enhanced version of this free plugin? - <a target="_blank" href="https://www.inboundnow.com/upgrade/?ref=357">Read more about our Inbound Now PRO plugin.</a></b></h4>
</div>';
echo ' </div>';
break;
case 3:
echo '<div class="" style="margin-left:auto;margin-right:auto;">
<h4><b>Thanks for using our free plugin! - <a target="_blank" href="https://wordpress.org/support/plugin/cta/reviews/?filter=5">Rate us 5 stars to help us grow!</a></b></h4>
</div>';
echo ' </div>';
break;
}
?>
</div>
<?php
}

Expand All @@ -344,7 +380,7 @@ public static function save_stand_alone_setting($key, $custom_fields) {
echo "<input type='hidden' name='wp_cta_{$key}_custom_fields_nonce' value='" . wp_create_nonce('wp-cta-nonce') . "' />";

// Begin the field table and loop
echo '<table class="wp-cta-tab-display" id="' . $key . '" style="display:' . $display . '">';
echo '<table class="wp-cta-tab-display" id="' . $key . '" style="padding:0px;display:' . $display . '">';

foreach ($custom_fields as $field) {
// get value of this field if it exists for this post
Expand Down Expand Up @@ -659,4 +695,4 @@ function load_CTA_Settings() {

add_action('admin_init', 'load_CTA_Settings');

}
}
2 changes: 1 addition & 1 deletion core/landing-pages/assets/js/admin/admin.post-new.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jQuery(document).ready(function ($) {
jQuery("#lp_template_change a").removeClass("button-primary").addClass("button");

// New Sidebar
jQuery("#postbox-container-1").html("<div class='postbox'><center><h3>Download Inbound PRO and join Inbound Now's membership plan for access to premium templates.</h3><a target='_blank' href='http://www.inboundnow.com/market/?show=landing-pages'><img src='"+lp_post_new_ui.LANDINGPAGES_URLPATH+"assets/images/get-wordpress-templates.png'></a><a target='_blank' href='http://www.inboundnow.com/market/?show=landing-pages' class='button new-lp-button button-primary button-large'>Download Landing Page Templates</a></center></div><div class='postbox'><center><h3>Need Custom Template Design?</h3><a target='_blank' href='http://www.inboundnow.com/contact'><img src='"+lp_post_new_ui.LANDINGPAGES_URLPATH+"assets/images/get-custom-setup.png'></a><a target='_blank' href='http://docs.inboundnow.com/guide/default-wp-themes/' class='button new-lp-button button-primary button-large'>Get Custom Template Setup</a></center></div>");
//jQuery("#postbox-container-1").html("<div class='postbox'><center><h3>Download Inbound PRO and join Inbound Now's membership plan for access to premium templates.</h3><a target='_blank' href='http://www.inboundnow.com/market/?show=landing-pages'><img src='"+lp_post_new_ui.LANDINGPAGES_URLPATH+"assets/images/get-wordpress-templates.png'></a><a target='_blank' href='http://www.inboundnow.com/market/?show=landing-pages' class='button new-lp-button button-primary button-large'>Download Landing Page Templates</a></center></div><div class='postbox'><center><h3>Need Custom Template Design?</h3><a target='_blank' href='http://www.inboundnow.com/contact'><img src='"+lp_post_new_ui.LANDINGPAGES_URLPATH+"assets/images/get-custom-setup.png'></a><a target='_blank' href='http://docs.inboundnow.com/guide/default-wp-themes/' class='button new-lp-button button-primary button-large'>Get Custom Template Setup</a></center></div>");

jQuery('.lp_select_template').click(function(){
jQuery(".mceIframeContainer iframe#content_ifr").css("height", "100%");
Expand Down
33 changes: 0 additions & 33 deletions core/landing-pages/classes/class.admin-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public function __construct() {

public static function add_hooks() {
add_action('admin_notices', array( __CLASS__, 'dont_install_landing_page_templates_here'));
add_action('admin_notices', array( __CLASS__, 'get_more_templates_notice' ) );
add_action('admin_notices', array( __CLASS__, 'permalink_structure_notice' ) );
}

Expand Down Expand Up @@ -77,38 +76,6 @@ public static function dont_install_landing_page_templates_here() {
}
}


/**
* Call to action to download more templates
*/
public static function get_more_templates_notice() {
global $pagenow;
$page_string = isset($_GET["page"]) ? $_GET["page"] : "null";
if ((($pagenow == 'edit.php') && ($page_string == "lp_manage_templates")) || (($pagenow == "post-new.php") && (isset($_GET['post_type']) && $_GET['post_type'] == "landing-page"))) {

/* only show administrators */
if( !current_user_can('activate_plugins') ) {
return;
}

?>
<div id="more-templates-button" style="display:none;">
<a target="_blank" href="https://www.inboundnow.com/marketplace/?show=landing-pages" class="button new-lp-button button-primary button-large"><?php _e( 'Download Inbound PRO and join Inbound Now\'s membership plan for access to premium templates.' , 'inbound-pro' ); ?></a>
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
var moretemp = jQuery("#more-templates-button");
jQuery("#bulk_actions").prepend(moretemp);
jQuery(".lp-selection-heading h1").append(moretemp);
jQuery(".lp-selection-heading #more-templates").css("float","right");
jQuery(moretemp).show();
});
</script>
<?php
}
}


/**
* Notice to tell people that a permalink structure besides default must be selected to enable split testing
*/
Expand Down
Loading

0 comments on commit 5a4613a

Please sign in to comment.