Plugin Directory

Changeset 3297929


Ignore:
Timestamp:
05/21/2025 09:48:59 AM (7 months ago)
Author:
FolioVision
Message:

1.3: Simple History improvements

Location:
businesspress/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • businesspress/trunk/businesspress.php

    r3284774 r3297929  
    44Plugin URI: http://www.foliovision.com
    55Description: This plugin secures your site
    6 Version: 1.2
     6Version: 1.3
    77Author: Foliovision
    88Author URI: http://foliovision.com
     
    1515 
    1616 
    17   const VERSION = '1.2';
     17  const VERSION = '1.3';
    1818 
    1919 
  • businesspress/trunk/plugins/simple-history-clean-up.php

    r3284756 r3297929  
    3535    'admin_head',
    3636    function() {
     37        // Target Simple History dashboard page
    3738        if ( ! empty( $_GET['page'] ) && 'simple_history_admin_menu_page' === $_GET['page'] ) {
     39            businesspress_remove_simple_history_texts();
     40
    3841            ?>
    3942            <style>
    40                 .sh-PageHeader {
     43                .sh-PageHeader, .sh-NotificationBar, .sh-PremiumFeaturesPostbox-button {
     44                    display: none;
     45                }
     46            </style>
     47            <?php
     48
     49        // Target Simple History settings page
     50        } else if ( ! empty( $_GET['page'] ) && 'simple_history_settings_page' === $_GET['page'] ) {
     51            businesspress_remove_simple_history_texts();
     52
     53            ?>
     54            <style>
     55                .sh-PageHeader-rightLink a[href*=premium], /* Add-ons link in header */
     56                .sh-NotificationBar, /* Yellow bar on top of the page */
     57                .sh-PremiumFeaturesPostbox, /* Right sidebar ad boxes */
     58                .sh-StatsDashboard-dateRangeControls-description, /* Upgrade to Premium to get access to more date ranges. */
     59                .sh-StatsDashboard-card:has(.is-blurred), /* blurred graphs on "Stats & Summaries" page */
     60                .sh-PremiumFeatureBadge, /* Greed "New" badge in header links */
     61                a.sh-ExternalLink[href*=premium_upsell], /* "Upgrade to Simple History Premium to set this to any number of days." link */
     62                .sh-PageNav a[href*=promo_upsell] /* "Upgrade to Premium for more features" link in header */{
    4163                    display: none;
    4264                }
     
    4668    }
    4769);
     70
     71function businesspress_remove_simple_history_texts() {
     72    add_filter(
     73        'gettext',
     74        function( $translation, $text, $domain ) {
     75            if ( 'simple-history' === $domain ) {
     76                if (
     77                    stripos( $text, 'a nice review at WordPress.org' ) !== false
     78                ) {
     79                    return '';
     80                }
     81            }
     82            return $translation;
     83        },
     84        10,
     85        3
     86    );
     87}
     88
     89/**
     90 * Force Simple History settings to BusinessPress defaults.
     91 */
     92
     93// Settings -> "History menu position" should be "Inside dashboard menu item" as by default it's above "Posts"
     94add_filter(
     95    'simple_history/admin_menu_location',
     96    function( $location ) {
     97        return 'inside_dashboard';
     98    }
     99);
     100
     101// Settings -> "Show history" -> "in the admin bar" should be disabled for performance reasons
     102add_filter( 'simple_history_show_in_admin_bar', '__return_false' );
     103
     104add_action(
     105    'simple_history/settings_page/general_section_output',
     106    function() {
     107        ?>
     108        <style>
     109            .businesspress-simple-history-setting-note {
     110                background: var(--sh-color-cream);
     111                padding: 2px;
     112                border-radius: 5px;
     113                margin-top: 10px;
     114            }
     115        </style>
     116        <script>
     117            jQuery( function($) {
     118                $( '#simple_history_show_in_admin_bar, [name=simple_history_menu_page_location]' ).prop( 'disabled', true );
     119                $( 'label[for=simple_history_show_in_admin_bar]' ).append( '<span class="businesspress-simple-history-setting-note">BusinessPress is disabling this for performance reasons.</span>' );
     120                $( '[name=simple_history_menu_page_location][value=inside_dashboard]' ).parent().append( '<span class="businesspress-simple-history-setting-note">BusinessPress is forcing this setting as the default setting moves it above "Posts" in the admin menu.</span>' );
     121            });
     122        </script>
     123        <?php
     124    }
     125);
  • businesspress/trunk/readme.txt

    r3284760 r3297929  
    101101
    102102== Changelog ==
     103
     104= 1.3 - 2025-05-21 =
     105
     106* Simple History: "History menu position" should be "Inside dashboard menu item" as by default it's above "Posts", so we force this setting
     107* Simple History: Settings -> "Show history" -> "in the admin bar" should be disabled for performance reasons, so we force this setting
     108* Simple History: Clean-up settings screen for version 5.11.0
    103109
    104110= 1.2 - 2025-04-30 =
Note: See TracChangeset for help on using the changeset viewer.