Plugin Directory

Changeset 2273744


Ignore:
Timestamp:
04/02/2020 09:50:50 AM (6 years ago)
Author:
shopybot
Message:

FIxed export URL matching; Tested with latest WP and WC;

Location:
shopybot-woocommerce/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • shopybot-woocommerce/trunk/includes/class-wc-shopybot-export.php

    r2220716 r2273744  
    5858     */
    5959    public function init() {
    60         add_filter('mod_rewrite_rules', array($this, 'add_htaccess_rule'));
    61 
    6260        add_action("added_post_meta", array($this, 'generateOffer'), 10, 2);
    6361        add_action('updated_postmeta', array($this, 'generateOffer'), 10, 2);
     
    7169    }
    7270
    73     public function add_htaccess_rule($rules) {
    74         $rules .= "RewriteRule ^" . $this->id . ".xml index.php\n";
    75         $rules .= "RewriteRule ^" . $this->id . ".xml.gz index.php\n";
    76 
    77         return $rules;
    78     }
    79 
    8071    public function getYmlAction() {
    8172        if(get_option('permalink_structure') != '') {
    8273            $url = parse_url($this->siteURL() . $_SERVER['REQUEST_URI']);
    8374
    84             if($url['path'] == '/' . $this->id . '.xml') {
     75            if(preg_match('/'.$this->id . '.xml.gz'.'/', $url['path'], $matches)) {
     76                $this->getYml(true);
     77                die;
     78            }
     79
     80            if(preg_match('/'.$this->id . '.xml'.'/', $url['path'], $matches)) {
    8581                $this->getYml();
    86                 die;
    87             }
    88 
    89             if($url['path'] == '/' . $this->id . '.xml.gz') {
    90                 $this->getYml(true);
    9182                die;
    9283            }
     
    647638     */
    648639    public function export() {
    649         // if(!$this->isLock()) {
    650 
    651             // $this->exportLock();
    652 
    653             if($this->inProcess()) {
    654                 // error_log("in process");
    655                 $this->bread('in process');
    656                 $this->renderPartOffers();
    657             } else {
    658                 // error_log("not in process");
    659                 $this->bread('not in process');
    660                 $this->bread('check time true');
    661                 $this->inProcessSet('yes');
    662                 $this->renderPartOffers();
    663             }
    664 
    665             if($this->yaml_finished) {
    666                 // error_log("yaml finished");
    667                 $this->bread('is yaml_finished true');
    668                 $this->inProcessSet('no');
    669                 $this->setPage(1);
    670             }
    671 
    672             // $this->exportUnlock();
    673         // } else {
    674             // $this->bread('process is lock');
    675         // }
     640        if($this->inProcess()) {
     641            // error_log("in process");
     642            $this->bread('in process');
     643            $this->renderPartOffers();
     644        } else {
     645            // error_log("not in process");
     646            $this->bread('not in process');
     647            $this->bread('check time true');
     648            $this->inProcessSet('yes');
     649            $this->renderPartOffers();
     650        }
     651
     652        if($this->yaml_finished) {
     653            // error_log("yaml finished");
     654            $this->bread('is yaml_finished true');
     655            $this->inProcessSet('no');
     656            $this->setPage(1);
     657        }
    676658    }
    677659
  • shopybot-woocommerce/trunk/includes/class-wc-shopybot-integration.php

    r2222403 r2273744  
    4444            // Checking whether we auto checkouting
    4545            add_action('template_redirect',  array($this, 'wc_auto_checkout'),  10);
    46             // Filters
    47             add_filter('mod_rewrite_rules', array($this, 'add_htaccess_rule'));
    4846        }
    49 
    50         public function add_htaccess_rule($rules) {
    51             $rules .= "RewriteRule ^" . $this->export_filename . " index.php\n";
    52             $rules .= "RewriteRule ^" . $this->export_filename . ".gz index.php\n";
    53 
    54             return $rules;
    55         }
    5647
    5748        public function wc_auto_checkout() {
  • shopybot-woocommerce/trunk/readme.txt

    r2222403 r2273744  
    33Tags: bot, e-commerce, chat-bot, chatbot, messenger, facebook, woocommerce, integration, ShopyBot, ai, machine learning, artificial intelligence
    44Requires at least: 3.9
    5 Tested up to: 5.3.2
    6 Stable tag: 1.0.10
     5Tested up to: 5.4
     6Stable tag: 1.0.11
    77License: GNU GENERAL PUBLIC LICENSE Version 3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    100100== Changelog ==
    101101
     102= 1.0.11 =
     103- Fixed export XML file url (shopybot-woocommerce.xml) for Wordpress installations in subfolders
     104- Tested plugin on Wordpress 5.4 and WooCommerce 4.0.1
     105
    102106= 1.0.10 =
    103107Added uninstall hook
  • shopybot-woocommerce/trunk/shopybot-woocommerce.php

    r2222403 r2273744  
    99 * that starts the plugin.
    1010 *
    11  * @link              https://www.shopybot.com
    12  * @since             1.0.10
    13  * @package           Shopybot_Woocommerce
     11 * @link                 https://www.shopybot.com
     12 * @since                1.0.11
     13 * @package              Shopybot_Woocommerce
    1414 *
    1515 * @wordpress-plugin
    16  * Plugin Name:       ShopyBot - Facebook ChatBot for WooCommerce
    17  * Plugin URI:        https://www.shopybot.com/connect-bot/woocommerce
    18  * Description:       Create a ChatBot and sell your products in Facebook Messenger
    19  * Version:           1.0.10
    20  * Author:            ShopyBot
    21  * Author URI:        https://www.shopybot.com
    22  * License:           GPL-2.0+
    23  * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
    24  * Text Domain:       shopybot-woocommerce
    25  * Domain Path:       /languages
     16 * Plugin Name:          ShopyBot - Facebook ChatBot for WooCommerce
     17 * Plugin URI:           https://www.shopybot.com/connect-bot/woocommerce
     18 * Description:          Create a ChatBot and sell your products in Facebook Messenger
     19 * Version:              1.0.11
     20 * Author:               ShopyBot
     21 * Author URI:           https://www.shopybot.com
     22 * License:              GPL-2.0+
     23 * License URI:          http://www.gnu.org/licenses/gpl-2.0.txt
     24 * Text Domain:          shopybot-woocommerce
     25 * Domain Path:          /languages
     26 * Woo:                  2127297:0ea4fe4c2d7ca6338f8a322fb3e4e187
     27 * Text Domain:          shopybot-woocommerce
     28 * Requires at least:    4.9
     29 * Tested up to:         5.4
     30 * WC requires at least: 3.0.0
     31 * WC tested up to:      4.0.1
    2632 */
    2733
Note: See TracChangeset for help on using the changeset viewer.