Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Improvements made for inclusion on WordPress.com VIP #12

Merged
merged 5 commits into from

2 participants

@danielbachhuber

First off, thanks for the well-written plugin! It definitely falls into the upper 10% percentile of plugins we see from the community.

One of our clients asked for this plugin to be included in our shared plugins directory, so I made a couple minor improvements hopefully to your satisfaction.

The last improvement I'd like seen is an upper bound to the get_posts() query. 'numberposts' => -1 is potentially dangerous if a user were to add thousands of links. How would you prefer to address this?

@chrisguitarguy chrisguitarguy merged commit 5cb352f into AgencyPMG:master
@chrisguitarguy

Awesome thanks!

As far as the upper bound, maybe that's best left up to a filter -- similar to how the blacklist max filter you incorporated works.

@danielbachhuber

Cool, I'll add that when I have a moment. We might also have some output caching coming your way too.

@chrisguitarguy chrisguitarguy referenced this pull request from a commit
@chrisguitarguy chrisguitarguy Allow end users to restrict total links fetched
Introduce another filter to that allows end users to change the maximum
number of links fetched instead of just fetching all of them.

See #12
5f9f7d7
@chrisguitarguy

Already got it. Output caching sounds awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 17, 2012
  1. @danielbachhuber
  2. @danielbachhuber

    Allow the total number of blacklisted URLs to be limited

    danielbachhuber authored
    On WordPress.com, the options table is in one cache bucket. This ensures we don't blow out the maximum size of the bucket
  3. @danielbachhuber
  4. @danielbachhuber
  5. @danielbachhuber

    Fix syntax error

    danielbachhuber authored
This page is out of date. Refresh to see the latest.
Showing with 77 additions and 74 deletions.
  1. +2 −0  inc/admin.php
  2. +2 −1  inc/front.php
  3. +1 −1  readme.txt
  4. +72 −72 seo-auto-linker.php
View
2  inc/admin.php
@@ -77,6 +77,8 @@ public static function cleaner($in)
$in['blacklist'] : array();
$lines = preg_split('/\r\n|\r|\n/', $blacklist);
$out['blacklist'] = array_map('esc_url', $lines);
+ if ( $blacklist_max = apply_filters( 'seoal_blacklist_max', '__return_false' ) )
+ $out['blacklist'] = array_slice( $out['blacklist'], 0, (int)$blacklist_max );
add_settings_error(
self::SETTING,
View
3  inc/front.php
@@ -186,7 +186,8 @@ protected static function setup_links($post)
'key' => self::get_key('keywords'),
'compare' => 'EXISTS' // doesn't do anything, just a reminder
)
- )
+ ),
+ 'suppress_filters' => false,
));
$rv = array();
View
2  readme.txt
@@ -37,7 +37,7 @@ Sort of. If you keyword list is `lorem, ipsum`, the word `lorem` OR the word `i
= Will this slow my site down? =
-If you add hundreds of keywords, the answer is probably yes. However, SEO auto linker makes use of several wp_cache functions which, when combined with a persistent caching plugin, should help speed things up. If you're running a large scale WordPress install, you should probably be using a caching plugin anyway.
+If you add hundreds of keywords, the answer is probably yes. However, SEO auto linker makes use of several wp_cache functions which, when combined with a persistent caching plugin, should help speed things up. If you're running a large scale WordPress install, you should probably be using a caching plugin anyway.
= This is breaking my HTML! What gives? =
View
144 seo-auto-linker.php
@@ -1,72 +1,72 @@
-<?php
-/*
-Plugin Name: SEO Auto Linker
-Plugin URI: http://pmg.co/seo-auto-linker
-Description: Allows you to automatically link terms with in your post, page or custom post type content.
-Version: 0.8.2
-Author: Christopher Davis
-Author URI: http://christopherdavis.me
-Text Domain: seoal
-Domain Path: /lang
-
- Copyright 2012 Christopher Davis, Performance Media Group <seo@pmg.co>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2, as
- published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-define('SEOAL_PATH', plugin_dir_path(__FILE__));
-define('SEOAL_URL', plugin_dir_url(__FILE__));
-
-require_once(SEOAL_PATH . 'inc/base.php');
-require_once(SEOAL_PATH . 'inc/post-type.php');
-if(is_admin())
-{
- require_once(SEOAL_PATH . 'inc/admin.php');
-}
-else
-{
- require_once(SEOAL_PATH . 'inc/front.php');
-}
-
-
-add_action('init', 'seoal_load_textdomain');
-/*
- * Loads the plugin's text domain for translation
- *
- * @uses load_plugin_textdomain
- * @since 0.7
- */
-function seoal_load_textdomain()
-{
- load_plugin_textdomain(
- 'seoal',
- false,
- dirname(plugin_basename(__FILE__)) . '/lang/'
- );
-}
-
-
-add_action('plugins_loaded', 'seoal_loaded');
-/**
- * Provides an always safe action into which to hook for plugins that extend
- * SEO Auto Linker.
- *
- * @since 0.8.2
- * @uses do_action
- * @return null
- */
-function seoal_loaded()
-{
- do_action('seoal_loaded');
-}
+<?php
+/*
+Plugin Name: SEO Auto Linker
+Plugin URI: http://pmg.co/seo-auto-linker
+Description: Allows you to automatically link terms with in your post, page or custom post type content.
+Version: 0.8.2
+Author: Christopher Davis
+Author URI: http://christopherdavis.me
+Text Domain: seoal
+Domain Path: /lang
+
+ Copyright 2012 Christopher Davis, Performance Media Group <seo@pmg.co>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License, version 2, as
+ published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+define('SEOAL_PATH', plugin_dir_path(__FILE__));
+define('SEOAL_URL', plugin_dir_url(__FILE__));
+
+require_once(SEOAL_PATH . 'inc/base.php');
+require_once(SEOAL_PATH . 'inc/post-type.php');
+if(is_admin())
+{
+ require_once(SEOAL_PATH . 'inc/admin.php');
+}
+else
+{
+ require_once(SEOAL_PATH . 'inc/front.php');
+}
+
+
+add_action('init', 'seoal_load_textdomain');
+/*
+ * Loads the plugin's text domain for translation
+ *
+ * @uses load_plugin_textdomain
+ * @since 0.7
+ */
+function seoal_load_textdomain()
+{
+ load_plugin_textdomain(
+ 'seoal',
+ false,
+ dirname(plugin_basename(__FILE__)) . '/lang/'
+ );
+}
+
+
+add_action('plugins_loaded', 'seoal_loaded');
+/**
+ * Provides an always safe action into which to hook for plugins that extend
+ * SEO Auto Linker.
+ *
+ * @since 0.8.2
+ * @uses do_action
+ * @return null
+ */
+function seoal_loaded()
+{
+ do_action('seoal_loaded');
+}
Something went wrong with that request. Please try again.