Plugin Directory

Changeset 544313


Ignore:
Timestamp:
05/15/2012 01:27:18 AM (14 years ago)
Author:
anubisthejackle
Message:

Added Auto Tagging module, and removed extraneous global calls to $wpdb, placed it as a constructor argument instead, added new footer messages, and periodic header donation request. Moved the all-post updaters to their own pages.

Location:
wordpress-automation-suite
Files:
48 added
8 edited

Legend:

Unmodified
Added
Removed
  • wordpress-automation-suite/trunk/AutoMore.php

    r543823 r544313  
    1010        public $data;
    1111
    12         public function __construct() {
    13             global $wpdb;
     12        public function __construct($wpdb) {
    1413            $this->_db = &$wpdb;
    15             self::$_instance = $this;
     14            self::$_instance = &$this;
    1615   
    1716            add_filter('content_save_pre', 'AutoMore::addTag', '1', 2);
     
    1918        }
    2019
     20        public static function getInstance() {
     21            return self::$_instance;
     22        }
     23       
    2124        public function activate() {
    2225            update_option('AutomationSuite_Module_AutoMore', true);
     
    201204
    202205        public function updateAll() {
    203        
     206            // Stop the auto tagger from firing, so we don't have a baragge of auto tagging going on.
     207            WNAutomation::getInstance()->stopTagger();
    204208            $posts = get_posts(array(
    205209                'numberposts' => '-1',
     
    213217                    setup_postdata($post);
    214218                    $post->post_content = self::addTag($post->post_content);
    215                     wp_update_post($post);         
     219                    wp_update_post($post);
     220                    usleep(750000);
    216221                }
    217222            }
  • wordpress-automation-suite/trunk/AutoPaging.php

    r543823 r544313  
    1010        public $data;
    1111
    12         public function __construct() {
    13             global $wpdb;
     12        public function __construct($wpdb) {
    1413            $this->_db = &$wpdb;
    15             self::$_instance = $this;
     14            self::$_instance = &$this;
    1615   
    1716            add_filter('content_save_pre', 'AutoPaging::addTag', '1', 2);
    1817        }
    1918
     19        public static function getInstance() {
     20            return self::$_instance;
     21        }
     22       
    2023        public function activate() {
    2124            update_option('AutomationSuite_Module_AutoPaging', true);
     
    99102
    100103        public function updateAll() {
    101        
     104            WNAutomation::getInstance()->stopTagger();
     105
    102106            $posts = get_posts(array(
    103107                'numberposts' => '-1',
     
    111115                    setup_postdata($post);
    112116                    $post->post_content = self::addTag($post->post_content);
    113                     wp_update_post($post);         
     117                    wp_update_post($post);
     118                    usleep(750000);                 
    114119                }
    115120            }
  • wordpress-automation-suite/trunk/Menu.php

    r543823 r544313  
    3333                $options['AutomationSuite_AutoMore'] = get_option('AutomationSuite_AutoMore', true);
    3434                $options['AutomationSuite_AutoPaging'] = get_option('AutomationSuite_AutoPaging', false);
     35                $options['AutomationSuite_AutoTagger'] = get_option('AutomationSuite_AutoTagger', false);
    3536                $options['AutomationSuite_GiveCredit'] = get_option('AutomationSuite_GiveCredit', false);
    3637                break;
     
    4748                $options['AutoPaging_break'] = get_option('AutoPaging_break', 1);
    4849                $options['AutoPaging_auto_update'] = get_option('AutoPaging_auto_update', true);
     50                break;
     51            case 'auto-tagger':
     52                $options['AutoTagger_TagTheNetCount'] = (int)get_option('AutoTagger_TagTheNetCount', 10);
     53                $options['AutoTagger_Blacklist'] = get_option('AutoTagger_Blacklist', null);
    4954                break;
    5055            default:
     
    7479    }
    7580
     81    public function buildAutoTaggerOptionsPage() {
     82   
     83        require_once(dirname(__FILE__).'/pages/auto-tagger.php');
     84   
     85    }
     86   
    7687    public function buildMenu() {
    7788
     
    8697        }
    8798
     99        if(get_option('AutomationSuite_AutoTagger', false) != false){
     100            $this->option_menu_page_four = add_submenu_page('automation_suite', 'Auto Post Tagger', 'Auto Post Tagger', 'manage_options', 'automation_suite_auto_tagger', array($this, 'buildAutoTaggerOptionsPage'));
     101        }
     102       
    88103    }
    89104
  • wordpress-automation-suite/trunk/automation-suite.php

    r543823 r544313  
    66Author URI: http://travisweston.com/
    77Description: With the help of this automation suite you are able to forget about creating excerpts, you can forget about manually inserting new pages for your posts. With this suite, all of these actions can, and will, be automated for you!
    8 Version: 1.0
     8Version: 2.0
    99*/
    10 ini_set('display_errors', 1);
    1110if(!defined('WESTON_NETWORKS_AUTOMATION_SUITE')){
    1211    define('WESTON_NETWORKS_AUTOMATION_SUITE', true);
     
    2524                    'More WordPress plugins',
    2625                    'Excellent technology blog, opinions and tutorials',
    27                     'WordPress Automation Suite © 2012 Travis Weston'
     26                    'WordPress Automation Suite © 2012 Travis Weston',
     27                    'This blog automated by WordPress Automation Suite'
    2828                );
    29        
     29
     30        private static $_instance;
     31               
    3032        public function __construct() {
    3133            global $wpdb;
     
    3638            if(get_option('AutomationSuite_AutoMore', true) != false){
    3739                include_once('AutoMore.php');
    38                 $this->_modules['auto-more'] = new AutoMore();
     40                $this->_modules['auto-more'] = new AutoMore($wpdb);
    3941            }
    4042
    4143            if(get_option('AutomationSuite_AutoPaging', false) != false){
    4244                include_once('AutoPaging.php');
    43                 $this->_modules['auto-paging'] = new AutoPaging();
     45                $this->_modules['auto-paging'] = new AutoPaging($wpdb);
    4446            }
    4547
     48            if(get_option('AutomationSuite_AutoTagger', false) != false){
     49                if(function_exists('curl_init')){
     50                    include_once('AutoTagger.php');
     51                    $this->_modules['auto-tagger'] = new AutoTagger();
     52                }else{
     53                    add_action('admin_notices', function() {
     54                                                    echo '<div id="message" class="error">Auto Tagger Module requires PHP cURL extension to be installed.</div>';
     55                                                    update_option("AutomationSuite_AutoTagger", false);
     56                                                }
     57                                );
     58                }
     59            }
     60           
    4661            add_action('wp_footer', array($this, 'giveCredit'));
    47 
     62            add_action('admin_notices', array($this, 'begForMoney'));
     63            self::$_instance = $this;
     64        }
     65       
     66        public static function getInstance() {
     67       
     68            if(!(self::$_instance instanceof WNAutomation))
     69                self::$_instance = new WNAutomation();
     70               
     71            return self::$_instance;
     72       
     73        }
     74       
     75        public function stopTagger() {
     76       
     77            if(!isset($this->_modules['auto-tagger']))
     78                return;
     79               
     80            $this->_modules['auto-tagger']->removeAction();
     81           
    4882        }
    4983       
     
    5791        }
    5892       
     93        public function setAlertTime() {
     94           
     95            $time = get_option('AutomationSuite_AlertTime', false);
     96           
     97            if($time !== false && $time > time())
     98                return;
     99           
     100            $length = (get_option('AutomationSuite_GiveCredit', true) != true) ? '+2 Weeks' : '+1 Month';
     101           
     102            update_option('AutomationSuite_AlertTime', strtotime($length, time()));
     103           
     104        }
     105       
     106        public function begForMoney() {
     107       
     108            $time = get_option('AutomationSuite_AlertTime', false);
     109
     110            if($time === false || $time > time() || isset($_POST['hide'])){
     111                $this->setAlertTime();
     112                return;
     113            }
     114           
     115            $button = <<<html
     116            <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
     117<input type="hidden" name="cmd" value="_s-xclick">
     118<input type="hidden" name="hosted_button_id" value="PMDJTKFD26YQL">
     119<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynow_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
     120<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
     121</form>
     122html;
     123            echo '<div id="message" class="updated fade"><p style="font-weight: bold;"><span style="float: left;">You\'ve used the WordPress Automation Suite for a while now. If you enjoy it, please consider donating $1</span>'.$button.'<form action="'.$_SERVER['REQUEST_URI'].'" method="get" style="float: right;"><input type="hidden" name="hide" value="true" /><input type="submit" class="button-primary" name="hide_msg" value="Hide Message" /></form></p><div style="clear:both;">&nbsp;</div></div>';
     124           
     125        }
     126       
    59127    }
    60128
  • wordpress-automation-suite/trunk/pages/MainOptions.php

    r543823 r544313  
    66?>
    77<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
    8 <input type="hidden" name="DoUpdate" />
     8<input type="hidden" name="DoUpdate" value="true" />
    99<div class="section" style="margin-right: 20px !important;">
    1010    <div class="box visible">
     
    2626            </li>
    2727            <li>
     28                I <select name="AutomationSuite_AutoTagger">
     29                    <option value="1" <?php echo (isset($options['AutomationSuite_AutoTagger']) && $options['AutomationSuite_AutoTagger'] == true) ? 'selected="SELECTED" ' : null; ?>/>would
     30                    <option value="0" <?php echo (!isset($options['AutomationSuite_AutoTagger']) || $options['AutomationSuite_AutoTagger'] != true) ? 'selected="SELECTED" ' : null; ?>/>wouldn't
     31                </select> like to use the Auto Post Tagger Module.
     32            </li>
     33            <li>
    2834                I <select name="AutomationSuite_GiveCredit">
    2935                    <option value="1" <?php echo (isset($options['AutomationSuite_GiveCredit']) && $options['AutomationSuite_GiveCredit'] == true) ? 'selected="SELECTED" ' : null;?>/>would
     
    3541            <input type="submit" class="button-primary" name="submit" value="Update" />
    3642        </p>
    37         <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    38             <input type="hidden" name="cmd" value="_s-xclick">
    39             <input type="hidden" name="hosted_button_id" value="XWLHKSW6EJD3A">
    40             <input type="hidden" name="on0" value="Donations">
    41             <h2>Donations</h2>
    42             <select name="os0">
    43                 <option value="Donate a coffee?">Donate a coffee? $1.00 USD</option>
    44                 <option value="Coffee w/ Bagel?">Coffee w/ Bagel? $5.00 USD</option>
    45                 <option value="Beer?">Beer? $10.00 USD</option>
    46                 <option value="Diapers for my 2 kids?">Diapers for my 2 kids? $25.00 USD</option>
    47                 <option value="Car Payment?">Car Payment? $50.00 USD</option>
    48                 <option value="House Payment?">House Payment? $100.00 USD</option>
    49                 <option value="Now you're just crazy, but I love you.">Now you're just crazy, but I love you. $500.00 USD</option>
    50             </select><br />
    51             <input type="hidden" name="currency_code" value="USD">
    52             <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
    53             <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
    54         </form>
     43        <?php include_once('paypal.php'); ?>
    5544    </div>
    5645</div>
  • wordpress-automation-suite/trunk/pages/auto-more.php

    r543823 r544313  
    77
    88if(isset($_POST['DoUpdate']) && isset($options['AutoMore_auto_update']) && $options['AutoMore_auto_update'] == true){
    9     AutoMore::updateAll();
     9    $url = plugins_url('pages/auto-more-update-all.php', dirname(__FILE__));
     10    wp_remote_post( $url, array('timeout' => 0.01, 'blocking' => false, 'sslverify' => apply_filters('https_local_ssl_verify', true)) );
    1011}
    1112?>
     
    3132                    <option value="0" <?php echo (isset($options['AutoMore_ignore_man_tag']) && $options['AutoMore_ignore_man_tag'] == false) ? 'selected="SELECTED" ' : null;?>/>wouldn't
    3233                </select> like to ignore manually inserted shortcode more tags of the format [amt_override].</p>
    33             <p class="submit">
    34                 <input type="submit" class="button-primary" value="<?php _e('Update Auto More Tag Settings'); ?>" />
    35             </p>
     34        <p class="submit">
     35            <input type="submit" class="button-primary" value="<?php _e('Update Auto More Tag Settings'); ?>" />
     36        </p>
     37        <?php include_once('paypal.php'); ?>
    3638    </div>
    3739</div>
  • wordpress-automation-suite/trunk/pages/auto-paging.php

    r543823 r544313  
    77
    88if(isset($_POST['DoUpdate']) && isset($options['AutoPaging_auto_update']) && $options['AutoPaging_auto_update'] == true){
    9     AutoPaging::updateAll();
     9    $url = plugins_url('pages/auto-paging-update-all.php', dirname(__FILE__));
     10    wp_remote_post( $url, array('timeout' => 0.01, 'blocking' => false, 'sslverify' => apply_filters('https_local_ssl_verify', true)) );
    1011}
    1112?>
     
    2829                    <option value="0" <?php echo (isset($options['AutoPaging_auto_update']) && $options['AutoPaging_auto_update'] == false) ? 'selected="SELECTED" ' : null;?>/>wouldn't
    2930                </select> like to automatically update every post in my blog when I update my settings.</p>
    30             <p class="submit">
    31                 <input type="submit" class="button-primary" value="<?php _e('Update Auto Post Paging Settings'); ?>" />
    32             </p>
     31        <p class="submit">
     32            <input type="submit" class="button-primary" value="<?php _e('Update Auto Post Paging Settings'); ?>" />
     33        </p>
     34        <?php include_once('paypal.php'); ?>
    3335    </div>
    3436</div>
  • wordpress-automation-suite/trunk/readme.txt

    r543834 r544313  
    88Requires at least: 3.0
    99Tested up to: 3.3.2
    10 Stable tag: 1.0
     10Stable tag: 2.0
    1111
    1212Makes your life easier by automating the mundane tasks of writing blog posts, so you can focus on the content.
     
    2020 * Auto More Tag Module
    2121 * Auto Pagination Module
    22 
     22 * Auto Post Tagging Module
     23 * Simple to understand, conversational options pages
     24 
    2325Excellent quality modules allow this Automation Suite for WordPress to handle the menial task of formatting your posts for maximum effectiveness. Use the Auto More Tag Module to get that "Read More" effect that so many blogs use to lower their bounce rate, and use the Auto Pagination Module to get the multiple post pages effect that sites like Cracked.com have been using for years, to great effect.
    2426
     
    3739This module uses a similar Intelligent Placement system as the More tags. Using a set of guidelines such as minimum number of characters or words to break apart into multiple pages, and the number of pages that you want to break your posts into, you can set the settings, and let the plugin do the work for you.
    3840
    39 = What is Intelligent Placement? =
     41= Auto Post Tagging Module =
    4042
    41 Intelligent Placement is a method of searching out the best placement for the tags. It does this through an analysis of the post, and finding a proper **break point**, which you can define as either an **End of Line** or a **Space**.
     43 * Tagthe.net API
     44 
     45Add tags to your posts, automatically, without having to focus on them. This module uses a multitude of APIs to collect the best tags for your posts, to help you organize your site for search engines, as well as the searching reader. Never force yourself to tag your posts again.
    4246
    4347== Installation ==
     
    5155Quite possibly. Auto more tag was a great plugin, which spawned this automation suite. But, with the installation of this plugin you can simply deactivate Auto More Tag, and setup the Auto More Tag module with the same settings. It is an updated version of that plugin.
    5256
     57= I can't seem to activate the Auto Tagger module? =
     58You most likely do not have the PHP cURL extension installed on your server. This is a requirement for the Auto Tagger module. You'll have to install this yourself, or if you do not have direct access to PHP, you'll have to ask your server admin to allow you access to this extension.
     59
    5360= What is the shortcode for Auto More Tag module's manual placement? =
    5461That would be [amt_override]. Something to note, though, if you have the option Ignore Manual tags to true, than you can place as many of those short codes as you want, and it will ignore them all.
     
    5764Post pagination has to be setup in the theme itself. Some themes ignore this, and don't include the required function call in the post page. Try adding a function call <?php wp_link_pages(); ?> to your themes single post page, in most cases that is *single.php* page.
    5865
    59 
    6066= I use the More Tag Module, but my posts still show full length, why? =
    6167It is quite possible that the theme you are using has purposely stopped any more tag use. To test this, you can chance to the default WordPress theme and see if your posts show short there. If not, please contact me.
     68
     69= What is Intelligent Placement? =
     70
     71Intelligent Placement is a method of searching out the best placement for the tags. It does this through an analysis of the post, and finding a proper **break point**, which you can define as either an **End of Line** or a **Space**.
    6272
    6373= Have a question? =
     
    6777== Screenshots ==
    6878
    69 1. This is the options page for Auto More Tag. See how simple and clean it looks? Sexy, right?
     791. The Main Options Page, you turn each individual module on and off here, as well as decide if you would like to give me credit VIA a link to my site in your footer.
     802. The Auto More Tag Module options page, look how simple those options are. Just fill out the paragraph, and you're set.
     813. The Auto Pagination Module options page. Same conversational tone as the other modules.
     824. The Auto Tagging Module, with that same conversational options page!
     835. This is what the menu looks like, when all modules are activated.
    7084
    7185== Changelog ==
     86
     87= 2.0 =
     88
     89Added Auto Tagging module, and removed extraneous global calls to $wpdb, placed it as a constructor argument instead, added new footer messages, and periodic header donation request. Moved the all-post updaters to their own pages.
    7290
    7391= 1.0 =
     
    7795== Upgrade Notice ==
    7896
     97= 2.0 =
     98
     99Added Auto Tagging module, and removed extraneous global calls to $wpdb, placed it as a constructor argument instead, added new footer messages, and periodic header donation request. Moved the all-post updaters to their own pages.
     100
    79101= 1.0 =
    80102
Note: See TracChangeset for help on using the changeset viewer.