[resolved] Errors in debug mode (3 posts)

  1. Jacob N. Breetvelt
    Posted 5 years ago #

    When running this plugin in debug mode (define('WP_DEBUG', true); in wp-config.php), there are various errors. One is the use of a deprecated (numeric) userlevel, and many are related to uninitialized variables.

    This is not nice for people who want to write their own error free plugins and therefor run always in debug mode.

    Please test your plugin in debug mode befor releasing it. It becomes more stable and reliable.

    Thank you

  2. Ov3rfly
    Posted 4 years ago #

    Seems the author does not care or has abandoned the project, here are the required fixes:

    WP-Optimize Version 0.9.2

    File wp-optimize.php, Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.

    Old line 52:

    if (function_exists('add_meta_box')) {
    	add_menu_page("WP-Optimize", "WP-Optimize", 2, "WP-Optimize", "optimize_menu");
    } else {
    	add_submenu_page("index.php", "WP-Optimize", "WP-Optimize", 2, "WP-Optimize", "optimize_menu");
    } // end if addmetabox

    New line 52:

    if (function_exists('add_meta_box')) {
    	add_menu_page("WP-Optimize", "WP-Optimize", "manage_options", "WP-Optimize", "optimize_menu");
    } else {
    	add_submenu_page("index.php", "WP-Optimize", "WP-Optimize", "manage_options", "WP-Optimize", "optimize_menu");
    } // end if addmetabox

    File wp-optimize-admin.php, fixes for some more warnings:

    Old line 62: $clean = "";
    New line 62: $clean = ""; $message = "";

    Old line 144: $sql = "";
    New line 144: $sql = ""; $message = "";

    Old line 375: $tot_data = 0;
    New line 375: $tot_data = 0; $total_gain = 0;


  3. ruhanirabin
    Plugin Author

    Posted 4 years ago #

    Submitted changes with the variable fixes.. thanks for the comment above and sorry for really late reply..

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP-Optimize
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic