• Resolved munyagu

    (@munyagu)


    Hi,

    Thank you for your nice plugin.

    But I saw an error message below.

    Fatal error: Call to undefined method wpdb::esc_like() in /home/ouchisuper/naturalbeautyandthebeast.com/public_html/wp-content/plugins/wp-product-feed-manager/includes/data/class-queries.php on line 348

    wpdb::esc_like introduced WordPress ver4.0 .
    According to description of plugin, “Requires: 3.8 or higher”.

    Is this description mistake ?

    https://ww.wp.xz.cn/plugins/wp-product-feed-manager/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor wpmarketingrobot

    (@wpmarketingrobot)

    Hi,

    This should be fine.
    The plugin is working fine in WordPress versions from 3.8 or higher.

    What version do you have?

    Did you try to disable all plugins and reactivating them one by one.
    Same with your theme, disable it and check if there is the issue.

    Let me know!

    Thread Starter munyagu

    (@munyagu)

    Hi,

    I have a clean installation of WordPress 3.8.15.
    After that , I installed WooCommerce 2.3.0 and WP Product Feed Manager 1.1.0.
    I registered the products, and the setting of the feed, has pressed the “Save & Generate Feed” button .

    Under process animation does not stop forever .
    And error message is logged.

    Plugin Author AukeJomm

    (@aukejomm)

    Did you update all other plugins in your shop?

    Did you try to disable all plugins and reactivating them one by one.
    Same with your theme, disable it and check if there is the issue.

    Auke

    Thread Starter munyagu

    (@munyagu)

    Helo Auke,

    Other than those installed in the above steps do not activate.

    Active plugins are only bellow.
    WooCommerce 2.3.0(This plug-in is a necessary for the operation of WP Product Feed Manager.)
    WP Product Feed Manager 1.1.0

    Using theme is bellow.
    Twenty Fourteen

    wpdb::esc_like method is not included in the WordPress 3.8.15, I think that There is no way to work.
    Am I wrong here?

    Plugin Contributor wpmarketingrobot

    (@wpmarketingrobot)

    Hello Munyagu,

    We do not use wpdb::esc_like method.
    It is not used throughout the plugin and not used in class-queries.php on line 348

    You will have to upgrade to the minimum requirements from Woocommerce.
    They make use of the function and require you to use alt least version 4.4

    Best regards,

    Auke

    Thread Starter munyagu

    (@munyagu)

    Hi wpmarketingrobot.

    I download now version 1.1.0 and find it.

    declare variable member for wpdb

    26:	class WPPFM_Queries {
    27:
    28:		// @private storage for global wpdb
    29:		private $_wpdb;

    set global $wpdb to member in constructor

    38:		public function __construct() {
    39:
    40:			// get global wordpress database functions
    41:			global $wpdb;
    42:
    43			// assign the global wpdb to a varable
    44			$this->_wpdb = &$wpdb;

    execute wpdb::esc_like in get_custom_product_fields method

    340:		public function get_custom_product_fields() {
    341:
    342:			$main_table	 = $this->_wpdb->postmeta;
    343:			$limit		 = apply_filters( 'postmeta_form_limit', 30 );
    344:			$sql		 = "SELECT DISTINCT meta_key FROM $main_table 
    345:				WHERE meta_key NOT BETWEEN '_' AND '_z' HAVING meta_key NOT LIKE %s
    346:				ORDER BY meta_key LIMIT %d";
    347:
    348:			return $this->_wpdb->get_col( $this->_wpdb->prepare( $sql, $this->_wpdb->esc_like( '_' ) . '%', $limit ) ); // ← !!! HERE is $this->_wpdb->esc_like( '_' ) !!!
    349:		}
    Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    Hi munyagu,

    I’m sorry, you’re right. Coincidentally this function was changed in my work version so when I searched in my work version I could not find it and I did look at an older version to check if it maybe was in an older version, but there this call to esc_like() was not implemented yet. So I could not find it, whilst it was in the version you were using.

    In the version for the next update the code will look like

    
    public function get_custom_product_fields() {
    
        $main_table = $this->_wpdb->postmeta;
    			
        return $this->_wpdb->get_col( "SELECT DISTINCT meta_key FROM $main_table WHERE meta_key NOT BETWEEN '_' AND '_z' OR meta_key LIKE '_cpf_%' OR meta_key LIKE '_wpmr_%' ORDER BY meta_key" );
    }

    You could change the code in your copy of the plugin to this and that should prevent the error from showing.

    Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    By the way, the next update will off course use this new function and thus fix this issue.

    Thread Starter munyagu

    (@munyagu)

    Thank you for your answers, Michel.

    I wait for your next release.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘doesn't work width WordPress 3.8.15’ is closed to new replies.