Plugin Directory

Changeset 1989464


Ignore:
Timestamp:
12/08/2018 07:34:25 PM (7 years ago)
Author:
soloblocks
Message:

Minor bug fixes

Location:
solo-blocks-photo-gallery/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • solo-blocks-photo-gallery/trunk/core/assets.php

    r1987619 r1989464  
    3939    }
    4040
    41     function get_jed_locale_data( $domain ) {
    42         $translations = get_translations_for_domain( $domain );
     41    function get_jed_locale_data($domain){
     42        $translations = get_translations_for_domain($domain);
    4343
    4444        $locale = array(
     
    4949        );
    5050
    51         if ( ! empty( $translations->headers['Plural-Forms'] ) ) {
     51        if(!empty($translations->headers['Plural-Forms'])) {
    5252            $locale['']['plural_forms'] = $translations->headers['Plural-Forms'];
    5353        }
    5454
    55         foreach ( $translations->entries as $msgid => $entry ) {
    56             $locale[ $msgid ] = $entry->translations;
     55        foreach($translations->entries as $msgid => $entry) {
     56            $locale[$msgid] = $entry->translations;
    5757        }
    5858
     
    6464     */
    6565    function enqueue_block_assets(){
     66        wp_enqueue_style('wp-blocks');
    6667        if(apply_filters('solo/blocks/gallery/photo/style/enable-style', true)) {
    6768            wp_enqueue_style(
    6869                'solo-blocks-photo-gallery-frontend',
    6970                plugins_url('dist/frontend.css', dirname(__FILE__)),
    70                 array( 'wp-blocks' ),
     71                array(),
    7172                filemtime(plugin_dir_path(__DIR__).'dist/frontend.css')
    7273            );
     
    100101    function enqueue_block_editor_assets(){
    101102        wp_enqueue_media();
    102         wp_enqueue_script( 'media-grid' );
    103         wp_enqueue_script( 'media' );
     103        wp_enqueue_script('media-grid');
     104        wp_enqueue_script('media');
    104105        // Scripts.
    105106        wp_enqueue_script(
  • solo-blocks-photo-gallery/trunk/loader.php

    r1980538 r1989464  
    2929        $this->actions();
    3030
    31         $this->FILE = dirname(__FILE__).'/'.$this->FILE;
     31        $this->FILE                 = dirname(__FILE__).'/'.$this->FILE;
    3232        $this->required_plugin_path = plugin_dir_path(__DIR__).$this->required_plugin;
    3333
     
    3939        $this->NAME    = $plugin_info['Name'];
    4040        define('SOLO_GALLERY_VERSION', $plugin_info['Version']);
     41    }
     42
     43    function _is_gutenberg_installed(){
     44        $file_path         = 'gutenberg/gutenberg.php';
     45        $installed_plugins = get_plugins();
     46
     47        return isset($installed_plugins[$file_path]);
    4148    }
    4249
     
    5562
    5663        if(!function_exists('register_block_type')) {
    57             add_action('admin_notices', array($this,'required_plugin_not_loaded'));
     64            add_action('admin_notices', array( $this, 'required_plugin_not_loaded' ));
     65
    5866            return;
    5967        }
     
    6169            require_once(ABSPATH.'wp-admin/includes/plugin.php');
    6270        }
    63         $gutenberg_version = get_plugin_data($this->required_plugin_path);
     71        $version = get_bloginfo('version');
    6472
    65         if(!version_compare($gutenberg_version['Version'], $this->required_plugin_version, '>=')) {
    66             add_action('admin_notices', array($this,'required_plugin_wrong_version'));
    67         } else {
     73        if ($this->_is_gutenberg_installed()) {
     74            $gutenberg_version = get_plugin_data($this->required_plugin_path);
     75
     76            if(!version_compare($gutenberg_version['Version'], $this->required_plugin_version, '>=')) {
     77                add_action('admin_notices', array( $this, 'required_plugin_wrong_version' ));
     78            } else {
     79                require_once __DIR__.'/core/init.php';
     80            }
     81
     82        } else if (version_compare($version, '5.0', '>=')) {
    6883            require_once __DIR__.'/core/init.php';
    6984        }
    70 
    7185    }
    7286
     
    8498            $activation_url = wp_nonce_url('plugins.php?action=activate&plugin='.$this->required_plugin.'&plugin_status=all&paged=1&s', 'activate-plugin_'.$this->required_plugin);
    8599
    86             $message = '<p>'.sprintf(esc_html__('%1$s is not working because you need to activate the %2$s plugin.', 'solo-gallery-photo-textdomain'),$this->NAME,$this->required_plugin_name).'</p>';
    87             $message .= sprintf('<p><a href="%s" class="button-primary">%s</a></p>', $activation_url, sprintf(esc_html__('Activate %1$s Now', 'solo-gallery-photo-textdomain'),$this->required_plugin_name));
     100            $message = '<p>'.sprintf(esc_html__('%1$s is not working because you need to activate the %2$s plugin.', 'solo-gallery-photo-textdomain'), $this->NAME, $this->required_plugin_name).'</p>';
     101            $message .= sprintf('<p><a href="%s" class="button-primary">%s</a></p>', $activation_url, sprintf(esc_html__('Activate %1$s Now', 'solo-gallery-photo-textdomain'), $this->required_plugin_name));
    88102        } else {
    89103            if(!current_user_can('install_plugins')) {
     
    93107            $install_url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=gutenberg'), 'install-plugin_gutenberg');
    94108
    95             $message = '<p>'.sprintf(esc_html__('%1$s is not working because you need to install the %2$s plugin.', 'solo-gallery-photo-textdomain'),$this->NAME,$this->required_plugin_name).'</p>';
    96             $message .= '<p>'.sprintf('<a href="%s" class="button-primary">%s</a>', $install_url, sprintf(esc_html__('Install %1$s Now', 'solo-gallery-photo-textdomain'),$this->required_plugin_name)).'</p>';
     109            $message = '<p>'.sprintf(esc_html__('%1$s is not working because you need to install the %2$s plugin.', 'solo-gallery-photo-textdomain'), $this->NAME, $this->required_plugin_name).'</p>';
     110            $message .= '<p>'.sprintf('<a href="%s" class="button-primary">%s</a>', $install_url, sprintf(esc_html__('Install %1$s Now', 'solo-gallery-photo-textdomain'), $this->required_plugin_name)).'</p>';
    97111        }
    98112
     
    101115
    102116    function required_plugin_wrong_version(){
    103         $msg = sprintf(esc_html__('%1$s requires an update of the %2$s version up to %3$s to work properly.', 'solo-gallery-photo-textdomain'),$this->NAME, $this->required_plugin_name, $this->required_plugin_version);
     117        $msg = sprintf(esc_html__('%1$s requires an update of the %2$s version up to %3$s to work properly.', 'solo-gallery-photo-textdomain'), $this->NAME, $this->required_plugin_name, $this->required_plugin_version);
    104118        echo '<div class="error"><p>'.$msg.'</p></div>';
    105119    }
     
    112126    }
    113127
    114     public function __clone() {
     128    public function __clone(){
    115129        // Cloning instances of the class is forbidden.
    116         _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'solo-gallery-photo-textdomain' ), $this->VERSION );
     130        _doing_it_wrong(__FUNCTION__, esc_html__('Cheatin&#8217; huh?', 'solo-gallery-photo-textdomain'), $this->VERSION);
    117131    }
    118132
    119     public function __wakeup() {
     133    public function __wakeup(){
    120134        // Unserializing instances of the class is forbidden.
    121         _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'solo-gallery-photo-textdomain' ), $this->VERSION );
     135        _doing_it_wrong(__FUNCTION__, esc_html__('Cheatin&#8217; huh?', 'solo-gallery-photo-textdomain'), $this->VERSION);
    122136    }
    123137}
  • solo-blocks-photo-gallery/trunk/readme.txt

    r1987619 r1989464  
    66Tested up to: 5.0.0
    77Requires PHP: 5.6
    8 Stable tag: 1.0.6
     8Stable tag: 1.0.6.1
    99License: GPLv3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1919
    2020[Solo Blocks Photo Gallery](https://livewp.site/wp/md/gutenote/solo-blocks-photo-gallery/)
     21
     22**Watch this Video to See the Solo Gallery in Action:**
     23[youtube https://www.youtube.com/watch?v=5Jxxz9vXQlk]
    2124
    2225The advantages of the plugin:
  • solo-blocks-photo-gallery/trunk/solo-blocks-photo-gallery.php

    r1987619 r1989464  
    44 * Plugin URI: https://soloblocks.com/
    55 * Description: Solo Blocks Photo Gallery - is a collection of the galleries for the Gutenberg WordPress editor.
    6  * Version: 1.0.6
     6 * Version: 1.0.6.1
    77 * Author: Solo Blocks
    88 * Text Domain: solo-gallery-photo-textdomain
Note: See TracChangeset for help on using the changeset viewer.