Envato Elements – Template Kits (Beta) - Version 1.0.6

Version Description

  • 2019-05-22 =
  • Fix: Importing Large Templates was resulting in blank page.
Download this release

Release Info

Developer dtbaker
Plugin Icon 128x128 Envato Elements – Template Kits (Beta)
Version 1.0.6
Comparing to
See all releases

Code changes from version 1.0.5 to 1.0.6

envato-elements.php CHANGED
@@ -4,7 +4,7 @@
4
  * Description: Beautifully designed, Free templates for popular WordPress page builders & access to Premium Photos from Envato Elements.
5
  * Author: Envato
6
  * Author URI: https://elements.envato.com/extensions/wordpress/?utm_source=extensions&utm_medium=referral&utm_campaign=elements_extensions_wpplugins
7
- * Version: 1.0.5
8
  * License: GPLv3 or later
9
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  *
@@ -28,7 +28,7 @@ if ( ! defined( 'ABSPATH' ) ) {
28
  }
29
 
30
  define( 'ENVATO_ELEMENTS_SLUG', 'envato-elements' );
31
- define( 'ENVATO_ELEMENTS_VER', '1.0.5' );
32
  define( 'ENVATO_ELEMENTS_FILE', __FILE__ );
33
  define( 'ENVATO_ELEMENTS_DIR', plugin_dir_path( ENVATO_ELEMENTS_FILE ) );
34
  define( 'ENVATO_ELEMENTS_URI', plugins_url( '/', ENVATO_ELEMENTS_FILE ) );
4
  * Description: Beautifully designed, Free templates for popular WordPress page builders & access to Premium Photos from Envato Elements.
5
  * Author: Envato
6
  * Author URI: https://elements.envato.com/extensions/wordpress/?utm_source=extensions&utm_medium=referral&utm_campaign=elements_extensions_wpplugins
7
+ * Version: 1.0.6
8
  * License: GPLv3 or later
9
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  *
28
  }
29
 
30
  define( 'ENVATO_ELEMENTS_SLUG', 'envato-elements' );
31
+ define( 'ENVATO_ELEMENTS_VER', '1.0.6' );
32
  define( 'ENVATO_ELEMENTS_FILE', __FILE__ );
33
  define( 'ENVATO_ELEMENTS_DIR', plugin_dir_path( ENVATO_ELEMENTS_FILE ) );
34
  define( 'ENVATO_ELEMENTS_URI', plugins_url( '/', ENVATO_ELEMENTS_FILE ) );
inc/class-collection-elementor.php CHANGED
@@ -100,21 +100,17 @@ class Collection_Elementor extends Collection {
100
  }
101
 
102
  if ( $new_post_id && ! is_wp_error( $new_post_id ) ) {
103
- global $wpdb;
104
- /*
105
- * duplicate all post meta just in two SQL queries
106
- */
107
- $post_meta_infos = $wpdb->get_results( $wpdb->prepare( "SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id = %d", $import_result['post_id'] ) );
108
- if ( count( $post_meta_infos ) != 0 ) {
109
- $sql_query = "INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) ";
110
- $sql_query_sel = array();
111
- foreach ( $post_meta_infos as $meta_info ) {
112
- $meta_key = $meta_info->meta_key;
113
- $meta_value = esc_sql( $meta_info->meta_value );
114
- $sql_query_sel[] = "SELECT $new_post_id, '$meta_key', '$meta_value'";
115
  }
116
- $sql_query .= implode( ' UNION ALL ', $sql_query_sel );
117
- $wpdb->query( $sql_query );
118
  }
119
 
120
  update_post_meta( $new_post_id, '_source_kit_id', $import_result['post_id'] ); // Required to figure out imported state.
@@ -159,7 +155,7 @@ class Collection_Elementor extends Collection {
159
  */
160
  public function filter_installed_status( $collection, $search = [] ) {
161
 
162
- if ( !empty( $search['elementor'] ) && $search['elementor'] === 'free' ) {
163
  // User only wants to see free templates. Remove here.
164
  foreach ( $collection['templates'] as $id => $template ) {
165
  if ( ! empty( $template['templateFeatures'] ) && isset( $template['templateFeatures']['elementor-pro'] ) ) {
100
  }
101
 
102
  if ( $new_post_id && ! is_wp_error( $new_post_id ) ) {
103
+
104
+ // Duplicate all post meta values
105
+ $old_post_meta_keys = get_post_custom_keys( $import_result['post_id'] );
106
+ if ( $old_post_meta_keys && is_array( $old_post_meta_keys ) && ! is_wp_error( $old_post_meta_keys ) ) {
107
+ foreach ( $old_post_meta_keys as $meta_key ) {
108
+ $meta_values = get_post_custom_values( $meta_key, $import_result['post_id'] );
109
+ foreach ( $meta_values as $meta_value ) {
110
+ $meta_value = maybe_unserialize( $meta_value );
111
+ add_post_meta( $new_post_id, $meta_key, wp_slash( $meta_value ) );
112
+ }
 
 
113
  }
 
 
114
  }
115
 
116
  update_post_meta( $new_post_id, '_source_kit_id', $import_result['post_id'] ); // Required to figure out imported state.
155
  */
156
  public function filter_installed_status( $collection, $search = [] ) {
157
 
158
+ if ( ! empty( $search['elementor'] ) && $search['elementor'] === 'free' ) {
159
  // User only wants to see free templates. Remove here.
160
  foreach ( $collection['templates'] as $id => $template ) {
161
  if ( ! empty( $template['templateFeatures'] ) && isset( $template['templateFeatures']['elementor-pro'] ) ) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: elementor, beaver builder, elements, templates
4
  Requires at least: 4.6
5
  Tested up to: 5.1
6
  Requires PHP: 5.6
7
- Stable tag: 1.0.5
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -81,6 +81,9 @@ If you have any questions or feedback for the team, please send an email to exte
81
 
82
  == Changelog ==
83
 
 
 
 
84
  = 1.0.5 - 2019-05-16 =
85
  * Fix: Fix WordPress Error Handling with 5.2
86
 
4
  Requires at least: 4.6
5
  Tested up to: 5.1
6
  Requires PHP: 5.6
7
+ Stable tag: 1.0.6
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
81
 
82
  == Changelog ==
83
 
84
+ = 1.0.6 - 2019-05-22 =
85
+ * Fix: Importing Large Templates was resulting in blank page.
86
+
87
  = 1.0.5 - 2019-05-16 =
88
  * Fix: Fix WordPress Error Handling with 5.2
89