Skip to content

Commit

Permalink
0.3
Browse files Browse the repository at this point in the history
* Fixed Activation Issue Bug [#1]
* Fixed Settings Saving / Getting Issue.
  • Loading branch information
varunsridharan committed Apr 4, 2015
1 parent 84277fe commit 56f38ec
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 15 deletions.
36 changes: 24 additions & 12 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Plugin Name: Woocommerce Attributes Menu
Plugin Name: WooCommerce Attributes Menu Manager
Plugin URI: http://varunsridharan.in/
Description: Woocommerce Attributes Menu
Version: 0.2
Description: WooCommerce Attributes Menu Manager
Version: 0.3
Author: Varun Sridharan
Author URI: http://varunsridharan.in/
License: GPL2
Expand All @@ -26,7 +26,7 @@


class wc_attributes_menu_manager {
private $db_key;
private static $db_key;
private $attributes;


Expand All @@ -38,7 +38,7 @@ function __construct() {
$this->attributes = $this->get_settings();
$this->save_settings();

register_activation_hook( __FILE__, array($this ,'_activate') );
register_activation_hook( __FILE__, array(__CLASS__ ,'_activate') );
add_action('admin_menu', array($this,'admin_register_menu'));
add_filter('woocommerce_attribute_show_in_nav_menus', array($this,'register_menu'), 99, 2);

Expand All @@ -63,10 +63,11 @@ public function register_menu( $register, $name = '' ) {
/**
* Runs When the Plugin Is Activated
* Filter Use register_activation_hook
* Since 0.1
* @Since 0.1
* @updated 0.3
*/
public static function _activate(){
add_option($this->db_key,'','', '');
add_option(self::$db_key,'','', '');
}

/**
Expand All @@ -80,13 +81,19 @@ public function admin_register_menu(){

/**
* Saves Settings In DB
* Since 0.1
* @Since 0.1
* @updated 0.3
*/
public function save_settings(){
if(isset($_REQUEST['action'])){
if($_REQUEST['action'] == 'save_wc_attribute_menu'){
$attributes = array_keys($_POST['attributes']);
$attributes = serialize($attributes);
if(isset($_POST['attributes'])){
$attributes = array_keys($_POST['attributes']);
$attributes = serialize($attributes);
} else {
$attributes = '';
}

update_option($this->db_key,$attributes);
}
}
Expand All @@ -95,11 +102,16 @@ public function save_settings(){

/**
* Retrives Settings From DB
* Since 0.1
* @since 0.1
* @updated 0.3
*/
private function get_settings(){
$attributes = get_option($this->db_key);
$attributes = unserialize($attributes);
if(!empty($attributes)){
$attributes = unserialize($attributes);
}else {
$attributes = '';
}
return $attributes;
}

Expand Down
28 changes: 25 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ Author URI: http://varunsridharan.in/
Plugin URL: https://wordpress.org/plugins/woocommerce-attributes-menu-manager/
Tags: Woocommerce,wc,menu,taxonomy,menu manager,attribute,attribute menu, wc attribute menu, affiliate, cart, checkout, commerce, configurable, digital, download, downloadable, e-commerce, ecommerce, inventory, reports, sales, sell, shipping, shop, shopping, stock, store, tax, variable, widgets, woothemes, wordpress ecommerce
Donate link: http://varunsridharan.in
Requires at least: 3.0 plus WooCommerce 2.x
Tested up to: 4.1 + WooCommerce 2.x
Stable tag: 0.2
Requires at least: 3.0
Tested up to: 4.1
Stable tag: 0.3
WC requires at least: 1.0
WC tested up to: 2.3.5
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -32,6 +34,22 @@ Thats all there is to it. You will now see this template when viewing taxonomy t
3. WP Menu Page

== Installation ==
= Minimum Requirements =

* WordPress 3.8 or greater
* PHP version 5.2.4 or greater
* MySQL version 5.0 or greater

= Automatic installation =

Automatic installation is the easiest option as WordPress handles the file transfers itself and you don't need to leave your web browser. To do an automatic install of WooCommerce Attributes Menu Manager, log in to your WordPress dashboard, navigate to the Plugins menu and click Add New.

In the search field type "WooCommerce Attributes Menu Manager" and click Search Plugins. Once you've found our plugin you can view details about it such as the the point release, rating and description. Most importantly of course, you can install it by simply clicking "Install Now"

= Manual installation =

The manual installation method involves downloading our plugin and uploading it to your Web Server via your favourite FTP application. The WordPress codex contains [instructions on how to do this here](http://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation).

1. Installing alternatives:
* via Admin Dashboard:
* Go to 'Plugins > Add New', search for "WooCommerce Attributes Menu Manager", click "install"
Expand All @@ -51,6 +69,10 @@ That's great. We are always open to your input, and we would like to add anythin
Oops. Please User github / WordPress to post bugs. <a href="/~https://github.com/technofreaky/WooCommerce-Attributes-Menu-Manager"> Open an Issue </a>

== Changelog ==
= 0.3 =
* Fixed Activation Issue Bug <a href="/~https://github.com/technofreaky/WooCommerce-Attributes-Menu-Manager/issues/1"> [#1] </a>
* Fixed Settings Saving / Getting Issue.

= 0.2 =
* Minor Fix
* Added Screenshot
Expand Down

0 comments on commit 56f38ec

Please sign in to comment.