Skip to content

Commit

Permalink
v.1.1.5
Browse files Browse the repository at this point in the history
Work on optimizing core files and fix a few logic flaws
  • Loading branch information
KmancusoRonik committed Sep 13, 2024
1 parent 2154d77 commit 91ef491
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const FetchAddon = ({ requestType, postOveride = null }) => {
checked={formValues['user-option'] === 'fetch-media'}
onChange={handleChange}
/>
<label htmlFor="switch-off">Init Unused Media Migration</label>
<label htmlFor="switch-off">Manual Media Library Scan</label>
</div>
<div className="radio-switch-field">
<input
Expand All @@ -153,7 +153,7 @@ const FetchAddon = ({ requestType, postOveride = null }) => {
className={isButtonDisabled ? 'submit-btn submit-btn-disabled' : 'submit-btn'}
disabled={isButtonDisabled} // Disable the button if syncIsRunning is valid
>
{formValues['user-option'] === 'fetch-media' ? isButtonDisabled ? 'Sync is inprogress' : 'Sync Media' : 'Delete Media'}
{formValues['user-option'] === 'fetch-media' ? isButtonDisabled ? 'Scan is inprogress' : 'Initiate Scan' : 'Delete Media'}
</button>
</form>
</div>
Expand Down
73 changes: 53 additions & 20 deletions admin/interface/dist/index.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion admin/interface/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import LoadSettingsScreen from './templates/settings.js';
import LoadSettingsScreenMediaCleaner from './templates/media_cleaner_settings.js';
import LoadGeneralScreen from './templates/general.js';
import LoadMediaCleanerScreen from './templates/media_cleaner.js';
import LoadMediaCleanerSupportScreen from './templates/support.js';
import LoadMediaCleanerSupportScreen from './templates/media_cleaner_support.js';

// Function to render a component into a DOM node
const renderComponent = (selector, Component) => {
Expand All @@ -26,6 +26,8 @@ document.addEventListener('readystatechange', (event) => {
renderComponent('#ronik-base_support', LoadSupportScreen);
renderComponent('#ronik-base_integrations', LoadIntegrationsScreen);
renderComponent('#ronik-base_settings', LoadSettingsScreen);


renderComponent('#ronik-base_settings-media-cleaner', LoadSettingsScreenMediaCleaner);
renderComponent('#ronik-base_support-media-cleaner', LoadMediaCleanerSupportScreen);
renderComponent('#ronik-base_general', LoadGeneralScreen);
Expand Down
4 changes: 2 additions & 2 deletions admin/interface/templates/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ function General() {
return (
<div className='general-container'>
<ContentBlock
title= "General Message"
description= ""
title= "Plugin Info"
description= "Thanks for using the Ronik plugin! <br><br>In the future, we expect to offer a full suite of functionality; for now we have Media Harmony. <br><br>For developers and content admins alike, we know how tricky it can be to manage a media library, especially for a large or aging website with multiple hands involved in asset creation and use. When not actively managed, the space used by old files quickly grows, negatively impacting site load times, performance, and internal hygiene. As soon as you have more than one person producing content, you get a messy basement, which also makes it hard for admins to locate and make use of the correct files for front-end publishing. Attempts to manually mitigate the issue by regularly reviewing, removing, or editing unlinked or improper files could take hours and is likely to result in mistakes. <br><br>The solution we saw to this issue is a tool that reviews your database for any unlinked files and allows for easy removal. Our plugin is compatible with most common frameworks and does a full database scan to reveal/ provide a holistic picture of unlinked files of all types in the media library. Editors can refine their results thanks to an array of sort and filter criteria and then preserve, individually target, or bulk delete their unlinked and matching files.<br><br>Most plugins out there that offer similar functionality are less reliable, lack granularity of selection, and fail to go as deep as ours to find things like nested clones of assets or corrupt files. Check our full feature list, installation instructions, and usage instructions below."
/>
<br></br>

Expand Down
2 changes: 1 addition & 1 deletion admin/interface/templates/media_cleaner.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function Mediacleaner() {
<div className='mediacleaner-container'>
<ContentBlock
title= "Welcome to Media Harmony!"
description= "Media Harmony will scan your media library for all unlinked JPG, PNG, and GIF files. The total size of your library will determine the time required to scan. Change your file size threshold in the Settings tab. Sort, filter, and delete or preserve your files in the list below."
description= "Media Harmony will scan your media library for all unlinked JPG, PNG, and GIF files. The total size of your library will determine the time required to scan. <ul> <li> Use the toggle to initiate a scan of your media library or to permanently delete all unlinked, unpreserved files. </li> <li> Change your file size threshold for the scan in the Settings tab. </li> <li> Use the search bar to filter for title keywords and sort files by size below. </li> <li> Review scanned files and individually delete files or preserve files to exclude them from bulk deletion. </li> </ul> "
/>
<br></br>
<TriggerAjaxRequest
Expand Down
14 changes: 6 additions & 8 deletions admin/interface/templates/media_cleaner_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const MediaCleanerSettings = () => {
setBackupEnabled(isChecked ? 'valid' : 'invalid');

if (isChecked) {
alert('Files will automatically be backed up within the ronik plugin /ronik-base/admin/media-cleaner/ronikdetached');
alert('Your files will be backed up within the file: /ronik-base/admin/media-cleaner/ronikdetached');
}
};

Expand Down Expand Up @@ -91,19 +91,17 @@ const MediaCleanerSettings = () => {
<div className='settings-container'>
{/* Display general settings message */}
<ContentBlock
title="Media Cleaner Settings Message"
description="Tell us which features you want to use."
title="Media Cleaner Settings:"
description="Configure file size minimum and backup settings below. <br><br>Minimum File Size Limit: Only files above the number entered below will be targeted for review. Anything less will be ignored. We recommend 750KB to target files with higher impact; or, you can start with a higher limit first, and try a lower limit afterwards."
/>
<br />
{/* File size settings */}
<div className='media-cleaner-item-settings__file-size'>
<label htmlFor="file-size-selector">Minimum File Size Limit</label>
<p>This will change the overall targeted media file size.</p>
<input
type="number"
id="file-size-selector"
name="file-size-selector"
min="0"
min="0.1"
max="1000"
step=".01"
value={formValues['filesize-option']}
Expand All @@ -114,8 +112,8 @@ const MediaCleanerSettings = () => {

{/* Backup settings */}
<ContentBlock
title="Media Cleaner Backup Settings"
description="Files will automatically be backed up within the ronik plugin /ronik-base/admin/media-cleaner/ronikdetached. Upon Deletion, <br> Based on size of site this may take a while"
title="Backup files:"
description="Turn on to automatically backup files. Please note that this may take an additional 1-2 minutes. "
/>
<br />
<div className='media-cleaner-item-settings__file-size'>
Expand Down
20 changes: 13 additions & 7 deletions admin/interface/templates/media_cleaner_support.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 12 additions & 11 deletions admin/media-cleaner/interface-layout/interface-layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@
6 // menu position
);


// Add Settings page.
add_submenu_page(
'options-ronik-base-mediacleaner', // parent page slug
'Ronik Base Settings',
'Settings',
'manage_options',
'options-ronik-base_settings_media_cleaner', //
'ronikbase_support_settings_media_cleaner',
1 // menu position
);
if(!$this->beta_mode_state){
// Add Settings page.
add_submenu_page(
'options-ronik-base-mediacleaner', // parent page slug
'Ronik Base Settings',
'Settings',
'manage_options',
'options-ronik-base_settings_media_cleaner', //
'ronikbase_support_settings_media_cleaner',
1 // menu position
);
}
// Add Support page.
add_submenu_page(
'options-ronik-base-mediacleaner', // parent page slug
Expand Down
5 changes: 4 additions & 1 deletion includes/class-ronik-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@ public function get_media_cleaner_state() {
}

public function get_beta_mode() {
error_log(print_r('API KEY OVERRIDE BETA MODE ACTIVE', true));
// 750kb
update_option('rbp_media_cleaner_file_size', 786432);
// Backup
update_option('rbp_media_cleaner_file_import','off');
return true;
}

Expand Down
8 changes: 4 additions & 4 deletions ronik-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
* that starts the plugin.
*
* @link https://www.ronikdesign.com/
* @since 1.1.4
* @since 1.1.5
* @package Ronik_Base
*
* @wordpress-plugin
* Plugin Name: Ronik
* Plugin URI: https://www.ronikdesign.com/
* Description: This is a description of the plugin.
* Version: 1.1.4
* Description: Clean out unused media -- your website will thank you! This plugin uses Advanced Custom Fields to run
* Version: 1.1.5
* Author: Kevin Mancuso
* Author URI: https://www.ronikdesign.com/
* License: GPL-2.0+
Expand All @@ -35,7 +35,7 @@
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define( 'RONIK_BASE_VERSION', '1.1.4' );
define( 'RONIK_BASE_VERSION', '1.1.5' );


/**
Expand Down

0 comments on commit 91ef491

Please sign in to comment.