Plugin Directory

Changeset 3373574


Ignore:
Timestamp:
10/06/2025 10:08:57 AM (5 months ago)
Author:
devnethr
Message:

v.1.1.0

Location:
snap-blocks
Files:
514 added
2 deleted
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • snap-blocks/tags/1.1.0/README.txt

    r3290339 r3373574  
    22Contributors: devnethr, MarinMatosevic
    33Tags: elementor, template, content blocks, repeatable blocks, layout
    4 Requires PHP: 7.2
    5 Stable tag: 1.0.1
     4Requires PHP: 7.4
     5Stable tag: 1.1.0
    66Tested up to: 6.8
    77License: GPLv2 or later
     
    8484- [Easy Booking Calendar](https://wordpress.org/plugins/easy-booking-calendar/) - Turn any product into a reservation-ready item. This plugin adds a customizable calendar to product pages, allowing customers to select date ranges for bookings.
    8585- [BizNotes](https://wordpress.org/plugins/biznotes/) - Exclusive admin notes for seamless order management among multiple admins. Effortless collaboration, powered up.
     86- [Snap Blocks](https://wordpress.org/plugins/snap-blocks/) - A lightweight plugin that lets you create reusable content blocks in WordPress.
     87- [PingVid](https://wordpress.org/plugins/pingvid/) - A lightweight WordPress plugin that adds a floating video widget to your site.
    8688
    8789
     
    126128== Changelog ==
    127129
    128 = 1.0.1 = *2025-05-09*
     130= 1.1.0 =
    129131
    130 * Add - WPBakery Integration
     132*2025-10-06*
    131133
    132 = 1.0.0 = *2025-05-08*
     134* Add: Freemius integration
     135* Performance: Code optimizations for better plugin efficiency
     136* Compatibility: WP tested up to 6.8
     137
     138
     139= 1.0.1 =
     140
     141*2025-05-09*
     142
     143* Add: WPBakery Integration
     144
     145= 1.0.0 =
     146
     147*2025-05-08*
    133148
    134149* Initial release.
  • snap-blocks/tags/1.1.0/snap-blocks.php

    r3290336 r3373574  
    44 * Plugin Name:       Snap Blocks
    55 * Description:       Snap blocks with popular page builder support via shortcode or widget.
    6  * Version:           1.0.1
     6 * Version:           1.1.0
     7 * Requires at least: 6.4
     8 * Requires PHP:      7.4
    79 * Author:            Devnet
    810 * Author URI:        https://devnet.hr
     
    1214 */
    1315
    14 namespace Devnet\SnapBlocks;
    15 
    16 use Devnet\SnapBlocks\Inc\PostType;
    17 use Devnet\SnapBlocks\Inc\Shortcode;
    18 use Devnet\SnapBlocks\Inc\Elementor\Integration as ElementorIntegration;
    19 use Devnet\SnapBlocks\Inc\WPBakery\Integration as WPBIntegration;
     16use Devnet\SnapBlocks\Includes\Plugin;
    2017
    2118if (!defined('ABSPATH')) {
     
    2320}
    2421
    25 define('SNAP_BLOCKS_PLUGIN_PATH', plugin_dir_path(__FILE__));
    26 define('SNAP_BLOCKS_PLUGIN_URL', plugin_dir_url(__FILE__));
     22if (function_exists('devnet_sb_fs')) {
     23    devnet_sb_fs()->set_basename(true, __FILE__);
     24} else {
     25    if (!function_exists('devnet_sb_fs')) {
     26        // Create a helper function for easy SDK access.
     27        function devnet_sb_fs()
     28        {
     29            global $devnet_sb_fs;
    2730
     31            if (!isset($devnet_sb_fs)) {
     32                // Include Freemius SDK.
     33                // SDK is auto-loaded through composer
     34                $devnet_sb_fs = fs_dynamic_init([
     35                    'id'               => '21030',
     36                    'slug'             => 'snap-blocks',
     37                    'type'             => 'plugin',
     38                    'public_key'       => 'pk_8955c81e2bf3f237548fad774cd46',
     39                    'is_org_compliant' => true,
     40                    'is_premium'       => false,
     41                    'has_addons'       => false,
     42                    'has_paid_plans'   => false,
     43                    'menu'             => [
     44                        'slug'    => 'edit.php?post_type=snap_block',
     45                        'account' => false
     46                    ]
     47                ]);
     48            }
    2849
    29 class Plugin
    30 {
     50            return $devnet_sb_fs;
     51        }
    3152
    32     private static $__instance = null;
    33     private $version = '1.0.1';
    34     private $plugin_name = 'snap-blocks';
    35 
    36     private function __construct() {}
    37 
    38     public static function instance()
    39     {
    40         if (!self::$__instance) {
    41             self::$__instance = new self();
    42             self::$__instance->setup();
    43         }
    44         return self::$__instance;
     53        // Init Freemius.
     54        devnet_sb_fs();
     55        // Signal that SDK was initiated.
     56        do_action('devnet_sb_fs_loaded');
    4557    }
    4658
    47     private function setup()
    48     {
    49         // Load core files
    50         require_once SNAP_BLOCKS_PLUGIN_PATH . '/inc/post-type.php';
    51         new PostType();
     59    if (!function_exists('devnet_sb_fs_is_submenu_visible')) {
     60        function devnet_sb_fs_is_submenu_visible($is_visible, $menu_id)
     61        {
     62            if ('contact' != $menu_id) {
     63                return $is_visible;
     64            }
    5265
    53         require_once SNAP_BLOCKS_PLUGIN_PATH . '/inc/shortcode.php';
    54         new Shortcode();
    55 
    56         // Elementor
    57         require_once SNAP_BLOCKS_PLUGIN_PATH . '/inc/elementor/integration.php';
    58         new ElementorIntegration();
    59 
    60         // WPBakery
    61         if (function_exists('vc_map')) {
    62             require_once SNAP_BLOCKS_PLUGIN_PATH . 'inc/wpbakery/integration.php';
    63             new WPBIntegration();
     66            return devnet_sb_fs()->can_use_premium_code();
    6467        }
    6568    }
     69
     70    if (!function_exists('devnet_sb_fs_custom_icon')) {
     71        function devnet_sb_fs_custom_icon()
     72        {
     73            return dirname(__FILE__) . '/assets/images/logo.png';
     74        }
     75    }
     76
     77    /*
     78     * Run Freemius actions and filters.
     79     */
     80    if (function_exists('devnet_sb_fs')) {
     81        devnet_sb_fs()->add_filter('is_submenu_visible', 'devnet_sb_fs_is_submenu_visible', 10, 2);
     82        devnet_sb_fs()->add_filter('plugin_icon', 'devnet_sb_fs_custom_icon');
     83    }
     84
     85    define('DEVNET_SNAP_BLOCKS_VERSION', '1.1.0');
     86    define('DEVNET_SNAP_BLOCKS_NAME', 'snap-blocks');
     87    define('DEVNET_SNAP_BLOCKS_PATH_DIR', plugin_dir_path(__FILE__));
     88    define('DEVNET_SNAP_BLOCKS_PATH_FILE', plugin_basename(__FILE__));
     89    define('DEVNET_SNAP_BLOCKS_URL', plugin_dir_url(__FILE__));
     90
     91    add_action('plugins_loaded', function () {
     92
     93        require DEVNET_SNAP_BLOCKS_PATH_DIR . 'includes/plugin.php';
     94        $plugin = new Plugin();
     95        $plugin->run();
     96    });
    6697}
    67 
    68 add_action('plugins_loaded', ['Devnet\SnapBlocks\Plugin', 'instance']);
  • snap-blocks/trunk/README.txt

    r3290339 r3373574  
    22Contributors: devnethr, MarinMatosevic
    33Tags: elementor, template, content blocks, repeatable blocks, layout
    4 Requires PHP: 7.2
    5 Stable tag: 1.0.1
     4Requires PHP: 7.4
     5Stable tag: 1.1.0
    66Tested up to: 6.8
    77License: GPLv2 or later
     
    8484- [Easy Booking Calendar](https://wordpress.org/plugins/easy-booking-calendar/) - Turn any product into a reservation-ready item. This plugin adds a customizable calendar to product pages, allowing customers to select date ranges for bookings.
    8585- [BizNotes](https://wordpress.org/plugins/biznotes/) - Exclusive admin notes for seamless order management among multiple admins. Effortless collaboration, powered up.
     86- [Snap Blocks](https://wordpress.org/plugins/snap-blocks/) - A lightweight plugin that lets you create reusable content blocks in WordPress.
     87- [PingVid](https://wordpress.org/plugins/pingvid/) - A lightweight WordPress plugin that adds a floating video widget to your site.
    8688
    8789
     
    126128== Changelog ==
    127129
    128 = 1.0.1 = *2025-05-09*
     130= 1.1.0 =
    129131
    130 * Add - WPBakery Integration
     132*2025-10-06*
    131133
    132 = 1.0.0 = *2025-05-08*
     134* Add: Freemius integration
     135* Performance: Code optimizations for better plugin efficiency
     136* Compatibility: WP tested up to 6.8
     137
     138
     139= 1.0.1 =
     140
     141*2025-05-09*
     142
     143* Add: WPBakery Integration
     144
     145= 1.0.0 =
     146
     147*2025-05-08*
    133148
    134149* Initial release.
  • snap-blocks/trunk/snap-blocks.php

    r3290336 r3373574  
    44 * Plugin Name:       Snap Blocks
    55 * Description:       Snap blocks with popular page builder support via shortcode or widget.
    6  * Version:           1.0.1
     6 * Version:           1.1.0
     7 * Requires at least: 6.4
     8 * Requires PHP:      7.4
    79 * Author:            Devnet
    810 * Author URI:        https://devnet.hr
     
    1214 */
    1315
    14 namespace Devnet\SnapBlocks;
    15 
    16 use Devnet\SnapBlocks\Inc\PostType;
    17 use Devnet\SnapBlocks\Inc\Shortcode;
    18 use Devnet\SnapBlocks\Inc\Elementor\Integration as ElementorIntegration;
    19 use Devnet\SnapBlocks\Inc\WPBakery\Integration as WPBIntegration;
     16use Devnet\SnapBlocks\Includes\Plugin;
    2017
    2118if (!defined('ABSPATH')) {
     
    2320}
    2421
    25 define('SNAP_BLOCKS_PLUGIN_PATH', plugin_dir_path(__FILE__));
    26 define('SNAP_BLOCKS_PLUGIN_URL', plugin_dir_url(__FILE__));
     22if (function_exists('devnet_sb_fs')) {
     23    devnet_sb_fs()->set_basename(true, __FILE__);
     24} else {
     25    if (!function_exists('devnet_sb_fs')) {
     26        // Create a helper function for easy SDK access.
     27        function devnet_sb_fs()
     28        {
     29            global $devnet_sb_fs;
    2730
     31            if (!isset($devnet_sb_fs)) {
     32                // Include Freemius SDK.
     33                // SDK is auto-loaded through composer
     34                $devnet_sb_fs = fs_dynamic_init([
     35                    'id'               => '21030',
     36                    'slug'             => 'snap-blocks',
     37                    'type'             => 'plugin',
     38                    'public_key'       => 'pk_8955c81e2bf3f237548fad774cd46',
     39                    'is_org_compliant' => true,
     40                    'is_premium'       => false,
     41                    'has_addons'       => false,
     42                    'has_paid_plans'   => false,
     43                    'menu'             => [
     44                        'slug'    => 'edit.php?post_type=snap_block',
     45                        'account' => false
     46                    ]
     47                ]);
     48            }
    2849
    29 class Plugin
    30 {
     50            return $devnet_sb_fs;
     51        }
    3152
    32     private static $__instance = null;
    33     private $version = '1.0.1';
    34     private $plugin_name = 'snap-blocks';
    35 
    36     private function __construct() {}
    37 
    38     public static function instance()
    39     {
    40         if (!self::$__instance) {
    41             self::$__instance = new self();
    42             self::$__instance->setup();
    43         }
    44         return self::$__instance;
     53        // Init Freemius.
     54        devnet_sb_fs();
     55        // Signal that SDK was initiated.
     56        do_action('devnet_sb_fs_loaded');
    4557    }
    4658
    47     private function setup()
    48     {
    49         // Load core files
    50         require_once SNAP_BLOCKS_PLUGIN_PATH . '/inc/post-type.php';
    51         new PostType();
     59    if (!function_exists('devnet_sb_fs_is_submenu_visible')) {
     60        function devnet_sb_fs_is_submenu_visible($is_visible, $menu_id)
     61        {
     62            if ('contact' != $menu_id) {
     63                return $is_visible;
     64            }
    5265
    53         require_once SNAP_BLOCKS_PLUGIN_PATH . '/inc/shortcode.php';
    54         new Shortcode();
    55 
    56         // Elementor
    57         require_once SNAP_BLOCKS_PLUGIN_PATH . '/inc/elementor/integration.php';
    58         new ElementorIntegration();
    59 
    60         // WPBakery
    61         if (function_exists('vc_map')) {
    62             require_once SNAP_BLOCKS_PLUGIN_PATH . 'inc/wpbakery/integration.php';
    63             new WPBIntegration();
     66            return devnet_sb_fs()->can_use_premium_code();
    6467        }
    6568    }
     69
     70    if (!function_exists('devnet_sb_fs_custom_icon')) {
     71        function devnet_sb_fs_custom_icon()
     72        {
     73            return dirname(__FILE__) . '/assets/images/logo.png';
     74        }
     75    }
     76
     77    /*
     78     * Run Freemius actions and filters.
     79     */
     80    if (function_exists('devnet_sb_fs')) {
     81        devnet_sb_fs()->add_filter('is_submenu_visible', 'devnet_sb_fs_is_submenu_visible', 10, 2);
     82        devnet_sb_fs()->add_filter('plugin_icon', 'devnet_sb_fs_custom_icon');
     83    }
     84
     85    define('DEVNET_SNAP_BLOCKS_VERSION', '1.1.0');
     86    define('DEVNET_SNAP_BLOCKS_NAME', 'snap-blocks');
     87    define('DEVNET_SNAP_BLOCKS_PATH_DIR', plugin_dir_path(__FILE__));
     88    define('DEVNET_SNAP_BLOCKS_PATH_FILE', plugin_basename(__FILE__));
     89    define('DEVNET_SNAP_BLOCKS_URL', plugin_dir_url(__FILE__));
     90
     91    add_action('plugins_loaded', function () {
     92
     93        require DEVNET_SNAP_BLOCKS_PATH_DIR . 'includes/plugin.php';
     94        $plugin = new Plugin();
     95        $plugin->run();
     96    });
    6697}
    67 
    68 add_action('plugins_loaded', ['Devnet\SnapBlocks\Plugin', 'instance']);
Note: See TracChangeset for help on using the changeset viewer.