Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.10.1 #1046

Merged
merged 14 commits into from
Sep 19, 2024
1 change: 1 addition & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ README.md
SECURITY.md
/scripts
.babelrc
phpcs.xml
4 changes: 2 additions & 2 deletions Modula.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://wp-modula.com/
* Description: Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks.
* Author: WPChill
* Version: 2.10.0
* Version: 2.10.1
* Author URI: https://www.wpchill.com/
* License: GPLv3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -47,7 +47,7 @@
* @since 2.0.2
*/

define( 'MODULA_LITE_VERSION', '2.10.0' );
define( 'MODULA_LITE_VERSION', '2.10.1' );
define( 'MODULA_PATH', plugin_dir_path( __FILE__ ) );
define( 'MODULA_URL', plugin_dir_url( __FILE__ ) );
defined( 'MODULA_PRO_STORE_URL' ) || define( 'MODULA_PRO_STORE_URL', 'https://wp-modula.com' );
Expand Down
55 changes: 20 additions & 35 deletions assets/js/admin/wp-modula-conditions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ jQuery.fn.setting_state = function (el, state) {
if (state == 'off') {
this.css('opacity', '0.5');
this.find('input, textarea, select, button').addClass('modula-no-pointer');
this.hide();
}
if (state == 'on') {
this.css('opacity', '1');
this.find('input, textarea, select, button').removeClass('modula-no-pointer');
this.show();
}
};

Expand Down Expand Up @@ -238,10 +240,7 @@ var modulaGalleryConditions = Backbone.Model.extend({
jQuery.each(children, function (index, item) {
var child = jQuery('[data-container="' + item + '"]');

if (0 == value && currentRow.hasClass('modula_accordion_open')) {
child.setting_state(this, 'off');
child.show();
} else if (0 == value) {
if (0 == value) {
child.hide();
} else {
child.setting_state( this, 'on');
Expand All @@ -251,6 +250,8 @@ var modulaGalleryConditions = Backbone.Model.extend({

if (0 != value) {
currentRow.addClass('modula_accordion_open');
} else {
currentRow.removeClass('modula_accordion_open');
}

this.enableEmail(false, wp.Modula.Settings.get('enableEmail'));
Expand Down Expand Up @@ -282,29 +283,21 @@ var modulaGalleryConditions = Backbone.Model.extend({

jQuery.each(children, function (index, item) {
var child = jQuery('[data-container="' + item + '"]');

if (
(0 == value || 0 == wp.Modula.Settings.get('enableSocial')) &&
currentRow.hasClass('modula_accordion_open')
) {
child.setting_state(this, 'off');
child.show();
} else if (
0 == value ||
0 == wp.Modula.Settings.get('enableSocial')
) {
child.hide();
} else {
child.css('opacity', '1');
child
.find('input, textarea, select, button')
.removeAttr('disabled');
child.show();
}
});

if (1 == value && 1 == wp.Modula.Settings.get('enableSocial')) {
currentRow.addClass('modula_accordion_open');
} else {
currentRow.removeClass('modula_accordion_open');
}
},

Expand All @@ -316,22 +309,17 @@ var modulaGalleryConditions = Backbone.Model.extend({
jQuery.each(children, function (index, item) {
var child = jQuery('[data-container="' + item + '"]');

if (0 == value && currentRow.hasClass('modula_accordion_open')) {
child.setting_state(this, 'off');
child.show();
} else if (0 == value) {
if (0 == value) {
child.hide();
} else {
child.css('opacity', '1');
child
.find('input, textarea, select, button')
.removeAttr('disabled');
child.show();
}
});

if (1 == value) {
currentRow.addClass('modula_accordion_open');
} else {
currentRow.removeClass('modula_accordion_open');
}
},

Expand All @@ -345,24 +333,23 @@ var modulaGalleryConditions = Backbone.Model.extend({
jQuery.each(children, function (index, item) {
var child = jQuery('[data-container="' + item + '"]');

if (1 == value && currentRow.hasClass('modula_accordion_open')) {
child.setting_state(this, 'off');
child.show();
} else if (1 == value) {
if (1 == value) {
child.hide();
} else {
child.css('opacity', '1');
child.setting_state(this, 'on');
child.show();
child.setting_state(this, 'on');
}
});

if (1 != value) {
currentRow.addClass('modula_accordion_open');
}else{
currentRow.removeClass('modula_accordion_open');
}
},

hideCaption: function (settings, value) {

var rows = this.get('rows'),
currentRow = rows.filter('[data-container="hide_description"]'),
children = currentRow.data('children');
Expand All @@ -372,20 +359,18 @@ var modulaGalleryConditions = Backbone.Model.extend({
jQuery.each(children, function (index, item) {
var child = jQuery('[data-container="' + item + '"]');

if (1 == value && currentRow.hasClass('modula_accordion_open')) {
child.setting_state(this, 'off');
child.show();
} else if (1 == value) {
if (1 == value) {
child.hide();
} else {
child.css('opacity', '1');
child.setting_state(this, 'on');
child.show();
child.setting_state(this, 'on');
}
});

if (1 != value) {
currentRow.addClass('modula_accordion_open');
}else{
currentRow.removeClass('modula_accordion_open');
}
},

Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin/wp-modula-conditions.min.js

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions assets/js/admin/wp-modula-gutenberg.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,15 @@ var ModulaGalleryImageInner = function ModulaGalleryImageInner(props) {
img = props.img,
hideTitle = props.hideTitle,
hideDescription = props.hideDescription,
hideSocial = props.hideSocial;
hideSocial = props.hideSocial,
index = props.index;
var effectArray = ['tilt_1', 'tilt_3', 'tilt_7'],
overlayArray = ['tilt_3', 'tilt_7'],
svgArray = ['tilt_1', 'tilt_7'],
jtgBody = ['lily', 'centered-bottom', 'sadie', 'ruby', 'bubba', 'dexter', 'chico', 'ming'];
return [/*#__PURE__*/React.createElement(ModulaGalleryImageInner_Fragment, null, effectArray.includes(settings.effect) && /*#__PURE__*/React.createElement("div", {
return [/*#__PURE__*/React.createElement(ModulaGalleryImageInner_Fragment, {
key: index
}, effectArray.includes(settings.effect) && /*#__PURE__*/React.createElement("div", {
className: "tilter__deco tilter__deco--shine"
}, /*#__PURE__*/React.createElement("div", null)), overlayArray.includes(settings.effect) && /*#__PURE__*/React.createElement("div", {
className: "tilter__deco tilter__deco--overlay"
Expand Down Expand Up @@ -364,6 +367,7 @@ var ModulaGalleryImage = function ModulaGalleryImage(props) {
settings: settings,
img: img,
index: index,
key: index,
hideTitle: effectCheck && effectCheck.title ? false : true,
hideDescription: effectCheck && effectCheck.description ? false : true,
hideSocial: effectCheck && effectCheck.social ? false : true,
Expand Down Expand Up @@ -822,7 +826,7 @@ var ModulaEdit = function ModulaEdit(props) {
galleryType: 'gallery'
});
}
}, edit_('Display An Existing Gallery', 'modula-best-grid-gallery'), utils_icons.chevronRightFancy), undefined == props.attributes.proInstalled && galleries.length > 0 && /*#__PURE__*/React.createElement(edit_Button, {
}, edit_('Display An Existing Gallery', 'modula-best-grid-gallery'), utils_icons.chevronRightFancy), !attributes.proInstalled && galleries.length > 0 && /*#__PURE__*/React.createElement(edit_Button, {
href: "https://wp-modula.com/pricing/?utm_source=modula-lite&utm_campaign=upsell",
className: "modula-button-upsell",
isSecondary: true,
Expand Down Expand Up @@ -958,6 +962,10 @@ var ModulaGutenberg = /*#__PURE__*/function () {
currentSelectize: {
type: 'array',
"default": []
},
proInstalled: {
type: 'boolean',
"default": 'true' === modulaVars.proInstalled
}
};
registerBlockType(this.blockName, {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin/wp-modula-gutenberg.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/src/js/components/ModulaGalleryImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const ModulaGalleryImage = (props) => {
settings={settings}
img={img}
index={index}
key={index}
hideTitle={
effectCheck && effectCheck.title ? false : true
}
Expand Down
4 changes: 2 additions & 2 deletions assets/src/js/components/ModulaGalleryImageInner.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import icons from '../utils/icons';
const { Fragment } = wp.element;

const ModulaGalleryImageInner = (props) => {
const { settings, img, hideTitle, hideDescription, hideSocial } = props;
const { settings, img, hideTitle, hideDescription, hideSocial, index } = props;

let effectArray = ['tilt_1', 'tilt_3', 'tilt_7'],
overlayArray = ['tilt_3', 'tilt_7'],
Expand All @@ -19,7 +19,7 @@ const ModulaGalleryImageInner = (props) => {
];

return [
<Fragment>
<Fragment key={index}>
{effectArray.includes(settings.effect) && (
<div className="tilter__deco tilter__deco--shine">
<div />
Expand Down
2 changes: 1 addition & 1 deletion assets/src/js/components/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export const ModulaEdit = (props) => {
{icons.chevronRightFancy}
</Button>
)}
{undefined == props.attributes.proInstalled &&
{!attributes.proInstalled &&
galleries.length > 0 && (
<Button
href="https://wp-modula.com/pricing/?utm_source=modula-lite&utm_campaign=upsell"
Expand Down
4 changes: 4 additions & 0 deletions assets/src/js/wp-modula-gutenberg.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ class ModulaGutenberg {
type: 'array',
default: [],
},
proInstalled: {
type: 'boolean',
default: 'true' === modulaVars.proInstalled,
},
};

registerBlockType(this.blockName, {
Expand Down
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
= 2.10.1 - 19.09.2024 =
Changed: Hide instead of disable admin settings on parent change. ( [#1031]( https://github.com/WPChill/modula-lite/issues/1031) )
Fixed: PHP warning: undefined value.( [#1041]( https://github.com/WPChill/modula-lite/issues/1041) )
Added: General settings upsell for Modula Video
Fixed: Guntenberg js errors

= 2.10.0 - 10.09.2024 =
Fixed: Debug metabox default to off ( [#1035]( https://github.com/WPChill/modula-lite/issues/1035) )
Added: Image upload position choice, users can now choose where to upload images in the gallery. ( [#1015](https://github.com/WPChill/modula-lite/issues/1015) )
Expand Down
5 changes: 5 additions & 0 deletions includes/admin/class-modula-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ public function register_submenus() {
'priority' => 85,
'badge' => 'PRO'
),
'video' => array(
'label' => esc_html__('Video', 'modula-best-grid-gallery'),
'priority' => 125,
'badge' => 'PRO'
),
);
$this->tabs = apply_filters( 'modula_admin_page_tabs', $tabs );

Expand Down
32 changes: 32 additions & 0 deletions includes/admin/class-modula-upsells.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ function __construct() {
add_action( 'modula_admin_tab_watermark', array( $this, 'render_watermark_tab' ) );
add_action( 'modula_admin_tab_roles', array( $this, 'render_roles_tab' ) );
add_action( 'modula_admin_tab_whitelabel', array( $this, 'render_whitelabel_tab' ) );
// Add upsell for the Video tab.
add_filter( 'modula_admin_tab_video', array( $this, 'video_settings_tab_upsell' ) );

// Remove upsells badge if user's license includes the addon
add_filter( 'modula_admin_page_tabs', array( $this, 'remove_upsells_badge' ), 999 );
Expand Down Expand Up @@ -1145,4 +1147,34 @@ public function get_modal_bulk_editor_upgrade() {
require MODULA_PATH . '/includes/admin/templates/modal/modula-modal-bulk-editor-upgrade.php';
wp_die();
}

/**
* Video tab upsell
*
* @param string $tab_content The tab content.
* @return string
*
* @since 2.10.1
*/
public function video_settings_tab_upsell( $tab_content ) {

if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon( 'modula-video' ) ) {
return;
}
?>
<div class="modula-settings-tab-upsell">
<h3><?php esc_html_e( 'Modula Video', 'modula-best-grid-gallery' ); ?></h3>
<p><?php esc_html_e( 'Adding a video gallery with self-hosted videos or videos from sources like YouTube and Vimeo to your website has never been easier.', 'modula-best-grid-gallery' ); ?></p>
<p>
<?php

$buttons = '<a target="_blank" href="' . esc_url( $this->free_vs_pro_link ) . '" class="button">' . esc_html__( 'Free vs Premium', 'modula-best-grid-gallery' ) . '</a>';
$buttons .= '<a target="_blank" href="https://wp-modula.com/pricing/?utm_source=upsell&utm_medium=modula-video_tab_upsell-tab&utm_campaign=modula-video" style="margin-top:10px;" class="button-primary button">' . esc_html__( 'Get Premium!', 'modula-best-grid-gallery' ) . '</a>';

echo apply_filters( 'modula_upsell_buttons', $buttons, 'modula-video' );
?>
</p>
</div>
<?php
}
}
Loading
Loading