Commit 5f8650ef authored by githue's avatar githue

Merge branch 'develop' into issue/3704.

Remove duplicate CSV rows using array_shift instead of substr, and make
the line terminator filterable.
parent 58e5c2ec
Pipeline #583 passed with stage
in 1 minute and 26 seconds
......@@ -19,6 +19,7 @@ deploy-old.sh
tests/
vendor/
composer.lock
package-lock.json
*.sass-cache
*.scssc
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
assets/img/add-ons/webhooks.png

8.27 KB | W: | H:

assets/img/add-ons/webhooks.png

19 KB | W: | H:

assets/img/add-ons/webhooks.png
assets/img/add-ons/webhooks.png
assets/img/add-ons/webhooks.png
assets/img/add-ons/webhooks.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
This diff is collapsed.
......@@ -44,7 +44,7 @@ define( ['models/formModel'], function( FormModel ) {
messageBox = document.createElement( 'p' );
title = document.createElement( 'em' );
buttons = document.createElement( 'div' );
confirm = document.createElement( 'div' );
confirm = document.createElement( 'button' );
cancel = document.createElement( 'div' );
container.classList.add( 'message' );
......@@ -121,9 +121,10 @@ define( ['models/formModel'], function( FormModel ) {
} );
var btnConfirm = this.modal.container[0].getElementsByClassName('confirm')[0];
btnConfirm.addEventListener('click', function() {
btnConfirm.addEventListener('click', function( e ) {
e.preventDefault();
var deleteInputVal = document.getElementById( 'confirmDeleteFormInput' ).value;
if( 'DELETE' === deleteInputVal ) {
that.confirmDelete(view);
} else {
......
......@@ -10,7 +10,7 @@
},
{
"title":"MailChimp",
"image":"assets/img/add-ons/mailchimp-for-ninja-forms.png",
"image":"assets/img/add-ons/mail-chimp.png",
"content":"Quickly create newsletter signup forms for your MailChimp account.",
"link":"https://ninjaforms.com/extensions/mail-chimp/?utm_medium=plugin&utm_source=plugin-addons-page&utm_campaign=Ninja+Forms+Addons+Page&utm_content=MailChimp",
"plugin":"ninja-forms-mail-chimp/ninja-forms-mail-chimp.php",
......
......@@ -89,7 +89,10 @@ class NF_Admin_CPT_DownloadAllSubmissions extends NF_Step_Processing {
}
$export .= NF_Database_Models_Submission::export( $this->args['form_id'], $sub_ids, TRUE );
if( 1 < $this->step ) {
$export = substr( $export, strpos( $export, "\n" ) + 1 );
$stack = explode( apply_filters( 'nf_sub_csv_terminator', "\n" ), $export );
array_shift($stack);
$stack = implode( apply_filters( 'nf_sub_csv_terminator', "\n" ), $stack );
$export = $stack;
}
fwrite( $myfile, $export );
......
......@@ -28,20 +28,31 @@ final class NF_Admin_Menus_Addons extends NF_Abstracts_Submenu
public function display()
{
//wp_enqueue_style( 'nf-admin-addons', Ninja_Forms::$url . 'assets/css/admin-addons.css' );
// $items = wp_remote_get( 'https://ninjaforms.com/?extend_feed=jlhrbgf89734go7387o4g3h' );
// $items = wp_remote_retrieve_body( $items );
$items = file_get_contents( Ninja_Forms::$dir . '/deprecated/addons-feed.json' );
$items = json_decode( $items, true );
// Fetch our marketing feed.
$saved = get_option( 'ninja_forms_addons_feed', false );
// If we got back nothing...
if ( ! $saved ) {
// Default to the in-app file.
$items = file_get_contents( Ninja_Forms::$dir . '/deprecated/addons-feed.json' );
$items = json_decode( $items, true );
} // Otherwise... (We did get something from the db.)
else {
// Use the data we fetched.
$items = json_decode( $saved, true );
}
//shuffle( $items );
$notices = array();
foreach ($items as $item) {
foreach ($items as &$item) {
$plugin_data = array();
if( !empty( $item['plugin'] ) && file_exists( WP_PLUGIN_DIR.'/'.$item['plugin'] ) ){
$plugin_data = get_plugin_data( WP_PLUGIN_DIR.'/'.$item['plugin'], false, true );
}
if ( ! file_exists( Ninja_Forms::$dir . '/' . $item[ 'image' ] ) ) {
$item[ 'image' ] = 'assets/img/add-ons/placeholder.png';
}
$version = isset ( $plugin_data['Version'] ) ? $plugin_data['Version'] : '';
......
......@@ -10,6 +10,8 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
public $position = '35.1337';
public $ver = Ninja_Forms::VERSION;
// Stores whether or not this form has a password field.
private $legacy_password = false;
......@@ -135,9 +137,9 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
wp_enqueue_script( 'backbone-radio', Ninja_Forms::$url . 'assets/js/lib/backbone.radio.min.js', array( 'jquery', 'backbone' ) );
wp_enqueue_script( 'backbone-marionette-3', Ninja_Forms::$url . 'assets/js/lib/backbone.marionette3.min.js', array( 'jquery', 'backbone' ) );
wp_enqueue_script( 'nf-jbox', Ninja_Forms::$url . 'assets/js/lib/jBox.min.js', array( 'jquery' ) );
wp_enqueue_script( 'nf-ninjamodal', Ninja_Forms::$url . 'assets/js/lib/ninjaModal.js', array( 'jquery' ) );
wp_enqueue_script( 'nf-ninjamodal', Ninja_Forms::$url . 'assets/js/lib/ninjaModal.js', array( 'jquery' ), $this->ver );
wp_enqueue_script( 'nf-moment', Ninja_Forms::$url . 'assets/js/lib/moment-with-locales.min.js', array( 'jquery', 'nf-dashboard' ) );
wp_enqueue_script( 'nf-dashboard', Ninja_Forms::$url . 'assets/js/min/dashboard.min.js', array( 'backbone-radio', 'backbone-marionette-3' ) );
wp_enqueue_script( 'nf-dashboard', Ninja_Forms::$url . 'assets/js/min/dashboard.min.js', array( 'backbone-radio', 'backbone-marionette-3' ), $this->ver );
$current_user = wp_get_current_user();
wp_localize_script( 'nf-dashboard', 'nfi18n', Ninja_Forms::config( 'i18nDashboard' ) );
......@@ -154,8 +156,8 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
'cleanup' == $_REQUEST[ 'action' ] ) ? 1 : 0,
) );
wp_enqueue_style( 'nf-builder', Ninja_Forms::$url . 'assets/css/builder.css' );
wp_enqueue_style( 'nf-dashboard', Ninja_Forms::$url . 'assets/css/dashboard.min.css' );
wp_enqueue_style( 'nf-builder', Ninja_Forms::$url . 'assets/css/builder.css', array(), $this->ver );
wp_enqueue_style( 'nf-dashboard', Ninja_Forms::$url . 'assets/css/dashboard.min.css', array(), $this->ver );
wp_enqueue_style( 'nf-jbox', Ninja_Forms::$url . 'assets/css/jBox.css' );
wp_enqueue_style( 'nf-font-awesome', Ninja_Forms::$url . 'assets/css/font-awesome.min.css' );
......@@ -201,7 +203,7 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
wp_enqueue_media();
wp_enqueue_style( 'nf-builder', Ninja_Forms::$url . 'assets/css/builder.css' );
wp_enqueue_style( 'nf-builder', Ninja_Forms::$url . 'assets/css/builder.css', array(), $this->ver );
wp_enqueue_style( 'nf-font-awesome', Ninja_Forms::$url . 'assets/css/font-awesome.min.css' );
/**
* CSS Libraries
......@@ -224,7 +226,7 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
wp_enqueue_script( 'jquery-perfect-scrollbar', Ninja_Forms::$url . 'assets/js/lib/perfect-scrollbar.jquery.min.js', array( 'jquery' ) );
wp_enqueue_script( 'jquery-hotkeys-new', Ninja_Forms::$url . 'assets/js/lib/jquery.hotkeys.min.js' );
wp_enqueue_script( 'jBox', Ninja_Forms::$url . 'assets/js/lib/jBox.min.js' );
wp_enqueue_script( 'nf-ninjamodal', Ninja_Forms::$url . 'assets/js/lib/ninjaModal.js', array( 'jBox' ) );
wp_enqueue_script( 'nf-ninjamodal', Ninja_Forms::$url . 'assets/js/lib/ninjaModal.js', array( 'jBox' ), $this->ver );
wp_enqueue_script( 'nf-jquery-caret', Ninja_Forms::$url . 'assets/js/lib/jquery.caret.min.js' );
wp_enqueue_script( 'speakingurl', Ninja_Forms::$url . 'assets/js/lib/speakingurl.js' );
wp_enqueue_script( 'jquery-slugify', Ninja_Forms::$url . 'assets/js/lib/slugify.min.js', array( 'jquery', 'speakingurl' ) );
......@@ -242,7 +244,7 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
wp_enqueue_script( 'summernote', Ninja_Forms::$url . 'assets/js/lib/summernote.min.js', array( 'jquery', 'speakingurl' ) );
wp_enqueue_script( 'nf-builder', Ninja_Forms::$url . 'assets/js/min/builder.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-effects-bounce', 'wp-color-picker' ) );
wp_enqueue_script( 'nf-builder', Ninja_Forms::$url . 'assets/js/min/builder.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-effects-bounce', 'wp-color-picker' ), $this->ver );
wp_localize_script( 'nf-builder', 'nfi18n', Ninja_Forms::config( 'i18nBuilder' ) );
$home_url = parse_url( home_url() );
......
......@@ -9,7 +9,7 @@ return apply_filters( 'ninja_forms_available_actions', array(
'link' => 'https://ninjaforms.com/extensions/mail-chimp/?utm_medium=plugin&utm_source=plugin&utm_campaign=Ninja+Forms+Actions+Drawer&utm_content=MailChimp',
'plugin_path' => 'ninja-forms-mail-chimp/ninja-forms-mail-chimp.php',
'modal_content' => '<div class="available-action-modal">
<img src="' . Ninja_Forms::$url . 'assets/img/add-ons/mailchimp-for-ninja-forms.png"/>
<img src="' . Ninja_Forms::$url . 'assets/img/add-ons/mail-chimp.png"/>
<p>In order to use this action, you need MailChimp for Ninja Forms.</p>
<p>The MailChimp extension allows you to quickly create newsletter signup forms for your MailChimp account using the power and flexibility that Ninja Forms provides.</p>
<div class="actions">
......
......@@ -19,5 +19,17 @@ return apply_filters( 'ninja-forms-dashboard-promotions', array(
"
),
/*
|--------------------------------------------------------------------------
| Ninja Shop
|--------------------------------------------------------------------------
|
*/
'ninja-shop' => array(
'id' => 'ninja-shop',
'content' => '<a href="https://getninjashop.com/?utm_medium=dashboard_banner&utm_source=ninja-forms&utm_campaign=Awareness" target="_blank" style="color:#FFF !important;background:#5DA54B;"><span class="dashicons dashicons-cart"></span>' . __( 'Are you frustrated with complicated eCommerce solutions?', 'ninja-forms' ) . '<br /><span class="cta">' . __( 'Start Selling Today With Ninja Shop!', 'ninja-forms' ) . '</span></a>',
'script' => "",
),
));
......@@ -81,7 +81,7 @@ $ads = array(
'type' => 'ad',
'modal-title' => 'Get MailChimp for Ninja Forms',
'modal-content' => '<div class="modal-template">
<img src="' . Ninja_Forms::$url . 'assets/img/add-ons/mailchimp-for-ninja-forms.png"/>
<img src="' . Ninja_Forms::$url . 'assets/img/add-ons/mail-chimp.png"/>
<p>In order to use this template, you need MailChimp for Ninja Forms.</p>
<p>The MailChimp extension allows you to quickly create newsletter signup forms for your MailChimp account using the power and flexibility that Ninja Forms provides.</p>
<div class="actions">
......
......@@ -35,6 +35,8 @@ final class NF_Dispatcher
*
* @since 3.2
* @return void
*
* @updated UPDATE_VERSION_ON_MERGE
*/
public function update_environment_vars() {
global $wpdb;
......@@ -73,6 +75,7 @@ final class NF_Dispatcher
$environment = array(
'nf_version' => Ninja_Forms::VERSION,
'nf_db_version' => get_option( 'ninja_forms_db_version', '1.0' ),
'wp_version' => get_bloginfo('version'),
'multisite_enabled' => $multisite_enabled,
'server_type' => $_SERVER['SERVER_SOFTWARE'],
......
......@@ -119,6 +119,10 @@
<!-- Section: Memberships -->
<script id="tmpl-nf-memberships" type="text/template">
<?php
$saved = get_option( 'ninja_forms_memberships_feed', false );
if ( ! $saved ) {
?>
<div class="widget widget-memberships">
<div class="pricing-container">
<div class="pricing-block widget">
......@@ -134,11 +138,6 @@
<span class="pricing-body-title"><?php _e( 'Unlimited Sites', 'ninja-forms' ); ?></span>
<span><?php _e( 'Updates & Support', 'ninja-forms' ); ?></span>
</div>
<div>
<i class="fa fa-money" aria-hidden="true"></i>
<span class="pricing-body-title"><?php _e( '50% off recurring renewals', 'ninja-forms' ); ?></span>
<span><?php _e( 'Renews at $249.50/year', 'ninja-forms' ); ?></span>
</div>
<div>
<i class="fa fa-rocket" aria-hidden="true"></i>
<span class="pricing-body-title"><?php _e( 'Fastest Support', 'ninja-forms' ); ?></span>
......@@ -175,11 +174,6 @@
<span class="pricing-body-title"><?php _e( '20 Sites', 'ninja-forms' ); ?></span>
<span><?php _e( 'Updates & Support', 'ninja-forms' ); ?></span>
</div>
<div>
<i class="fa fa-money" aria-hidden="true"></i>
<span class="pricing-body-title"><?php _e( '50% off recurring renewals', 'ninja-forms' ); ?></span>
<span><?php _e( 'Renews at $99.50/year', 'ninja-forms' ); ?></span>
</div>
<div>
<i class="fa fa-plane" aria-hidden="true"></i>
<span class="pricing-body-title"><?php _e( 'Faster Support', 'ninja-forms' ); ?></span>
......@@ -208,11 +202,6 @@
<span class="pricing-body-title"><?php _e( '1 Site', 'ninja-forms' ); ?></span>
<span><?php _e( 'Updates & Support', 'ninja-forms' ); ?></span>
</div>
<div>
<i class="fa fa-money" aria-hidden="true"></i>
<span class="pricing-body-title"><?php _e( '50% off recurring renewals', 'ninja-forms' ); ?></span>
<span><?php _e( 'Renews at $49.50/year', 'ninja-forms' ); ?></span>
</div>
<div>
<i class="fa fa-car" aria-hidden="true"></i>
<span class="pricing-body-title"><?php _e( 'Fast Support', 'ninja-forms' ); ?></span>
......@@ -234,9 +223,14 @@
<div class="widget widget-plan-notice">
<p class="widget-title"><?php _e( 'That sounds amazing! What else comes with Ninja Forms?', 'ninja-forms' ); ?></p>
<a href="https://ninjaforms.com/features/?utm_medium=plugin&utm_source=plugin-dashboard&utm_campaign=Ninja+Forms+Memberships&utm_content=Features" target="_blank" class="nf-button primary feature-list-link"><?php _e( 'We\'re glad you asked! Checkout our full list of features!', 'ninja-forms' ); ?> <i class="fa fa-chevron-circle-right" aria-hidden="true"></i></a>
<div><em><?php _e( 'All plans include 50% discount on automatic renewals, and a 14 day money back guarantee.', 'ninja-forms' ); ?></em></div>
<div><em><?php _e( 'All plans include a 14 day money back guarantee.', 'ninja-forms' ); ?></em></div>
<div><?php _e( 'Requires a current active license and subject to our', 'ninja-forms' ); ?> <a target="_blank" href="https://ninjaforms.com/terms-conditions/?utm_medium=plugin&utm_source=plugin-dashboard&utm_campaign=Ninja+Forms+Memberships&utm_content=Terms+Conditions"><?php _e( 'Terms & Conditions', 'ninja-forms' ); ?></a>.</div>
</div>
<?php
} else {
echo( $saved );
}
?>
</script>
<!-- Widget: Forms -->
......
......@@ -974,12 +974,24 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf
}
add_action( 'nf_optin_cron', 'nf_optin_update_environment_vars' );
// Custom Cron Recurrences
/**
* Function to register our Custom Cron Recurrences.
*
* @param $schedules (Array) The available cron recurrences.
* @return (Array) The filtered cron recurrences.
*
* @since
* @updated UPDATE_VERSION_ON_MERGE
*/
function nf_custom_cron_job_recurrence( $schedules ) {
$schedules[ 'nf-monthly' ] = array(
'display' => __( 'Once per month', 'ninja-forms' ),
'interval' => 2678400,
);
$schedules[ 'nf-weekly' ] = array(
'display' => __( 'Once per week', 'ninja-forms' ),
'interval' => 604800,
);
return $schedules;
}
add_filter( 'cron_schedules', 'nf_custom_cron_job_recurrence' );
......@@ -990,6 +1002,42 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf
wp_schedule_event( current_time( 'timestamp' ), 'nf-monthly', 'nf_optin_cron' );
}
}
add_action( 'wp', 'nf_optin_send_admin_email_cron_job' );
/**
* Function called via weekly wp_cron to update our marketing feeds.
*
* @since UPDATE_VERSION_ON_MERGE
*/
function nf_update_marketing_feed() {
// Fetch our membership data.
$data = wp_remote_get( 'http://api.ninjaforms.com/feeds/?fetch=memberships' );
// If we got a valid response...
if ( 200 == $data[ 'response' ][ 'code' ] ) {
// Save the data to our option.
$data = wp_remote_retrieve_body( $data );
update_option( 'ninja_forms_memberships_feed', $data, false );
}
// Fetch our addon data.
$data = wp_remote_get( 'http://api.ninjaforms.com/feeds/?fetch=addons' );
// If we got a valid response...
if ( 200 == $data[ 'response' ][ 'code' ] ) {
// Save the data to our option.
$data = wp_remote_retrieve_body( $data );
update_option( 'ninja_forms_addons_feed', $data, false );
}
}
add_action( 'nf_marketing_feed_cron', 'nf_update_marketing_feed' );
/**
* Function called by our marketing feed cron.
*
* @since UPDATE_VERSION_ON_MERGE
*/
function nf_marketing_feed_cron_job() {
if ( ! wp_next_scheduled( 'nf_marketing_feed_cron' ) ) {
wp_schedule_event( current_time( 'timestamp' ), 'nf-weekly', 'nf_marketing_feed_cron' );
}
}
add_action( 'wp', 'nf_marketing_feed_cron_job' );
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment