Plugin Directory

Changeset 2372273


Ignore:
Timestamp:
08/31/2020 11:03:04 AM (6 years ago)
Author:
thecrackerjack
Message:

Yoast SEO support when swapping meta title and description text with URL params

Location:
ppc-masterminds/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ppc-masterminds/trunk/includes/class-ppcm-url-params-to-content.php

    r2354361 r2372273  
    99class PPCM_URL_Params_To_Content {
    1010   
     11    private $is_aio = false;
     12    private $is_yoast = false;
     13   
    1114    /**
    1215     * Constructor.
     
    1417    public function __construct() {
    1518     
    16         /* The following requires All In One SEO Pack plugin, so don't load if plugin not installed */
    17         if ( is_plugin_active( 'all-in-one-seo-pack/all_in_one_seo_pack.php' ) ) {
     19        /* The following requires All In One SEO Pack plugin or Yoast, so don't load these actions if plugin not installed */
     20        if ( ( $this->is_aio = is_plugin_active( 'all-in-one-seo-pack/all_in_one_seo_pack.php' ) )
     21             || ( $this->is_yoast = is_plugin_active( 'wordpress-seo/wp-seo.php' ) ) ) {
    1822           
    1923            /* If in an admin page, init meta box */
     
    2428           
    2529            /** Change meta description if url params are set @see PPCM_URL_Params_To_Content::change_seo_meta_desc_for_url_params() */
    26             add_filter( 'aioseop_description', array( $this, 'change_seo_meta_desc_for_url_params' ), 10, 1 );
     30            add_filter( 'aioseop_description', array( $this, 'change_seo_meta_desc_for_url_params' ), PHP_INT_MAX, 1 );
     31            add_filter( 'wpseo_metadesc', array( $this, 'change_seo_meta_desc_for_url_params' ), PHP_INT_MAX, 1 );
    2732            /** Change title tag if url params are set @see PPCM_URL_Params_To_Content::change_seo_page_title_for_url_params() */
    28             add_filter( 'aioseop_title', array( $this, 'change_seo_page_title_for_url_params' ), 10, 1 );
     33            add_filter( 'aioseop_title', array( $this, 'change_seo_page_title_for_url_params' ), PHP_INT_MAX, 1 );
     34            add_filter( 'wpseo_title', array( $this, 'change_seo_page_title_for_url_params' ), PHP_INT_MAX, 1 );
    2935        }
    3036       
     
    4854        add_meta_box(
    4955            'ppcm-url-param-meta-box',
    50             __( 'URL Params To SEO', 'ppc-masterminds' ),
     56            __( 'PPC Masterminds Meta Settings', 'ppc-masterminds' ),
    5157            array( $this, 'render_metabox' ),
    5258            array('page', 'post'),
     
    7076        ?>
    7177        <p>When a url param matches the params listed below, it'll swap any {param} text in the title or meta description fields below with that url parameter. If there is no match,
    72             or if the page title or page meta description fields below are empty, the page will use the <strong>All In One SEO Pack</strong> title or description instead.</p>
     78            or if the page title or page meta description fields below are empty, the page will use the <strong><?php esc_html_e( $this->is_aio ? 'All In One SEO Pack' : 'Yoast SEO' );?></strong> title or description instead.</p>
    7379        <p>For example, for https://mysite.com/?my_param=Foo, if the param was my_param, then "{param}" would be replaced with "Foo" wherever it exists in the title and meta description.</p>
    7480        <p class="post-attributes-label-wrapper page-template-label-wrapper">
  • ppc-masterminds/trunk/ppcmasterminds.php

    r2354361 r2372273  
    22/**
    33 * Plugin Name:       PPC Masterminds
    4  * Plugin URI:        https://ppcmasterminds.com
     4 * Plugin URI:        https://ppcmasterminds.com/
     5 * Author:            PPC Masterminds
     6 * Author URI:        https://ppcmasterminds.com/
    57 * Description:       PPC/SEO Utility plugin by PPC Masterminds
    6  * Version:           1.0.0
     8 * Version:           1.1.0
    79 * Requires at least: 5.2
    810 * Requires PHP:      7.2
  • ppc-masterminds/trunk/readme.txt

    r2354361 r2372273  
    11=== PPC Masterminds ===
    22Contributors: zaidovski, thecrackerjack
     3Plugin link: https://ppcmasterminds.com/
    34Tags: ppc, pay per click, landing page optimization, cro, geoip, plugin extensions
    45Requires at least: 5.2
    56Tested up to: 5.4
    67Requires PHP: 7.2
    7 Stable tag: 1.0.0
     8Stable tag: 1.1.0
    89License: GPLv3
    910License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    1213
    1314== Description ==
    14 PPC Masterminds plugin helps you increase ppc quality scores, relevancy and conversion rates on landing pages by dynamically appending meta titles, descriptions and on page text (via shortcode) based on actual keyword search queries. It also has the ability to display a users approximate location by city or state. 
     15PPC Masterminds plugin helps you increase ppc quality scores, relevancy and conversion rates on landing pages by dynamically appending meta titles, descriptions and on page text (via shortcode) based on actual keyword search queries. It also has the ability to display a users approximate location by city or state.
    1516
    1617To summarize, this plugin does the following:
    1718
    18 1. Appends meta titles and descriptions with paid search queries to increase quality scores. This feature currently works in combination with All In One SEO plugin only. No other SEO plugin is supported at this time. 
     191. Appends meta titles and descriptions with paid search queries to increase quality scores. This feature currently works only in combination with either the All In One SEO or Yoast SEO plugins. No other SEO plugin is supported at this time.
    19202. Dynamically changes text on any page to show paid search queries, using shortcode.
    20213. Dynamically inserts closest city/state based on the user's public IP address. This requires the use of Maxmind’s GeoIP extension.
     
    2526Once the plugin is installed and activated, it will add a new section within your page editor, usually at the bottom, called “PPC Masterminds Meta Settings”. That section is responsible for appending the meta title/description based on your settings. Within that section, you will need to enter the URL parameter you are using to capture paid search queries. By default, that parameter is usually “keyword”, but that can be set to whatever parameter you like.
    2627
    27 The plugin then checks for the URL parameter you indicated. When a URL parameter matches the parameter in your settings, the plugin will swap any {param} text in the title or meta description fields with that url parameter. (screenshot below). 
     28The plugin then checks for the URL parameter you indicated. When a URL parameter matches the parameter in your settings, the plugin will swap any {param} text in the title or meta description fields with that url parameter. (screenshot below).
    2829
    2930If there is no match, or if the page title or page meta description fields are empty, the page will use the All In One SEO Pack title or description instead.
    30 For example, for https://mysite.com/?my_param=Foo, if the parameter was my_param, then "{param}" would be replaced with "Foo" wherever it exists in the title and meta description. 
     31For example, for https://mysite.com/?my_param=Foo, if the parameter was my_param, then "{param}" would be replaced with "Foo" wherever it exists in the title and meta description.
    3132
    3233= How to show paid search queries within page text? =
    33 Once the plugin is installed and activated. You can place the shortcode below anywhere within your page you want the paid search query to appear. 
     34Once the plugin is installed and activated. You can place the shortcode below anywhere within your page you want the paid search query to appear.
    3435
    3536**[url_params_to_text text="This is the {param} text you want displayed" params="word" default="This text will appear instead if no params match"] **
     
    4344Shortcode On Your Webpage: Looking for a [url_params_to_text text="This is the {param} text you want displayed" params="word" default="marketing company"]? You are here!
    4445
    45 Displayed (when parameter is found): Looking for a **ppc agency**? You are here! 
     46Displayed (when parameter is found): Looking for a **ppc agency**? You are here!
    4647Displayed (when NO parameter is found): Looking for a **marketing company**? You are here!
    4748
     
    51521. You will need to ensure that the Maxmind GeoLite2 City database is installed in the plugin directory. You can download this database by signing up for a free account here: https://www.maxmind.com/en/geolite2/signup. The file should come named as “GeoLite2-City.mmdb”. It will need to be placed in the **“[PLUGIN_DIRECTORY]/ppcmasterminds/includes/geoip/”** folder.
    5253
    53 2. Once the above steps are complete, you can place the shortcode below anywhere within your page to display the approximate location of the user based on their public IP address. 
     542. Once the above steps are complete, you can place the shortcode below anywhere within your page to display the approximate location of the user based on their public IP address.
    5455
    55 Use this shortcode to display city name: 
     56Use this shortcode to display city name:
    5657**[geoip_location state="no" not_found_text=""]**
    5758
    58 Use this shortcode to display state name: 
     59Use this shortcode to display state name:
    5960**[geoip_location city="no" not_found_text=""]**
    6061
    61 Use this shortcode to display both city & state: 
     62Use this shortcode to display both city & state:
    6263**[geoip_location not_found_text="Oops, couldn't find your location!"]**
    6364
     
    6869**Initial Release**
    6970* Plugin released to the public.
     71
     72= 1.1.0 - 2020-08-31 =
     73**Yoast SEO Support**
     74* The swapping of meta titles and descriptions with URL parameters is now compatible with both Yoast SEO & All-In-One SEO Pack
Note: See TracChangeset for help on using the changeset viewer.