Support » Plugin: WP-Optimize » [Plugin: WP-Optimize] Errors in debug mode

  • 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

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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;

    Plugin Contributor ruhanirabin


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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WP-Optimize] Errors in debug mode’ is closed to new replies.