Plugin Directory

Changeset 1217898


Ignore:
Timestamp:
08/11/2015 06:25:00 AM (11 years ago)
Author:
prefrent
Message:

upgrade / register banner

Location:
aimojo/trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • aimojo/trunk/affinitomics.php

    r1211141 r1217898  
    44Plugin URI: http://prefrent.com
    55Description: Apply Affinitomic Descriptors, Draws, and Distance to Posts and Pages.  Shortcode to display Affinitomic relationships. Google CSE with Affinitomics.
    6 Version: 1.1
     6Version: 1.1.1
    77Author: Prefrent
    88Author URI: http://prefrent.com
     
    3030// +----------------------------------------------------------------------+
    3131
    32 define( 'AI_MOJO__VERSION', '1.1.0' );
     32define( 'AI_MOJO__VERSION', '1.1.1' );
    3333define( 'AI_MOJO__TYPE', 'aimojo_wp' );
    3434define( 'AI_MOJO__MINIMUM_WP_VERSION', '3.5' );
     
    5050add_action( 'init', 'my_script_enqueuer' );
    5151
     52// add an admin notice if aimojo isn't setup
     53add_action( is_network_admin() ? 'network_admin_notices' : 'admin_notices',  'display_notice'  );
    5254
    5355
     
    5557 * Attached to activate_{ plugin_basename( __FILES__ ) } by register_activation_hook()
    5658 */
    57 function plugin_activation()
     59function plugin_activation() 
    5860{
    5961    $message = '';
    60     if ( version_compare( $GLOBALS['wp_version'], AI_MOJO__MINIMUM_WP_VERSION, '<' ) )
     62    if ( version_compare( $GLOBALS['wp_version'], AI_MOJO__MINIMUM_WP_VERSION, '<' ) ) 
    6163    {
    6264      load_plugin_textdomain( 'aimojo' );
    63 
     65     
    6466      $message = sprintf(esc_html__( 'aimojo %s requires WordPress %s or higher.' , 'aimojo'), AI_MOJO__VERSION, AI_MOJO__MINIMUM_WP_VERSION ).sprintf(__('Please upgrade WordPress to a current version.', 'aimojo'), 'https://codex.wordpress.org/Upgrading_WordPress', 'http://wordpress.org/extend/plugins/aimojo/download/');
    6567
    6668   }
    67    else
     69   else 
    6870   {
    69       af_check_for_errors();
     71      af_check_for_errors();       
    7072
    7173      $af_errors = get_option('af_errors', '');
     
    8890}
    8991
    90 function plugin_deactivation( )
     92function plugin_deactivation( ) 
    9193{
    92   //TODO:
     94  //TODO: 
    9395}
    9496
     
    202204  if (!isset($af_cloud_url) || $af_cloud_url == "")
    203205  {
    204     $af_cloud_url = 'www.affinitomics.com';
     206    $af_cloud_url = 'www.affinitomics.com'; 
    205207    update_option( 'af_cloud_url' , $af_cloud_url );
    206208  }
     
    712714  }
    713715
     716      if ( isset( $_GET['dismissNotice'] ) )
     717      {
     718        update_option( 'af_banner_notice_dismissed' , 'true' ); 
     719      }
     720
     721
    714722  af_verify_key();
    715723  echo '<div class="wrap">';
     
    867875  register_setting('af-cloud-settings-group', 'af_cloudify');
    868876}
     877
     878
     879function extraView( $name, array $args = array() )
     880{
     881  $args = apply_filters( 'aimojo_view_arguments', $args, $name );
     882
     883  foreach ( $args AS $key => $val )
     884  {
     885    $$key = $val;
     886  }
     887
     888  load_plugin_textdomain( 'aimojo' );
     889
     890  $file = AI_MOJO__PLUGIN_DIR . 'views/'. $name . '.php';
     891
     892  include( $file );
     893}
     894
     895function display_notice()
     896{
     897  // only show notice if we're either a super admin on a network or an admin on a single site
     898  $show_notice = current_user_can( 'manage_network_plugins' ) || ( ! is_multisite() && current_user_can( 'install_plugins' ) );
     899
     900  if ( !$show_notice )
     901    return;
     902
     903  $af_key = af_verify_key();
     904  $af_cloud_url = af_verify_provider();
     905
     906  $dismissed = get_option( 'af_banner_notice_dismissed', '' );
     907  if ($dismissed != 'true')
     908  {
     909    $registerLink = 'http://' . $af_cloud_url . '/users/sign_up?key=' . $af_key;
     910    $postOptionsUrl = 'edit.php?post_type=archetype&page=affinitomics&dismissNotice=1';
     911    $bannerImage = 'register-aimojo-mod.jpg';
     912
     913
     914    extraView( 'notice', array( 'bannerLink' => $registerLink, 'postOptionsUrl' => $postOptionsUrl, 'bannerImage' => $bannerImage ) );
     915  }
     916}
     917
    869918
    870919/*
  • aimojo/trunk/changelog.txt

    r1211126 r1217898  
    55----------------------------------------------------------------------
    66----------------------------------------------------------------------
     7
     81.1.1
     9----------------------------------------------------------------------
     10- added admin notices for the plugin
    711
    8121.1
  • aimojo/trunk/readme.txt

    r1211141 r1217898  
    33Donate link: http://prefrent.com/
    44Tags: match, sort, rank, related, related posts, relational, relate, tags, posts, post-types, types, ai, a.i., artificial intelligence, filter, filtering, micro format, context, contextual, contextually, search, data, freeform, construct, descriptors, draws, distance, support-vector, parse, discover, classifier, affinitomics, ai mojo, cognitive, decision support, big data, cookies
     5 
    56Requires at least: 3.6
    6 Tested up to: 4.2.3
    7 Stable tag: 1.1
     7Tested up to: 4.1.1
     8Stable tag: 1.1.1
    89License: GPLv2
    910License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1011
    11 Aimojo™ - Match, Rank, Relate anything!
     12Aimojo™ - Match, Rank, Relate anything! 
    1213**Replaces Affinitomics for Wordpress**
    1314
     
    38391. Install the plugin
    39401. In the admin panel, find the “Affinitomics” menu (usually below Posts) and select “settings”
    40 1. Make sure that there is an API key present in the field. If the field is empty, or no key is recognized, register the plugin and claim your key via http://affinitomics.com/register
     411. Make sure that there is an API key present in the field. If the field is empty, or no key is recognized, register the plugin and claim your key via http://affinitomics.com/register 
    41421. From the resulting page, copy the API key and paste it in the API field in your settings.
    42431. Next, under “To which Post-types would you like to apply your Affinitomics™?” check the boxes for the post-types you want to use with Affinitomics.
     
    53541. For your Google Custom Search Engine (CSE) ID follow the instructions here [https://developers.google.com/custom-search/](https://developers.google.com/custom-search/)
    5455
    55 = NOTE: Existing pages and posts (rather, the Affinitomics placed on them) must be exported to the Affinitomics cloud before any of them will work. =
     56= NOTE: Existing pages and posts (rather, the Affinitomics placed on them) must be exported to the Affinitomics cloud before any of them will work. = 
    56571. Under the Affinitomics menu choose “Cloud Export.”
    57582. Check “Make it so” and wait for a bit. It won’t take too long, but we haven’t bothered to give you a spinner yet, sorry. You’ll see an output list when it’s done.
     
    6061= Configure individual Posts, Pages, or Archetypes™ =
    6162
    62 1. For existing pages or posts, either copy or move tags to the “Descriptors” field in the page or post editor.
     631. For existing pages or posts, either copy or move tags to the “Descriptors” field in the page or post editor. 
    63641. If you want like objects to attract like objects in your system, copy the tags to both “Descriptors” and “Draw”.
    64651. It is a best practice (not a requirement) to include a Descriptor of Person, Place, Thing, Concept or Construct in the Descriptors, especially if the Affinitomics are to be exported later, and shared.
     
    100101
    101102Users are granted space for 1000 Affinitomic™ constructs and 5,000 transactions per month.
    102 Larger accounts are available at [Prefrent.com](http://prefrent.com).
     103Larger accounts are available at [Prefrent.com](http://prefrent.com). 
    103104
    104105= How many “Archetypes” will I need? =
     
    119120
    120121== Changelog ==
    121 
    122 =1.1=
    123 * updated domain assignment for unregistered users
    124 * add version syncing code for communication with server
    125 * resolved issue for legacy users with ajax pointing to wrong directory
    126 * updated pathing from WP_PLUGIN_URL to recommended best practices plugins_url()
    127 * added plugin_activation function so the plugin can perform immediate, necessary actions upon the plugin being activated by the user in wordpress
    128122
    129123=1.0.0=
     
    149143It’s easy to derive Affinitomics from these tags. “dog, big, k9, furry” are all easily recognizable as Descriptors. The Draws are easy to recognize as well, and we can take a shortcut in writing them that will differentiate them from Descriptors. They become: +eating, +kids, +snow. We also take a shortcut on what are easy to spot as Distances, and they become: -cars, -cats. By separating the tags into three types of Affinitomics, not only have they become more useful for the computer system, they are actually easier to write and take up less space.
    150144
    151 Traditional Tags look like this:
     145Traditional Tags look like this: 
    152146= dog, big, k9, furry, eats a lot, good with kids, likes snow, chases cars, chases cats =
    153147
    154 Whereas the features in an Affinitomic Archetype look like this:
     148Whereas the features in an Affinitomic Archetype look like this: 
    155149= dog, big, k9, furry, +eating, +kids, +snow, -cars, -cats =
    156150
    157 So now you know how to write Affinitomics, you can see that it takes much less time than writing tags, and by categorizing tags into Descriptors, Draws and Distances, you’ve made the computer much happier.
     151So now you know how to write Affinitomics, you can see that it takes much less time than writing tags, and by categorizing tags into Descriptors, Draws and Distances, you’ve made the computer much happier. 
    158152
    159153= It’s like sorting laundry – it takes the same amount of time and results come out in the wash. With these Affinitomics instead of tags, algorithms can much more quickly determine matches, affinities, and sort values. =
     
    161155= Extra Credit =
    162156
    163 Affinitomics are even more valuable with attenuation – telling the system how much to value Draws and Distances. For example: How much does the dog like to eat?  Or which does it hate more; cars or cats? The attenuated Affinitomics for the St. Bernard answer those questions like this:
     157Affinitomics are even more valuable with attenuation – telling the system how much to value Draws and Distances. For example: How much does the dog like to eat?  Or which does it hate more; cars or cats? The attenuated Affinitomics for the St. Bernard answer those questions like this: 
    164158= dog, big, k9, furry, +eating2, +kids, +snow4, -cars2, -cats5 =
    165159
    166 You’ll notice that it’s still less data than the tags, even though the Affinitomics now represent a three dimensional feature space which is far more valuable for knowledge retrieval, discovery, and machine learning. Because of this, Affinitomics can be evaluated, sorted, and grouped much faster and more accurately than tags. In addition, since the Affinitomics essentially make the information self-ranking and self-sorting, systems that use Affinitomics don’t require categories.
     160You’ll notice that it’s still less data than the tags, even though the Affinitomics now represent a three dimensional feature space which is far more valuable for knowledge retrieval, discovery, and machine learning. Because of this, Affinitomics can be evaluated, sorted, and grouped much faster and more accurately than tags. In addition, since the Affinitomics essentially make the information self-ranking and self-sorting, systems that use Affinitomics don’t require categories. 
    167161
    168162There you have it. You now know how to create Affinitomic Archetypes – a fancy way of saying that you understand how and why you should sort your laundry, errr, tags.
Note: See TracChangeset for help on using the changeset viewer.