Photo Gallery by WD – Responsive Photo Gallery - Version 1.2.41

Version Description

  • Fixed: Embed media for wordpress lower than 4.0.0.
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Photo Gallery by WD – Responsive Photo Gallery
Version 1.2.41
Comparing to
See all releases

Code changes from version 1.2.40 to 1.2.41

Files changed (3) hide show
  1. framework/WDWLibraryEmbed.php +30 -2
  2. photo-gallery.php +3 -3
  3. readme.txt +4 -1
framework/WDWLibraryEmbed.php CHANGED
@@ -28,7 +28,29 @@ class WDWLibraryEmbed {
28
  ////////////////////////////////////////////////////////////////////////////////////////
29
  // Getters & Setters //
30
  ////////////////////////////////////////////////////////////////////////////////////////
31
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  /**
34
  * check host and get data for a given url
@@ -90,7 +112,13 @@ class WDWLibraryEmbed {
90
  include( ABSPATH . WPINC . '/class-oembed.php' );
91
  // get an oembed object
92
  $oembed = _wp_oembed_get_object();
93
- $provider = $oembed->get_provider( $url );
 
 
 
 
 
 
94
  foreach ($accepted_oembeds as $oembed_provider => $regex) {
95
  if(preg_match($regex, $provider)==1){
96
  $host = $oembed_provider;
28
  ////////////////////////////////////////////////////////////////////////////////////////
29
  // Getters & Setters //
30
  ////////////////////////////////////////////////////////////////////////////////////////
31
+
32
+ public function get_provider($oembed, $url, $args = '') {
33
+ $provider = false;
34
+ if (!isset($args['discover'])) {
35
+ $args['discover'] = true;
36
+ }
37
+ foreach ($oembed->providers as $matchmask => $data ) {
38
+ list( $providerurl, $regex ) = $data;
39
+ // Turn the asterisk-type provider URLs into regex
40
+ if ( !$regex ) {
41
+ $matchmask = '#' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $matchmask ), '#' ) ) . '#i';
42
+ $matchmask = preg_replace( '|^#http\\\://|', '#https?\://', $matchmask );
43
+ }
44
+ if ( preg_match( $matchmask, $url ) ) {
45
+ $provider = str_replace( '{format}', 'json', $providerurl ); // JSON is easier to deal with than XML
46
+ break;
47
+ }
48
+ }
49
+ if ( !$provider && $args['discover'] ) {
50
+ $provider = $oembed->discover($url);
51
+ }
52
+ return $provider;
53
+ }
54
 
55
  /**
56
  * check host and get data for a given url
112
  include( ABSPATH . WPINC . '/class-oembed.php' );
113
  // get an oembed object
114
  $oembed = _wp_oembed_get_object();
115
+ if (method_exists($oembed, 'get_provider')) {
116
+ // Since 4.0.0
117
+ $provider = $oembed->get_provider($url);
118
+ }
119
+ else {
120
+ $provider = self::get_provider($oembed, $url);
121
+ }
122
  foreach ($accepted_oembeds as $oembed_provider => $regex) {
123
  if(preg_match($regex, $provider)==1){
124
  $host = $oembed_provider;
photo-gallery.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Photo Gallery
5
  * Plugin URI: https://web-dorado.com/products/wordpress-photo-gallery-plugin.html
6
  * Description: This plugin is a fully responsive gallery plugin with advanced functionality. It allows having different image galleries for your posts and pages. You can create unlimited number of galleries, combine them into albums, and provide descriptions and tags.
7
- * Version: 1.2.40
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -3346,7 +3346,7 @@ function bwg_activate() {
3346
  ));
3347
  }
3348
  $version = get_option("wd_bwg_version");
3349
- $new_version = '1.2.40';
3350
  if ($version && version_compare($version, $new_version, '<')) {
3351
  require_once WD_BWG_DIR . "/update/bwg_update.php";
3352
  bwg_update($version);
@@ -3364,7 +3364,7 @@ wp_oembed_add_provider( '#https://instagr(\.am|am\.com)/p/.*#i', 'https://api.in
3364
 
3365
  function bwg_update_hook() {
3366
  $version = get_option("wd_bwg_version");
3367
- $new_version = '1.2.40';
3368
  if ($version && version_compare($version, $new_version, '<')) {
3369
  require_once WD_BWG_DIR . "/update/bwg_update.php";
3370
  bwg_update($version);
4
  * Plugin Name: Photo Gallery
5
  * Plugin URI: https://web-dorado.com/products/wordpress-photo-gallery-plugin.html
6
  * Description: This plugin is a fully responsive gallery plugin with advanced functionality. It allows having different image galleries for your posts and pages. You can create unlimited number of galleries, combine them into albums, and provide descriptions and tags.
7
+ * Version: 1.2.41
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
3346
  ));
3347
  }
3348
  $version = get_option("wd_bwg_version");
3349
+ $new_version = '1.2.41';
3350
  if ($version && version_compare($version, $new_version, '<')) {
3351
  require_once WD_BWG_DIR . "/update/bwg_update.php";
3352
  bwg_update($version);
3364
 
3365
  function bwg_update_hook() {
3366
  $version = get_option("wd_bwg_version");
3367
+ $new_version = '1.2.41';
3368
  if ($version && version_compare($version, $new_version, '<')) {
3369
  require_once WD_BWG_DIR . "/update/bwg_update.php";
3370
  bwg_update($version);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-photo-gallery-plugin.html
4
  Tags: photo, photo gallery, image gallery, video gallery, gallery, galleries, wordpress gallery plugin, images gallery, album, photo albums, simple gallery, best gallery plugin, free photo gallery, wp gallery, wordpress gallery, website gallery, gallery shortcode, best gallery, picture, pictures, gallery slider, photo album, photogallery, widget gallery, image, images, photos, gallery lightbox, photoset, wordpress photo gallery plugin, wp gallery plugins, responsive wordpress photo gallery, media, image album, filterable gallery, banner rotator, fullscreen gallery, fotogalerie, galleria, galerie, galeri, responsive gallery, add album, add gallery, add pictures, fotoalbum, foto, gallery decription, multiple pictures, photoalbum, upload images, upload photos, view images, view pictures, admin, AJAX, comments, gallery image, image lightbox, image rotate, image slideshow, image slider, jquery, jquery gallery, slide show, slideshow, thumbnail, thumbnail view, thumbnails, thumbs, responsive, watermarking, watermarks,fullscreen slider, lightbox, photography, sidebar, slide, youtube, vimeo, videos, instagram, mosaic
5
  Requires at least: 3.4
6
  Tested up to: 4.2
7
- Stable tag: 1.2.40
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -207,6 +207,9 @@ Yes, it is possible to add advertising and/or watermark over the images. In both
207
 
208
  == Changelog ==
209
 
 
 
 
210
  = 1.2.40 =
211
  * Changed: Save images ordering in admin.
212
  * Fixed: Warnings in filemanager.
4
  Tags: photo, photo gallery, image gallery, video gallery, gallery, galleries, wordpress gallery plugin, images gallery, album, photo albums, simple gallery, best gallery plugin, free photo gallery, wp gallery, wordpress gallery, website gallery, gallery shortcode, best gallery, picture, pictures, gallery slider, photo album, photogallery, widget gallery, image, images, photos, gallery lightbox, photoset, wordpress photo gallery plugin, wp gallery plugins, responsive wordpress photo gallery, media, image album, filterable gallery, banner rotator, fullscreen gallery, fotogalerie, galleria, galerie, galeri, responsive gallery, add album, add gallery, add pictures, fotoalbum, foto, gallery decription, multiple pictures, photoalbum, upload images, upload photos, view images, view pictures, admin, AJAX, comments, gallery image, image lightbox, image rotate, image slideshow, image slider, jquery, jquery gallery, slide show, slideshow, thumbnail, thumbnail view, thumbnails, thumbs, responsive, watermarking, watermarks,fullscreen slider, lightbox, photography, sidebar, slide, youtube, vimeo, videos, instagram, mosaic
5
  Requires at least: 3.4
6
  Tested up to: 4.2
7
+ Stable tag: 1.2.41
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
207
 
208
  == Changelog ==
209
 
210
+ = 1.2.41 =
211
+ * Fixed: Embed media for wordpress lower than 4.0.0.
212
+
213
  = 1.2.40 =
214
  * Changed: Save images ordering in admin.
215
  * Fixed: Warnings in filemanager.