Plugin Directory

Changeset 1554444


Ignore:
Timestamp:
12/14/2016 11:09:22 AM (9 years ago)
Author:
zibbra
Message:

Release 1.6.3

Location:
zibbra/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • zibbra/trunk/core/controller.php

    r1535746 r1554444  
    5252    public function dispatch() {
    5353
    54         // Language stuff
    55        
    56         $this->init_locale();
    57        
    58         // Load modules and widgets
    59        
    60         foreach(get_declared_classes() as $className) {
    61            
    62             // Check if this class is a module
    63            
    64             if(is_subclass_of($className, "Zibbra_Plugin_Module_Abstract")) {
    65                
    66                 $module = new $className($this);
    67                 $this->modules[$module->getModuleName()] = $module;
    68                
    69             } // end if
    70            
    71             // Check if this class is a widget
    72            
    73             if(is_subclass_of($className, "Zibbra_Plugin_Widget_Abstract")) {
    74                
    75                 $this->widgets[] = $className;
    76                
    77             } // end if
    78            
    79         } // end foreach
    80        
    81         // Load Google Analytics if enabled
    82        
    83         $trackingid = get_option("zibbra_ga_tracking_id",null);
    84        
    85         if(!empty($trackingid)) {
    86            
    87             $this->ga = new Zibbra_Plugin_Ga($trackingid);
    88            
    89             if(get_option("zibbra_ga_enable_ecommerce","Y")=="Y") {
    90                
    91                 $this->ga->enableEcommerce();
    92                
    93             } // end if
    94            
    95         } // end if
    96 
    97         // Load Facebook Pixel if enabled
    98 
    99         $trackingid = get_option("zibbra_fb_tracking_id",null);
    100 
    101         if(!empty($trackingid)) {
    102 
    103             $this->fb = new Zibbra_Plugin_Fb($trackingid);
    104 
    105         } // end if
    106        
    107         // Register actions
    108 
    109         add_action("init", array($this,"register_ajax"));
    110         add_action("parse_query", array($this,"process_post"));
    111         add_action("plugins_loaded", array($this, "load_plugin_textdomain"));
    112         add_action("generate_rewrite_rules", array($this, "generate_rewrite_rules"));
    113         add_action("widgets_init", array($this, "widgets_init"));
    114         add_action("wp_authenticate", array($this, "authenticate"), 10, 2);
    115         add_action("wp_logout", array($this, "logout"));
    116         add_action("add_meta_boxes", array($this, "add_meta_boxes"));
    117         add_action("save_post", array($this, "save_post"));     
    118         add_action("wp_login_failed", array($this, "login_failed"));
    119         add_action("wp_head", array($this, "register_ga"));
    120         add_action("wp_head", array($this, "register_fb"));
    121         add_action("pre_get_posts", array($this, "pre_get_posts"));
    122        
    123         // Register filters
    124    
    125         add_filter("query_vars", array($this, "query_vars"));
    126         add_filter("template_include", array($this, "template_include"));   
    127         add_filter("login_url", array($this, "login_url"));
    128         add_filter("register_url", array($this, "register_url"));
    129         add_filter("lostpassword_url", array($this, "lostpassword_url"));
    130         add_filter("show_admin_bar", "__return_false");
    131         add_filter("body_class", array($this, "body_class"));
    132 
    133         add_filter("login_form_bottom", function() {
    134 
    135             $register_params = ($this->getActiveModule() instanceof Zibbra_Plugin_Module_Checkout) ? "?return=".urlencode(site_url("/zibbra/checkout/")) : "";
    136        
    137             $html = "<p class=\"login-links\">";
    138             $html .= "<a href=\"".site_url("/zibbra/reset/")."\" class=\"lostpassword\">".__("Forgot your password?", Zibbra_Plugin::LC_DOMAIN)."</a>";
    139             $html .= "<a href=\"".site_url("/zibbra/register/").$register_params."\" class=\"register\">".__("Register a new account", Zibbra_Plugin::LC_DOMAIN)."</a>";
    140             $html .= "</p>";
    141             $html .= "<div class=\"clearfix\"></div>";
    142        
    143             return $html;
    144        
    145         });
    146        
    147         if(!is_admin()) {
    148        
    149             add_filter("edit_profile_url", function($url, $user_id, $scheme) {
    150                
    151                 return site_url("/zibbra/account/");
    152                
    153             }, 10, 3);
    154        
    155         } // end if
    156        
    157         // Register CSS and JS
    158        
    159         wp_enqueue_style("wp-plugin-zibbra", plugins_url("css/zibbra.css",ZIBBRA_BASE_DIR."/css"));
    160         wp_enqueue_script("wp-plugin-zibbra", plugins_url("jscripts/zibbra.js",ZIBBRA_BASE_DIR."/jscripts"),array("jquery"));
    161         add_action("wp_footer", function() {
    162             echo "<script> zibbra.setSiteUrl('" . site_url() . "') </script>";
    163         });
     54        if($this->library->isConfigured()) {
     55
     56            // Language stuff
     57       
     58            $this->init_locale();
     59       
     60            // Load modules and widgets
     61       
     62            foreach(get_declared_classes() as $className) {
     63           
     64                // Check if this class is a module
     65           
     66                if(is_subclass_of($className, "Zibbra_Plugin_Module_Abstract")) {
     67               
     68                    $module = new $className($this);
     69                    $this->modules[$module->getModuleName()] = $module;
     70               
     71                } // end if
     72           
     73                // Check if this class is a widget
     74           
     75                if(is_subclass_of($className, "Zibbra_Plugin_Widget_Abstract")) {
     76               
     77                    $this->widgets[] = $className;
     78               
     79                } // end if
     80           
     81            } // end foreach
     82       
     83            // Load Google Analytics if enabled
     84       
     85            $trackingid = get_option("zibbra_ga_tracking_id",null);
     86       
     87            if(!empty($trackingid)) {
     88           
     89                $this->ga = new Zibbra_Plugin_Ga($trackingid);
     90           
     91                if(get_option("zibbra_ga_enable_ecommerce","Y")=="Y") {
     92               
     93                    $this->ga->enableEcommerce();
     94               
     95                } // end if
     96           
     97            } // end if
     98
     99            // Load Facebook Pixel if enabled
     100
     101            $trackingid = get_option("zibbra_fb_tracking_id",null);
     102
     103            if(!empty($trackingid)) {
     104
     105                $this->fb = new Zibbra_Plugin_Fb($trackingid);
     106
     107            } // end if
     108       
     109            // Register actions
     110
     111            add_action("init", array($this,"register_ajax"));
     112            add_action("parse_query", array($this,"process_post"));
     113            add_action("plugins_loaded", array($this, "load_plugin_textdomain"));
     114            add_action("generate_rewrite_rules", array($this, "generate_rewrite_rules"));
     115            add_action("widgets_init", array($this, "widgets_init"));
     116            add_action("wp_authenticate", array($this, "authenticate"), 10, 2);
     117            add_action("wp_logout", array($this, "logout"));
     118            add_action("add_meta_boxes", array($this, "add_meta_boxes"));
     119            add_action("save_post", array($this, "save_post"));     
     120            add_action("wp_login_failed", array($this, "login_failed"));
     121            add_action("wp_head", array($this, "register_ga"));
     122            add_action("wp_head", array($this, "register_fb"));
     123            add_action("pre_get_posts", array($this, "pre_get_posts"));
     124       
     125            // Register filters
     126   
     127            add_filter("query_vars", array($this, "query_vars"));
     128            add_filter("template_include", array($this, "template_include"));   
     129            add_filter("login_url", array($this, "login_url"));
     130            add_filter("register_url", array($this, "register_url"));
     131            add_filter("lostpassword_url", array($this, "lostpassword_url"));
     132            add_filter("show_admin_bar", "__return_false");
     133            add_filter("body_class", array($this, "body_class"));
     134
     135            add_filter("login_form_bottom", function() {
     136
     137                $register_params = ($this->getActiveModule() instanceof Zibbra_Plugin_Module_Checkout) ? "?return=".urlencode(site_url("/zibbra/checkout/")) : "";
     138       
     139                $html = "<p class=\"login-links\">";
     140                $html .= "<a href=\"".site_url("/zibbra/reset/")."\" class=\"lostpassword\">".__("Forgot your password?", Zibbra_Plugin::LC_DOMAIN)."</a>";
     141                $html .= "<a href=\"".site_url("/zibbra/register/").$register_params."\" class=\"register\">".__("Register a new account", Zibbra_Plugin::LC_DOMAIN)."</a>";
     142                $html .= "</p>";
     143                $html .= "<div class=\"clearfix\"></div>";
     144       
     145                return $html;
     146       
     147            });
     148       
     149            if(!is_admin()) {
     150       
     151                add_filter("edit_profile_url", function($url, $user_id, $scheme) {
     152               
     153                    return site_url("/zibbra/account/");
     154               
     155                }, 10, 3);
     156       
     157            } // end if
     158       
     159            // Register CSS and JS
     160       
     161            wp_enqueue_style("wp-plugin-zibbra", plugins_url("css/zibbra.css",ZIBBRA_BASE_DIR."/css"));
     162            wp_enqueue_script("wp-plugin-zibbra", plugins_url("jscripts/zibbra.js",ZIBBRA_BASE_DIR."/jscripts"),array("jquery"));
     163            add_action("wp_footer", function() {
     164                echo "<script> zibbra.setSiteUrl('" . site_url() . "') </script>";
     165            });
     166       
     167        } // end if
    164168       
    165169    } // end function
  • zibbra/trunk/readme.txt

    r1539156 r1554444  
    11=== Zibbra ===
    22Requires at least: 4.5.0
    3 Tested up to: 4.6.1
     3Tested up to: 4.7.0
    44Contributors: Zibbra
    55Tags: Ecommerce, Cloud
    6 Stable tag: 1.6.2
     6Stable tag: 1.6.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5252== Changelog ==
    5353
     54= 1.6.3 =
     55
     56* Compatibility issue php 5.6
     57* Tested on Wordpress 4.7.0
     58
    5459= 1.6.2 =
    5560
  • zibbra/trunk/zibbra.php

    r1539156 r1554444  
    66 * Plugin URI: http://wordpress.org/plugins/zibbra/
    77 * Description: Zibbra integration plugin for Wordpress
    8  * Version: 1.6.2
     8 * Version: 1.6.3
    99 * Author: Zibbra
    1010 * Author URI: https://www.zibbra.com
     
    100100        const FORM_ACTION = "zibbra";
    101101        const ROLE = "customer";
    102         const VERSION = "1.6.2";
     102        const VERSION = "1.6.3";
    103103       
    104104        private $controller = null;
Note: See TracChangeset for help on using the changeset viewer.