Plugin Directory

Changeset 1910320


Ignore:
Timestamp:
07/17/2018 10:41:34 AM (8 years ago)
Author:
kstover
Message:

Updating to version 3.0.12. See changelog for details.

Location:
ninja-forms-addon-manager
Files:
32 added
4 edited

Legend:

Unmodified
Added
Removed
  • ninja-forms-addon-manager/trunk/includes/app/webhooks/webhook-install.php

    r1891101 r1910320  
    8383    * Literally installs the plugin
    8484    *
     85    * @since 3.0.12 Updated download URL/Link to use EDD SL endpoint.
     86    *
    8587    * @param string $download Download slug.
    8688    * @param string $license Valid license key.
     
    9193    private function _install_plugin( $download, $license, $api_url )
    9294    {
    93         $api_args = array_merge( array(
    94             'item_name'  => urlencode( $download ),
    95             'license'    => $license,
    96         ), Plugin::config( 'edd', 'download_link' ) );
     95      $download_url = add_query_arg( array(
     96        'edd_action' => 'get_version',
     97        'item_name' => $download,
     98        'license' => $license,
     99        'url' => site_url(),
     100      ), 'https://ninjaforms.com/' );
    97101
    98         $download_link = add_query_arg( $api_args, $api_url );
     102      $response = wp_remote_get( $download_url );
     103      $response_body = wp_remote_retrieve_body( $response );
     104      $response_body_parsed = json_decode( $response_body );
     105
     106      $download_link = $response_body_parsed->download_link;
    99107
    100108        if ( ! class_exists( 'Plugin_Upgrader' ) ) {
  • ninja-forms-addon-manager/trunk/includes/plugin.php

    r1891101 r1910320  
    88final class Plugin extends WordPress\Plugin
    99{
     10    const NINJA_FORMS_MIN_VERSION = '3.3.2';
     11
    1012    public function setup( $version, $file ) {
    1113
     
    2527        if( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
    2628          add_filter( 'http_request_args', [ $this, 'whitelist_request' ], 10, 2 );
     29        }
     30
     31        if( ! self::is_ninja_forms_installed() || ! self::is_ninja_forms_compatible( \Ninja_Forms::VERSION, self::NINJA_FORMS_MIN_VERSION ) ){
     32          add_action( 'admin_notices', [ $this, 'ninja_forms_min_version' ] );
    2733        }
    2834    }
     
    5662      return $args;
    5763    }
     64
     65    public function is_ninja_forms_installed() {
     66      return ( class_exists ( 'Ninja_Forms', $autoload = false ) );
     67    }
     68
     69    public static function is_ninja_forms_compatible( $version, $version_required ) {
     70      return version_compare( $version, $version_required, '>=' );
     71    }
     72
     73    public function ninja_forms_min_version() {
     74      echo '<div class="error"><p>'
     75          . __( 'The Ninja Forms Add-on Manager requires the latest version of Ninja Forms.', 'ninja-forms-addon-manager' )
     76          . '</p></div>';
     77    }
    5878}
  • ninja-forms-addon-manager/trunk/ninja-forms-addon-manager.php

    r1891101 r1910320  
    22
    33/*
    4  * Plugin Name: Ninja Forms - Addon Manager
    5  * Version: 3.0.10
     4Plugin Name: Ninja Forms - Addon Manager
     5Version: 3.0.12
     6Description: Install Ninja Forms add-ons with a single click.
     7Author: The WP Ninjas
     8Author URI: http://ninjaforms.com
     9
     10Copyright 2018 Saturday Drive, Inc.
    611 */
    712
     
    1217    require_once( plugin_dir_path( __FILE__ ) . 'bootstrap.php' );
    1318
    14     \NinjaFormsAddonManager\Plugin::getInstance()->setup(  '3.0.10', __FILE__  );
     19    \NinjaFormsAddonManager\Plugin::getInstance()->setup(  '3.0.12', __FILE__  );
    1520
    1621} else {
  • ninja-forms-addon-manager/trunk/readme.txt

    r1891101 r1910320  
    55Requires at least: 4.7
    66Tested up to: 4.9
    7 Stable Tag: 3.0.11
     7Stable Tag: 3.0.12
    88License: GPLv2 or later
    99
     
    3131== Upgrade Notice ==
    3232
    33 * Initial release.
     33* Updated the package download URL.
    3434
    3535== Changelog ==
     36
     37= 3.0.12 =
     38
     39* Updated the package download URL.
    3640
    3741= 3.0.11 =
Note: See TracChangeset for help on using the changeset viewer.