Plugin Directory

Changeset 2852684


Ignore:
Timestamp:
01/23/2023 02:19:08 AM (3 years ago)
Author:
abcfolio
Message:

Version 1.6.9

Location:
staff-list/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • staff-list/trunk/admin/mbox-item-optns.php

    r2426846 r2852684  
    1313        echo abcfl_input_checkbox('hideSPgLnk',  '', $hideSPgLnk, abcfsl_txta(308), '', '', '', 'abcflMTop10', '', '', '' );
    1414        //----------------------------------------------------
     15        $lblPretty = abcfl_input_sec_title_hlp( ABCFSL_ICONS_URL, abcfsl_txta(231), abcfsl_aurl(60), 'abcflFontWP abcflFontS13 abcflFontW600' );
     16        $lblPgTitle = abcfl_input_sec_title_hlp( ABCFSL_ICONS_URL, abcfsl_txta(77), abcfsl_aurl(102), 'abcflFontWP abcflFontS13 abcflFontW600' );
     17
    1518        echo abcfl_input_hline('1', '10');
    16         echo abcfl_input_sec_title_hlp( ABCFSL_ICONS_URL, abcfsl_txta(303), abcfsl_aurl(60) );
    17         echo abcfl_input_txt('pretty', '', $pretty,  abcfsl_txta(231), abcfsl_txta(270) . ' ' . abcfsl_txta(232), '50%', '', '', 'abcflFldCntr', 'abcflFldLbl');
     19        echo abcfl_input_sec_title_hlp( ABCFSL_ICONS_URL, abcfsl_txta(303), abcfsl_aurl(101) );
     20        //echo abcfl_input_txt('pretty', '', $pretty,  abcfsl_txta(231), abcfsl_txta(270) . ' ' . abcfsl_txta(232), '50%', '', '', 'abcflFldCntr', 'abcflFldLbl');
     21        echo abcfl_input_txt('pretty', '', $pretty,   $lblPretty, abcfsl_txta(270) . ' ' . abcfsl_txta(232), '50%', '', '', 'abcflFldCntr', 'abcflFldLbl');
     22
    1823        //Html Head Title
    19         echo abcfl_input_txt('sPgTitle', '', $sPgTitle,  abcfsl_txta(77), abcfsl_txta(270), '50%', '', '', 'abcflFldCntr', 'abcflFldLbl');
     24        //echo abcfl_input_txt('sPgTitle', '', $sPgTitle,  abcfsl_txta(77), abcfsl_txta(270), '50%', '', '', 'abcflFldCntr', 'abcflFldLbl');
     25        echo abcfl_input_txt('sPgTitle', '', $sPgTitle,  $lblPgTitle, abcfsl_txta(270), '50%', '', '', 'abcflFldCntr', 'abcflFldLbl');
    2026        //----------------------------------------------------
    2127        echo abcfl_input_hline('1', '10');
    22         abcfsl_mbox_tplate_field_section_hdr( 0, 367, false);
     28        abcfsl_mbox_tplate_field_section_hdr( 73, 367, false);
    2329        echo abcfl_input_txt('itemCustCls', '', $itemCustCls,  abcfsl_txta(301), abcfsl_txta(270), '50%', '', '', 'abcflFldCntr', 'abcflFldLbl');
    2430    echo abcfl_html_tag_end('div');
    2531}
    26 
  • staff-list/trunk/admin/txt-admin.php

    r2708631 r2852684  
    14091409        case 458:
    14101410            $out = __('Changelog', 'staff-list');
    1411             break;          
     1411            break;
    14121412//--------------------------------             
    14131413        case 500:
  • staff-list/trunk/admin/txt-aurl.php

    r2708631 r2852684  
    317317        case 98:
    318318            $out = $sld . 'admin-months/';
    319         break;
     319             break;
    320320        case 99:
    321321            $out = $d . 'admin-license-key/';
     
    324324        case 100:
    325325            $out = $sld . 'changelog/';
    326         break;   
     326            break;   
    327327        case 101:
    328         $out = $d . '';
    329         break;                                             
     328            $out = $d . 'staff-list-seo/#single-pages-seo';
     329            break;
     330        case 102:
     331            $out = $d . 'staff-list-seo/#seo-page-title';
     332            break;         
    330333
    331334        default:
  • staff-list/trunk/inc/cnt-spage.php

    r2683032 r2852684  
    77    $pversion = $scodeArgs['pversion'];
    88    $staffID = abcfsl_spg_a_tag_staff_member_id ( $scodeArgs );
     9
     10//error_log( print_r( $tplateID, true) );
    911
    1012    //Both qry args are missing. Show blank page.
  • staff-list/trunk/inc/db.php

    r2801069 r2852684  
    382382
    383383    global $wpdb;
    384     $sPgTitle = $wpdb->get_var( $wpdb->prepare(
     384    $imgURL = $wpdb->get_var( $wpdb->prepare(
    385385            "SELECT meta_value
    386386            FROM $wpdb->postmeta
     
    388388            AND post_id = %d;", $postID ) );
    389389
    390     return $sPgTitle;
     390    return $imgURL;
    391391}
    392392//--------------------
  • staff-list/trunk/readme.txt

    r2814684 r2852684  
    66Tested up to:  6.1
    77Requires PHP: 5.6
    8 Stable tag: 1.6.8
     8Stable tag: 1.6.9
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    122122
    123123== Changelog ==
     124
     125= 1.6.9 20230112
     126* New: Added support for Rank Math SEO - page title, canonical and og properties.
     127* Update: Staff Member Data > Options. Modified links to documentation.
    124128
    125129= 1.6.8 20221108
  • staff-list/trunk/staff-list.php

    r2814684 r2852684  
    1111Requires at least: 4.9
    1212Requires PHP: 5.6
    13 Version: 1.6.8
     13Version: 1.6.9
    1414------------------------------------------------------------------------
    1515Copyright 2009-2021 abcFolio.
     
    3939    private static $instance;
    4040    public $pluginSlug = 'abcfolio-staff-list';
    41     public $pluginVersion = '1.6.8';   
     41    public $pluginVersion = '1.6.9';   
    4242    public $prefix = 'abcfsl';
    4343
     
    121121        require_once ABCFSL_PLUGIN_DIR . 'library/abcfl-html.php';
    122122        require_once ABCFSL_PLUGIN_DIR . 'library/abcfl-util.php';
    123 
    124         //require_once ABCFSL_PLUGIN_DIR . 'deprecated/inc.php';
    125123
    126124        //if( $this->pluginSlug == 'abcfolio-staff-list' ) {
     
    211209    private function setup_actions() {
    212210
    213         //error_log( print_r( 'setup_actions', true) );
    214 
    215211        //add_action( 'plugins_loaded', array( $this, 'load_textdomain' ));
    216212        add_action( 'init', array( $this, 'load_textdomain' ));
     
    229225        add_filter('rewrite_rules_array', array( $this, 'filter_rewrite_rules' ), 1 );
    230226
    231         //--- SEO plugins START ----------------------------------------------------------------
     227        //--- SEO plugins START -- Yoast SEO, AIOSE All in One SEO, The SEO Framework, Squirrly SEO, Rank Math SEO --------------
    232228        // Detect plugin. For use on Front End and Back End. Check for plugin using plugin name.
    233229        $pluginActive = false;
     
    236232
    237233        // Yoast SEO
    238         if(in_array('wordpress-seo/wp-seo.php', apply_filters('active_plugins', $activePlugins))){
     234        if( in_array('wordpress-seo/wp-seo.php', apply_filters('active_plugins', $activePlugins))){
    239235            //error_log( print_r( 'yoast-seo_active', true) );           
    240236            $pluginActive = true;
     
    250246            // add_filter( 'wpseo_opengraph_image_size' , array( $this, 'filter_spg_false'), 20,2 ); 
    251247        }
     248
     249        // AIOSE All in One SEO
     250        if( !$pluginActive ){
     251            if( in_array('all-in-one-seo-pack/all_in_one_seo_pack.php', apply_filters('active_plugins', $activePlugins))){
     252                //error_log( print_r( 'all-in-one-seo-pack_active', true) );
     253                $pluginActive = true;
     254                add_filter( 'aioseo_title', array( $this, 'filter_spg_wp_title' ), 10, 2);
     255                add_filter( 'aioseo_canonical_url', array( $this, 'aioseo_spg_canonical' ));
     256                add_filter( 'aioseo_facebook_tags', array( $this, 'aioseo_spg_og' ));
     257                add_filter( 'aioseo_twitter_tags', array( $this, 'aioseo_spg_twitter' ));   
     258            }
     259        }   
    252260
    253261        // The SEO Framework
     
    276284            }
    277285        }
    278        
     286
     287        // Rank Math SEO
     288        if( !$pluginActive ){
     289            if(in_array('seo-by-rank-math/rank-math.php', apply_filters('active_plugins', $activePlugins))){
     290                //error_log( print_r( 'rank-math active', true) );
     291                $pluginActive = true;
     292                add_filter( 'rank_math/frontend/title', array( $this, 'filter_spg_wp_title' ) );
     293                add_filter( 'rank_math/frontend/canonical', array( $this, 'filter_spg_canonical' ));
     294                // Not needed, cannonical URL is ised.
     295                //add_filter( 'rank_math/opengraph/url', array( $this, 'filter_spg_canonical' ));
     296                add_filter( 'rank_math/opengraph/facebook/image', array( $this, 'img_url_by_pretty'));
     297                add_filter( 'rank_math/opengraph/twitter/image', array( $this, 'img_url_by_pretty'));
     298            }
     299        }
     300
    279301        // No SEO plugins. Render custom staff member title using WP filter.
    280302        if( !$pluginActive ){
     
    362384            'perfil/([^/]+)/?$' => 'index.php?pagename=perfil&staff-name=$matches[1]',
    363385            'profilo/([^/]+)/?$' => 'index.php?pagename=profilo&staff-name=$matches[1]'
    364         );
     386        );
     387
    365388        return $newRules + $rules;
    366389    }
     
    411434    }
    412435
    413     // function custom_document_title( $title ) {
    414     //     return 'Here is the new title 2222.';
    415     // }
    416  
    417 
    418     // Used by all
     436    //-- Used by AIOSE START ----------------------------------------------------------------
     437    function aioseo_spg_og( $facebookMeta ) {
     438
     439        if( !$this->spg_is_pretty_permalink() ){ return $facebookMeta; }
     440
     441        $title = $this->filter_spg_wp_title( $facebookMeta['og:title'] );
     442        $facebookMeta['og:title'] = $title;
     443        $facebookMeta['og:image'] =  $this->img_url_by_pretty();
     444        //['og:url'] = cannonical URL is ised;   
     445        return $facebookMeta;
     446    }
     447
     448    function aioseo_spg_twitter( $twitterMeta ) {
     449
     450        if( !$this->spg_is_pretty_permalink() ){ return $twitterMeta; }
     451
     452        $twitterMeta['twitter:image'] = $this->img_url_by_pretty(); 
     453        return $twitterMeta;
     454    }
     455
     456    function aioseo_spg_canonical( $canonical ) {
     457
     458        $prettyPermalink = $this->spg_pretty_permalink_staff_name();
     459        if( !empty( $prettyPermalink ) ){
     460            // Called twice for cannonical and og:url. Do not run again when alredy is proper cannonical.
     461            if( strpos( $canonical, $prettyPermalink ) === false){
     462                $canonical .= '' . $prettyPermalink . '/';
     463            }           
     464        }
     465        return $canonical;
     466    }
     467    //-- Used by AIOSE END ----------------------------------------------------------------
     468
     469    //--- Used by all START --------------------------------------------------------------
    419470    function filter_spg_wp_title( $title ) {
    420471
    421472        // pp from URL
    422         $prettyPermalink = $this->spg_pretty_permalink();
     473        $prettyPermalink = $this->spg_pretty_permalink_staff_name();
     474
     475        //error_log( print_r( 'prettyPermalink', true) );
     476        //error_log( print_r( $prettyPermalink, true) );
    423477
    424478        //Custom page title replaces single page title. Works only when pretty permalink field is populated. //$title .= ' ' . $sPgTitle;
     
    431485    }
    432486
    433     // Used by all.
    434487    function filter_spg_canonical( $canonical ) {
    435488
    436         $prettyPermalink = $this->spg_pretty_permalink();
    437 
     489        $prettyPermalink = $this->spg_pretty_permalink_staff_name();
    438490        if( !empty( $prettyPermalink ) ){
    439491            $canonical .= '' . $prettyPermalink . '/';               
     
    441493        return $canonical;
    442494    }
    443     //-----------------------------------------------------------------------
    444     // Used by all.
     495
    445496    private function spgs_for_pretty() {
    446497
     
    455506        return $ppPages;
    456507    }
    457 
    458     // Returns last part of pretty permalink URL - Staff Member name.
    459     private function spg_pretty_permalink() {
     508     //--- Used by all END --------------------------------------------------------------
     509
     510    // Returns last part of pretty permalink URL - Staff Member name. OR empty.
     511    private function spg_pretty_permalink_staff_name() {
    460512
    461513        // Return empty if not pp page.
    462514        $ppPages = $this->spgs_for_pretty();
    463         $prettyPermalink = '';
    464515
    465516        // Check URL only if it's pp page.
     
    469520            $nameStart = strpos( $currentURL, '&staff-name=' );
    470521
    471             if( $nameStart === false ){ return $prettyPermalink; }
    472             $prettyPermalink = substr( $currentURL, $nameStart + 12 );
    473         }
    474         return $prettyPermalink;
    475     }
    476 
    477     // Used by all.
     522            if( $nameStart === false ){ return ''; }
     523            return substr( $currentURL, $nameStart + 12 );
     524        }
     525        return '';
     526    }
     527
     528    private function spg_is_pretty_permalink() {
     529
     530        $ppPages = $this->spgs_for_pretty();
     531
     532        if( is_page( $ppPages ) ){
     533            global $wp;
     534            $currentURL = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );
     535            $nameStart = strpos( $currentURL, '&staff-name=' );
     536
     537            if( $nameStart === false ){ return false; }
     538            return true;
     539
     540        }
     541        return false;
     542    }
     543
     544    // Returns spg image URL (meta_key _imgUrlL).
    478545    function img_url_by_pretty( $imgURL='' ) {
    479546
    480         //error_log( print_r( $url, true) );
    481         //error_log( print_r( 'xxxxxxxxxxxxxxxxxxx', true) );
    482 
    483         $prettyPermalink = $this->spg_pretty_permalink();
     547        $prettyPermalink = $this->spg_pretty_permalink_staff_name();
    484548        $sPgTitle = abcfsl_db_spg_title_by_pretty( $prettyPermalink );
    485549
Note: See TracChangeset for help on using the changeset viewer.