• Resolved maikunari

    (@maikunari)


    Hi, this plugin sounds like exactly what I’m looking for but wondering if you are planning to update? It throws a fatal error when I try to load and looks like it has some security issues. If you are not planning to continue development can I fork it?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author JK

    (@jayedul)

    Could you please share the error details and security concerns? I’ll release an update that includes this fix along with some other improvements.

    By the way, you’re welcome to fork the project. However, since I’ve noticed there are some active installations, this one itself needs to be updated as well.

    Thread Starter maikunari

    (@maikunari)

    Sure, it’s giving me this error:

    Plugin could not be activated because it triggered a fatal error.

    Parse error: syntax error, unexpected ‘)’, expecting variable (T_VARIABLE) in /wp-content/plugins/redeem-code/vendor/solidie/solidie-lib/src/_Array.php on line 302

    Plus running the codebase through Cursor came back with these (sorry formatting may be weird below):

    1. Translation Loading Issue:
    • The plugin is loading translations in two places:
    • In Main.php with add_action(‘init’, array($this, ‘loadTranslations’))
    • In Scripts.php with add_action(‘init’, array($this, ‘loadTextDomain’))
    • This could lead to translations being loaded twice or at inconsistent times
    • The error logs show that translations are being loaded too early

    2. Syntax Error in Array.php:

      • The file has been fixed in the current version, but the error logs indicate there was a trailing comma in the groupRows method parameter list
      • This suggests that the version of the file in the WordPress installation might be different from the one in the codebase

      3. Potential Database Issues:

        • The RedeemCode model uses $wpdb->redeem_codes table, but there’s no clear indication of where this table is created
        • This could lead to database errors if the table doesn’t exist

        4. Commented Out Code in Shortcode.php:

          • There’s a large block of commented-out code in the renderForm method of the Shortcode class
          • This could indicate incomplete functionality or deprecated code
          • 5. Potential Security Issues:
          • The CodeController has role-based access control, but it’s not clear if all endpoints are properly secured
          • The applyRedeemCode method doesn’t have role restrictions, which might be intentional but could be a security concern
          • 6. Dependency on WooCommerce:
          • The plugin requires WooCommerce but doesn’t have clear checks to ensure WooCommerce is active before using its functions
          • This could lead to errors if WooCommerce is deactivated
          • 7. Potential Performance Issues:
          • The getProductsVariations method in WooCommerce.php performs multiple database queries
          • For sites with many products, this could cause performance issues
          • 8. Inconsistent Error Handling:
          • Some methods use wp_send_json_error for error handling, while others might not handle errors consistently
          • This could lead to inconsistent user experience
          • 9. Potential Compatibility Issues:
          • The plugin requires PHP 7.4, but some of the code might use features that are deprecated in newer PHP versions
          • The error logs indicate issues with PHP 7.4.33
          • 10. Potential WordPress Version Compatibility:
          • The plugin is tested up to WordPress 6.6.2, but the error logs show issues with WordPress functions
          • This could indicate compatibility issues with the current WordPress version

          Hope this helps.

          Thread Starter maikunari

          (@maikunari)

          One further question on the functionality though, is the user required to be logged-in to redeem the codes? If so this won’t work for my intended purpose.

          Plugin Author JK

          (@jayedul)

          Thanks for the details. This will help improve the next release.

          Your last point is a good one. Not all products require user login. However, we need to figure out how users can access their purchase later without logging in, since the orders page requires authentication. Also, the current setup works better for virtual products; supporting offline ones will require handling shipping details as well.

          I’d love to add you as a contributor to the repositories. If you’re interested, please share your GitHub username.

          Thread Starter maikunari

          (@maikunari)

          Yeah offline would be harder for sure, I’m looking to use it for virtual products. Thank you sure, my github username is maikunari.

          Plugin Author JK

          (@jayedul)

          You’ve been invited to three repositories.

          redeem-code is the main plugin. The other two are dependencies that you likely won’t need to modify. Please start working off the dev branch.

          Thread Starter maikunari

          (@maikunari)

          Thanks JK, I’ve accepted, can’t commit much time at the moment but will push some requests when I get the chance.

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

        The topic ‘Will You Update?’ is closed to new replies.