Skip to content

Commit

Permalink
Merge pull request #74 from themeum/dev
Browse files Browse the repository at this point in the history
UPDATE: Marge latest from dev branch
  • Loading branch information
sazedul-haque committed Jul 25, 2022
2 parents b502015 + 5535b59 commit 5e40207
Show file tree
Hide file tree
Showing 11 changed files with 428 additions and 24 deletions.
332 changes: 332 additions & 0 deletions assets/css/animation.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/reactjs/src/blocks/contactform/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const formItems = [
{
type: "text",
label: "Full Name",
name: "full-name ",
name: "full-name",
placeholder: "Full Name",
width: { md: 50 },
required: true,
Expand Down
2 changes: 2 additions & 0 deletions assets/reactjs/src/blocks/image/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
position: relative;

.qubely-image-image {
max-width: 100%;
margin: 0;
padding: 0;
display: block;
Expand Down Expand Up @@ -40,6 +41,7 @@
right: 0;
z-index: 10;
line-height: normal;
box-sizing: border-box;
}
}
div.qubely-image-container {
Expand Down
7 changes: 6 additions & 1 deletion assets/reactjs/src/blocks/row/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
position: relative;
.qubely-container {
position: relative;
width: 100%;
// width: 100%;
margin-right: auto;
margin-left: auto;

Expand Down Expand Up @@ -155,5 +155,10 @@ div[data-type="qubely/row"] {
}
}
}

.wp-block {
margin-top: 0;
margin-bottom: 0;
}
}
}
2 changes: 1 addition & 1 deletion assets/reactjs/src/blocks/tabs/Save.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Save extends Component {
{title.iconName && (iconPosition == "top" || iconPosition == "left") && (
<i className={`qubely-tab-icon ${title.iconName}`} />
)}
{title.title}
<span className="qubely-tab-title-text">{title.title}</span>
{title.iconName && iconPosition == "right" && (
<i className={`qubely-tab-icon ${title.iconName}`} />
)}
Expand Down
2 changes: 1 addition & 1 deletion assets/reactjs/src/components/CssGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export const CssGenerator = (

// Join CSS
if (md.length > 0) {
__CSS += "@media (min-width: 1200px) {" + md.join("") + "}";
__CSS += md.join("");
}
if (sm.length > 0) {
__CSS += "@media (max-width: 1199px) {" + sm.join("") + "}";
Expand Down
2 changes: 1 addition & 1 deletion assets/reactjs/src/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
.qubely-row > .block-editor-inner-blocks > .block-editor-block-list__layout {
display: flex;
flex-wrap: wrap;
// flex-wrap: wrap;
}
.wp-block-qubely-row > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="qubely/column"] {
display: flex;
Expand Down
57 changes: 45 additions & 12 deletions core/QUBELY.php
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,32 @@ public function qubely_enqueue_style() {
}
}

// Check if a block is in reusable
public function has_block_in_reusable( $block_name, $id = false ){
$id = (!$id) ? get_the_ID() : $id;
if( $id ){
if ( has_block( 'block', $id ) ){
// Check reusable blocks
$content = get_post_field( 'post_content', $id );
$blocks = parse_blocks( $content );

if ( ! is_array( $blocks ) || empty( $blocks ) ) {
return false;
}

foreach ( $blocks as $block ) {
if ( $block['blockName'] === 'core/block' && ! empty( $block['attrs']['ref'] ) ) {
if( has_block( $block_name, $block['attrs']['ref'] ) ){
return true;
}
}
}
}
}

return false;
}

public function qubely_enqueue_scripts() {
wp_register_script( 'qubely_local_script', '' );
$protocols = array( 'http://', 'https://', 'http://www', 'https://www', 'www' );
Expand All @@ -683,7 +709,7 @@ public function qubely_enqueue_scripts() {
wp_enqueue_script( 'qubely_local_script' );

$blocks_meta_data = get_post_meta( get_the_ID(), '__qubely_available_blocks', true );
$blocks_meta_data = unserialize( $blocks_meta_data );
$blocks_meta_data = maybe_unserialize( $blocks_meta_data );

/**
* register scripts
Expand All @@ -703,19 +729,19 @@ public function qubely_enqueue_scripts() {
$has_animation = $blocks_meta_data['animation'];
$has_parallax = $blocks_meta_data['parallax'];

if ( has_block( 'qubely/animatedheadline' ) ) {
if ( has_block( 'qubely/animatedheadline' ) || $this->has_block_in_reusable( 'qubely/animatedheadline' ) ) {
wp_enqueue_script( 'qubley-animated-headline-script' );
}
if ( has_block( 'qubely/map' ) ) {
wp_enqueue_script( 'qubely-block-map' );
}
if ( has_block( 'qubely/videopopup' ) || has_block( 'qubely/gallery' ) ) {
if ( has_block( 'qubely/videopopup' ) || has_block( 'qubely/gallery' ) || $this->has_block_in_reusable( 'qubely/videopopup' ) || $this->has_block_in_reusable( 'qubely/gallery' ) ) {
wp_enqueue_script( 'qubely-magnific-popup-script' );
}
if ( has_block( 'qubely/contactform' ) || has_block( 'qubely/form' ) ) {
if ( has_block( 'qubely/contactform' ) || has_block( 'qubely/form' ) || $this->has_block_in_reusable( 'qubely/contactform' ) || $this->has_block_in_reusable( 'qubely/form' ) ) {
wp_enqueue_script( 'qubely-block-contactform' );
}
if ( has_block( 'qubely/imagecomparison' ) ) {
if ( has_block( 'qubely/imagecomparison' ) || $this->has_block_in_reusable( 'qubely/imagecomparison' ) ) {
wp_enqueue_script( 'qubely-block-image-comparison' );
}

Expand All @@ -733,7 +759,14 @@ public function qubely_enqueue_scripts() {
in_array( 'qubely/tabs', $available_blocks ) ||
in_array( 'qubely/table-of-contents', $available_blocks ) ||
in_array( 'qubely/verticaltabs', $available_blocks ) ||
in_array( 'qubely/postgrid', $available_blocks )
in_array( 'qubely/postgrid', $available_blocks ) ||
$this->has_block_in_reusable( 'qubely/accordion' ) ||
$this->has_block_in_reusable( 'qubely/pieprogress' ) ||
$this->has_block_in_reusable( 'qubely/counter' ) ||
$this->has_block_in_reusable( 'qubely/tabs' ) ||
$this->has_block_in_reusable( 'qubely/table-of-contents' ) ||
$this->has_block_in_reusable( 'qubely/verticaltabs' ) ||
$this->has_block_in_reusable( 'qubely/postgrid' )
) {
wp_enqueue_script( 'qubely-block-common' );
}
Expand Down Expand Up @@ -1966,7 +1999,7 @@ public function qubely_send_form_data() {
$formSuccessMessage = ( $_POST['form-success-message'] ) ? sanitize_text_field( $_POST['form-success-message'] ) : '';
$formErrorMessage = ( $_POST['form-error-message'] ) ? sanitize_text_field( $_POST['form-error-message'] ) : '';
$emailReceiver = ( $_POST['email-receiver'] ) ? sanitize_email( $_POST['email-receiver'] ) : $default_receiver;
$emailHeaders = ( $_POST['email-headers'] ) ? $_POST['email-headers'] : '';
$emailHeaders = ( $_POST['email-headers'] ) ? sanitize_textarea_field( $_POST['email-headers'] ) : '';
$emailSubject = ( $_POST['email-subject'] ) ? sanitize_text_field( $_POST['email-subject'] ) : '';
$emailBody = ( $_POST['email-body'] ) ? wp_kses_post( $_POST['email-body'] ) : '';

Expand Down Expand Up @@ -1997,16 +2030,16 @@ public function qubely_send_form_data() {
$_header = explode( ':', $_header );
if ( count( $_header ) > 0 ) {
if ( strtolower( $_header[0] ) == 'reply-to' ) {
$replyToMail = isset( $_header[1] ) ? trim( $_header[1] ) : '';
$replyToMail = isset( $_header[1] ) ? sanitize_text_field( $_header[1] ) : '';
}
if ( strtolower( $_header[0] ) == 'reply-name' ) {
$replyToName = isset( $_header[1] ) ? trim( $_header[1] ) : '';
$replyToName = isset( $_header[1] ) ? sanitize_text_field( $_header[1] ) : '';
}
if ( strtolower( $_header[0] ) == 'cc' ) {
$cc = isset( $_header[1] ) ? trim( $_header[1] ) : '';
$cc = isset( $_header[1] ) ? sanitize_text_field( $_header[1] ) : '';
}
if ( strtolower( $_header[0] ) == 'bcc' ) {
$bcc = isset( $_header[1] ) ? trim( $_header[1] ) : '';
$bcc = isset( $_header[1] ) ? sanitize_text_field( $_header[1] ) : '';
}
}
}
Expand All @@ -2022,7 +2055,7 @@ public function qubely_send_form_data() {
}

// Subject Structure
$siteName = isset( $_SERVER['SERVER_NAME'] ) ? $_SERVER['SERVER_NAME'] : '';
$siteName = isset( $_SERVER['SERVER_NAME'] ) ? sanitize_text_field( $_SERVER['SERVER_NAME'] ) : '';
$emailSubject = str_replace( '{{site-name}}', $siteName, $emailSubject );

$headers[] = 'Content-Type: text/html; charset=UTF-8';
Expand Down
8 changes: 4 additions & 4 deletions qubely.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* Plugin Name: Qubely - Advanced Gutenberg Blocks
* Plugin URI: https://www.themeum.com/
* Description: The one and only Gutenberg block plugin you will ever need.
* Version: 1.8.1
* Version: 1.8.3
* Author: Themeum
* Author URI: https://www.themeum.com/
* Text Domain: qubely
* Requires at least: 5.0
* Tested up to: 6.0
* Requires at least: 5.3
* Tested up to: 6.0.1
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
Expand All @@ -24,7 +24,7 @@ function qubely_language_load()
}

// Define Version
define('QUBELY_VERSION', '1.8.1');
define('QUBELY_VERSION', '1.8.3');

// Define License
define('QUBELY_LICENSE', 'free');
Expand Down
19 changes: 16 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Contributors: themeum
Donate link: https://www.themeum.com
Tags: blocks, gutenberg, gutenberg blocks, editor, block, page builder
Requires at least: 5.0
Tested up to: 6.0
Stable tag: 1.8.1
Requires at least: 5.3
Tested up to: 6.0.1
Stable tag: 1.8.3
Requires PHP: 7.0
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
Expand Down Expand Up @@ -239,6 +239,19 @@ You can report bugs on the [support forum here](https://wordpress.org/support/pl

== Changelog ==

= 1.8.3 =
Update: Email Sending Mechanism is improved in terms of Security and Performance
Update: PHP version compatibility is improved
Fix: Counter was not working properly
Fix: Row Padding was not being implemented the same way as it is shown in the Preview page
Fix: Pre-made templates were appearing differently when editing than how they appear on the frontend

= 1.8.2 =
Update: Compatibility with the latest WPML plugin is introduced
Fix: PHP Notice Message was appearing on some Pages
Fix: The "Number of Columns" setting was not working in the latest Qubely
Fix: Mobile View Styles Break after the latest update to 1.8.0

= 1.8.1 =
New: Introduced the "Hide on Desktop" feature for Blocks
Update: Significant security improvements on authorization and authentication
Expand Down
19 changes: 19 additions & 0 deletions wpml-config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<wpml-config>
<gutenberg-blocks>
<gutenberg-block type="qubely/accordion-item" translate="1">
<xpath>//span[@class="qubely-accordion-panel-handler-label"]</xpath>
</gutenberg-block>
<gutenberg-block type="qubely/tabs" translate="1">
<xpath>//span[@class="qubely-tab-title-text"]</xpath>
<xpath>//div[@class="image-type-nav-title"]</xpath>
</gutenberg-block>
</gutenberg-blocks>
<custom-fields>
<custom-field action="copy">_qubely_css</custom-field>
<custom-field action="copy">_qubely_interaction_json</custom-field>
<custom-field action="copy">__qubely_available_blocks</custom-field>
</custom-fields>
<admin-texts>
<key name="qubely_global_options"/>
</admin-texts>
</wpml-config>

0 comments on commit 5e40207

Please sign in to comment.