In this tutorial, we'll look at creating a custom carousel slider. This can be useful to showcase your posts, products and custom post types with Owl Carousel using a repeater.

Owl Carousel Example
Owl Carousel Example

Things Needed

We will create the carousel with a repeater element as this way we can reuse the carousel.

Create a new snippet - I named it scripts enqueue for my better understanding. I had the owl.carousel.min.css, owl.theme.default.min.css & owl.carousel.min.js uploaded to the directory /wp-content/snips/ this can be downloaded from owl carousel github page linked above.

/* Owl Start */

wp_enqueue_style( 'owlcore', '/wp-content/snips/owl.carousel.min.css' );
wp_enqueue_style( 'owltheme', '/wp-content/snips/owl.theme.default.min.css' );
wp_enqueue_script( 'owljs', '/wp-content/snips/owl.carousel.min.js',array( 'jquery' ),'2.3.4',true);

/* Owl End */


Step 2: Create the repeater element

For me I created a Repeater with the following elements. All the elements were wrapped inside a Div element and all elements in the div is stacked vertically with 100% width.

Repeater Element Structure
Repeater Element Structure

Step 3: Modify the Elements

Repeater Element

Add a class of owl-carousel (or a choice of yours) to the element

Under query option I manually put up the queries. For better understanding you can use Sridhar's Guide - https://wpdevdesign.com/manual-query-params-in-oxygen/

post_type=post&posts_per_page=6&no_found_rows=true&nopaging=true

In the layout option make child elements stack horizontally with top vertical alignment and center horizontal alignment.

Repeater Layout Option

Div Element

Make width 100%

Step 4: Create a Code Block

In the code block just paste the below javascript

jQuery(".owl-carousel > .oxy-repeater-pages-wrap").remove();

jQuery('.owl-carousel').owlCarousel({
   autoplay:true,
   autoplayTimeout:2000,
   autoplayHoverPause:true,
  loop: true,
responsive: {
// breakpoint from 0 and up
0: {
items: 1,
nav: true,
margin: 10,
slideBy: 1,
rewind: false,
},
// breakpoint from 500 and up
500: {
items: 2,
nav: true,
margin: 10,
slideBy: 1,
rewind: false,
},
// breakpoint from 768 and up
768: {
items: 2,
margin: 10,
nav: true,
slideBy: 1,
rewind: false,
},
// breakpoint from 1024px and up
1024: {
items: 3,
margin: 20,
nav: true,
slideBy: 1,
rewind: false,
// autoplay: true,
// autoplaySpeed: 1500
},
// breakpoint from 1440px and up
1440: {
items: 4,
margin: 20,
nav: true,
slideBy: 1,
rewind: false,
// autoplay: true,
// autoplaySpeed: 1500
}
}
});

To explain the above the first set of code is to remove repeater navigation which is unnecessary in this stance. The Next and final code initializes owl carousel.

When adding the javascript note that you should change the word owl-carousel to the name you used in the repeater.

Next add the following css in the css section of the code block.

.owl-theme .owl-nav {
margin-top: 10px;
outline: none;
}
.owl-carousel .owl-nav button.owl-prev,
.owl-carousel .owl-nav button.owl-next {
position: absolute;
padding: 10px !important;
top: 38%;
line-height: 1;
outline: none;
}
.owl-carousel .owl-nav button.owl-prev:hover,
.owl-carousel .owl-nav button.owl-next:hover {
background: none;
color: #404040;
outline: none;
}
.owl-carousel .owl-nav .owl-prev span,
.owl-carousel .owl-nav .owl-next span {
font-size: 40px;
outline: none;
color: #fff;
}
.owl-carousel .owl-nav .owl-prev {
left: -10px;
}
.owl-carousel .owl-nav .owl-next {
right: -10px;
}

.owl-carousel .oxy-repeater-pages-wrap {
  display: none;
}

Change the CSS Values as necessary.

Result

The final result is shared as a picture below:

Customization

Oxygen Element Block Shortcode

If you have blocks library enabled you can use the below shortcode to do all the above without needed to manually do much edits except edit the post query as necessary. The below would enqueue the Owl Carousel script in code block import necessary css and javascript along with the repeater.

[
]

If you prefer other carousels over flickity you can try the below:

In this tutorial, we'll look at creating a custom carousel slider. This can be useful to showcase your posts, products and custom post types with flickity using a repeater.

Flickity Carousel Example
Flickity Carousel Example

Things Needed

We will create the carousel with a repeater element as this way we can reuse the carousel.

Step 1: Enqueue the Necessary Scripts & CSS using Code Snippets

Create a new snippet - I named it scripts enqueue for my better understanding. I had the flickity.min.css & flickity.pkgd.min.js uploaded to the directory /wp-content/snips/

/*Carousel Start */

wp_enqueue_style( 'flickcore', '/wp-content/snips/flickity.min.css' );
wp_enqueue_script( 'flickjs', '/wp-content/snips/flickity.pkgd.min.js',array( 'jquery' ),'2.2.1',true);

/*Carousel End */

Step 2: Create the repeater element

For me I created a Repeater with the following elements. All the elements were wrapped inside a Div element as we need a div element to declare it as a carousel cell needed for the carousel to work well.

Repeater Element Structure
Repeater Element Structure

Step 3: Modify the Elements

Repeater Element

Add a class of flick (or a choice of yours) to the element

Under query option I manually put up the queries. For better understanding you can use Sridhar's Guide - https://wpdevdesign.com/manual-query-params-in-oxygen/

post_type=post&posts_per_page=6&no_found_rows=true&nopaging=true

For sizing option make width 100%

For layout make the element a block

Div Element

Add a Class of Carousel-cell for the div to work correctly as a single slide.

For Layout options, All child elements stacked vertically with Horizontal alignment in the center and Vertical Alignment in the top.

For the Div element I added a padding of 5 px to left and right to make spacing. It is advised to only use padding in the case of carousel to avoid errors that is caused by margins.

In the stance for width I gave 25% as this would yield 4 carousel in view. You can also give 33.33% if you require on 3 carousel in view or as needed.

For the height make height AUTO

Step 4: Create a Code Block

In the code block just paste the below javascript

jQuery(".flick").flickity({
  cellAlign: 'left',
  contain: true,
  wrapAround: true,
  autoPlay: true,
  prevNextButtons: false,
  pauseAutoPlayOnHover: false,
});

To explain the above the first set of code is to remove repeater navigation which is unnecessary in this stance. Second code ensures the height of the carousel is as needed and matches the highest height to the repeater itself with the class flick and finally the last code initializes the carousel script.

The code has been updated only to work with flickity. The code would initialize the carousel script.

When adding the javascript note that you should change the word flick to the name you used in the repeater.

Result

The final result is shared as a picture below:

Oxygen Element Block Shortcode

If you have blocks library enabled you can use the below shortcode to do all the above without needed to manually do much edits except edit the post query as necessary. The below would enqueue the flickity script in code block import necessary css and javascript along with the repeater.

[
]

Customization

If you prefer other carousels over flickity you can try the below:

So I wanted to try out Web App and Android App penetration testing the first software I was introduced to was BURP Suite, best in class industry standard tool for Penetration Testing.

Background

It had crossed me as I remember when Pathao App was accused of stealing personal data (Accusation was proved and necessary actions were taken) BURP was used for testing. So I went on a journey to configure BURP for android.

In Android Nougat, we’ve changed how Android handles trusted certificate authorities (CAs) to provide safer defaults for secure app traffic. Most apps and users should not be affected by these changes or need to take any action. The changes include:

https://android-developers.googleblog.com/2016/07/changes-to-trusted-certificate.html

That was the most painful task to do as though burp was easy setup the main problem was to get the certificate working inside Android 7+. I had a Android 9 and the problem with this version (I said problem but its a benefit if you are a general user) was that it did not allow for CA Certificates that are user installed to allow proxy connections that Burp needed in order to work.

The phone I used was a Xiaomi Mi 6x Rooted with Magisk, it is currently running MIUI 11.2 Android Version 9 - Pie.

As expected I followed all steps denoted in their website: Link, I got through some of the basic steps. Then came the most painful part getting the certificate to android. The Steps over at: Configuring Burp Suite With Android Nougat are really great but the current needs are different as android is ever evolving.

Install the Burp Suite CA as a system-level CA on the device. My recommendation for the easiest solution, but does require a rooted device. Also added benefit of not having to set a lockscreen PIN 🙂

Basic requirements

Though I say basic but its the most crucial element to succeeding in solving this simple problem.

The first thing you will need is an android device, it has to be rooted. (Use Magisk as it simply the best i have seen so far due to its ability to hide from apps)

Second you need a Linux Machine - I use Kali Linux on a virtual Machine to do my task.

Steps

Step 1: Start Burp Suite and add a new proxy listener. Make the proxy listener a Specific Address

Burp Suite new proxy listener
Burp Suite new proxy listener

Step 2: Export the Certificate and the Certificate KEY

First Click on Import / Export Certificate then first click on export in DER Format and Save file as cacert.der (you can use any name but I am using this and will be continuing to use this as reference name) then again do the same but this time select private key in DER format and save it as cacertKey.der . I stored them at root for easier manipultaion.

Exporting the Certificate and the Certificate KEY
Exporting the Certificate and the Certificate KEY

Step 3: Open Terminal and Use the following codes

openssl rsa -inform der -in cacertKey.der -outform pem -out cacertKey.pem

the above code will tell openssl to change the key from DER format to PEM format. We need this in order to sign the conversion of our cacert.der certificate to cacert.pem but the the key.

openssl x509 -inform der -in cacert.der -signkey cacertKey.pem -days 730 -outform der -out cacert2.der

The code that worked next would be telling openssl to create a new certificate in der format and save it as cacert2.der this is done in order to keep the original and the edited version. The code above also changes the validity of the certificate which is needed for apps to function properly. A typical certificate would last about 29 months so I gave about 730 days that is equivalent to 2 years or 24 Months. The signkey is our key we have converted this ensures that we are able to import it back to burp as we changed the date of issue and expiry. Next, we will convert the original to a pem certificate.

openssl x509 -inform der -in cacert.der -signkey cacertKey.pem -days 730 -outform pem -out cacert2.pem

This is needed for the android system which reads pems as a valid certificate. After the certificate is generated we will use the below 2 codes

openssl x509 -inform pem -in cacert.pem -subject_hash_old |head -1

cp cacert2.pem <Hash>.0

The first code will provide a result such as below:

Openssl Code Result
Openssl Code Result

The <Hash> for me is 9a5ba575. Up execution of the next code a new file will be generated with the hash and extension of zero.

Step 4: Copy the Cacert2.der and the <hash>.0 file over to android with any tools or method of your liking.

Step 5: Copy the <hash>.0 to the folder /system/etc/security/cacerts/
my preferred file manager for this is Mixplorer.

Step 6: Follow the steps over at Burp Suite - Link, use the file cacert2.der for the task and then proceed to next step

Step 7: Import into burp the Cacert2.der using the old der key.

Importing into burp the Cacert2.der using the old der key.
Importing into burp the Cacert2.der using the old .der key.
The New cacert and Old cacert key.
The New cacert and Old cacert key.

Viola All steps complete now you can start using BURP Suite with your android device.

Raw Codes

openssl rsa -inform der -in cacertKey.der -outform pem -out cacertKey.pem

openssl x509 -inform der -in cacert.der -signkey cacertKey.pem -days 730 -outform der -out cacert2.der

openssl x509 -inform der -in cacert.der -signkey cacertKey.pem -days 730 -outform pem -out cacert2.pem

openssl x509 -inform pem -in cacert.pem -subject_hash_old |head -1

cp cacert2.pem <Hash>.0

Backdoor Attack - 60 Million WordPress Sites at Risk

Scope (How the Integration Came to be)

I have recently migrated all my posts from DIVI builder to Gutenberg and plan to use it going forward. Recently diving into Oxygen Builder I found some mismatches in the CSS and they were bugging me a lot. Being a curious new player in the field I wanted to fix it.

Version History

Version 1 - NOV 2019

The first set of integration work is live and is working flawlessly with few errors. Almost all the blocks were working correctly except the Embed of Facebook & Audio.

Version 2 - 10 FEB 2020

Updated it too look better on some cases.
Fixed Bug: Caption links and caption texts on images

Installation - Oxygen Template System

The Installation of this integration is fairly easy. One of the greatest feature in oxygen comes to play regarding this, Inner Content. Inner Content out of the box does not do anything but the mixing of code levels it up.

Steps

  1. Create New Template - No Design Inherits & in the others section toggle Inner Content. What this will do is capture everything that is passes the inner content but is not built with Oxygen Builder itself. Example if a page is made with Gutenberg only that will pass through this template nothing else.
  2. Go to Templates and Navigate to your Blog Post Template (Single Blog Post). Open the template in Oxygen.
  3. Once the Oxygen builder opens, click add and then add a section. Inside the section place a inner content element. This is the default system meant for Oxygen to work correctly. you should already have the inner content template. On the same section follow step 4.
  4. Add a Code Block Element to the section below inner content. Add the below codes to the code block respectively to get them working.

Codes

PHP & HTML

<?php
add_theme_support( 'responsive-embeds' );
add_theme_support( 'customize-selective-refresh-widgets' );
add_theme_support( 'wp-block-styles' );
add_theme_support( 'align-wide' );
add_theme_support( 'editor-styles' );
add_editor_style( 'style-editor.css' );
?>

CSS

.wp-block-preformatted {
display: block;
  font-family: Menlo, Consolas, monaco, monospace;
  white-space: pre-wrap;
  word-wrap: break-word;
  text-align: justify;
  margin: 1em 0;}

    
.wp-block-code {
	font-family: Menlo, Consolas, monaco, monospace;
	font-size: 14px;
	color: #23282d;
	padding: 0.8em 1em;
	border: 1px solid #e2e4e7;
	border-radius: 4px;
 	white-space: pre-wrap;
}

.wp-block-audio{
color: #23282d;
	font-size: $default-font-size;
  text-align: center;}

pre.wp-block-verse {
  white-space: pre-wrap;
}

.wp-block-image figcaption {
  overflow-wrap: break-word;
  text-align: center;
  font-size: x-small;
}

The above should work for all Oxygen versions.

Copyright © Ibrahim Jaber | Designed & Developed by Ibrahim Jaber
closephone-squarebarsenvelope-squarechevron-down-circle linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram