• Resolved John Robertson

    (@braddor)


    Is it just me or do I have to keep generating the SEO title every time I post, else I get a blank title. I would have thought that it would auto generate a title based on the title put into the original WP title field, unless changed otherwise.

Viewing 15 replies - 1 through 15 (of 16 total)
  • jimmywhofan

    (@jimmywhofan)

    It does the same thing for me. I wonder if this is a bug or a known issue?

    Plugin Contributor Joost de Valk

    (@joostdevalk)

    It should actually do that indeed, you get a blank SEO title field?

    jimmywhofan

    (@jimmywhofan)

    After creating a new post, the SEO title field says: ” – Wise Republic” (with no quotes). Wise Republic is the name of my site. If I click “Regenerate SEO Title”, the SEO title field says: “Test Post – Wise Republic” (“Test Post” is the title of the post)

    Thread Starter John Robertson

    (@braddor)

    Yea exactly what jimmy mentioned is happening with me.

    Plugin Contributor Joost de Valk

    (@joostdevalk)

    Yeah I need to come up with better logic there… Stay tuned ??

    Thread Starter John Robertson

    (@braddor)

    Also the description is not generated period unless I manually paste it in, even after I configured it for auto descriptions. :/

    Plugin Contributor Joost de Valk

    (@joostdevalk)

    no it doesn’t generate in the preview yet, that’s being worked on at the moment.

    Thread Starter John Robertson

    (@braddor)

    Alright thanks man. Great work as always.

    Plugin Contributor Joost de Valk

    (@joostdevalk)

    Version 0.1.8, coming soon, will have different logic for this, it won’t save an SEO title by default, it’ll display in the snippet preview what your article heading would look like in the post title UNTIL you set an SEO title specifically. Simpler than it used to be, thus better, I guess ??

    jjhealy

    (@jjhealy)

    do i have to add code to the theme to get titles to show, I use sem reloaded theme. All I get is first letter of post title, I was hoping to use plugin with some autogenerated content, but cannot if post title has to be fixed for each post. I have no coding skills

    Plugin Contributor Joost de Valk

    (@joostdevalk)

    it should “just” work. If you drop a url here I can have a look, but you should probably first check your theme’s header.php for what’s there between the title tags.

    jjhealy

    (@jjhealy)

    Below is the code used in the sem logic theme header.php.
    Unfortunately it means little to me, do I have to add a line of code?

    <?php
    /**
    * sem_header
    *
    * @package Semiologic Reloaded
    **/

    class sem_header {
    /**
    * scripts()
    *
    * @return void
    **/

    function scripts() {
    $header = header::get();

    if ( !$header )
    return;

    preg_match(“/\.([^.]+)$/”, $header, $ext);
    $ext = end($ext);

    if ( $ext == ‘swf’ )
    wp_enqueue_script(‘swfobject’);
    } # scripts()

    /**
    * save_options()
    *
    * @return void
    **/

    function save_options() {
    if ( !$_POST || !current_user_can(‘switch_themes’) )
    return;

    check_admin_referer(‘sem_header’);

    #dump($_POST, $_FILES);

    global $sem_options;
    $header = header::get();
    $active_skin = $sem_options[‘active_skin’];

    if ( !empty($_FILES[‘header_file’][‘name’]) ) {
    if ( $header && strpos($header, “/skins/$active_skin/”) === false ) {
    if ( !is_writable(WP_CONTENT_DIR . $header) ) {
    echo ‘<div class=”error”>’
    . “<p>”
    . “
    . sprintf(__(‘%s is not writable.’, ‘sem-reloaded’), ‘wp-content’ . $header)
    . “

    . “</p>\n”
    . “</div>\n”;
    return;
    } elseif ( !@unlink(WP_CONTENT_DIR . $header) ) {
    echo ‘<div class=”error”>’
    . “<p>”
    . “
    . sprintf(__(‘Failed to delete %s.’, ‘sem-reloaded’), ‘wp-content’ . $header)
    . “

    . “</p>\n”
    . “</div>\n”;
    return;
    }
    }

    preg_match(“/\.([^.]+)$/”, $_FILES[‘header_file’][‘name’], $ext);
    $ext = end($ext);
    $ext = strtolower($ext);

    if ( !in_array($ext, defined(‘GLOB_BRACE’) ? array(‘jpg’, ‘jpeg’, ‘png’, ‘gif’, ‘swf’) : array(‘jpg’)) ) {
    echo ‘<div class=”error”>’
    . “<p>”
    . “
    . __(‘Invalid File Type.’, ‘sem-reloaded’)
    . “

    . “</p>\n”
    . “</div>\n”;
    return;
    } else {
    $entropy = intval(get_site_option(‘sem_entropy’)) + 1;
    update_site_option(‘sem_entropy’, $entropy);

    $name = WP_CONTENT_DIR . header::get_basedir() . ‘/header-‘ . $entropy . ‘.’ . $ext;

    @move_uploaded_file($_FILES[‘header_file’][‘tmp_name’], $name);

    $stat = stat(dirname($name));
    $perms = $stat[‘mode’] & 0000666;
    @chmod($name, $perms);
    }
    } elseif ( $header && isset($_POST[‘delete_header’]) && strpos($header, “/skins/$active_skin/”) === false ) {
    if ( !is_writable(WP_CONTENT_DIR . $header) ) {
    echo ‘<div class=”error”>’
    . “<p>”
    . “
    . sprintf(__(‘%s is not writable.’, ‘sem-reloaded’), ‘wp-content’ . $header)
    . “

    . “</p>\n”
    . “</div>\n”;
    return;
    } elseif ( !@unlink(WP_CONTENT_DIR . $header) ) {
    echo ‘<div class=”error”>’
    . “<p>”
    . “
    . sprintf(__(‘Failed to delete %s.’, ‘sem-reloaded’), ‘wp-content’ . $header)
    . “

    . “</p>\n”
    . “</div>\n”;
    return;
    }
    }

    delete_transient(‘sem_header’);

    echo ‘<div class=”updated fade”>’
    . ‘<p>
    . __(‘Settings saved.’, ‘sem-reloaded’)
    . ‘
    </p>’
    . ‘</div>’ . “\n”;
    } # save_options()

    /**
    * edit_options()
    *
    * @return void
    **/

    function edit_options() {
    echo ‘<div class=”wrap”>’;

    echo ‘<form enctype=”multipart/form-data” method=”post” action=””>’;

    wp_nonce_field(‘sem_header’);

    global $sem_options;

    $header = header::get();
    $active_skin = $sem_options[‘active_skin’];

    screen_icon();

    echo ‘<h2>’ . __(‘Manage Header’, ‘sem-reloaded’) . ‘</h2>’ . “\n”;

    echo ‘<p>’
    . __(‘The header\’s height will automatically adjust to fit your image or flash file. The width to use will depend on your layout\’s canvas width, and on your skin (strip 20px if you\’re using the Kubrick skin).’, ‘sem-reloaded’)
    . ‘</p>’ . “\n”;

    if ( $header ) {
    echo ‘<h3>’ . __(‘Current Header’, ‘sem-reloaded’) . ‘</h3>’;

    preg_match(“/\.([^.]+)$/”, $header, $ext);
    $ext = strtolower(end($ext));

    if ( $ext != ‘swf’ ) {
    echo ‘<p>’
    . header::display_image($header)
    . ‘</p>’ . “\n”;
    } else {
    echo header::display_flash($header);
    }

    if ( is_writable(WP_CONTENT_DIR . $header) ) {
    echo ‘<p>’
    . ‘<label>’
    . ‘<input type=”checkbox” name=”delete_header” />’
    . ‘ ‘
    . __(‘Delete Header’, ‘sem-reloaded’)
    . ‘</label>’
    . ‘</p>’ . “\n”;

    echo ‘<div class=”submit”>’
    . ‘<input type=”submit” value=”‘ . esc_attr(__(‘Save Changes’, ‘sem-reloaded’)) . ‘” />’
    . ‘</div>’ . “\n”;
    } elseif ( strpos($header, “/skins/$active_skin/”) !== false ) {
    echo ‘<p>’
    . sprintf(__(‘This header (%s) is hard-coded in your skin. You cannot delete it, but you can override it.’, ‘sem-reloaded’), ‘wp-content’ . $header)
    . ‘</p>’ . “\n”;
    } else {
    echo ‘<p>’
    . sprintf(__(‘This header (%s) is not writable by the server. Please delete it manually to change it.’, ‘sem-reloaded’), ‘wp-content’ . $header)
    . ‘</p>’ . “\n”;
    }
    }

    $site_basedir = header::get_basedir();
    wp_mkdir_p(WP_CONTENT_DIR . $site_basedir);

    if ( !$header || is_writable(WP_CONTENT_DIR . $header) || strpos($header, “/skins/$active_skin/”) !== false ) {
    if ( is_writable(WP_CONTENT_DIR . $site_basedir) ) {
    echo ‘<h3>’
    . ‘<label for=”header_file”>’
    . ( defined(‘GLOB_BRACE’)
    ? __(‘Upload a New Header (jpg, png, gif, swf)’, ‘sem-reloaded’)
    : __(‘Upload a New Header (jpg)’, ‘sem-reloaded’)
    )
    . ‘</label>’
    . ‘</h3>’ . “\n”;

    echo ‘<p>’
    . ‘<input type=”file” class=”widefat” id=”header_file” name=”header_file” />’
    . ‘</p>’ . “\n”;
    } elseif ( !is_writable(WP_CONTENT_DIR) ) {
    echo ‘<p>’
    . __(‘Your wp-content folder is not writeable by the server’, ‘sem-reloaded’)
    . ‘</p>’ . “\n”;
    } else {
    echo ‘<p>’
    . __(‘Your wp-content/header folder is not writeable by the server’, ‘sem-reloaded’)
    . ‘</p>’ . “\n”;
    }

    echo ‘<p>’
    . sprintf(__(‘Maximum file size is %s based on your server\’s configuration.’, ‘sem-reloaded’), wp_convert_bytes_to_hr(apply_filters(‘import_upload_size_limit’, wp_max_upload_size())))
    . ‘</p>’ . “\n”;

    echo ‘<div class=”submit”>’
    . ‘<input type=”submit” value=”‘ . esc_attr(__(‘Save Changes’, ‘sem-reloaded’)) . ‘” />’
    . ‘</div>’ . “\n”;
    }

    echo ‘</form>’ . “\n”;

    echo ‘</div>’ . “\n”;
    } # edit_options()

    /**
    * edit_entry()
    *
    * @param object $post
    * @return void
    **/

    function edit_entry($post)
    {
    $post_ID = $post->ID;

    if ( defined(‘GLOB_BRACE’) ) {
    $header_scan = “header{,-*}.{jpg,jpeg,png,gif,swf}”;
    $scan_type = GLOB_BRACE;
    } else {
    $header_scan = “header-*.jpg”;
    $scan_type = false;
    }

    $header = glob(WP_CONTENT_DIR . header::get_basedir() . “/$post_ID/$header_scan”, $scan_type);

    if ( $header ) {
    $header = current($header);
    $header = str_replace(WP_CONTENT_DIR, ”, $header);
    } else {
    $header = false;
    }

    if ( $header ) {
    echo ‘<h4>’
    . __(‘Current Header’, ‘sem-reloaded’)
    . ‘</h4>’ . “\n”;

    preg_match(“/\.([^.]+)$/”, $header, $ext);
    $ext = strtolower(end($ext));

    echo ‘<div style=”overflow: hidden;”>’ . “\n”;

    if ( $ext != ‘swf’ ) {
    echo ‘<p>’
    . header::display_image($header)
    . ‘</p>’ . “\n”;
    } else {
    echo header::display_flash($header);
    }

    echo ‘</div>’ . “\n”;

    if ( is_writable(WP_CONTENT_DIR . $header) ) {
    echo ‘<p>’
    . ‘<label>’
    . ‘<input type=”checkbox” name=”delete_header” />’
    . ‘ ‘
    . __(‘Delete Header’, ‘sem-reloaded’)
    . ‘</label>’
    . ‘</p>’ . “\n”;

    echo ‘<p>’
    . ‘<input type=”submit” name=”save” class=”button” tabindex=”5″ value=”‘ . esc_attr(__(‘Save’, ‘sem-reloaded’)) . ‘” />’
    . ‘</p>’ . “\n”;
    } else {
    echo ‘<p>’
    . sprintf(__(‘This header (%s) is not writable by the server. Please delete it manually to change it.’, ‘sem-reloaded’), ‘wp-content’ . $header)
    . ‘</p>’ . “\n”;
    }
    }

    wp_mkdir_p(WP_CONTENT_DIR . header::get_basedir());

    if ( !$header || is_writable(WP_CONTENT_DIR . $header) ) {
    if ( is_writable(WP_CONTENT_DIR . ‘/header’) ) {
    echo ‘<h4>’
    . ‘<label for=”header_file”>’
    . ( defined(‘GLOB_BRACE’)
    ? __(‘Upload a New Header (jpg, png, gif, swf)’, ‘sem-reloaded’)
    : __(‘Upload a New Header (jpg)’, ‘sem-reloaded’)
    )
    . ‘</label>’
    . ‘</h4>’ . “\n”;

    echo ‘<p>’
    . ‘<input type=”file” id=”header_file” name=”header_file” />’
    . ‘ ‘
    . ‘<input type=”submit” name=”save” class=”button” tabindex=”5″ value=”‘ . esc_attr(__(‘Save’, ‘sem-reloaded’)) . ‘” />’
    . ‘</p>’ . “\n”;
    } elseif ( !is_writable(WP_CONTENT_DIR) ) {
    echo ‘<p>’
    . __(‘Your wp-content folder is not writeable by the server’, ‘sem-reloaded’)
    . ‘</p>’ . “\n”;
    } else {
    echo ‘<p>’
    . __(‘Your wp-content/header folder is not writeable by the server’, ‘sem-reloaded’)
    . ‘</p>’ . “\n”;
    }

    echo ‘<p>’
    . sprintf(__(‘Maximum file size is %s based on your server\’s configuration.’, ‘sem-reloaded’), wp_convert_bytes_to_hr(apply_filters(‘import_upload_size_limit’, wp_max_upload_size())))
    . ‘</p>’ . “\n”;
    }
    } # edit_entry()

    /**
    * save_entry()
    *
    * @param int $post_ID
    * @return void
    **/

    function save_entry($post_id) {
    if ( !$_POST || wp_is_post_revision($post_id) || !current_user_can(‘edit_post’, $post_id) )
    return;

    $post_id = (int) $post_id;

    if ( defined(‘GLOB_BRACE’) ) {
    $header_scan = “header{,-*}.{jpg,jpeg,png,gif,swf}”;
    $scan_type = GLOB_BRACE;
    } else {
    $header_scan = “header-*.jpg”;
    $scan_type = false;
    }

    $header = glob(WP_CONTENT_DIR . header::get_basedir() . “/$post_id/$header_scan”, $scan_type);

    if ( $header ) {
    $header = current($header);
    $header = str_replace(WP_CONTENT_DIR, ”, $header);
    } else {
    $header = false;
    }

    if ( @ $_FILES[‘header_file’][‘name’] ) {
    preg_match(“/\.([^.]+)$/”, $_FILES[‘header_file’][‘name’], $ext);
    $ext = strtolower(end($ext));

    if ( !in_array($ext, defined(‘GLOB_BRACE’) ? array(‘jpg’, ‘jpeg’, ‘png’, ‘gif’, ‘swf’) : array(‘jpg’)) ) {
    return;
    } elseif ( !wp_mkdir_p(WP_CONTENT_DIR . header::get_basedir() . $post_id) ) {
    return;
    } elseif ( $header && !@unlink(WP_CONTENT_DIR . $header) ) {
    return;
    }

    $entropy = intval(get_site_option(‘sem_entropy’)) + 1;
    update_site_option(‘sem_entropy’, $entropy);

    $name = WP_CONTENT_DIR . header::get_basedir() . ‘/’ . $post_id . ‘/header-‘ . $entropy . ‘.’ . $ext;

    wp_mkdir_p(WP_CONTENT_DIR . header::get_basedir() . ‘/’ . $post_id);
    @move_uploaded_file($_FILES[‘header_file’][‘tmp_name’], $name);

    $stat = stat(dirname($name));
    $perms = $stat[‘mode’] & 0000666;
    @chmod($name, $perms);

    delete_post_meta($post_id, ‘_sem_header’);
    } elseif ( $header && isset($_POST[‘delete_header’]) ) {
    if ( !@unlink(WP_CONTENT_DIR . $header) ) {
    return;
    }

    delete_post_meta($post_id, ‘_sem_header’);
    }
    } # save_entry()
    } # sem_header

    add_action(‘admin_print_scripts’, array(‘sem_header’, ‘scripts’));
    add_action(‘appearance_page_header’, array(‘sem_header’, ‘save_options’), 0);
    add_action(‘save_post’, array(‘sem_header’, ‘save_entry’), 30);
    ?>

    Apologies for length, appreciate your help very much

    JJ

    Plugin Contributor Joost de Valk

    (@joostdevalk)

    I’ve reached out to the author to see if we can fix this.

    Thank you very much for your help, the plugin in is now working perfect and I am grateful for your assistance. I will sing your praises in Auto Blog Blueprint.

    Plugin Contributor Joost de Valk

    (@joostdevalk)

    hey jjhealy, good to hear! A 5 star rating for the plugin would be appreciated ??

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘[Plugin: WordPress SEO] Auto Title Generation’ is closed to new replies.