Skip to content

Commit

Permalink
Improved Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kjbenk committed Nov 20, 2015
1 parent 0c4ff8d commit 8f4d1f0
Show file tree
Hide file tree
Showing 13 changed files with 432 additions and 28 deletions.
Binary file added assets/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/screenshot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 20 additions & 11 deletions controllers/all-audits.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,30 @@

if ( isset($_POST['submit']) && check_admin_referer('msa-add-audit') ) {

/**
*
* This is the main action for creating an audit
*
*/
do_action('msa_create_audit', $_POST);
// Check if they can add a new audit

$_POST['user'] = get_current_user_id();
if ( apply_filters('msa_can_add_new_audit', true) ) {

$date_range = json_decode(stripcslashes($_POST['date-range']), true);
/**
*
* This is the main action for creating an audit
*
*/
do_action('msa_create_audit', $_POST);

$_POST['after-date'] = $date_range['start'];
$_POST['before-date'] = $date_range['end'];
$_POST['user'] = get_current_user_id();

msa_add_audit_to_queue($_POST);
$date_range = json_decode(stripcslashes($_POST['date-range']), true);

$_POST['after-date'] = $date_range['start'];
$_POST['before-date'] = $date_range['end'];

msa_add_audit_to_queue($_POST);

} else {

set_transient('msa_unable_to_create_audit', __('Unable to create your audit because you reached the maximum number of audits you can have. In order to add a new audit you will first need to delete one. If you want want to increase the amount of audits you can have please ') . '<a href="' . MY_SITE_AUDIT_EXT_URL . '" target="_blank">' . __('download the extension') . '</a>' );
}

msa_force_redirect(get_admin_url() . 'admin.php?page=msa-all-audits');
}
Expand Down
57 changes: 57 additions & 0 deletions css/theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* ===================================================================
*
* My Site Audit https://mysiteaudit.com
*
* Created: 11/20/15
* Package: Styles/ Theme
* File: theme.css
* Author: Kyle Benk
*
*
* Copyright 2015
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* ================================================================= */

/* ===================================================================
*
* This theme is baed on the My Site Audit color palette.
*
* Source: http://www.color-hex.com/color-palette/12493
*
* ================================================================= */

/* Text */

.mas-text-default {
color: #333;
}

.msa-text-primary {
color: #a532f7;
}

.msa-text-success {
color: #357f26;
}

.msa-text-warning {
color: #f7a532;
}

.msa-text-danger {
color: #FA421F;
}

.msa-text-info {
color: #26357f;
}
14 changes: 14 additions & 0 deletions functions/admin-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@
*/
function msa_admin_notices() {

// Unable to create audit

if ( false !== ( $no_audit = get_transient('msa_unable_to_create_audit') ) ) {

?>
<div class="error">
<p><?php echo $no_audit; ?></p>
</div>
<?php

delete_transient('msa_unable_to_create_audit');

}

// Schedule Audit Notice

if ( false !== ( $scheduled_audit = get_transient('msa_schedule_audit') ) ) {
Expand Down
27 changes: 21 additions & 6 deletions functions/admin-pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ function msa_menu() {
*/
function msa_dashboard_scripts() {

msa_include_default_styles();

// Style

wp_enqueue_style('msa-common-css', MY_SITE_AUDIT_PLUGIN_URL . '/css/common.css');
wp_enqueue_style('msa-dashboard-css', MY_SITE_AUDIT_PLUGIN_URL . '/css/dashboard.css');

wp_enqueue_style('msa-fontawesome-css', MY_SITE_AUDIT_PLUGIN_URL . '/includes/font-awesome/css/font-awesome.min.css');

// Scripts
Expand All @@ -144,11 +144,11 @@ function msa_dashboard_scripts() {
*/
function msa_all_audits_scripts() {

msa_include_default_styles();

// Style

wp_enqueue_style('msa-all-audits-css', MY_SITE_AUDIT_PLUGIN_URL . '/css/all-audits.css');
wp_enqueue_style('msa-common-css', MY_SITE_AUDIT_PLUGIN_URL . '/css/common.css');

wp_enqueue_style('msa-fontawesome-css', MY_SITE_AUDIT_PLUGIN_URL . '/includes/font-awesome/css/font-awesome.min.css');
wp_enqueue_style('msa-jquery-ui-css', MY_SITE_AUDIT_PLUGIN_URL . '/includes/jquery-datepicker/jquery-ui.min.css');
wp_enqueue_style('msa-jquery-ui-theme-css', MY_SITE_AUDIT_PLUGIN_URL . '/includes/jquery-datepicker/jquery-ui.theme.min.css');
Expand Down Expand Up @@ -200,11 +200,11 @@ function msa_all_audits_scripts() {
*/
function msa_settings_scripts() {

msa_include_default_styles();

// Style

wp_enqueue_style('msa-common-css', MY_SITE_AUDIT_PLUGIN_URL . '/css/common.css');
wp_enqueue_style('msa-settings-css', MY_SITE_AUDIT_PLUGIN_URL . '/css/settings.css');

wp_enqueue_style('msa-fontawesome-css', MY_SITE_AUDIT_PLUGIN_URL . '/includes/font-awesome/css/font-awesome.min.css');

// Script
Expand Down Expand Up @@ -235,6 +235,8 @@ function msa_settings_scripts() {
*/
function msa_extensions_scripts() {

msa_include_default_styles();

// Style

wp_enqueue_style('msa-extensions-css', MY_SITE_AUDIT_PLUGIN_URL . '/css/extensions.css');
Expand All @@ -243,6 +245,19 @@ function msa_extensions_scripts() {

}

/**
* Include the default styles on all pages
*
* @access public
* @return void
*/
function msa_include_default_styles() {

wp_enqueue_style('msa-common-css', MY_SITE_AUDIT_PLUGIN_URL . '/css/common.css');
wp_enqueue_style('msa-theme-css', MY_SITE_AUDIT_PLUGIN_URL . '/css/theme.css');

}

/**
* This is the main function for the dashboard page
*
Expand Down
6 changes: 3 additions & 3 deletions functions/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function msa_add_new_audit_check($data) {
$audit_model = new MSA_Audits_Model();
$audits = $audit_model->get_data();

if ( count($audits) >= 5 ) {
if ( count($audits) >= MY_SITE_AUDIT_MAX_AUDITS ) {
return false;
}

Expand All @@ -137,11 +137,11 @@ function msa_add_new_audit_check($data) {
*/
function msa_save_more_audits_extension($audits) {

if ( count($audits) >= 5 ) {
if ( count($audits) >= MY_SITE_AUDIT_MAX_AUDITS ) {

$audits[] = array(
'extension' => true,
'extension-link' => 'https://mysiteaudit.com',
'extension-link' => MY_SITE_AUDIT_EXT_URL,
'score' => 1,
'name' => __('Want to Save more Audits? Get the Extension!', 'msa'),
'date' => date('Y-m-d H:i:s'),
Expand Down
6 changes: 5 additions & 1 deletion functions/welcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function msa_welcome_menus() {
'msa_welcome_getting_started_page'
);

/*
// About Page
add_dashboard_page(
Expand All @@ -54,6 +55,7 @@ function msa_welcome_menus() {
'msa-about',
'msa_welcome_about_page'
);
*/

// Changelog Page

Expand Down Expand Up @@ -281,9 +283,11 @@ function msa_welcome_page_tabs() {
?>
<h2 class="nav-tab-wrapper">

<!--
<a class="nav-tab <?php echo $selected == 'msa-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'msa-about' ), 'index.php' ) ) ); ?>">
<?php _e( "What's New", 'msa' ); ?>
</a>
-->

<a class="nav-tab <?php echo $selected == 'msa-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'msa-getting-started' ), 'index.php' ) ) ); ?>">
<?php _e( 'Getting Started', 'msa' ); ?>
Expand Down Expand Up @@ -333,7 +337,7 @@ function msa_welcome_page_redirect() {
// Update

else {
wp_safe_redirect( admin_url( 'index.php?page=msa-about' ) );
wp_safe_redirect( admin_url( 'index.php?page=msa-getting-started' ) );
exit;
}

Expand Down
Loading

0 comments on commit 8f4d1f0

Please sign in to comment.