Version Description
Download this release
Release Info
Developer | pressshack |
Plugin | EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor |
Version | 2.1.0 |
Comparing to | |
See all releases |
Code changes from version 2.0.3 to 2.1.0
- EmbedPress/Ends/Back/Settings.php +1 -1
- EmbedPress/Plugins/Plugin.php +45 -50
- EmbedPress/Updater.php +0 -381
- embedpress.php +1 -1
- includes.php +7 -2
- readme.txt +9 -2
- vendor/composer/autoload_files.php +11 -0
- vendor/composer/autoload_psr4.php +1 -0
- vendor/composer/autoload_real.php +18 -0
- vendor/composer/autoload_static.php +10 -0
- vendor/composer/installed.json +66 -0
- vendor/publishpress/edd-license-handler +1 -0
- vendor/publishpress/wordpress-edd-license-integration +1 -0
EmbedPress/Ends/Back/Settings.php
CHANGED
@@ -109,7 +109,7 @@ class Settings
|
|
109 |
*/
|
110 |
public static function registerMenuItem()
|
111 |
{
|
112 |
-
add_menu_page('EmbedPress Settings', '
|
113 |
}
|
114 |
|
115 |
/**
|
109 |
*/
|
110 |
public static function registerMenuItem()
|
111 |
{
|
112 |
+
add_menu_page('EmbedPress Settings', 'EmbedPress', 'manage_options', 'embedpress', array(self::$namespace, 'renderForm'), null, 64);
|
113 |
}
|
114 |
|
115 |
/**
|
EmbedPress/Plugins/Plugin.php
CHANGED
@@ -1,7 +1,9 @@
|
|
1 |
<?php
|
2 |
namespace EmbedPress\Plugins;
|
3 |
|
4 |
-
use \
|
|
|
|
|
5 |
|
6 |
(defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
|
7 |
|
@@ -17,6 +19,38 @@ use \EmbedPress\Updater;
|
|
17 |
*/
|
18 |
abstract class Plugin
|
19 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
/**
|
21 |
* Method that register all EmbedPress events.
|
22 |
*
|
@@ -81,16 +115,12 @@ abstract class Plugin
|
|
81 |
} else {
|
82 |
static::registerSettings();
|
83 |
|
84 |
-
$
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
'license' => $licenseKey,
|
91 |
-
'item_name' => "EmbedPress " . static::NAME,
|
92 |
-
'author' => "EmbedPress"
|
93 |
-
));
|
94 |
}
|
95 |
}
|
96 |
|
@@ -306,46 +336,11 @@ abstract class Plugin
|
|
306 |
*/
|
307 |
protected static function validateLicenseKey($licenseKey)
|
308 |
{
|
309 |
-
$
|
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 |
-
|
330 |
-
|
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 |
-
|
349 |
-
}
|
350 |
}
|
351 |
}
|
1 |
<?php
|
2 |
namespace EmbedPress\Plugins;
|
3 |
|
4 |
+
use PublishPress\EDD_License\Core\Container as EDDContainer;
|
5 |
+
use PublishPress\EDD_License\Core\ServicesConfig as EDDServicesConfig;
|
6 |
+
use PublishPress\EDD_License\Core\Services as EDDServices;
|
7 |
|
8 |
(defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
|
9 |
|
19 |
*/
|
20 |
abstract class Plugin
|
21 |
{
|
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 |
+
|
54 |
/**
|
55 |
* Method that register all EmbedPress events.
|
56 |
*
|
115 |
} else {
|
116 |
static::registerSettings();
|
117 |
|
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'];
|
|
|
|
|
|
|
|
|
124 |
}
|
125 |
}
|
126 |
|
336 |
*/
|
337 |
protected static function validateLicenseKey($licenseKey)
|
338 |
{
|
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;
|
|
|
345 |
}
|
346 |
}
|
EmbedPress/Updater.php
DELETED
@@ -1,381 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
namespace EmbedPress;
|
3 |
-
|
4 |
-
(defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Class that handles Pro plugins updates.
|
8 |
-
* Based on Pippin Williamson's work.
|
9 |
-
*/
|
10 |
-
class Updater
|
11 |
-
{
|
12 |
-
private $api_url = '';
|
13 |
-
private $api_data = array();
|
14 |
-
private $name = '';
|
15 |
-
private $slug = '';
|
16 |
-
private $version = '';
|
17 |
-
private $wp_override = false;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Class constructor.
|
21 |
-
*
|
22 |
-
* @uses plugin_basename()
|
23 |
-
* @uses hook()
|
24 |
-
*
|
25 |
-
* @param string $_api_url The URL pointing to the custom API endpoint.
|
26 |
-
* @param string $_plugin_file Path to the plugin file.
|
27 |
-
* @param array $_api_data Optional data to send with API calls.
|
28 |
-
*/
|
29 |
-
public function __construct($_api_url, $_plugin_file, $_api_data = null)
|
30 |
-
{
|
31 |
-
global $edd_plugin_data;
|
32 |
-
|
33 |
-
$this->api_url = trailingslashit($_api_url);
|
34 |
-
$this->api_data = $_api_data;
|
35 |
-
$this->name = plugin_basename($_plugin_file);
|
36 |
-
$this->slug = basename($_plugin_file, '.php');
|
37 |
-
$this->version = $_api_data['version'];
|
38 |
-
$this->wp_override = isset($_api_data['wp_override']) ? (bool)$_api_data['wp_override'] : false;
|
39 |
-
|
40 |
-
$edd_plugin_data[$this->slug] = $this->api_data;
|
41 |
-
|
42 |
-
$this->prepareHooks();
|
43 |
-
}
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Set up WordPress filters to hook into WP's update process.
|
47 |
-
*
|
48 |
-
* @uses add_filter()
|
49 |
-
* @uses add_action()
|
50 |
-
* @uses remove_action()
|
51 |
-
*
|
52 |
-
* @return void
|
53 |
-
*/
|
54 |
-
public function prepareHooks()
|
55 |
-
{
|
56 |
-
add_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'));
|
57 |
-
add_filter('plugins_api', array($this, 'plugins_api_filter'), 10, 3);
|
58 |
-
remove_action('after_plugin_row_'. $this->name, 'wp_plugin_update_row', 10, 2);
|
59 |
-
add_action('after_plugin_row_'. $this->name, array($this, 'show_update_notification'), 10, 2);
|
60 |
-
add_action('admin_init', array($this, 'show_changelog'));
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Check for Updates at the defined API endpoint and modify the update array.
|
65 |
-
*
|
66 |
-
* This function dives into the update API just when WordPress creates its update array,
|
67 |
-
* then adds a custom API call and injects the custom plugin data retrieved from the API.
|
68 |
-
* It is reassembled from parts of the native WordPress plugin update code.
|
69 |
-
* See wp-includes/update.php line 121 for the original wp_update_plugins() function.
|
70 |
-
*
|
71 |
-
* @uses api_request()
|
72 |
-
*
|
73 |
-
* @param array $_transient_data Update array build by WordPress.
|
74 |
-
* @return array Modified update array with custom plugin data.
|
75 |
-
*/
|
76 |
-
public function check_update($_transient_data)
|
77 |
-
{
|
78 |
-
global $pagenow;
|
79 |
-
|
80 |
-
if (!is_object($_transient_data)) {
|
81 |
-
$_transient_data = new stdClass;
|
82 |
-
}
|
83 |
-
|
84 |
-
if ('plugins.php' === $pagenow && is_multisite()) {
|
85 |
-
return $_transient_data;
|
86 |
-
}
|
87 |
-
|
88 |
-
if (!empty($_transient_data->response) && !empty($_transient_data->response[$this->name]) && false === $this->wp_override) {
|
89 |
-
return $_transient_data;
|
90 |
-
}
|
91 |
-
|
92 |
-
$version_info = $this->api_request('plugin_latest_version', array('slug' => $this->slug));
|
93 |
-
|
94 |
-
if (false !== $version_info && is_object($version_info) && isset($version_info->new_version)) {
|
95 |
-
if (version_compare($this->version, $version_info->new_version, '<')) {
|
96 |
-
$_transient_data->response[$this->name] = $version_info;
|
97 |
-
}
|
98 |
-
|
99 |
-
$_transient_data->last_checked = time();
|
100 |
-
$_transient_data->checked[$this->name] = $this->version;
|
101 |
-
}
|
102 |
-
|
103 |
-
return $_transient_data;
|
104 |
-
}
|
105 |
-
|
106 |
-
/**
|
107 |
-
* show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise!
|
108 |
-
*
|
109 |
-
* @param string $file
|
110 |
-
* @param array $plugin
|
111 |
-
*/
|
112 |
-
public function show_update_notification($file, $plugin)
|
113 |
-
{
|
114 |
-
if (is_network_admin()) {
|
115 |
-
return;
|
116 |
-
}
|
117 |
-
|
118 |
-
if (!current_user_can('update_plugins')) {
|
119 |
-
return;
|
120 |
-
}
|
121 |
-
|
122 |
-
if (!is_multisite()) {
|
123 |
-
return;
|
124 |
-
}
|
125 |
-
|
126 |
-
if ($this->name !== $file) {
|
127 |
-
return;
|
128 |
-
}
|
129 |
-
|
130 |
-
// Remove our filter on the site transient
|
131 |
-
remove_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'), 10);
|
132 |
-
|
133 |
-
$update_cache = get_site_transient('update_plugins');
|
134 |
-
|
135 |
-
$update_cache = is_object($update_cache) ? $update_cache : new stdClass();
|
136 |
-
|
137 |
-
if (empty($update_cache->response) || empty($update_cache->response[$this->name])) {
|
138 |
-
$cache_key = md5('edd_plugin_'. sanitize_key($this->name) .'_version_info');
|
139 |
-
$version_info = get_transient($cache_key);
|
140 |
-
|
141 |
-
if (false === $version_info) {
|
142 |
-
$version_info = $this->api_request('plugin_latest_version', array('slug' => $this->slug));
|
143 |
-
|
144 |
-
set_transient($cache_key, $version_info, 3600);
|
145 |
-
}
|
146 |
-
|
147 |
-
if (!is_object($version_info)) {
|
148 |
-
return;
|
149 |
-
}
|
150 |
-
|
151 |
-
if (version_compare($this->version, $version_info->new_version, '<')) {
|
152 |
-
$update_cache->response[$this->name] = $version_info;
|
153 |
-
}
|
154 |
-
|
155 |
-
$update_cache->last_checked = time();
|
156 |
-
$update_cache->checked[$this->name] = $this->version;
|
157 |
-
|
158 |
-
set_site_transient('update_plugins', $update_cache);
|
159 |
-
} else {
|
160 |
-
$version_info = $update_cache->response[$this->name];
|
161 |
-
}
|
162 |
-
|
163 |
-
// Restore our filter
|
164 |
-
add_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'));
|
165 |
-
|
166 |
-
if (!empty($update_cache->response[$this->name]) && version_compare($this->version, $version_info->new_version, '<')) {
|
167 |
-
// build a plugin list row, with update notification
|
168 |
-
$wp_list_table = _get_list_table('WP_Plugins_List_Table');
|
169 |
-
|
170 |
-
echo '<tr class="plugin-update-tr" id="'. $this->slug .'-update" data-slug="'. $this->slug .'" data-plugin="'. $this->slug .'/'. $file .'">';
|
171 |
-
echo '<td colspan="3" class="plugin-update colspanchange">';
|
172 |
-
echo '<div class="update-message notice inline notice-warning notice-alt">';
|
173 |
-
|
174 |
-
$changelog_link = self_admin_url('index.php?edd_sl_action=view_plugin_changelog&plugin='. $this->name .'&slug='. $this->slug .'&TB_iframe=true&width=772&height=911');
|
175 |
-
|
176 |
-
if (empty($version_info->download_link)) {
|
177 |
-
printf(
|
178 |
-
__( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s.', 'easy-digital-downloads' ),
|
179 |
-
esc_html($version_info->name),
|
180 |
-
'<a target="_blank" class="thickbox" href="'. esc_url($changelog_link) .'" rel="noopener noreferrer">',
|
181 |
-
esc_html($version_info->new_version),
|
182 |
-
'</a>'
|
183 |
-
);
|
184 |
-
} else {
|
185 |
-
printf(
|
186 |
-
__('There is a new version of %1$s available. %2$sView version %3$s details%4$s or %5$supdate now%6$s.', 'easy-digital-downloads'),
|
187 |
-
esc_html($version_info->name),
|
188 |
-
'<a target="_blank" class="thickbox" href="'. esc_url($changelog_link) .'" rel="noopener noreferrer">',
|
189 |
-
esc_html($version_info->new_version),
|
190 |
-
'</a>',
|
191 |
-
'<a href="'. esc_url(wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=') . $this->name, 'upgrade-plugin_'. $this->name)) .'">',
|
192 |
-
'</a>'
|
193 |
-
);
|
194 |
-
}
|
195 |
-
|
196 |
-
do_action("in_plugin_update_message-{$file}", $plugin, $version_info);
|
197 |
-
|
198 |
-
echo '</div></td></tr>';
|
199 |
-
}
|
200 |
-
}
|
201 |
-
|
202 |
-
/**
|
203 |
-
* Updates information on the "View version x.x details" page with custom data.
|
204 |
-
*
|
205 |
-
* @uses api_request()
|
206 |
-
*
|
207 |
-
* @param mixed $_data
|
208 |
-
* @param string $_action
|
209 |
-
* @param object $_args
|
210 |
-
* @return object $_data
|
211 |
-
*/
|
212 |
-
public function plugins_api_filter($_data, $_action = '', $_args = null)
|
213 |
-
{
|
214 |
-
if ($_action != 'plugin_information') {
|
215 |
-
return $_data;
|
216 |
-
}
|
217 |
-
|
218 |
-
if (!isset($_args->slug) || ($_args->slug != $this->slug)) {
|
219 |
-
return $_data;
|
220 |
-
}
|
221 |
-
|
222 |
-
$to_send = array(
|
223 |
-
'slug' => $this->slug,
|
224 |
-
'is_ssl' => is_ssl(),
|
225 |
-
'fields' => array(
|
226 |
-
'banners' => false, // These will be supported soon hopefully
|
227 |
-
'reviews' => false
|
228 |
-
)
|
229 |
-
);
|
230 |
-
|
231 |
-
$cache_key = 'edd_api_request_'. substr(md5(serialize($this->slug)), 0, 15);
|
232 |
-
|
233 |
-
//Get the transient where we store the api request for this plugin for 24 hours
|
234 |
-
$edd_api_request_transient = get_site_transient($cache_key);
|
235 |
-
|
236 |
-
//If we have no transient-saved value, run the API, set a fresh transient with the API value, and return that value too right now.
|
237 |
-
if (empty($edd_api_request_transient)) {
|
238 |
-
$api_response = $this->api_request('plugin_information', $to_send);
|
239 |
-
|
240 |
-
//Expires in 1 day
|
241 |
-
set_site_transient($cache_key, $api_response, DAY_IN_SECONDS);
|
242 |
-
|
243 |
-
if (false !== $api_response) {
|
244 |
-
$_data = $api_response;
|
245 |
-
}
|
246 |
-
}
|
247 |
-
|
248 |
-
return $_data;
|
249 |
-
}
|
250 |
-
|
251 |
-
/**
|
252 |
-
* Disable SSL verification in order to prevent download update failures
|
253 |
-
*
|
254 |
-
* @param array $args
|
255 |
-
* @param string $url
|
256 |
-
* @return object $array
|
257 |
-
*/
|
258 |
-
public function http_request_args($args, $url)
|
259 |
-
{
|
260 |
-
// If it is an https request and we are performing a package download, disable ssl verification
|
261 |
-
if (strpos($url, 'https://') !== false && strpos($url, 'edd_action=package_download')) {
|
262 |
-
$args['sslverify'] = false;
|
263 |
-
}
|
264 |
-
|
265 |
-
return $args;
|
266 |
-
}
|
267 |
-
|
268 |
-
/**
|
269 |
-
* Calls the API and, if successfull, returns the object delivered by the API.
|
270 |
-
*
|
271 |
-
* @uses get_bloginfo()
|
272 |
-
* @uses wp_remote_post()
|
273 |
-
* @uses is_wp_error()
|
274 |
-
*
|
275 |
-
* @param string $_action The requested action.
|
276 |
-
* @param array $_data Parameters for the API action.
|
277 |
-
* @return false|object
|
278 |
-
*/
|
279 |
-
private function api_request($_action, $_data)
|
280 |
-
{
|
281 |
-
global $wp_version;
|
282 |
-
|
283 |
-
$data = array_merge($this->api_data, $_data);
|
284 |
-
|
285 |
-
if ($data['slug'] != $this->slug) {
|
286 |
-
return;
|
287 |
-
}
|
288 |
-
|
289 |
-
if ($this->api_url == trailingslashit(home_url())) {
|
290 |
-
return false; // Don't allow a plugin to ping itself
|
291 |
-
}
|
292 |
-
|
293 |
-
$api_params = array(
|
294 |
-
'edd_action' => 'get_version',
|
295 |
-
'license' => !empty($data['license']) ? $data['license'] : '',
|
296 |
-
'item_name' => isset($data['item_name']) ? $data['item_name'] : false,
|
297 |
-
'item_id' => isset($data['item_id']) ? $data['item_id'] : false,
|
298 |
-
'slug' => $data['slug'],
|
299 |
-
'author' => $data['author'],
|
300 |
-
'url' => home_url()
|
301 |
-
);
|
302 |
-
|
303 |
-
$request = wp_remote_post($this->api_url, array(
|
304 |
-
'timeout' => 15,
|
305 |
-
'sslverify' => false,
|
306 |
-
'body' => $api_params
|
307 |
-
));
|
308 |
-
|
309 |
-
if (!is_wp_error($request)) {
|
310 |
-
$request = json_decode(wp_remote_retrieve_body($request));
|
311 |
-
}
|
312 |
-
|
313 |
-
if ($request && isset($request->sections)) {
|
314 |
-
$request->sections = maybe_unserialize($request->sections);
|
315 |
-
} else {
|
316 |
-
$request = false;
|
317 |
-
}
|
318 |
-
|
319 |
-
return $request;
|
320 |
-
}
|
321 |
-
|
322 |
-
public function show_changelog()
|
323 |
-
{
|
324 |
-
global $edd_plugin_data;
|
325 |
-
|
326 |
-
if (empty($_REQUEST['edd_sl_action']) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action']) {
|
327 |
-
return;
|
328 |
-
}
|
329 |
-
|
330 |
-
if (empty($_REQUEST['plugin'])) {
|
331 |
-
return;
|
332 |
-
}
|
333 |
-
|
334 |
-
if (empty($_REQUEST['slug'])) {
|
335 |
-
return;
|
336 |
-
}
|
337 |
-
|
338 |
-
if (!current_user_can('update_plugins')) {
|
339 |
-
wp_die(__('You do not have permission to install plugin updates', 'easy-digital-downloads'), __('Error', 'easy-digital-downloads'), array('response' => 403));
|
340 |
-
}
|
341 |
-
|
342 |
-
$data = $edd_plugin_data[$_REQUEST['slug']];
|
343 |
-
$cache_key = md5('edd_plugin_'. sanitize_key($_REQUEST['plugin']) .'_version_info');
|
344 |
-
$version_info = get_transient($cache_key);
|
345 |
-
|
346 |
-
if (false === $version_info) {
|
347 |
-
$api_params = array(
|
348 |
-
'edd_action' => 'get_version',
|
349 |
-
'item_name' => isset($data['item_name']) ? $data['item_name'] : false,
|
350 |
-
'item_id' => isset($data['item_id']) ? $data['item_id'] : false,
|
351 |
-
'slug' => $_REQUEST['slug'],
|
352 |
-
'author' => $data['author'],
|
353 |
-
'url' => home_url()
|
354 |
-
);
|
355 |
-
|
356 |
-
$request = wp_remote_post($this->api_url, array(
|
357 |
-
'timeout' => 15,
|
358 |
-
'sslverify' => false,
|
359 |
-
'body' => $api_params
|
360 |
-
));
|
361 |
-
|
362 |
-
if (!is_wp_error($request)) {
|
363 |
-
$version_info = json_decode(wp_remote_retrieve_body($request));
|
364 |
-
}
|
365 |
-
|
366 |
-
if (!empty($version_info) && isset($version_info->sections)) {
|
367 |
-
$version_info->sections = maybe_unserialize($version_info->sections);
|
368 |
-
} else {
|
369 |
-
$version_info = false;
|
370 |
-
}
|
371 |
-
|
372 |
-
set_transient($cache_key, $version_info, 3600);
|
373 |
-
}
|
374 |
-
|
375 |
-
if (!empty($version_info) && isset($version_info->sections['changelog'])) {
|
376 |
-
echo '<div style="background:#fff;padding:10px;">'. $version_info->sections['changelog'] .'</div>';
|
377 |
-
}
|
378 |
-
|
379 |
-
exit;
|
380 |
-
}
|
381 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
embedpress.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: WordPress supports around 35 embed sources, but PublishPress Embeds adds over 40 more, including Facebook, Google Maps, Google Docs, UStream! Just use the URL!
|
6 |
* Author: EmbedPress
|
7 |
* Author URI: http://embedpress.com
|
8 |
-
* Version: 2.0
|
9 |
* Text Domain: embedpress
|
10 |
* Domain Path: /languages
|
11 |
*
|
5 |
* Description: WordPress supports around 35 embed sources, but PublishPress Embeds adds over 40 more, including Facebook, Google Maps, Google Docs, UStream! Just use the URL!
|
6 |
* Author: EmbedPress
|
7 |
* Author URI: http://embedpress.com
|
8 |
+
* Version: 2.1.0
|
9 |
* Text Domain: embedpress
|
10 |
* Domain Path: /languages
|
11 |
*
|
includes.php
CHANGED
@@ -21,7 +21,7 @@ if (!defined('EMBEDPRESS_PLG_NAME')) {
|
|
21 |
}
|
22 |
|
23 |
if (!defined('EMBEDPRESS_PLG_VERSION')) {
|
24 |
-
define('EMBEDPRESS_PLG_VERSION', "2.0
|
25 |
}
|
26 |
|
27 |
if (!defined('EMBEDPRESS_ROOT')) {
|
@@ -68,5 +68,10 @@ if (file_exists(__DIR__ . '/vendor/autoload.php')) {
|
|
68 |
require_once __DIR__ . '/vendor/autoload.php';
|
69 |
}
|
70 |
|
|
|
|
|
|
|
71 |
// Run the plugin autoload script
|
72 |
-
|
|
|
|
21 |
}
|
22 |
|
23 |
if (!defined('EMBEDPRESS_PLG_VERSION')) {
|
24 |
+
define('EMBEDPRESS_PLG_VERSION', "2.1.0");
|
25 |
}
|
26 |
|
27 |
if (!defined('EMBEDPRESS_ROOT')) {
|
68 |
require_once __DIR__ . '/vendor/autoload.php';
|
69 |
}
|
70 |
|
71 |
+
// Includes the EDD integration library
|
72 |
+
require_once __DIR__ . '/vendor/publishpress/wordpress-edd-license-integration/src/includes.php';
|
73 |
+
|
74 |
// Run the plugin autoload script
|
75 |
+
if (!defined('EMBEDPRESS_IS_LOADED')) {
|
76 |
+
require_once EMBEDPRESS_PATH_BASE ."autoloader.php";
|
77 |
+
}
|
readme.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
=== EmbedPress – Embed Google Docs, Vimeo and Wistia videos, Giphy and Imgur photos, and more ===
|
2 |
-
Contributors: EmbedPress, andergmartins, stevejburge, pressshack
|
3 |
Author: EmbedPress, PressShack
|
4 |
Author URI: https://embedpress.com
|
5 |
Tags: YouTube, Google, Facebook, Wistia, Vimeo
|
6 |
Requires at least: 4.6
|
7 |
Tested up to: 4.9.4
|
8 |
-
Stable tag: 2.0
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -184,6 +184,13 @@ Not at all. You can set up everything your team needs without any coding knowled
|
|
184 |
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
185 |
and this project adheres to [Semantic Versioning](http://semver.org/).
|
186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
= [2.0.3] = 2018-02-07 =
|
188 |
|
189 |
*Fixed:*
|
1 |
=== EmbedPress – Embed Google Docs, Vimeo and Wistia videos, Giphy and Imgur photos, and more ===
|
2 |
+
Contributors: EmbedPress, andergmartins, stevejburge, pressshack, deenison
|
3 |
Author: EmbedPress, PressShack
|
4 |
Author URI: https://embedpress.com
|
5 |
Tags: YouTube, Google, Facebook, Wistia, Vimeo
|
6 |
Requires at least: 4.6
|
7 |
Tested up to: 4.9.4
|
8 |
+
Stable tag: 2.1.0
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
184 |
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
185 |
and this project adheres to [Semantic Versioning](http://semver.org/).
|
186 |
|
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 |
+
|
194 |
= [2.0.3] = 2018-02-07 =
|
195 |
|
196 |
*Fixed:*
|
vendor/composer/autoload_files.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_files.php @generated by Composer
|
4 |
+
|
5 |
+
$vendorDir = dirname(dirname(__FILE__));
|
6 |
+
$baseDir = dirname(dirname($vendorDir));
|
7 |
+
|
8 |
+
return array(
|
9 |
+
'46a06f2cec651588901bf1ff51ef5979' => $vendorDir . '/publishpress/edd-license-handler/EDD_License_Handler.php',
|
10 |
+
'9e7913fda8218537ad84c3389047ab16' => $vendorDir . '/publishpress/edd-license-handler/EDD_SL_Plugin_Updater.php',
|
11 |
+
);
|
vendor/composer/autoload_psr4.php
CHANGED
@@ -6,5 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
|
|
6 |
$baseDir = dirname(dirname($vendorDir));
|
7 |
|
8 |
return array(
|
|
|
9 |
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
|
10 |
);
|
6 |
$baseDir = dirname(dirname($vendorDir));
|
7 |
|
8 |
return array(
|
9 |
+
'PublishPress\\EDD_License\\Core\\' => array($vendorDir . '/publishpress/wordpress-edd-license-integration/src/core'),
|
10 |
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
|
11 |
);
|
vendor/composer/autoload_real.php
CHANGED
@@ -47,6 +47,24 @@ class ComposerAutoloaderInit7958360bac6330880191174e478899ed
|
|
47 |
|
48 |
$loader->register(true);
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
return $loader;
|
51 |
}
|
52 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
$loader->register(true);
|
49 |
|
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 |
+
|
59 |
return $loader;
|
60 |
}
|
61 |
}
|
62 |
+
|
63 |
+
function 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 |
+
}
|
vendor/composer/autoload_static.php
CHANGED
@@ -6,14 +6,24 @@ namespace Composer\Autoload;
|
|
6 |
|
7 |
class ComposerStaticInit7958360bac6330880191174e478899ed
|
8 |
{
|
|
|
|
|
|
|
|
|
|
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'P' =>
|
11 |
array (
|
|
|
12 |
'Psr\\Container\\' => 14,
|
13 |
),
|
14 |
);
|
15 |
|
16 |
public static $prefixDirsPsr4 = array (
|
|
|
|
|
|
|
|
|
17 |
'Psr\\Container\\' =>
|
18 |
array (
|
19 |
0 => __DIR__ . '/..' . '/psr/container/src',
|
6 |
|
7 |
class ComposerStaticInit7958360bac6330880191174e478899ed
|
8 |
{
|
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 |
+
|
14 |
public static $prefixLengthsPsr4 = array (
|
15 |
'P' =>
|
16 |
array (
|
17 |
+
'PublishPress\\EDD_License\\Core\\' => 30,
|
18 |
'Psr\\Container\\' => 14,
|
19 |
),
|
20 |
);
|
21 |
|
22 |
public static $prefixDirsPsr4 = array (
|
23 |
+
'PublishPress\\EDD_License\\Core\\' =>
|
24 |
+
array (
|
25 |
+
0 => __DIR__ . '/..' . '/publishpress/wordpress-edd-license-integration/src/core',
|
26 |
+
),
|
27 |
'Psr\\Container\\' =>
|
28 |
array (
|
29 |
0 => __DIR__ . '/..' . '/psr/container/src',
|
vendor/composer/installed.json
CHANGED
@@ -147,5 +147,71 @@
|
|
147 |
"container-interop",
|
148 |
"psr"
|
149 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
}
|
151 |
]
|
147 |
"container-interop",
|
148 |
"psr"
|
149 |
]
|
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": "contact@easydigitaldownloads.com"
|
176 |
+
},
|
177 |
+
{
|
178 |
+
"name": "PublishPress",
|
179 |
+
"email": "help@publishpress.com"
|
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": "help@publishpress.com"
|
214 |
+
}
|
215 |
+
]
|
216 |
}
|
217 |
]
|
vendor/publishpress/edd-license-handler
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Subproject commit 0cf8447b2dd73d4a916b2bdcf1e364c89218b25d
|
vendor/publishpress/wordpress-edd-license-integration
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Subproject commit 12c9768df10b7d16d12f2583a1dca9a6822cad7a
|