Plugin Directory

Changeset 1818427


Ignore:
Timestamp:
02/08/2018 05:38:22 PM (8 years ago)
Author:
pressshack
Message:

Updating to 2.1.0

Location:
embedpress/trunk
Files:
147 added
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • embedpress/trunk/EmbedPress/Ends/Back/Settings.php

    r1817633 r1818427  
    110110    public static function registerMenuItem()
    111111    {
    112         add_menu_page('EmbedPress Settings', 'Embeds', 'manage_options', 'embedpress', array(self::$namespace, 'renderForm'), null, 64);
     112        add_menu_page('EmbedPress Settings', 'EmbedPress', 'manage_options', 'embedpress', array(self::$namespace, 'renderForm'), null, 64);
    113113    }
    114114
  • embedpress/trunk/EmbedPress/Plugins/Plugin.php

    r1817633 r1818427  
    22namespace EmbedPress\Plugins;
    33
    4 use \EmbedPress\Updater;
     4use PublishPress\EDD_License\Core\Container as EDDContainer;
     5use PublishPress\EDD_License\Core\ServicesConfig as EDDServicesConfig;
     6use PublishPress\EDD_License\Core\Services as EDDServices;
    57
    68(defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
     
    1820abstract class Plugin
    1921{
     22    const VERSION = '0.0.0';
     23
     24    protected static $eddContainer;
     25
     26    protected static function getEddContainer()
     27    {
     28        if (empty(static::$eddContainer)) {
     29            $options = static::getOptions();
     30
     31            $licenseKey    = isset($options['license']['key']) ? (string)$options['license']['key'] : "";
     32            $licenseStatus = isset($options['license']['status']) ? (string)$options['license']['status'] : "missed";
     33
     34            $config = new EDDServicesConfig();
     35            $config->setApiUrl(EMBEDPRESS_LICENSES_API_URL);
     36            $config->setLicenseKey($licenseKey);
     37            $config->setLicenseStatus($licenseStatus);
     38            $config->setPluginVersion(static::VERSION);
     39            $config->setEddItemId(static::EDD_ID);
     40            $config->setPluginAuthor('EmbedPress');
     41            $config->setPluginFile(EMBEDPRESS_PLG_NAME .'/'. EMBEDPRESS_PLG_NAME .'.php');
     42
     43            $services = new EDDServices($config);
     44
     45            $eddContainer = new EDDContainer();
     46            $eddContainer->register($services);
     47
     48            static::$eddContainer = $eddContainer;
     49        }
     50
     51        return static::$eddContainer;
     52    }
     53
    2054    /**
    2155     * Method that register all EmbedPress events.
     
    82116            static::registerSettings();
    83117
    84             $options = static::getOptions();
    85 
    86             $licenseKey = isset($options['license']['key']) ? (string)$options['license']['key'] : "";
    87 
    88             new Updater(EMBEDPRESS_LICENSES_API_URL, static::PATH . EMBEDPRESS_PLG_NAME .'-'. static::SLUG .'.php', array(
    89                 'version'   => static::VERSION,
    90                 'license'   => $licenseKey,
    91                 'item_name' => "EmbedPress " . static::NAME,
    92                 'author'    => "EmbedPress"
    93             ));
     118            $eddContainer = static::getEddContainer();
     119            /*
     120             * Instantiate the update manager. The variable is not used by purpose, only
     121             * to instantiate the manager.
     122             */
     123            $update = $eddContainer['update_manager'];
    94124        }
    95125    }
     
    307337    protected static function validateLicenseKey($licenseKey)
    308338    {
    309         $pluginSlug = EMBEDPRESS_PLG_NAME .':'. static::SLUG;
    310 
    311         $params = array(
    312             'timeout'     => 30,
    313             'sslverify'   => false,
    314             'redirection' => 1,
    315             'body'      => array(
    316                 'edd_action' => "activate_license",
    317                 'license'    => $licenseKey,
    318                 'url'        => home_url()
    319             )
    320         );
    321         if (defined(get_called_class() . '::EDD_ID')) {
    322             $params['body']['item_id'] = static::EDD_ID;
    323         } else {
    324             $params['body']['item_name'] = "EmbedPress ". static::NAME;
    325         }
    326 
    327         $response = wp_remote_post(EMBEDPRESS_LICENSES_API_URL, $params);
    328 
    329         if (is_wp_error($response) || 200 !== wp_remote_retrieve_response_code($response)) {
    330             $errMessage = $response->get_error_message();
    331             if (is_wp_error($response) && !empty($errMessage)) {
    332                 return $errMessage;
    333             } else {
    334                 return __('An error occurred. Please, try again.');
    335             }
    336         } else {
    337             $licenseData = json_decode(wp_remote_retrieve_body($response));
    338             if (empty($licenseData) || !is_object($licenseData)) {
    339                 $licenseNewStatus = "invalid";
    340             } else {
    341                 if (isset($licenseData->success) && $licenseData->success === true) {
    342                     $licenseNewStatus = "valid";
    343                 } else {
    344                     $licenseNewStatus = isset($licenseData->error) && !empty($licenseData->error) ? $licenseData->error : "invalid";
    345                 }
    346             }
    347 
    348             return $licenseNewStatus;
    349         }
     339        $licenseManager = static::$eddContainer['license_manager'];
     340
     341        $licenseNewStatus = $licenseManager->validate_license_key($licenseKey, static::EDD_ID);
     342        var_dump($licenseNewStatus);die;
     343
     344        return $licenseNewStatus;
    350345    }
    351346}
  • embedpress/trunk/embedpress.php

    r1817633 r1818427  
    66 * Author:      EmbedPress
    77 * Author URI:  http://embedpress.com
    8  * Version:     2.0.3
     8 * Version:     2.1.0
    99 * Text Domain: embedpress
    1010 * Domain Path: /languages
  • embedpress/trunk/includes.php

    r1817633 r1818427  
    2222
    2323if (!defined('EMBEDPRESS_PLG_VERSION')) {
    24     define('EMBEDPRESS_PLG_VERSION', "2.0.3");
     24    define('EMBEDPRESS_PLG_VERSION', "2.1.0");
    2525}
    2626
     
    6969}
    7070
     71// Includes the EDD integration library
     72require_once __DIR__ . '/vendor/publishpress/wordpress-edd-license-integration/src/includes.php';
     73
    7174// Run the plugin autoload script
    72 require_once EMBEDPRESS_PATH_BASE ."autoloader.php";
     75if (!defined('EMBEDPRESS_IS_LOADED')) {
     76    require_once EMBEDPRESS_PATH_BASE ."autoloader.php";
     77}
  • embedpress/trunk/readme.txt

    r1817633 r1818427  
    66Requires at least: 4.6
    77Tested up to: 4.9.4
    8 Stable tag: 2.0.3
     8Stable tag: 2.1.0
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    185185and this project adheres to [Semantic Versioning](http://semver.org/).
    186186
     187= [2.1.0] - 2018-02-08 =
     188
     189*Changed:*
     190
     191* Changed the label of the menu from Embeds to EmbedPress;
     192* Updated structure for plugins to validate licenses on embedpress.com;
     193
    187194= [2.0.3] = 2018-02-07 =
    188195
  • embedpress/trunk/vendor/composer/autoload_psr4.php

    r1817633 r1818427  
    77
    88return array(
     9    'PublishPress\\EDD_License\\Core\\' => array($vendorDir . '/publishpress/wordpress-edd-license-integration/src/core'),
    910    'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
    1011);
  • embedpress/trunk/vendor/composer/autoload_real.php

    r1817633 r1818427  
    4848        $loader->register(true);
    4949
     50        if ($useStaticLoader) {
     51            $includeFiles = Composer\Autoload\ComposerStaticInit7958360bac6330880191174e478899ed::$files;
     52        } else {
     53            $includeFiles = require __DIR__ . '/autoload_files.php';
     54        }
     55        foreach ($includeFiles as $fileIdentifier => $file) {
     56            composerRequire7958360bac6330880191174e478899ed($fileIdentifier, $file);
     57        }
     58
    5059        return $loader;
    5160    }
    5261}
     62
     63function composerRequire7958360bac6330880191174e478899ed($fileIdentifier, $file)
     64{
     65    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
     66        require $file;
     67
     68        $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
     69    }
     70}
  • embedpress/trunk/vendor/composer/autoload_static.php

    r1817633 r1818427  
    77class ComposerStaticInit7958360bac6330880191174e478899ed
    88{
     9    public static $files = array (
     10        '46a06f2cec651588901bf1ff51ef5979' => __DIR__ . '/..' . '/publishpress/edd-license-handler/EDD_License_Handler.php',
     11        '9e7913fda8218537ad84c3389047ab16' => __DIR__ . '/..' . '/publishpress/edd-license-handler/EDD_SL_Plugin_Updater.php',
     12    );
     13
    914    public static $prefixLengthsPsr4 = array (
    1015        'P' =>
    1116        array (
     17            'PublishPress\\EDD_License\\Core\\' => 30,
    1218            'Psr\\Container\\' => 14,
    1319        ),
     
    1521
    1622    public static $prefixDirsPsr4 = array (
     23        'PublishPress\\EDD_License\\Core\\' =>
     24        array (
     25            0 => __DIR__ . '/..' . '/publishpress/wordpress-edd-license-integration/src/core',
     26        ),
    1727        'Psr\\Container\\' =>
    1828        array (
  • embedpress/trunk/vendor/composer/installed.json

    r1817633 r1818427  
    148148            "psr"
    149149        ]
     150    },
     151    {
     152        "name": "publishpress/edd-license-handler",
     153        "version": "1.6.14.3",
     154        "version_normalized": "1.6.14.3",
     155        "source": {
     156            "type": "git",
     157            "url": "https://github.com/OSTraining/EDD-License-handler",
     158            "reference": "0cf8447b2dd73d4a916b2bdcf1e364c89218b25d"
     159        },
     160        "time": "2018-02-07T10:08:34+00:00",
     161        "type": "library",
     162        "installation-source": "source",
     163        "autoload": {
     164            "files": [
     165                "EDD_License_Handler.php",
     166                "EDD_SL_Plugin_Updater.php"
     167            ]
     168        },
     169        "license": [
     170            "GPL-2"
     171        ],
     172        "authors": [
     173            {
     174                "name": "EasyDigitalDownloads",
     175                "email": "[email protected]"
     176            },
     177            {
     178                "name": "PublishPress",
     179                "email": "[email protected]"
     180            }
     181        ]
     182    },
     183    {
     184        "name": "publishpress/wordpress-edd-license-integration",
     185        "version": "2.1.2",
     186        "version_normalized": "2.1.2.0",
     187        "source": {
     188            "type": "git",
     189            "url": "https://github.com/OSTraining/WordPress-EDD-License-Integration",
     190            "reference": "12c9768df10b7d16d12f2583a1dca9a6822cad7a"
     191        },
     192        "require": {
     193            "pimple/pimple": "~3.2",
     194            "publishpress/edd-license-handler": "~1.6"
     195        },
     196        "require-dev": {
     197            "lucatume/wp-browser": "~1.22"
     198        },
     199        "time": "2018-02-07T10:11:15+00:00",
     200        "type": "library",
     201        "installation-source": "source",
     202        "autoload": {
     203            "psr-4": {
     204                "PublishPress\\EDD_License\\Core\\": "src/core/"
     205            }
     206        },
     207        "license": [
     208            "GPL-2"
     209        ],
     210        "authors": [
     211            {
     212                "name": "PublishPress",
     213                "email": "[email protected]"
     214            }
     215        ]
    150216    }
    151217]
Note: See TracChangeset for help on using the changeset viewer.