• Hello,

    Thank you for this very usefull Plugin.

    Can you fix the warnings on the last Version 240315 (visible on the Workpress dashboard, PHP 8.1 & WordPress 6.4.3).

    Warning: Undefined array key 2 in ./wp-content/plugins/s2member/src/includes/classes/security-rest.inc.php on line 45
    Warning: Undefined array key 3 in ./wp-content/plugins/s2member/src/includes/classes/security-rest.inc.php on line 46

    Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Cristián Lávaque

    (@clavaque)

    Hi Bernard,

    Thanks for reporting that!

    I will include this in the next release, but you can try it now if you want…

    In the file mentioned in the warning: /wp-content/plugins/s2member/src/includes/classes/security-rest.inc.php

    The lines mentioned, 45 and 46, are these:

      $type  = sanitize_key($route[2]); // e.g. pages
      $id    = (int)$route[3];

    You can add these right before/above:

      if (empty($route[2]) || empty($route[3]))
        return $response;

    So you’ll have this:

      $route = $request->get_route(); // e.g. /wp/v2/pages
      $route = explode('/', trim($route, '/'));
    
      if (empty($route[2]) || empty($route[3]))
        return $response;
    
      $type  = sanitize_key($route[2]); // e.g. pages
      $id    = (int)$route[3];

    Let me know if you try it and if it helps you!

    Warnings are not serious, errors would stop the script from going on. But you may want to hide warnings and errors. If not disable them, at least not display them on the site, instead log them into a file. https://wordpress.org/documentation/article/debugging-in-wordpress/#wp_debug_log

    🙂

    Thread Starter bernard92000

    (@bernard92000)

    Thank you for this detailed response (no more warning for my tests).

    Good morning Same problem on my side.

    The warning disappeared after adding the lines above.

    Thank you for your responsiveness and thank you to bernard92000 for reporting the problem.

    This issue is preventing editing with elementor pro, the fix above solves it.

    Plugin Author Cristián Lávaque

    (@clavaque)

    The latest v240325 release includes that fix. 🙂

    Thread Starter bernard92000

    (@bernard92000)

    Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Very usefull plugin but warning’ is closed to new replies.