Comments (15)
The restore happens here, if you know how to make it skip already existing resizes, please create pull request or give us the solution and we will make the changes.
from unyson-backups-extension.
I can add a filter here and here so you will be able to add_filter()
and disable those tasks.
Will this solution fit your needs?
from unyson-backups-extension.
Yes, if we can trigger this filter for specific demos.
For example trigger this filter when specific demo is installing.
from unyson-backups-extension.
In the filter you will have access to demo details (like ID)
from unyson-backups-extension.
That would be awesome.
from unyson-backups-extension.
function _filter_theme_fw_backups_do_image_sizes_restore(
$do,
FW_Ext_Backups_Task_Collection $collection
) {
if (
$collection->get_id() === 'demo-content-install'
&&
($task = $collection->get_task('demo:demo-download'))
&&
($task_args = $task->get_args())
&&
isset($task_args['demo_id'])
&&
in_array($task_args['demo_id'], array('DEMO_ID_1', 'DEMO_ID_2'))
) {
$do = false;
}
return $do;
}
add_filter(
'fw:ext:backups:add-restore-task:image-sizes-restore',
'_filter_theme_fw_backups_do_image_sizes_restore'.
10, 2
);
from unyson-backups-extension.
Download latest Backups extension from Github and test the filter. Let us know it works and it will be included in the next release.
from unyson-backups-extension.
When we add this filter, then no demo has Image Sizes Restore task.
How can we get the demo ID? We tried local folder names, but that didn't work.
from unyson-backups-extension.
$task_args['demo_id']
from unyson-backups-extension.
Tried this, but all our demos skip Image Sizes Restore task.
function _filter_theme_fw_backups_do_image_sizes_restore(
$do,
FW_Ext_Backups_Task_Collection $collection
) {
if (
$collection->get_id() === 'demo-content-install'
&&
($task = $collection->get_task('demo:demo-download'))
&&
($task_args = $task->get_args())
&&
isset($task_args['demo_id'])
&&
in_array($task_args['demo_id'], array('demo-local-643e272z588b54db5abf0af67f730345'))
) {
$do = false;
}
return $do;
}
add_filter(
'fw:ext:backups:add-restore-task:image-sizes-restore',
'_filter_theme_fw_backups_do_image_sizes_restore',
10, 2
);
from unyson-backups-extension.
Debug that code and check why it always enters in if
.
from unyson-backups-extension.
The issue was dot instead of comma:
'_filter_theme_fw_backups_do_image_sizes_restore'. <--------------
10, 2
Now everything works fine, but the demo id is generated different in every new installation. For example I have Classic and Explore demos, I need to disable image resize for Classic demo for every client WordPress installation.
from unyson-backups-extension.
One way to fix it could be by using demo content folder name instead?
from unyson-backups-extension.
Yes. The id must be always the same. You are generating random md5 as id?
from unyson-backups-extension.
For one of demos I was using value what was given by $task_args['demo_id'], but then I realize that it was dynamically generated.
from unyson-backups-extension.
Related Issues (20)
- Export selected db tables only
- Export custom folder HOT 6
- Database Restore, case sensitive table name HOT 1
- Unspecified ajax error ( Backups 2.0.23 ) HOT 7
- theme_mods name replace HOT 1
- Canot make full backup because of installed plugin
- Issues unzipping demo-content when wordpress root is on NFS HOT 6
- Disable donations HOT 6
- Can we do flush rewrite rules on demo content installation complete? HOT 2
- Full Backup fails, Content backup ok HOT 1
- HTTP to HTTPS replace during demo content install
- Backup stuck at "Directory cleanup" HOT 2
- Backup Extension plugin HOT 1
- Array and string offset access syntax with curly braces is no longer supported in PHP 7.4+
- "Cannot create temporary directory" Error on my AWS Virtual Server when Installing Demo and Content Extension HOT 1
- Loopback in the code
- curl connection timeout both in unyson-backup-extension and normal unyson HOT 5
- Duplicate foreign key constraint name 'fk_wp_wc_download_log_permission_id'
- PHP 8.x Images sizes issue with demo import
- Failed to create tmp table _fwbk_wp_actionscheduler_actions.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unyson-backups-extension.