diff --git a/readme.txt b/readme.txt index 31d7d73..b38fb8d 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i Tags: comments, spam, optimize, database, revisions, users, posts, trash, schedule, automatic, clean, phpmyadmin, meta, postmeta, responsive, mobile Requires at least: 3.8 Tested up to: 4.0 -Stable tag: 1.8.9.7 +Stable tag: 1.8.9.8 License: GPLv2+ License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -42,7 +42,9 @@ Please join GitHub and collaborate. * Enable/Disable weekly schedules of optimization * Apply native WordPress MySql optimize commands on your database tables without phpMyAdmin or any manual query. * Display Database table statistics. Shows how much space can be optimized and how much space has been cleared. -* Enabled for Administrators only. +* Enabled for Administrators only. +* E-mail notifications on automatic cleanup + **All the potentially dangerous clean up options are marked RED.** @@ -151,6 +153,10 @@ Please check your database for corrupted tables. That can happen, usually your w == Changelog == += 1.8.9.8 = +* Daily Schedule Option Added +* Email notification on automatic optimization, default email is admin email address. You can change this in settings + = 1.8.9.7 = * BUGFIX for Settings screen * Enable/Disable trackbacks / comments buttons removal and use select box instead. Extra button caused the Auto Scheduler to get into reset mode. diff --git a/wp-optimize-common.php b/wp-optimize-common.php index c5cf06f..b5d947d 100644 --- a/wp-optimize-common.php +++ b/wp-optimize-common.php @@ -257,7 +257,7 @@ function wpo_headerImage(){ $text = 'WP-Optimize
'; - $text .=''; + //$text .=''; echo $text; } diff --git a/wp-optimize-credits.php b/wp-optimize-credits.php index 444acc6..afe813c 100644 --- a/wp-optimize-credits.php +++ b/wp-optimize-credits.php @@ -15,15 +15,6 @@



- Ruhani Rabin

- - -

diff --git a/wp-optimize.php b/wp-optimize.php index 1b536fd..1d887f2 100644 --- a/wp-optimize.php +++ b/wp-optimize.php @@ -1,7 +1,7 @@ add_node(array( - 'id' => 'wp-optimize', - 'title' => 'WP-Optimize', - 'href' => admin_url( 'admin.php?page=WP-Optimize', 'http' ) - )); + //Add a link called at the top admin bar + $wp_admin_bar->add_node(array( + 'id' => 'wp-optimize', + 'title' => 'WP-Optimize', + 'href' => admin_url( 'admin.php?page=WP-Optimize', 'http' ) + )); } @@ -106,32 +106,32 @@ function wpo_plugin_settings_link($links) { // plugin activation actions function wpo_admin_actions() { - if ( current_user_can('manage_options') ) { - if (function_exists('add_meta_box')) { - add_menu_page("WP-Optimize", "WP-Optimize", "manage_options", "WP-Optimize", "wp_optimize_menu", plugin_dir_url( __FILE__ ).'wpo.png'); - } else { - add_submenu_page("index.php", "WP-Optimize", "WP-Optimize", "manage_options", "WP-Optimize", "wp_optimize_menu", plugin_dir_url( __FILE__ ).'wpo.png'); - } // end if addmeta box + if ( current_user_can('manage_options') ) { + if (function_exists('add_meta_box')) { + add_menu_page("WP-Optimize", "WP-Optimize", "manage_options", "WP-Optimize", "wp_optimize_menu", plugin_dir_url( __FILE__ ).'wpo.png'); + } else { + add_submenu_page("index.php", "WP-Optimize", "WP-Optimize", "manage_options", "WP-Optimize", "wp_optimize_menu", plugin_dir_url( __FILE__ ).'wpo.png'); + } // end if addmeta box if (get_option( OPTION_NAME_ENABLE_ADMIN_MENU, 'false' ) == 'true' ){ - add_action( 'wp_before_admin_bar_render', 'wpo_admin_bar' ); + add_action( 'wp_before_admin_bar_render', 'wpo_admin_bar' ); } - //wpo_detectDBType(); + //wpo_detectDBType(); wpo_PluginOptionsSetDefaults(); - wpo_cron_activate(); - } + wpo_cron_activate(); + } } // TODO: Need to find out why the schedule time is not refreshing function wpo_cron_activate() { - //wpo_debugLog('running wpo_cron_activate()'); + //wpo_debugLog('running wpo_cron_activate()'); $gmtoffset = (int) (3600 * ((double) get_option('gmt_offset'))); if ( get_option( OPTION_NAME_SCHEDULE ) !== false ) { - if ( get_option(OPTION_NAME_SCHEDULE) == 'true') { - if (!wp_next_scheduled('wpo_cron_event2')) { + if ( get_option(OPTION_NAME_SCHEDULE) == 'true') { + if (!wp_next_scheduled('wpo_cron_event2')) { - $schedule_type = get_option(OPTION_NAME_SCHEDULE_TYPE, 'wpo_weekly'); + $schedule_type = get_option(OPTION_NAME_SCHEDULE_TYPE, 'wpo_weekly'); switch ($schedule_type) { case "wpo_daily": @@ -159,20 +159,17 @@ function wpo_cron_activate() { break; } - //$this_time = time() + $gmtoffset; add_action('wpo_cron_event2', 'wpo_cron_action'); - //wp_schedule_event(current_time( "timestamp", 0 ) + $this_time + $gmtoffset, $schedule_type, 'wpo_cron_event2'); wp_schedule_event(current_time( "timestamp", 0 ) + $this_time , $schedule_type, 'wpo_cron_event2'); wpo_debugLog('running wp_schedule_event()'); - //add_filter('cron_schedules', 'wpo_cron_update_sched'); - } - } - } else wpo_PluginOptionsSetDefaults(); + } + } + } else wpo_PluginOptionsSetDefaults(); } function wpo_cron_deactivate() { - //wp_clear_scheduled_hook('wpo_cron_event'); - wpo_debugLog('running wpo_cron_deactivate()'); + //wp_clear_scheduled_hook('wpo_cron_event'); + wpo_debugLog('running wpo_cron_deactivate()'); wp_clear_scheduled_hook('wpo_cron_event2'); } @@ -181,32 +178,24 @@ function wpo_cron_deactivate() { // scheduler functions to update schedulers -// possible problem found at support request -// http://wordpress.org/support/topic/bug-found-in-scheduler-code function wpo_cron_update_sched( $schedules ) { - $schedules['wpo_daily'] = array('interval' => 60*60*24, 'display' => 'Once Daily'); - $schedules['wpo_weekly'] = array('interval' => 60*60*24*7, 'display' => 'Once Weekly'); - $schedules['wpo_otherweekly'] = array('interval' => 60*60*24*14, 'display' => 'Once Every Other Week'); - $schedules['wpo_monthly'] = array('interval' => 60*60*24*31, 'display' => 'Once Every Month'); - return $schedules; + $schedules['wpo_daily'] = array('interval' => 60*60*24, 'display' => 'Once Daily'); + $schedules['wpo_weekly'] = array('interval' => 60*60*24*7, 'display' => 'Once Weekly'); + $schedules['wpo_otherweekly'] = array('interval' => 60*60*24*14, 'display' => 'Once Every Other Week'); + $schedules['wpo_monthly'] = array('interval' => 60*60*24*31, 'display' => 'Once Every Month'); + return $schedules; } // plugin deactivation actions function wpo_admin_actions_remove() { - wpo_cron_deactivate(); - wpo_removeOptions(); + wpo_cron_deactivate(); + wpo_removeOptions(); } add_action('admin_menu', 'wpo_admin_actions'); -/* function wpo_admin_styles() { - wp_register_style( 'wpo_admin_stylesheet', plugins_url( '/css/wpo_admin.css', __FILE__ ) ); - wp_enqueue_style( 'wpo_admin_stylesheet' ); -} -add_action( 'admin_enqueue_scripts', 'wpo_admin_styles' ); */ - function wpo_admin_register_head() { $style_url = plugins_url( '/css/wpo_admin.css', __FILE__ ) ;