"Advanced 301/302 Redirect", // the name of the plugin 'developer_website' => "https://www.yydevelopment.com", // link to the developer website page 'plugin_review_page' => "https://wordpress.org/plugins/advanced-301-and-302-redirect/#reviews", // link to the plugin support page 'plugin_support_link' => "https://wordpress.org/support/plugin/advanced-301-and-302-redirect/", // link to the plugin review page 'company_plugins_page' => "https://wordpress.org/plugins/search/yydevelopment/", // link to the main company plugins page 'icon_image_path' => plugins_url() . "/" . basename( dirname( __FILE__ ) ) . "/images/icon.png", // link to the plugin icon 'save_database_time_stamp_name' => "yydev_redirect_timestamp", // database input name to save data 'send_mail_in_days' => (30 * 60 * 60 * 24) + strtotime("now"), // the amount of time after we show the notice (30 days) ); // ================================================ // creating time stamp if it doesn't exists // ================================================ // loading the plugin version from the database $plugin_db_timestamp = get_option($yydev_redirect_notice_info_array['save_database_time_stamp_name']); // checking if the plugin version exists on the dabase // and checking if the database version equal to the plugin version $plugin_version if( empty($plugin_db_timestamp) ) { // update the plugin version in the database update_option($yydev_redirect_notice_info_array['save_database_time_stamp_name'], $yydev_redirect_notice_info_array['send_mail_in_days']); $plugin_db_timestamp = get_option($yydev_redirect_notice_info_array['save_database_time_stamp_name']); } // if( empty($plugin_db_timestamp) ) { // add_action('plugins_loaded', 'my_awesome_plugin_check_version'); // ================================================ // ajax function for when the visitor click on the buttons // ================================================ // when the visitor want to stop getting the messages function yydev_redirect_stop_notice_forever() { global $yydev_redirect_notice_info_array; update_option($yydev_redirect_notice_info_array['save_database_time_stamp_name'], 'stop'); die(); // we have to end ajax functions with die(); } // function yydev_redirect_stop_notice_forever() { add_action( 'wp_ajax_yydev_redirect_stop_notice_forever', 'yydev_redirect_stop_notice_forever' ); // when the visitor ask to get the message in the future function yydev_redirect_stop_notice_for_now() { global $yydev_redirect_notice_info_array; update_option($yydev_redirect_notice_info_array['save_database_time_stamp_name'], $yydev_redirect_notice_info_array['send_mail_in_days']); die(); // we have to end ajax functions with die(); } // function yydev_redirect_stop_notice_for_now() { add_action( 'wp_ajax_yydev_redirect_stop_notice_for_now', 'yydev_redirect_stop_notice_for_now' ); // ================================================ // update the time stamp if the user click on one of the button // ================================================ // creating a function with admin notice output function yydev_redirect_admin_notice($notice_info_array) { global $yydev_redirect_notice_info_array; $plugin_name = $yydev_redirect_notice_info_array['plugin_name']; $developer_website = $yydev_redirect_notice_info_array['developer_website']; $plugin_review_page = $yydev_redirect_notice_info_array['plugin_review_page']; $plugin_support_link = $yydev_redirect_notice_info_array['plugin_support_link']; $company_plugins_page = $yydev_redirect_notice_info_array['company_plugins_page']; $icon_image_path = $yydev_redirect_notice_info_array['icon_image_path']; $save_database_time_stamp_name = $yydev_redirect_notice_info_array['save_database_time_stamp_name']; ?>