EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor - Version 1.4.2

Version Description

Release Date: 2017-01-09

  • Fixed the plugin activation in older PHP environments (>
Download this release

Release Info

Developer pressshack
Plugin Icon wp plugin EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor
Version 1.4.2
Comparing to
See all releases

Code changes from version 1.4.1 to 1.4.2

EmbedPress/AutoLoader.php CHANGED
File without changes
EmbedPress/Core.php CHANGED
@@ -276,7 +276,7 @@ class Core
276
  AutoLoader::register($pluginMeta->namespace, WP_PLUGIN_DIR .'/'. EMBEDPRESS_PLG_NAME .'-'. $pluginMeta->slug .'/'. $pluginMeta->name);
277
 
278
  $plugin = "{$pluginMeta->namespace}\Plugin";
279
- if (!empty(@$plugin::SLUG)) {
280
  self::$plugins[$pluginMeta->slug] = $pluginMeta->namespace;
281
 
282
  $bsFilePath = $plugin::PATH . EMBEDPRESS_PLG_NAME .'-'. $plugin::SLUG .'.php';
276
  AutoLoader::register($pluginMeta->namespace, WP_PLUGIN_DIR .'/'. EMBEDPRESS_PLG_NAME .'-'. $pluginMeta->slug .'/'. $pluginMeta->name);
277
 
278
  $plugin = "{$pluginMeta->namespace}\Plugin";
279
+ if (\defined("{$plugin}::SLUG") && $plugin::SLUG !== null) {
280
  self::$plugins[$pluginMeta->slug] = $pluginMeta->namespace;
281
 
282
  $bsFilePath = $plugin::PATH . EMBEDPRESS_PLG_NAME .'-'. $plugin::SLUG .'.php';
EmbedPress/Disabler.php CHANGED
File without changes
EmbedPress/Ends/Back/Handler.php CHANGED
@@ -80,8 +80,10 @@ class Handler extends EndHandlerAbstract
80
  */
81
  public function doShortcodeReceivedViaAjax()
82
  {
 
 
83
  $response = array(
84
- 'data' => Shortcode::parseContent(@$_POST['subject'], true)
85
  );
86
 
87
  header('Content-Type:application/json;charset=UTF-8');
@@ -99,8 +101,10 @@ class Handler extends EndHandlerAbstract
99
  */
100
  public function getUrlInfoViaAjax()
101
  {
 
 
102
  $response = array(
103
- 'url' => trim(@$_GET['url']),
104
  'canBeResponsive' => false
105
  );
106
 
80
  */
81
  public function doShortcodeReceivedViaAjax()
82
  {
83
+ $subject = isset($_POST['subject']) ? $_POST['subject'] : "";
84
+
85
  $response = array(
86
+ 'data' => Shortcode::parseContent($subject, true)
87
  );
88
 
89
  header('Content-Type:application/json;charset=UTF-8');
101
  */
102
  public function getUrlInfoViaAjax()
103
  {
104
+ $url = isset($_GET['url']) ? trim($_GET['url']) : "";
105
+
106
  $response = array(
107
+ 'url' => $url,
108
  'canBeResponsive' => false
109
  );
110
 
EmbedPress/Ends/Back/Settings.php CHANGED
@@ -120,7 +120,7 @@ class Settings
120
  */
121
  public static function registerActions()
122
  {
123
- $activeTab = strtolower(@$_GET['tab']);
124
  if ($activeTab !== "embedpress") {
125
  $action = "embedpress:{$activeTab}:settings:register";
126
  } else {
@@ -151,7 +151,7 @@ class Settings
151
  */
152
  public static function renderForm()
153
  {
154
- $activeTab = strtolower(@$_GET['tab']);
155
  $settingsFieldsIdentifier = !empty($activeTab) ? "embedpress:{$activeTab}" : self::$sectionGroupIdentifier;
156
  $settingsSectionsIdentifier = !empty($activeTab) ? "embedpress:{$activeTab}" : self::$identifier;
157
  ?>
@@ -268,7 +268,7 @@ class Settings
268
  echo '</optgroup>';
269
  echo '</select>';
270
 
271
- echo '<p class="description">Choose to force or not a different language into your Facebook embeds.</p>';
272
  }
273
 
274
  /**
120
  */
121
  public static function registerActions()
122
  {
123
+ $activeTab = isset($_GET['tab']) ? strtolower($_GET['tab']) : "";
124
  if ($activeTab !== "embedpress") {
125
  $action = "embedpress:{$activeTab}:settings:register";
126
  } else {
151
  */
152
  public static function renderForm()
153
  {
154
+ $activeTab = isset($_GET['tab']) ? strtolower($_GET['tab']) : "";
155
  $settingsFieldsIdentifier = !empty($activeTab) ? "embedpress:{$activeTab}" : self::$sectionGroupIdentifier;
156
  $settingsSectionsIdentifier = !empty($activeTab) ? "embedpress:{$activeTab}" : self::$identifier;
157
  ?>
268
  echo '</optgroup>';
269
  echo '</select>';
270
 
271
+ echo '<p class="description">Choose a different language for your Facebook embeds.</p>';
272
  }
273
 
274
  /**
EmbedPress/Ends/Front/Handler.php CHANGED
File without changes
EmbedPress/Ends/Handler.php CHANGED
File without changes
EmbedPress/Loader.php CHANGED
File without changes
EmbedPress/Plugins/Html/Field.php CHANGED
@@ -116,7 +116,7 @@ class Field
116
  $field->type = strtolower($field->type);
117
 
118
  if ($field->slug === "license_key") {
119
- $value = @$options['license']['key'];
120
  } else {
121
  $value = isset($options[$field->slug]) ? $options[$field->slug] : (isset($field->default) ? $field->default : '');
122
  }
@@ -136,14 +136,15 @@ class Field
136
 
137
  $html = str_replace('{{slug}}', $params['pluginSlug'], $html);
138
  $html = str_replace('{{name}}', $field->slug, $html);
139
- $html = str_replace('{{classes}}', implode(' ', (array)@$field->classes), $html);
140
- $html = str_replace('{{placeholder}}', (string)@$field->placeholder, $html);
141
 
142
  $html .= wp_nonce_field("{$pluginSlug}:nonce", "{$pluginSlug}:nonce");
143
 
144
  if ($field->slug === "license_key") {
145
  $licenseStatusClass = "ep-label-danger";
146
- switch (trim(strtoupper(@$options['license']['status']))) {
 
147
  case '':
148
  $licenseStatusMessage = "Missing license";
149
  break;
@@ -176,7 +177,8 @@ class Field
176
  }
177
 
178
  $html .= '<br/><br/><strong>Status: <span class="'. $licenseStatusClass .'">'. __($licenseStatusMessage) .'</span>.</strong><br/><br/>';
179
- if (@$options['license']['status'] !== 'valid') {
 
180
  $html .= '<button type="submit" class="button-secondary">' . __('Activate License') . '</button> ';
181
  $html .= '<a href="'. EMBEDPRESS_LICENSES_MORE_INFO_URL .'" target="_blank" class="ep-small-link ep-small-spacing" rel="noopener noreferrer" style="display: inline-block; margin-left: 20px;" title="'. __('Click here to read more about licenses.') .'">' . __('More information') . '</a>';
182
  $html .= '<br/><br/>';
116
  $field->type = strtolower($field->type);
117
 
118
  if ($field->slug === "license_key") {
119
+ $value = isset($options['license']['key']) ? (string)$options['license']['key'] : "";
120
  } else {
121
  $value = isset($options[$field->slug]) ? $options[$field->slug] : (isset($field->default) ? $field->default : '');
122
  }
136
 
137
  $html = str_replace('{{slug}}', $params['pluginSlug'], $html);
138
  $html = str_replace('{{name}}', $field->slug, $html);
139
+ $html = str_replace('{{classes}}', implode(' ', (!empty($field->classes) ? (array)$field->classes : array())), $html);
140
+ $html = str_replace('{{placeholder}}', (!empty($field->placeholder) ? (string)$field->placeholder : ""), $html);
141
 
142
  $html .= wp_nonce_field("{$pluginSlug}:nonce", "{$pluginSlug}:nonce");
143
 
144
  if ($field->slug === "license_key") {
145
  $licenseStatusClass = "ep-label-danger";
146
+ $currentLicenseStatus = isset($options['license']['status']) ? trim(strtoupper($options['license']['status'])) : "";
147
+ switch ($currentLicenseStatus) {
148
  case '':
149
  $licenseStatusMessage = "Missing license";
150
  break;
177
  }
178
 
179
  $html .= '<br/><br/><strong>Status: <span class="'. $licenseStatusClass .'">'. __($licenseStatusMessage) .'</span>.</strong><br/><br/>';
180
+
181
+ if (!(isset($options['license']['status']) && $options['license']['status'] === 'valid')) {
182
  $html .= '<button type="submit" class="button-secondary">' . __('Activate License') . '</button> ';
183
  $html .= '<a href="'. EMBEDPRESS_LICENSES_MORE_INFO_URL .'" target="_blank" class="ep-small-link ep-small-spacing" rel="noopener noreferrer" style="display: inline-block; margin-left: 20px;" title="'. __('Click here to read more about licenses.') .'">' . __('More information') . '</a>';
184
  $html .= '<br/><br/>';
EmbedPress/Plugins/Html/index.html CHANGED
File without changes
EmbedPress/Plugins/Plugin.php CHANGED
@@ -83,9 +83,11 @@ abstract class Plugin
83
 
84
  $options = static::getOptions();
85
 
 
 
86
  new Updater(EMBEDPRESS_LICENSES_API_URL, static::PATH . EMBEDPRESS_PLG_NAME .'-'. static::SLUG .'.php', array(
87
  'version' => static::VERSION,
88
- 'license' => (string)@$options['license']['key'],
89
  'item_name' => "EmbedPress - ". static::NAME,
90
  'author' => "PressShack"
91
  ));
@@ -321,19 +323,22 @@ abstract class Plugin
321
  )
322
  ));
323
 
324
- $errMessage = "";
325
  if (is_wp_error($response) || 200 !== wp_remote_retrieve_response_code($response)) {
326
- $errMessage = (is_wp_error($response) && !empty($response->get_error_message())) ? $response->get_error_message() : __('An error occurred, please try again.');
327
- return "";
 
 
 
 
328
  } else {
329
  $licenseData = json_decode(wp_remote_retrieve_body($response));
330
  if (empty($licenseData) || !is_object($licenseData)) {
331
  $licenseNewStatus = "invalid";
332
  } else {
333
- if (@$licenseData->success === false) {
334
- $licenseNewStatus = !empty(@$licenseData->error) ? $licenseData->error : "invalid";
335
- } else {
336
  $licenseNewStatus = "valid";
 
 
337
  }
338
  }
339
 
83
 
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' => "PressShack"
93
  ));
323
  )
324
  ));
325
 
 
326
  if (is_wp_error($response) || 200 !== wp_remote_retrieve_response_code($response)) {
327
+ $errMessage = $response->get_error_message();
328
+ if (is_wp_error($response) && !empty($errMessage)) {
329
+ return $errMessage;
330
+ } else {
331
+ return __('An error occurred. Please, try again.');
332
+ }
333
  } else {
334
  $licenseData = json_decode(wp_remote_retrieve_body($response));
335
  if (empty($licenseData) || !is_object($licenseData)) {
336
  $licenseNewStatus = "invalid";
337
  } else {
338
+ if (isset($licenseData->success) && $licenseData->success === true) {
 
 
339
  $licenseNewStatus = "valid";
340
+ } else {
341
+ $licenseNewStatus = isset($licenseData->error) && !empty($licenseData->error) ? $licenseData->error : "invalid";
342
  }
343
  }
344
 
EmbedPress/Plugins/index.html CHANGED
File without changes
EmbedPress/Providers/GoogleDocs.php CHANGED
File without changes
EmbedPress/Providers/GoogleMaps.php CHANGED
File without changes
EmbedPress/Providers/index.html CHANGED
File without changes
EmbedPress/Shortcode.php CHANGED
@@ -150,7 +150,7 @@ class Shortcode
150
  'maps' => '/^Location:\s+(http[s]?:\/\/.+)$/i'
151
  );
152
 
153
- $service = strtolower(@$matches[1]);
154
  // No specific service was found in the url.
155
  if (empty($service)) {
156
  // Let's try to guess which service the original url belongs to.
150
  'maps' => '/^Location:\s+(http[s]?:\/\/.+)$/i'
151
  );
152
 
153
+ $service = isset($matches[1]) ? strtolower($matches[1]) : null;
154
  // No specific service was found in the url.
155
  if (empty($service)) {
156
  // Let's try to guess which service the original url belongs to.
EmbedPress/Updater.php CHANGED
File without changes
PROVIDERS.md CHANGED
File without changes
assets/css/font.css CHANGED
File without changes
assets/css/vendor/bootstrap/bootstrap.css.map CHANGED
File without changes
assets/images/menu-icon.png CHANGED
File without changes
assets/js/preview.js CHANGED
File without changes
assets/js/vendor/bootbox.min.js CHANGED
File without changes
autoloader.php CHANGED
File without changes
changelog.txt CHANGED
@@ -1,4 +1,10 @@
1
  == Changelog ==
 
 
 
 
 
 
2
  = 1.4.1 =
3
  Release Date: 2017-01-06
4
 
1
  == Changelog ==
2
+ = 1.4.2 =
3
+ Release Date: 2017-01-09
4
+
5
+ * Fixed the plugin activation in older PHP environments (>= 5.3.0);
6
+ * Option description enhancements.
7
+
8
  = 1.4.1 =
9
  Release Date: 2017-01-06
10
 
embedpress.php CHANGED
@@ -12,7 +12,7 @@
12
  * @embedpress
13
  * Plugin Name: EmbedPress
14
  * Plugin URI: http://pressshack.com/embedpress/
15
- * Version: 1.4.1
16
  * Description: WordPress supports around 35 embed sources, but EmbedPress adds over 40 more, including Facebook, Google Maps, Google Docs, UStream! Just use the URL!
17
  * Author: PressShack
18
  * Author URI: http://pressshack.com
12
  * @embedpress
13
  * Plugin Name: EmbedPress
14
  * Plugin URI: http://pressshack.com/embedpress/
15
+ * Version: 1.4.2
16
  * Description: WordPress supports around 35 embed sources, but EmbedPress adds over 40 more, including Facebook, Google Maps, Google Docs, UStream! Just use the URL!
17
  * Author: PressShack
18
  * Author URI: http://pressshack.com
includes.php CHANGED
@@ -20,7 +20,7 @@ if (!defined('EMBEDPRESS_PLG_NAME')) {
20
  }
21
 
22
  if (!defined('EMBEDPRESS_PLG_VERSION')) {
23
- define('EMBEDPRESS_PLG_VERSION', "1.4.1");
24
  }
25
 
26
  if (!defined('EMBEDPRESS_PATH_BASE')) {
20
  }
21
 
22
  if (!defined('EMBEDPRESS_PLG_VERSION')) {
23
+ define('EMBEDPRESS_PLG_VERSION', "1.4.2");
24
  }
25
 
26
  if (!defined('EMBEDPRESS_PATH_BASE')) {
providers.php CHANGED
File without changes
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: PressShack
3
  Tags: 23hq, amcharts, animoto, bambuser, cacoo, chartblocks, chirbit, circuitlab, cloudup, clyp, collegehumor, coub, crowd ranking, daily mile, dailymotion, devianart, dipity, dotsub, facebook, flickr, funnyordie, gettyimages, github gist, google docs, google drawings, google maps, google sheets, google slides, huffduffer, hulu, imgur, infogram, instagram, issuu, kickstarter, meetup, mixcloud, mobypicture, nfb, photobucket, polldaddy, porfolium, reddit, release wire, reverbnation, roomshare, rutube, sapo videos, scribd, shortnote, shoudio, sketchfab, slideshare, smugmug, soundcloud, speaker deck, spotify, ted, tumblr, twitter, ustream, viddler, videojug, videopress, vimeo, vine, wordpress tv, youtube
4
  Requires at least: 4.0
5
  Tested up to: 4.7
6
- Stable tag: 1.4.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -90,6 +90,12 @@ There're two ways to install EmbedPress plugin:
90
  `
91
 
92
  == Changelog ==
 
 
 
 
 
 
93
  = 1.4.1 =
94
  Release Date: 2017-01-06
95
 
3
  Tags: 23hq, amcharts, animoto, bambuser, cacoo, chartblocks, chirbit, circuitlab, cloudup, clyp, collegehumor, coub, crowd ranking, daily mile, dailymotion, devianart, dipity, dotsub, facebook, flickr, funnyordie, gettyimages, github gist, google docs, google drawings, google maps, google sheets, google slides, huffduffer, hulu, imgur, infogram, instagram, issuu, kickstarter, meetup, mixcloud, mobypicture, nfb, photobucket, polldaddy, porfolium, reddit, release wire, reverbnation, roomshare, rutube, sapo videos, scribd, shortnote, shoudio, sketchfab, slideshare, smugmug, soundcloud, speaker deck, spotify, ted, tumblr, twitter, ustream, viddler, videojug, videopress, vimeo, vine, wordpress tv, youtube
4
  Requires at least: 4.0
5
  Tested up to: 4.7
6
+ Stable tag: 1.4.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
90
  `
91
 
92
  == Changelog ==
93
+ = 1.4.2 =
94
+ Release Date: 2017-01-09
95
+
96
+ * Fixed the plugin activation in older PHP environments (>= 5.3.0);
97
+ * Option description enhancements.
98
+
99
  = 1.4.1 =
100
  Release Date: 2017-01-06
101