Plugin Directory

Changeset 2211656


Ignore:
Timestamp:
12/13/2019 03:06:54 PM (6 years ago)
Author:
b3none
Message:

update trunk

Location:
the-insertr/trunk
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • the-insertr/trunk/readme.txt

    r2210901 r2211656  
    1616This tool helps with PPC and can make landing pages appear more specified and tailored to the ads.
    1717
    18 The Herdl dynamic keyword insertion plugin, The Insertr, dynamically inserts a keyword onto your page using a simple URL query string to determine the keyword and a shortcode for placement.
    19 
    20 The placement of the word or phrase is determined by the location of the short code. In the case where a word is not specified a fallback Keyword or phrase is placed instead.
    21 
    22 Short code to be used: [insertr key="{desiredword}" fallback="{fallback}"] where 'desiredword' is the word to be placed, and 'fallback' is the word to appear if no keyword is specified.
    23 
    24 For the Keyword to be placed on your page,  you must also add the following parameter to your URL: ?keyword={example} Where 'example' is the word you want to placed.
    25 
    26 If your URL already has parameters (E.g - there is already a ? in the URL) add &keyword={keyword} to the end of the string.
    27 
    28 Use Cases
    29 - Improving the landing page experience for Google Ads performance by improving keyword relevancy
    30 - Personalisation of pages
    31 - Marketing automation
    32 
    3318== Installation ==
    3419
     
    3621
    3722Once this plugin has been approved on the WordPress marketplace we will update the repository with a link.
     23
     24== Usage ==
     25
     26To use this plugin you'll need to implement short codes in your WordPress editor like so:
     27```
     28The [insertr key="keyword" fallback="person"] went for a run.
     29```
     30
     31Then you can use a link to this page as
     32```
     33herdl.com/run/?keyword=Cheetah
     34```
    3835
    3936== Frequently Asked Questions ==
  • the-insertr/trunk/the-insertr.php

    r2210952 r2211656  
    1414}
    1515
    16 /**
    17  * If ACF is enabled add a listener to allow short codes
    18  */
    19 if (!class_exists('ACF')) {
     16function theinsertr_register_settings() {
     17    add_submenu_page('options-general.php', 'TheInsertr', 'TheInsertr', 'manage_options', 'theinsertr', 'theinsertr_settings');
     18}
     19
     20function theinsertr_settings() {
     21    $user = wp_get_current_user();
     22
     23    if (!current_user_can('administrator')) {
     24        echo '<p>You are not allowed to access this page.</p>';
     25        return;
     26    }
     27
     28    if (isset($_REQUEST['submit'])) {
     29        if (!isset($_REQUEST['theinsertr_nonce'])) {
     30            $errorMessage = 'nonce field is missing. Settings NOT saved.';
     31        } elseif (!wp_verify_nonce($_REQUEST['theinsertr_nonce'], 'theinsertr')) {
     32            $errorMessage = 'Invalid nonce specified. Settings NOT saved.';
     33        } else {
     34            update_option('theinsertr_acf_enable', isset($_REQUEST['theinsertr_acf_enable']) ? 'yes' : 'no');
     35            update_option('theinsertr_yoast_title_enable', isset($_REQUEST['theinsertr_yoast_title_enable']) ? 'yes' : 'no');
     36
     37            $message = 'Settings Saved.';
     38        }
     39    }
     40
     41    include_once(__DIR__ . '/templates/settings.php');
     42}
     43
     44if (get_option('theinsertr_acf_enable') === 'yes') {
    2045    add_filter('acf/format_value', 'my_acf_format_value');
    2146
     
    2954}
    3055
    31 /**
    32  * If Yoast SEO is enabled make sure we can use short codes
    33  */
    34 if (is_plugin_active('wordpress-seo/wp-seo.php') || is_plugin_active('wordpress-seo-premium/wp-seo-premium.php')) {
     56if (get_option('theinsertr_yoast_title_enable') === 'yes') {
    3557    add_filter('wpseo_title', 'my_wpseo_title');
    3658
     
    5880}
    5981
     82add_action('admin_menu', 'theinsertr_register_settings');
     83add_action('wp_footer', 'theinsertr_render_script');
    6084add_shortcode('insertr', 'insertr_function');
Note: See TracChangeset for help on using the changeset viewer.