Plugin Directory

Changeset 2784121


Ignore:
Timestamp:
09/13/2022 03:46:32 PM (4 years ago)
Author:
undefinedfr
Message:

Updating trunk

Location:
linky/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • linky/trunk/linky.php

    r2761812 r2784121  
    1212  Description: Create & manage link’s hub for your
    1313social profile directly in your websites
    14   Version: 1.3.9
     14  Version: 1.4.1
    1515  Author Name: Nicolas RIVIERE (hello@undefined.fr)
    1616  Author: Nicolas RIVIERE (Undefined)
  • linky/trunk/readme.txt

    r2761812 r2784121  
    44Tags: linktree, later, links, bio links, social
    55Requires at least: 4.0
    6 Tested up to: 6.0
    7 Stable tag: 1.3.9
     6Tested up to: 6.0.2
     7Stable tag: 1.4.1
    88Requires PHP: 5.4
    99License: GPLv2 or later
     
    197197* Support EWWW Image Optimizer lazyload
    198198
     199=1.4.0=
     200* Fix undefined prefix url
     201* test on latest WordPress version
     202
     203=1.4.1=
     204* Remove yoast meta
     205
    199206== Upgrade Notice ==
    200207
  • linky/trunk/src/Controllers/ajaxController.php

    r2512695 r2784121  
    4141    {
    4242        if(!empty($_POST['_group'])){
     43            global $wpLinky;
     44
    4345            $data = $this->_save();
     46            $data['page_url'] =  $wpLinky->getIndexController()->getSettings()->getPageUrl($data['global']['slug']);
    4447            wp_send_json_success($data);
    4548        }
  • linky/trunk/src/Controllers/indexController.php

    r2318116 r2784121  
    3737        $this->menu         = new Menu(!empty($data['appareance']['menu']) ? $data['appareance']['menu'] : false);
    3838        $this->links        = new Links($data['links']);
     39
     40        if ( WPLinkyHelper::pluginsExists(['wordpress-seo/wp-seo.php','wordpress-seo-premium/wp-seo-premium.php'] ) ) {
     41            foreach(['robots','canonical','metadesc','metakeywords','opengraph_title','opengraph_desc','opengraph_url','opengraph_type','opengraph_image','opengraph_site_name','opengraph_admin','opengraph_author_facebook','opengraph_show_publish_date','twitter_title','twitter_description','twitter_card_type','twitter_site','twitter_image','twitter_creator_account','json_ld_output'] as $filter) {
     42                add_filter('wpseo_' . $filter, [$this, 'remove_yoast_metas']);
     43            }
     44        }
    3945    }
    4046
     
    8389            return $page;
    8490        }
     91    }
    8592
     93    /**
     94     * Remove yoast meta for linky page
     95     *
     96     * @param $content
     97     * @return false|mixed
     98     */
     99    public function remove_yoast_metas( $content ) {
     100        if(!empty( get_query_var( 'is_linky' ) )) {
     101            return apply_filters(UNDFND_WP_LINKY_DOMAIN . '_yoast_meta_' . current_filter(), false);
     102        }
     103
     104        return $content;
    86105    }
    87106}
  • linky/trunk/src/Helper/WPLinkyHelper.php

    r2517498 r2784121  
    223223        return $array;
    224224    }
     225
     226    /**
     227     * Check if plugin exist
     228     *
     229     * @param $plugins $array
     230     *
     231     * @return mixed
     232     */
     233    public static function pluginsExists( $plugins ) {
     234        $exist = false;
     235        foreach ( $plugins as $plugin ) {
     236            if(is_plugin_active($plugin))
     237                $exist = true;
     238        }
     239        return $exist;
     240    }
    225241}
  • linky/trunk/views/front/html/header.php

    r2319174 r2784121  
    2121    $background = ($backgroundType == 'none') ? '#FFF' : $page->get('header_background_color', '#FFF');
    2222}
     23
     24$title = $page->get('title') ? $page->get('title') : __('My links', 'linky') . ' | ' . get_bloginfo('blogname');
     25$yoastExist = WPLinkyHelper::pluginsExists(['wordpress-seo/wp-seo.php','wordpress-seo-premium/wp-seo-premium.php'] );
     26add_filter(($yoastExist ? 'wpseo_title' : 'pre_get_document_title'), function() use ($title) {
     27    return $title;
     28});
    2329?>
    2430<html>
     
    2733        <meta name="msapplication-navbutton-color" content="<?php echo $background; ?>">
    2834        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    29         <title><?php echo $page->get('title') ? $page->get('title') : __('My links', 'linky') . ' | ' . get_bloginfo('blogname'); ?></title>
    3035        <?php wp_head(); ?>
    3136        <?php if($analytics): ?>
  • linky/trunk/views/front/page.php

    r2355170 r2784121  
    1414$indexController = $wpLinky->getIndexController();
    1515$page = $indexController->getPage();
     16$socials = $indexController->getSocials();
    1617$theme_id = $page->get('body_theme', 'default');
    1718
Note: See TracChangeset for help on using the changeset viewer.