Skip to content

Commit 9c9e480

Browse files
authored
Merge pull request #3 from addonify/dev-sniper
= 1.0.1 = Released on: 30 May 2021
2 parents 6247385 + edfb464 commit 9c9e480

17 files changed

+3084
-2787
lines changed

README.txt

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
1-
=== Addonify Gutenberg Block Image & Gallery Lightbox ===
1+
=== Addonify: Block Image & Gallery Lightbox ===
22
Contributors: addonify
3-
Donate link: https://github.com/addonify/addonify-gutenberg-block-image-gallery-lightbox
3+
Donate link: https://github.com/addonify/addonify-block-image-gallery-lightbox
44
Tags: gutenberg, block, image, gallery, lightbox
55
Requires at least: 5.0.0
66
Tested up to: 5.7.2
7-
Stable tag: 1.0.0
7+
Stable tag: 1.0.1
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

11-
A simple plugin that makes Gutenberg block image clickable to preview it in LightBox popup.
11+
A simple plugin that makes block image clickable to preview it in LightBox popup.
1212

1313
== Description ==
1414

15-
A simple plugin that makes Gutenberg block image clickable to preview it in Lightbox popup. Technically, This plugin finds `IMG` tag inside Gutenberg wp block image or gallery & it uses lightGallery js to preview images in LightBox.
15+
A simple plugin that makes block image clickable to preview it in Lightbox popup. Technically, This plugin finds `IMG` tag inside Gutenberg WP block image or gallery & it uses lightGallery js to preview images in LightBox.
1616

1717
Talking about the benefits it ✅ Works with any theme. While it might impact your webpage ❗️ load time it has to find the `class` name from **DOM** using **jQuery**.
1818

19+
#### USAGE:
20+
21+
This plugin is a plug and play tool. You don't need to configure anything. Just make sure that you haven't insert media/attachment page link for images in editor. if you insert a link to to image block the markup will be as follow in DOM.
22+
23+
<figure class="wp-block-image size-large adfy__image__lightbox">
24+
<a href="#">
25+
<a href="#" class="adfy__lightbox__link">
26+
</a>
27+
</a>
28+
</figure>
29+
1930
== Installation ==
2031

2132
1. Download the plugin.
@@ -25,4 +36,10 @@ Talking about the benefits it ✅ Works with any theme. While it might impact yo
2536

2637
== Changelog ==
2738

28-
= 1.0.0 = Released on: 21 May 2021
39+
= 1.0.1 = Released on: 30 May 2021
40+
41+
- Tweak: Plugin name & plugin
42+
43+
= 1.0.0 = Released on: 21 May 2021
44+
45+
- Initial release
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?php
2+
3+
/**
4+
*
5+
* @link https://addonify.com/
6+
* @since 1.0.0
7+
* @package Addonify_Block_Image_Gallery_Lightbox
8+
*
9+
* @wordpress-plugin
10+
* Plugin Name: Addonify: Block Image & Gallery Lightbox
11+
* Plugin URI: https://github.com/addonify/addonify-block-image-gallery-lightbox
12+
* Description: A simple plugin that makes block image clickable to preview it in LightBox popup.
13+
* Version: 1.0.1
14+
* Author: Addonify
15+
* Author URI: https://github.com/addonify/addonify-block-image-gallery-lightbox
16+
* License: GPL-2.0+
17+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
18+
* Text Domain: addonify-block-image-gallery-lightbox
19+
* Domain Path: /languages
20+
*/
21+
22+
// If this file is called directly, abort.
23+
if ( ! defined( 'WPINC' ) ) {
24+
die;
25+
}
26+
27+
/**
28+
* Currently plugin version.
29+
* Start at version 1.0.0 and use SemVer - https://semver.org
30+
* Rename this for your plugin and update it as you release new versions.
31+
*/
32+
define( 'ADDONIFY_BLOCK_IMAGE_GALLERY_LIGHTBOX_VERSION', '1.0.1' );
33+
34+
/**
35+
* The code that runs during plugin activation.
36+
* This action is documented in includes/class-addonify-block-image-gallery-lightbox-activator.php
37+
*/
38+
function activate_addonify_block_image_gallery_lightbox() {
39+
require_once plugin_dir_path( __FILE__ ) . 'includes/class-activator.php';
40+
Addonify_Block_Image_Gallery_Lightbox_Activator::activate();
41+
}
42+
43+
/**
44+
* The code that runs during plugin deactivation.
45+
* This action is documented in includes/class-addonify-block-image-gallery-lightbox-deactivator.php
46+
*/
47+
function deactivate_addonify_block_image_gallery_lightbox() {
48+
require_once plugin_dir_path( __FILE__ ) . 'includes/class-deactivator.php';
49+
Addonify_Block_Image_Gallery_Lightbox_Deactivator::deactivate();
50+
}
51+
52+
register_activation_hook( __FILE__, 'activate_addonify_block_image_gallery_lightbox' );
53+
register_deactivation_hook( __FILE__, 'deactivate_addonify_block_image_gallery_lightbox' );
54+
55+
/**
56+
* The core plugin class that is used to define internationalization,
57+
* admin-specific hooks, and public-facing site hooks.
58+
*/
59+
require plugin_dir_path( __FILE__ ) . 'includes/class-addonify-block-image-gallery-lightbox.php';
60+
61+
/**
62+
* Begins execution of the plugin.
63+
*
64+
* Since everything within the plugin is registered via hooks,
65+
* then kicking off the plugin from this point in the file does
66+
* not affect the page life cycle.
67+
*
68+
* @since 1.0.0
69+
*/
70+
function run_addonify_block_image_gallery_lightbox() {
71+
72+
$plugin = new Addonify_Block_Image_Gallery_Lightbox();
73+
$plugin->run();
74+
75+
}
76+
run_addonify_block_image_gallery_lightbox();

addonify-gutenberg-block-image-gallery-lightbox.php

Lines changed: 0 additions & 76 deletions
This file was deleted.

gulpfile.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ var wpPot = require('gulp-wp-pot');
1212
// gulp makepot
1313

1414
// Task to run
15-
gulp.task('makepot', function() {
15+
gulp.task('makepot', function () {
1616

1717
return gulp.src(['**/*.php', '!node_modules/**'])
1818
.pipe(wpPot({
19-
domain: 'addonify-gutenberg-block-image-gallery-lightbox',
20-
package: 'Addonify Gutenberg Block Image & Gallery Lightbox'
19+
domain: 'addonify-block-image-gallery-lightbox',
20+
package: 'Addonify Block Image & Gallery Lightbox'
2121
}))
22-
.pipe(gulp.dest('languages/addonify-gutenberg-block-image-gallery-lightbox.pot'));
22+
.pipe(gulp.dest('languages/addonify-block-image-gallery-lightbox.pot'));
2323
});

includes/class-activator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* @link https://addonify.com/
77
* @since 1.0.0
88
*
9-
* @package Addonify_Gutenberg_Block_Image_Gallery_Lightbox
10-
* @subpackage Addonify_Gutenberg_Block_Image_Gallery_Lightbox/includes
9+
* @package Addonify_Block_Image_Gallery_Lightbox
10+
* @subpackage Addonify_Block_Image_Gallery_Lightbox/includes
1111
*/
1212

1313
/**
@@ -16,11 +16,11 @@
1616
* This class defines all code necessary to run during the plugin's activation.
1717
*
1818
* @since 1.0.0
19-
* @package Addonify_Gutenberg_Block_Image_Gallery_Lightbox
20-
* @subpackage Addonify_Gutenberg_Block_Image_Gallery_Lightbox/includes
19+
* @package Addonify_Block_Image_Gallery_Lightbox
20+
* @subpackage Addonify_Block_Image_Gallery_Lightbox/includes
2121
* @author Addonify <addonify@gmail.com>
2222
*/
23-
class Addonify_Gutenberg_Block_Image_Gallery_Lightbox_Activator {
23+
class Addonify_Block_Image_Gallery_Lightbox_Activator {
2424

2525
/**
2626
* Short Description. (use period)

includes/class-addonify-gutenberg-block-image-gallery-lightbox.php renamed to includes/class-addonify-block-image-gallery-lightbox.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* @link https://addonify.com/
1010
* @since 1.0.0
1111
*
12-
* @package Addonify_Gutenberg_Block_Image_Gallery_Lightbox
13-
* @subpackage Addonify_Gutenberg_Block_Image_Gallery_Lightbox/includes
12+
* @package Addonify_Block_Image_Gallery_Lightbox
13+
* @subpackage Addonify_Block_Image_Gallery_Lightbox/includes
1414
*/
1515

1616
/**
@@ -23,19 +23,19 @@
2323
* version of the plugin.
2424
*
2525
* @since 1.0.0
26-
* @package Addonify_Gutenberg_Block_Image_Gallery_Lightbox
27-
* @subpackage Addonify_Gutenberg_Block_Image_Gallery_Lightbox/includes
26+
* @package Addonify_Block_Image_Gallery_Lightbox
27+
* @subpackage Addonify_Block_Image_Gallery_Lightbox/includes
2828
* @author Addonify <addonify@gmail.com>
2929
*/
30-
class Addonify_Gutenberg_Block_Image_Gallery_Lightbox {
30+
class Addonify_Block_Image_Gallery_Lightbox {
3131

3232
/**
3333
* The loader that's responsible for maintaining and registering all hooks that power
3434
* the plugin.
3535
*
3636
* @since 1.0.0
3737
* @access protected
38-
* @var Addonify_Gutenberg_Block_Image_Gallery_Lightbox_Loader $loader Maintains and registers all hooks for the plugin.
38+
* @var Addonify_Block_Image_Gallery_Lightbox_Loader $loader Maintains and registers all hooks for the plugin.
3939
*/
4040
protected $loader;
4141

@@ -67,12 +67,12 @@ class Addonify_Gutenberg_Block_Image_Gallery_Lightbox {
6767
* @since 1.0.0
6868
*/
6969
public function __construct() {
70-
if ( defined( 'ADDONIFY_GUTENBERG_BLOCK_IMAGE_GALLERY_LIGHTBOX_VERSION' ) ) {
71-
$this->version = ADDONIFY_GUTENBERG_BLOCK_IMAGE_GALLERY_LIGHTBOX_VERSION;
70+
if ( defined( 'ADDONIFY_BLOCK_IMAGE_GALLERY_LIGHTBOX_VERSION' ) ) {
71+
$this->version = ADDONIFY_BLOCK_IMAGE_GALLERY_LIGHTBOX_VERSION;
7272
} else {
7373
$this->version = '1.0.0';
7474
}
75-
$this->plugin_name = 'addonify-gutenberg-block-image-gallery-lightbox';
75+
$this->plugin_name = 'addonify-block-image-gallery-lightbox';
7676

7777
$this->load_dependencies();
7878
$this->set_locale();
@@ -85,10 +85,10 @@ public function __construct() {
8585
*
8686
* Include the following files that make up the plugin:
8787
*
88-
* - Addonify_Gutenberg_Block_Image_Gallery_Lightbox_Loader. Orchestrates the hooks of the plugin.
89-
* - Addonify_Gutenberg_Block_Image_Gallery_Lightbox_i18n. Defines internationalization functionality.
90-
* - Addonify_Gutenberg_Block_Image_Gallery_Lightbox_Admin. Defines all hooks for the admin area.
91-
* - Addonify_Gutenberg_Block_Image_Gallery_Lightbox_Public. Defines all hooks for the public side of the site.
88+
* - Addonify_Block_Image_Gallery_Lightbox_Loader. Orchestrates the hooks of the plugin.
89+
* - Addonify_Block_Image_Gallery_Lightbox_i18n. Defines internationalization functionality.
90+
* - Addonify_Block_Image_Gallery_Lightbox_Admin. Defines all hooks for the admin area.
91+
* - Addonify_Block_Image_Gallery_Lightbox_Public. Defines all hooks for the public side of the site.
9292
*
9393
* Create an instance of the loader which will be used to register the hooks
9494
* with WordPress.
@@ -114,24 +114,24 @@ private function load_dependencies() {
114114
* The class responsible for defining all actions that occur in the public-facing
115115
* side of the site.
116116
*/
117-
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-addonify-gutenberg-block-image-gallery-lightbox-public.php';
117+
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-addonify-block-image-gallery-lightbox-public.php';
118118

119-
$this->loader = new Addonify_Gutenberg_Block_Image_Gallery_Lightbox_Loader();
119+
$this->loader = new Addonify_Block_Image_Gallery_Lightbox_Loader();
120120

121121
}
122122

123123
/**
124124
* Define the locale for this plugin for internationalization.
125125
*
126-
* Uses the Addonify_Gutenberg_Block_Image_Gallery_Lightbox_i18n class in order to set the domain and to register the hook
126+
* Uses the Addonify_Block_Image_Gallery_Lightbox_i18n class in order to set the domain and to register the hook
127127
* with WordPress.
128128
*
129129
* @since 1.0.0
130130
* @access private
131131
*/
132132
private function set_locale() {
133133

134-
$plugin_i18n = new Addonify_Gutenberg_Block_Image_Gallery_Lightbox_i18n();
134+
$plugin_i18n = new Addonify_Block_Image_Gallery_Lightbox_i18n();
135135

136136
$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
137137

@@ -146,7 +146,7 @@ private function set_locale() {
146146
*/
147147
private function define_public_hooks() {
148148

149-
$plugin_public = new Addonify_Gutenberg_Block_Image_Gallery_Lightbox_Public( $this->get_plugin_name(), $this->get_version() );
149+
$plugin_public = new Addonify_Block_Image_Gallery_Lightbox_Public( $this->get_plugin_name(), $this->get_version() );
150150

151151
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
152152
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
@@ -177,7 +177,7 @@ public function get_plugin_name() {
177177
* The reference to the class that orchestrates the hooks with the plugin.
178178
*
179179
* @since 1.0.0
180-
* @return Addonify_Gutenberg_Block_Image_Gallery_Lightbox_Loader Orchestrates the hooks of the plugin.
180+
* @return Addonify_Block_Image_Gallery_Lightbox_Loader Orchestrates the hooks of the plugin.
181181
*/
182182
public function get_loader() {
183183
return $this->loader;

includes/class-deactivator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* @link https://addonify.com/
77
* @since 1.0.0
88
*
9-
* @package Addonify_Gutenberg_Block_Image_Gallery_Lightbox
10-
* @subpackage Addonify_Gutenberg_Block_Image_Gallery_Lightbox/includes
9+
* @package Addonify_Block_Image_Gallery_Lightbox
10+
* @subpackage Addonify_Block_Image_Gallery_Lightbox/includes
1111
*/
1212

1313
/**
@@ -16,11 +16,11 @@
1616
* This class defines all code necessary to run during the plugin's deactivation.
1717
*
1818
* @since 1.0.0
19-
* @package Addonify_Gutenberg_Block_Image_Gallery_Lightbox
20-
* @subpackage Addonify_Gutenberg_Block_Image_Gallery_Lightbox/includes
19+
* @package Addonify_Block_Image_Gallery_Lightbox
20+
* @subpackage Addonify_Block_Image_Gallery_Lightbox/includes
2121
* @author Addonify <addonify@gmail.com>
2222
*/
23-
class Addonify_Gutenberg_Block_Image_Gallery_Lightbox_Deactivator {
23+
class Addonify_Block_Image_Gallery_Lightbox_Deactivator {
2424

2525
/**
2626
* Short Description. (use period)

0 commit comments

Comments
 (0)