setup(); add_action( 'wp_ajax_nf_services', function(){ $services = apply_filters( 'ninja_forms_services', [ 'ninja-forms-addon-manager' => [ 'name' => __( 'Add-on Manager (Beta)', 'ninja-mail' ), 'slug' => 'ninja-forms-addon-manager', 'installPath' => 'ninja-forms-addon-manager/ninja-forms-addon-manager.php', 'description' => 'Install any purchased Ninja Forms add-ons with a single click. No need to download a file or copy/paste a license key! * Won\'t work on a local dev environment.', 'enabled' => null, 'learnMore' => '
Here at Ninja Forms, we love add-ons. Add-ons let us create awesome products that serve very specific users with integrations, workflows, and power features, while keeping those options away from users that don’t need them. It also lets our users pay for what they need, rather than a bloated, one-size-fits-all solution.
Despite all the great things about add-ons, there’s a glaring downside: installing 40+ add-ons and setting up licensing for all of those add-ons is a pain. We’re trying to change all of that with the Ninja Forms Add-on Manager, and we want your help putting it through its paces!
The Add-on Manager makes installing Ninja Forms Add-ons a snap. Once you connect your site to my.ninjaforms.com using the Setup button, you can install add-ons and setup their licenses with a single click!
How it works:
The add-on manager is free to use for anyone that has a Ninja Forms add-on purchase. At the moment, it’s in a Beta state as we work out some bugs. We’d love your feedback. Please, try it out today!
Form submission notifications not hitting your inbox? Some of your visitors getting form feedback via email, others not? By default, your WordPress site sends emails through your web host, which can be unreliable. Your host has spent lots of time and money optimizing to serve your pages, not send your emails.
Ninja Mail is a transactional email service that removes your web host from the email equation.
'; // print_r( error_get_last() ); // echo ''; // }); if ( ! current_user_can('install_plugins') ) die( json_encode( [ 'error' => __( 'Sorry, you are not allowed to install plugins on this site.' ) ] ) ); $plugin = $_REQUEST[ 'plugin' ]; $install_path = $_REQUEST[ 'install_path' ]; include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); //for plugins_api.. $api = plugins_api( 'plugin_information', array( 'slug' => $plugin, 'fields' => array( 'short_description' => false, 'sections' => false, 'requires' => false, 'rating' => false, 'ratings' => false, 'downloaded' => false, 'last_updated' => false, 'added' => false, 'tags' => false, 'compatibility' => false, 'homepage' => false, 'donate_link' => false, ), ) ); if ( is_wp_error( $api ) ) { die( json_encode( [ 'error' => $api->get_error_message() ] ) ); } $plugins = get_plugins(); if( ! isset( $plugins[ $install_path ] ) ){ if ( ! class_exists( 'Plugin_Upgrader' ) ) { include_once ABSPATH . 'wp-admin/includes/file.php'; include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; } include_once plugin_dir_path( __FILE__ ) . 'remote-installer-skin.php'; ob_start(); $upgrader = new \Plugin_Upgrader( new Remote_Installer_Skin() ); $install = $upgrader->install( $api->download_link ); ob_clean(); if( ! $install ){ die( json_encode( [ 'error' => $upgrader->skin->get_errors() ] ) ); } } if( ! is_plugin_active($plugin) ){ ob_start(); $activated = activate_plugin( $install_path ); ob_clean(); if( is_wp_error( $activated ) ){ die( json_encode( [ 'error' => $activated->get_error_message() ] ) ); } } $response = apply_filters( 'nf_services_installed_' . $plugin, '1' ); echo json_encode( $response ); die( '1' ); }); /** * Override the Ninja Mail download link until published in the repository. */ /* add_filter( 'plugins_api_result', function( $response, $action, $args ){ if( 'plugin_information' !== $action ) return $response; if( 'ninja-mail' !== $args->slug ) return $response; $response = new \stdClass(); $response->download_link = 'http://my.ninjaforms.com/wp-content/uploads/ninja-mail-792d39446223d14b8464e214773e7786627855d8.zip'; return $response; }, 10, 3 ); */ /** * Override the Add-on Manager download link until published in the repository. */ /* add_filter( 'plugins_api_result', function( $response, $action, $args ){ if( 'plugin_information' !== $action ) return $response; if( 'ninja-forms-addon-manager' !== $args->slug ) return $response; $response = new \stdClass(); $response->download_link = 'http://my.ninjaforms.com/wp-content/uploads/ninja-forms-addon-manager-4b6a3f724b27d6d9f7d4e89ebe12dad215ec1b20.zip'; return $response; }, 10, 3 ); add_filter( 'http_request_args', function( $args, $url ){ if( defined( 'WP_DEBUG' ) && WP_DEBUG ) { $args['sslverify'] = false; // Local development $args['reject_unsafe_urls'] = false; } return $args; }, 10, 2 ); */