Skip to content

Commit 85f7749

Browse files
authored
Merge pull request #8 from akshuvo/dev
v3.4.9
2 parents c7258f4 + c9162a3 commit 85f7749

20 files changed

+449
-2332
lines changed

.github/workflows/demoServerPush.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy Private GitHub repository to cPanel
22
on:
33
push:
44
branches:
5-
- dev
5+
- main
66
jobs:
77
FTP-Deploy-Action:
88
name: 🎉 Deploy

.github/workflows/wporg.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Deploy to WordPress.org
2+
on:
3+
push:
4+
tags:
5+
- "*"
6+
jobs:
7+
tag:
8+
name: New tag
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@master
12+
- name: WordPress Plugin Deploy
13+
uses: 10up/action-wordpress-plugin-deploy@stable
14+
env:
15+
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
16+
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
17+
SLUG: ajax-filter-posts # optional, remove if GitHub repo name matches SVN slug, including capitalization
18+

LICENSE

-674
This file was deleted.

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
```md
44
Contributors: mdshuvo, addonmaster, mdashikul
55
Tags: infinite scroll, post grid, grid, post type grid, pagination, ajax pagination, grid display, filter, filtering, grid, layout, post, post filter, post layout, taxonomy, taxonomy filter, ajax grid, display post grid, post type grid, wp post grid, ajax post filter, filter post ajax, ajaxify, mixitup, isotop, category filter, filter without reload, ajax filter, ajax plugin
6-
Tested up to: 6.4.3
7-
Stable tag: 3.4.7
6+
Tested up to: 6.5.x
7+
Stable tag: 3.4.9
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010
```
@@ -181,6 +181,12 @@ More features coming soon...
181181
3. Pagination Preview
182182

183183
## Changelog
184+
185+
= 3.4.9 - July 02, 2024 =
186+
- Fixed: Security issues
187+
- Compatible with WordPress 6.5.x
188+
189+
184190
= 3.4.7 - Mar 04, 2024=
185191
- Added: Filter Heading Option
186192
- Added: Toggle Filter Items Option

admin/Admin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function scripts() {
199199
) );
200200

201201
wp_enqueue_style( 'bootstrap-grid', GRIDMASTER_URL . '/admin/assets/bootstrap-grid.min.css', array(), GRIDMASTER_VERSION );
202-
wp_enqueue_style( 'gridmaster-admin-style', GRIDMASTER_URL . '/admin/assets/admin.min.css', array(), GRIDMASTER_VERSION );
202+
wp_enqueue_style( 'gridmaster-admin-style', GRIDMASTER_URL . '/admin/assets/admin.css', array(), GRIDMASTER_VERSION );
203203

204204
if( !defined( 'GRIDMASTER_PRO_VERSION' ) ) {
205205
wp_enqueue_style( 'gridmaster-admin-pro-block-style', GRIDMASTER_URL . '/admin/assets/block-pro-admin.min.css', array(), GRIDMASTER_VERSION );

admin/DB_Migration.php

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
namespace GridMaster;
3+
4+
class DB_Migration {
5+
6+
// DB Version
7+
private $db_version = '1.0.0';
8+
9+
/**
10+
* Initialize the class
11+
*/
12+
public function __construct() {
13+
// run if the plugin version up using version_compare
14+
if ( version_compare( get_option( 'gridmaster_db_version', 0 ), $this->db_version, '<' ) ) {
15+
$this->run_migration();
16+
update_option( 'gridmaster_db_version', $this->db_version );
17+
}
18+
}
19+
20+
/**
21+
* Run the migration
22+
*
23+
* @return void
24+
*/
25+
public function run_migration() {
26+
global $wpdb;
27+
28+
$charset_collate = $wpdb->get_charset_collate();
29+
30+
$sql = "CREATE TABLE {$wpdb->prefix}gridmaster_grids (
31+
id mediumint(9) NOT NULL AUTO_INCREMENT,
32+
title text NOT NULL,
33+
attributes text NOT NULL,
34+
dated datetime DEFAULT NOW(),
35+
PRIMARY KEY (id)
36+
) $charset_collate;";
37+
38+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
39+
dbDelta( $sql );
40+
}
41+
}
42+
43+
// Initialize the class
44+
new DB_Migration();

admin/Grids.php

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?php
2+
namespace GridMaster;
3+
4+
class Grids {
5+
6+
/**
7+
* Initializes a singleton instance
8+
*/
9+
public static function init() {
10+
static $instance = false;
11+
12+
if ( ! $instance ) {
13+
$instance = new self();
14+
}
15+
16+
return $instance;
17+
}
18+
19+
/**
20+
* List of grids
21+
*
22+
* @return array
23+
*/
24+
public function list() {
25+
global $wpdb;
26+
$grids = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}gridmaster_grids" );
27+
return $grids;
28+
}
29+
30+
/**
31+
* Add/update grid
32+
*
33+
* @param array $data
34+
* @return int
35+
*/
36+
public function save( $data ) {
37+
global $wpdb;
38+
39+
$id = isset( $data['id'] ) ? $data['id'] : 0;
40+
$title = isset( $data['title'] ) ? $data['title'] : '';
41+
$attributes = isset( $data['attributes'] ) ? $data['attributes'] : '';
42+
43+
if ( $id ) {
44+
$wpdb->update(
45+
"{$wpdb->prefix}gridmaster_grids",
46+
[
47+
'title' => $title,
48+
'attributes' => $attributes
49+
],
50+
[ 'id' => $id ]
51+
);
52+
} else {
53+
$wpdb->insert(
54+
"{$wpdb->prefix}gridmaster_grids",
55+
[
56+
'title' => $title,
57+
'attributes' => $attributes
58+
]
59+
);
60+
$id = $wpdb->insert_id;
61+
}
62+
63+
return $id;
64+
}
65+
66+
/**
67+
* Get grid by ID
68+
*
69+
* @param int $id
70+
* @return object
71+
*/
72+
public function get( $id ) {
73+
global $wpdb;
74+
$grid = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}gridmaster_grids WHERE id = %d", $id ) );
75+
return $grid;
76+
}
77+
78+
/**
79+
* Delete grid
80+
*
81+
* @param int $id
82+
* @return void
83+
*/
84+
public function delete( $id ) {
85+
global $wpdb;
86+
$wpdb->delete( $wpdb->prefix . 'gridmaster_grids', [ 'id' => $id ] );
87+
}
88+
89+
}

admin/assets/admin.css

+60-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
color: rgba(46,68,83,.8);
6363
border-color: #cfd7df;
6464
box-shadow: 0 1px 3px rgba(0,0,0,.08);
65+
background-color: #f6f6f6;
6566
}
6667

6768
.gm-btn-fill {
@@ -135,6 +136,7 @@ button.gm-btn:disabled{
135136
padding: 10px 20px;
136137
display: flex;
137138
align-items: center;
139+
gap: 10px;
138140
}
139141

140142
.gm-admin-toolbar .nav-tab span,
@@ -171,6 +173,7 @@ button.gm-btn:disabled{
171173

172174
.gm-icon span {
173175
font-size: 62px;
176+
width: 62px;
174177
color: #30057b;
175178
}
176179

@@ -282,6 +285,10 @@ span.description {
282285
background: #fff;
283286
}
284287

288+
.gm-btn-has-icon span {
289+
margin-left: -7px;
290+
}
291+
285292
/* Responsive Devices */
286293
span.gridmaster-responsive-fields {
287294
display: inline-flex;
@@ -526,4 +533,56 @@ div[class^="show-if-"] {
526533
#gm-responsive-bar-scale__value-wrapper{
527534
width: unset;
528535
padding: 0 10px;
529-
}
536+
}
537+
538+
.gm-page-build-grid .nav-tab {
539+
width: 100%;
540+
justify-content: flex-end;
541+
margin: 0;
542+
}
543+
544+
/* Modal */
545+
.gm-modal-wrap {
546+
background-color: rgba(0, 0, 0, 0.5);
547+
display: none;
548+
height: 100vh;
549+
left: 0;
550+
overflow: hidden;
551+
position: fixed;
552+
top: 0;
553+
width: 100%;
554+
z-index: 100100;
555+
}
556+
557+
.gm-modal-inner {
558+
background-color: white;
559+
border-radius: 6px;
560+
-moz-box-shadow: 0 0 40px 0 rgba(0, 0, 0, 0.2);
561+
-webkit-box-shadow: 0 0 40px 0 rgba(0, 0, 0, 0.2);
562+
box-shadow: 0 0 40px 0 rgba(0, 0, 0, 0.2);
563+
display: block !important;
564+
left: 50%;
565+
max-width: 550px;
566+
min-width: 550px;
567+
position: absolute;
568+
text-align: center;
569+
top: 50%;
570+
transform: translate(-50%, -50%);
571+
overflow: visible;
572+
}
573+
574+
.gm-modal-body {
575+
padding: 40px 50px;
576+
-webkit-font-smoothing: antialiased;
577+
-moz-osx-font-smoothing: grayscale;
578+
}
579+
580+
.gm-modal-close {
581+
position: absolute;
582+
top: 7px;
583+
right: 7px;
584+
display: flex !important;
585+
align-items: center;
586+
border: 0;
587+
}
588+
/* Modal */

admin/assets/admin.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,20 @@ jQuery(document).ready(function($) {
197197

198198
// Copy Shortcode
199199
jQuery( document ).on( 'click', '.gm-copy-btn', function(e) {
200-
jQuery(".gm-copy-inp").select();
200+
jQuery(this).closest(".gm-copy-wrap").find(".gm-copy-val").select();
201201
document.execCommand("copy");
202202
} );
203203

204+
// Modal Open
205+
jQuery( document ).on( 'click', '.gm-toggle-modal', function(e) {
206+
let modalId = jQuery(this).attr('data-modal-id');
207+
jQuery('#' + modalId).fadeIn('fast');
208+
} );
209+
// Modal Close
210+
jQuery( document ).on( 'click', '.gm-modal-close', function(e) {
211+
jQuery(this).closest('.gm-modal-wrap').fadeOut('fast');
212+
} );
213+
204214
// Change Filter Style
205215
jQuery(document).on( 'change', '#filter_style', function(e) {
206216
let $val = jQuery(this).val();

admin/assets/admin.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)